@dwtechs/antity-pgsql 0.2.0 → 0.2.1
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.
- package/dist/antity-pgsql.js +4 -4
- package/package.json +1 -1
package/dist/antity-pgsql.js
CHANGED
|
@@ -169,7 +169,7 @@ class Select {
|
|
|
169
169
|
query(table, paginate) {
|
|
170
170
|
const p = paginate ? this._count : '';
|
|
171
171
|
const c = this._cols ? this._cols : '*';
|
|
172
|
-
return `SELECT ${c}${p} FROM
|
|
172
|
+
return `SELECT ${c}${p} FROM ${quoteIfUppercase(table)}`;
|
|
173
173
|
}
|
|
174
174
|
execute(query, args, client) {
|
|
175
175
|
return execute$1(query, args, client)
|
|
@@ -202,7 +202,7 @@ class Insert {
|
|
|
202
202
|
this._nbProps++;
|
|
203
203
|
}
|
|
204
204
|
query(table, rows, consumerId, consumerName, rtn = "") {
|
|
205
|
-
let query = `INSERT INTO
|
|
205
|
+
let query = `INSERT INTO ${quoteIfUppercase(table)} (${this._cols}) VALUES `;
|
|
206
206
|
const args = [];
|
|
207
207
|
let i = 0;
|
|
208
208
|
for (const row of rows) {
|
|
@@ -247,7 +247,7 @@ class Update {
|
|
|
247
247
|
rows = this.addConsumer(rows, consumerId, consumerName);
|
|
248
248
|
const l = rows.length;
|
|
249
249
|
const args = rows.map(row => row.id);
|
|
250
|
-
let query = `UPDATE "${table}" SET `;
|
|
250
|
+
let query = `UPDATE "${quoteIfUppercase(table)}" SET `;
|
|
251
251
|
let i = args.length + 1;
|
|
252
252
|
for (const p of this._props) {
|
|
253
253
|
if (rows[0][p] === undefined)
|
|
@@ -284,7 +284,7 @@ var __awaiter$1 = (undefined && undefined.__awaiter) || function (thisArg, _argu
|
|
|
284
284
|
});
|
|
285
285
|
};
|
|
286
286
|
function query(table) {
|
|
287
|
-
return `DELETE FROM
|
|
287
|
+
return `DELETE FROM ${quoteIfUppercase(table)} WHERE "archivedAt" < $1`;
|
|
288
288
|
}
|
|
289
289
|
function execute(date, query, client) {
|
|
290
290
|
return __awaiter$1(this, void 0, void 0, function* () {
|