Comparing version 3.4.3 to 3.4.4
@@ -67,2 +67,3 @@ /* SQB | ||
(defaults.prettyPrint != null ? defaults.prettyPrint : true); | ||
/* Generate sql */ | ||
o = query.generate(o, false); | ||
@@ -72,3 +73,3 @@ this.query.sql = o.sql; | ||
this.query.values = o.values; | ||
if (o.returningParams) | ||
if (o.is) | ||
this.query.returningParams = o.returningParams; | ||
@@ -75,0 +76,0 @@ if (this.options.fetchRows == null) |
@@ -88,3 +88,3 @@ /* SQB | ||
} else | ||
arr = Object.getOwnPropertyNames(this._input); | ||
arr = Object.keys(this._input); | ||
return Serializable.serializeFallback(ctx, 'insert_columns', arr, () => { | ||
@@ -102,8 +102,8 @@ return Serializable.joinArray(arr); | ||
_serializeValues(ctx) { | ||
if (this._input.isSelect) { | ||
if (this._input.isSerializable) | ||
return this._input._serialize(ctx); | ||
} | ||
const arr = []; | ||
const allValues = this._input; | ||
for (const n of Object.getOwnPropertyNames(allValues)) { | ||
for (const n of Object.keys(allValues)) { | ||
arr.push(Serializable.serializeObject(ctx, allValues[n])); | ||
@@ -110,0 +110,0 @@ } |
@@ -86,3 +86,4 @@ /* SQB | ||
merge.deep(ctx, options); | ||
ctx.values = ctx.values || this._values || {}; | ||
ctx.values = ctx.values || | ||
(this._values ? merge.clone.deep(this._values) : {}); | ||
/* create serialization extension */ | ||
@@ -103,6 +104,9 @@ ctx.extension = extensions.createSerializer(ctx); | ||
const sql = this._serialize(ctx); | ||
return { | ||
const out = { | ||
sql: flattenText(sql, {noWrap: !ctx.prettyPrint}), | ||
values: ctx.outValues | ||
}; | ||
if (ctx.adapterProperties) | ||
Object.assign(out, ctx.adapterProperties); | ||
return out; | ||
} | ||
@@ -109,0 +113,0 @@ |
@@ -77,2 +77,3 @@ /* SQB | ||
return ''; | ||
ctx.isReturningQuery = true; | ||
const arr = []; | ||
@@ -79,0 +80,0 @@ for (const t of this._returning) { |
@@ -36,2 +36,11 @@ /* SQB | ||
this.type = 'select'; | ||
this._tables = null; | ||
this._columns = null; | ||
this._joins = null; | ||
this._where = null; | ||
this._groupby = null; | ||
this._alias = null; | ||
this._limit = null; | ||
this._offset = null; | ||
this._orderby = null; | ||
if (column.length) | ||
@@ -38,0 +47,0 @@ this.columns(...column); |
{ | ||
"name": "sqb", | ||
"description": "Extensible, multi-dialect SQL query builder and Database connection framework for JavaScript", | ||
"version": "3.4.3", | ||
"version": "3.4.4", | ||
"author": "Panates Ltd.", | ||
@@ -6,0 +6,0 @@ "contributors": [ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
120842
4449