Comparing version 1.5.0 to 1.5.1
@@ -100,5 +100,11 @@ /* UNIQORM | ||
keyValues = this._prepareKeyValues(keyValues); | ||
options = options || {}; | ||
if (this._hooks && this._hooks.get) | ||
return this._hooks.get(keyValues, options, callback); | ||
const opts = merge({}, options); | ||
merge(opts, { | ||
where: this._prepareWhereforKeys(keyValues), | ||
where: keyValues, | ||
limit: 1, | ||
@@ -138,3 +144,3 @@ offset: 0, | ||
return promisify.fromCallback((cb) => this.list(options, cb)); | ||
options = options || {}; | ||
options.attributes = options.attributes || | ||
@@ -180,2 +186,5 @@ Object.getOwnPropertyNames(this.fields); | ||
if (this._hooks && this._hooks.create) | ||
return this._hooks.create(values, options, callback); | ||
const silent = options.silent || this.owner.options.silent; | ||
@@ -259,4 +268,8 @@ values = this._prepareUpdateValues(values, { | ||
options = options || {}; | ||
if (this._hooks && this._hooks.create) | ||
return this._hooks.create(values, options, callback); | ||
const silent = options.silent || this.owner.options.silent; | ||
let where = options.where || this._prepareWhereforKeys(values); | ||
let where = options.where || this._prepareKeyValues(values); | ||
where = Array.isArray(where) ? where : [where]; | ||
@@ -334,2 +347,7 @@ /* prepare update values */ | ||
keyValues = this._prepareKeyValues(keyValues); | ||
options = options || {}; | ||
if (this._hooks && this._hooks.create) | ||
return this._hooks.create(keyValues, options, callback); | ||
const opts = merge({}, options); | ||
@@ -340,3 +358,3 @@ /* Prepare query */ | ||
.delete(this.tableNameFull) | ||
.where(this._prepareWhereforKeys(keyValues)); | ||
.where(keyValues); | ||
@@ -510,3 +528,3 @@ /* Execute query */ | ||
_prepareWhereforKeys(keyValues) { | ||
_prepareKeyValues(keyValues) { | ||
if (!(this.keyFields && this.keyFields.length)) | ||
@@ -513,0 +531,0 @@ throw new ErrorEx('No key field defined for model "%s"', this.name); |
{ | ||
"name": "uniqorm", | ||
"description": "Easy to use, multi-dialect ORM framework for JavaScript", | ||
"version": "1.5.0", | ||
"version": "1.5.1", | ||
"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
63585
2182