Comparing version 0.1.19-alpha.15 to 0.2.0-alpha.0
@@ -28,2 +28,4 @@ let currentConfig = { | ||
let up = false | ||
const init = async () => { | ||
@@ -41,2 +43,3 @@ const settings = getSettings() | ||
} | ||
up = true | ||
} | ||
@@ -50,9 +53,13 @@ | ||
require('./init/databases').shutdown() | ||
up = false | ||
} | ||
const isUp = () => up | ||
module.exports = { | ||
configure, | ||
getSettings, | ||
isUp, | ||
init, | ||
shutdown | ||
} |
@@ -13,3 +13,3 @@ const logger = require('../logger') | ||
if (!createTransport) { | ||
options.prettyPrint = {} | ||
options.transport = { target: 'pino-pretty' } | ||
} | ||
@@ -16,0 +16,0 @@ logger.init( |
const noop = () => {} | ||
const defaultLogger = { | ||
child () { | ||
return this | ||
}, | ||
debug: noop, | ||
@@ -27,2 +30,3 @@ error: console.error, | ||
module.exports = { | ||
child: proxy('child'), | ||
debug: proxy('debug'), | ||
@@ -29,0 +33,0 @@ error: proxy('error'), |
@@ -192,3 +192,3 @@ const { DatabaseModelBase } = require('./DatabaseModelBase') | ||
.exec() | ||
if (result.insertId) { | ||
if (result.insertId && !this.pk) { | ||
this.set(row.model.pkName, result.insertId) | ||
@@ -222,8 +222,8 @@ // Set this back to the cascade ^^ | ||
async save () { | ||
async save (...args) { | ||
await this.validate() | ||
if (this.pk) { | ||
return await this.update() | ||
return await this.update(...args) | ||
} | ||
return await this.create() | ||
return await this.create(...args) | ||
} | ||
@@ -230,0 +230,0 @@ |
{ | ||
"name": "djorm", | ||
"version": "0.1.19-alpha.15", | ||
"version": "0.2.0-alpha.0", | ||
"description": "Django like ORM framework", | ||
@@ -40,7 +40,7 @@ "author": "Pavel Žák <pavel@zak.global>", | ||
"moment-timezone": "^0.5.33", | ||
"pino": "^6.11.3", | ||
"pino-pretty": "^5.0.2", | ||
"pino": "^8.14.1", | ||
"pino-pretty": "^10.0.0", | ||
"uuid": "^9.0.0" | ||
}, | ||
"gitHead": "1dd4de9c54dbf98bd3ce060e28e6cc2254b20c7f" | ||
"gitHead": "6b3e128d9788969f227cc7df3363fa89671e9371" | ||
} |
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
44
3175
92043
86
+ Addedabort-controller@3.0.0(transitive)
+ Addedbase64-js@1.5.1(transitive)
+ Addedbuffer@6.0.3(transitive)
+ Addedcolorette@2.0.20(transitive)
+ Addedevent-target-shim@5.0.1(transitive)
+ Addedevents@3.3.0(transitive)
+ Addedfast-copy@3.0.2(transitive)
+ Addedhelp-me@5.0.0(transitive)
+ Addedieee754@1.2.1(transitive)
+ Addedminimist@1.2.8(transitive)
+ Addedon-exit-leak-free@2.1.2(transitive)
+ Addedpino@8.21.0(transitive)
+ Addedpino-abstract-transport@1.2.0(transitive)
+ Addedpino-pretty@10.3.1(transitive)
+ Addedpino-std-serializers@6.2.2(transitive)
+ Addedprocess@0.11.10(transitive)
+ Addedprocess-warning@3.0.0(transitive)
+ Addedreadable-stream@4.5.2(transitive)
+ Addedreal-require@0.2.0(transitive)
+ Addedsafe-stable-stringify@2.5.0(transitive)
+ Addedsecure-json-parse@2.7.0(transitive)
+ Addedsonic-boom@3.8.1(transitive)
+ Addedsplit2@4.2.0(transitive)
+ Addedthread-stream@2.7.0(transitive)
- Removed@hapi/bourne@2.1.0(transitive)
- Removedansi-styles@3.2.14.3.0(transitive)
- Removedargs@5.0.3(transitive)
- Removedcamelcase@5.0.0(transitive)
- Removedchalk@2.4.24.1.2(transitive)
- Removedcolor-convert@1.9.32.0.1(transitive)
- Removedcolor-name@1.1.31.1.4(transitive)
- Removedescape-string-regexp@1.0.5(transitive)
- Removedflatstr@1.0.12(transitive)
- Removedhas-flag@3.0.04.0.0(transitive)
- Removedinherits@2.0.4(transitive)
- Removedjmespath@0.15.0(transitive)
- Removedleven@2.1.0(transitive)
- Removedmri@1.1.4(transitive)
- Removedpino@6.14.0(transitive)
- Removedpino-pretty@5.1.3(transitive)
- Removedpino-std-serializers@3.2.0(transitive)
- Removedprocess-warning@1.0.0(transitive)
- Removedreadable-stream@3.6.2(transitive)
- Removedrfdc@1.4.1(transitive)
- Removedsonic-boom@1.4.1(transitive)
- Removedsplit2@3.2.2(transitive)
- Removedsupports-color@5.5.07.2.0(transitive)
- Removedutil-deprecate@1.0.2(transitive)
Updatedpino@^8.14.1
Updatedpino-pretty@^10.0.0