ismx-nexo-node-app 0.4.154 → 0.4.155
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.
|
@@ -226,6 +226,8 @@ class RepositoryDatabasePostgres extends RepositoryDatabase_1.default {
|
|
|
226
226
|
if (!this.tables[tableName])
|
|
227
227
|
throw new Error(`table ${tableName} does not exist`);
|
|
228
228
|
let [table, schema, column] = [this.tables[tableName], this.tables[tableName][0].schema, PostgresUtils_1.default.camelToSnake(select)];
|
|
229
|
+
if (PostgresUtils_1.default.isReservedWord(column))
|
|
230
|
+
column = `"${column}"`;
|
|
229
231
|
if (!PostgresUtils_1.default.columns(table).includes(column))
|
|
230
232
|
throw new Error(`column ${column} does not exist in table ${tableName}`);
|
|
231
233
|
let { where, values } = this.toWhere(tableName, filters);
|
|
@@ -238,6 +240,8 @@ class RepositoryDatabasePostgres extends RepositoryDatabase_1.default {
|
|
|
238
240
|
if (!this.tables[tableName])
|
|
239
241
|
throw new Error(`table ${tableName} does not exist`);
|
|
240
242
|
let [table, schema, column] = [this.tables[tableName], this.tables[tableName][0].schema, PostgresUtils_1.default.camelToSnake(select)];
|
|
243
|
+
if (PostgresUtils_1.default.isReservedWord(column))
|
|
244
|
+
column = `"${column}"`;
|
|
241
245
|
if (!PostgresUtils_1.default.columns(table).includes(column))
|
|
242
246
|
throw new Error(`column ${column} does not exist in table ${tableName}`);
|
|
243
247
|
let { where, values } = this.toWhere(tableName, filters);
|
package/package.json
CHANGED
|
@@ -198,6 +198,7 @@ export default class RepositoryDatabasePostgres extends RepositoryDatabase
|
|
|
198
198
|
{
|
|
199
199
|
if (!this.tables[tableName]) throw new Error(`table ${tableName} does not exist`);
|
|
200
200
|
let [ table, schema, column ] = [ this.tables[tableName], this.tables[tableName][0].schema, PostgresUtils.camelToSnake(select) ];
|
|
201
|
+
if (PostgresUtils.isReservedWord(column)) column = `"${column}"`;
|
|
201
202
|
|
|
202
203
|
if (!PostgresUtils.columns(table).includes(column)) throw new Error(`column ${column} does not exist in table ${tableName}`);
|
|
203
204
|
let { where, values } = this.toWhere(tableName, filters);
|
|
@@ -210,6 +211,7 @@ export default class RepositoryDatabasePostgres extends RepositoryDatabase
|
|
|
210
211
|
{
|
|
211
212
|
if (!this.tables[tableName]) throw new Error(`table ${tableName} does not exist`);
|
|
212
213
|
let [ table, schema, column ] = [ this.tables[tableName], this.tables[tableName][0].schema, PostgresUtils.camelToSnake(select) ];
|
|
214
|
+
if (PostgresUtils.isReservedWord(column)) column = `"${column}"`;
|
|
213
215
|
|
|
214
216
|
if (!PostgresUtils.columns(table).includes(column)) throw new Error(`column ${column} does not exist in table ${tableName}`);
|
|
215
217
|
let { where, values } = this.toWhere(tableName, filters);
|