@dwtechs/antity-pgsql 0.5.0 → 0.5.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 +5 -3
- package/package.json +1 -1
package/dist/antity-pgsql.js
CHANGED
|
@@ -254,13 +254,15 @@ function $i(qty, start) {
|
|
|
254
254
|
class Insert {
|
|
255
255
|
constructor() {
|
|
256
256
|
this._props = [];
|
|
257
|
+
this._quotedProps = [];
|
|
257
258
|
this._nbProps = 0;
|
|
258
259
|
this._cols = "";
|
|
259
260
|
}
|
|
260
261
|
addProp(prop) {
|
|
261
|
-
this._props.push(
|
|
262
|
+
this._props.push(prop);
|
|
263
|
+
this._quotedProps.push(quoteIfUppercase(prop));
|
|
262
264
|
this._nbProps++;
|
|
263
|
-
this._cols = this.
|
|
265
|
+
this._cols = this._quotedProps.join(", ");
|
|
264
266
|
}
|
|
265
267
|
query(table, rows, consumerId, consumerName, rtn = "") {
|
|
266
268
|
const propsToUse = [...this._props];
|
|
@@ -269,7 +271,7 @@ class Insert {
|
|
|
269
271
|
if (consumerId !== undefined && consumerName !== undefined) {
|
|
270
272
|
propsToUse.push("consumerId", "consumerName");
|
|
271
273
|
nbProps += 2;
|
|
272
|
-
cols += "
|
|
274
|
+
cols += `, "consumerId", "consumerName"`;
|
|
273
275
|
}
|
|
274
276
|
let query = `INSERT INTO ${quoteIfUppercase(table)} (${cols}) VALUES `;
|
|
275
277
|
const args = [];
|