@zenorm/generate 1.6.0 → 1.7.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/CHANGELOG.md CHANGED
@@ -1,5 +1,8 @@
1
1
  # Changelog
2
2
 
3
+ ## [1.7.0] - 2023-5-18
4
+ - 构造器增加 pkval 参数
5
+
3
6
  ## [1.6.0] - 2023-5-18
4
7
  - 使用构造器提前初始化对象的属性,用于优化 v8 对象缓存机制
5
8
 
package/dist/generate.js CHANGED
@@ -68,7 +68,8 @@ async function generate(tables, cfg) {
68
68
  structs.push(...props);
69
69
  structs.push('');
70
70
  // 使用构造器提前初始化对象的属性,用于优化 v8 对象缓存机制
71
- structs.push(` constructor(data: Partial<${className}Table> = {}) {`);
71
+ structs.push(` constructor(pkval?: ${pkType}, data: Partial<${className}Table> = {}) {`);
72
+ structs.push(` this.__pk = pkval;`);
72
73
  for (const c of columns) {
73
74
  structs.push(` this.${c} = data.${c};`);
74
75
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@zenorm/generate",
3
3
  "description": "Easy ORM, easy query. easy typing! Auto generate typescript declaration.",
4
- "version": "1.6.0",
4
+ "version": "1.7.0",
5
5
  "exports": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
7
7
  "homepage": "https://zenorm.node.ltd",