neopg 2.2.9 → 2.3.0
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/lib/ModelChain.js +4 -1
- package/package.json +1 -1
package/lib/ModelChain.js
CHANGED
|
@@ -443,7 +443,10 @@ class ModelChain {
|
|
|
443
443
|
const result = await this.sql`UPDATE ${fullTable} SET ${this.sql(data)} ${whereFragment} ${retFragment}`
|
|
444
444
|
|
|
445
445
|
if (this._returning && this._returning.length > 0) {
|
|
446
|
-
if (result.length
|
|
446
|
+
if (one_result && result.length < 2) {
|
|
447
|
+
return result[0] ?? null
|
|
448
|
+
}
|
|
449
|
+
|
|
447
450
|
return result
|
|
448
451
|
}
|
|
449
452
|
return result
|