ismx-nexo-node-app 0.4.20 → 0.4.21
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.
|
@@ -160,7 +160,7 @@ class RepositoryDatabasePostgres extends RepositoryDatabase_1.default {
|
|
|
160
160
|
throw new Error(`No valid columns provided to update for table ${tableName}`);
|
|
161
161
|
const params = columns.map((_, index) => `\$${index + 2}`).join(",");
|
|
162
162
|
const values = [id, ...columns.map((column) => object[PostgresUtils_1.default.stringToCamel(column)])];
|
|
163
|
-
const query = `UPDATE ${schema}.${tableName} SET (${columns.join(",")}) = (${params}) WHERE id = $1 RETURNING *`;
|
|
163
|
+
const query = `UPDATE ${schema}.${tableName} SET (${columns.join(",")}) = ROW(${params}) WHERE id = $1 RETURNING *`;
|
|
164
164
|
return this.query(query, values).then((result) => result[0]);
|
|
165
165
|
});
|
|
166
166
|
}
|
package/package.json
CHANGED
|
@@ -135,7 +135,7 @@ export default class RepositoryDatabasePostgres extends RepositoryDatabase
|
|
|
135
135
|
|
|
136
136
|
const params = columns.map((_, index) => `\$${index + 2}`).join(",");
|
|
137
137
|
const values = [ id, ...columns.map((column) => object[PostgresUtils.stringToCamel(column) as keyof T]) ];
|
|
138
|
-
const query = `UPDATE ${schema}.${tableName} SET (${columns.join(",")}) = (${params}) WHERE id = $1 RETURNING *`;
|
|
138
|
+
const query = `UPDATE ${schema}.${tableName} SET (${columns.join(",")}) = ROW(${params}) WHERE id = $1 RETURNING *`;
|
|
139
139
|
|
|
140
140
|
return this.query<T>(query, values).then((result) => result[0]);
|
|
141
141
|
}
|