@onivoro/server-typeorm-postgres 22.0.5 → 22.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -91,11 +91,14 @@ class TypeOrmRepository {
91
91
  let whereClause = '';
92
92
  Object.entries(where || {}).forEach(([propertyPath, value], index) => {
93
93
  const key = this.columns[propertyPath].databasePath;
94
+ const where = Array.isArray(value.value)
95
+ ? `${key} in $${index + 1}`
96
+ : `${key} = $${index + 1}`;
94
97
  if (index === 0) {
95
- whereClause += ` WHERE ${key} = $${index + 1}`;
98
+ whereClause += ` WHERE ${where}`;
96
99
  }
97
100
  else {
98
- whereClause += ` AND ${key} = $${index + 1}`;
101
+ whereClause += ` AND ${where}`;
99
102
  }
100
103
  queryParams.push(value);
101
104
  });
@@ -91,11 +91,14 @@ class TypeOrmRepository {
91
91
  let whereClause = '';
92
92
  Object.entries(where || {}).forEach(([propertyPath, value], index) => {
93
93
  const key = this.columns[propertyPath].databasePath;
94
+ const where = Array.isArray(value.value)
95
+ ? `${key} in $${index + 1}`
96
+ : `${key} = $${index + 1}`;
94
97
  if (index === 0) {
95
- whereClause += ` WHERE ${key} = $${index + 1}`;
98
+ whereClause += ` WHERE ${where}`;
96
99
  }
97
100
  else {
98
- whereClause += ` AND ${key} = $${index + 1}`;
101
+ whereClause += ` AND ${where}`;
99
102
  }
100
103
  queryParams.push(value);
101
104
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onivoro/server-typeorm-postgres",
3
- "version": "22.0.5",
3
+ "version": "22.0.6",
4
4
  "repository": {
5
5
  "url": "git+https://github.com/onivoro/server-typeorm-postgres.git"
6
6
  },