neopg 2.0.4 → 2.0.5

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
@@ -2,6 +2,7 @@
2
2
 
3
3
  const makeId = require('./makeId.js')
4
4
  const makeTimestamp = require('./makeTimestamp.js')
5
+ const serialId = makeId.serialId
5
6
 
6
7
  // 提取常量定义
7
8
  const INT_TYPES = new Set([
@@ -547,6 +548,10 @@ class ModelChain {
547
548
  this.def.validateField(key, row[key])
548
549
  }
549
550
  }
551
+
552
+ makeId(len=16) {
553
+ return this.def ? this.def.makeId(this.def.pkLen) : serialId(len)
554
+ }
550
555
  }
551
556
 
552
557
  module.exports = ModelChain
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "neopg",
3
- "version": "2.0.4",
3
+ "version": "2.0.5",
4
4
  "description": "orm for postgres",
5
5
  "keywords": [
6
6
  "neopg",