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 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 === 1 && one_result) return result[0]
446
+ if (one_result && result.length < 2) {
447
+ return result[0] ?? null
448
+ }
449
+
447
450
  return result
448
451
  }
449
452
  return result
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "neopg",
3
- "version": "2.2.9",
3
+ "version": "2.3.0",
4
4
  "description": "orm for postgres",
5
5
  "keywords": [
6
6
  "neopg",