gg-mysql-connector 1.0.39 → 1.0.41
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/README.md +11 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -46,6 +46,13 @@ const model: MyModel[] = [
|
|
|
46
46
|
],
|
|
47
47
|
},
|
|
48
48
|
]
|
|
49
|
+
|
|
50
|
+
const viewData: MyViewModel[] = [
|
|
51
|
+
{
|
|
52
|
+
viewName: "item_view",
|
|
53
|
+
sqlStatement: SQL`CREATE OR REPLACE VIEW item_view AS SELECT id ,name , amount, price FROM item`,
|
|
54
|
+
},
|
|
55
|
+
]
|
|
49
56
|
```
|
|
50
57
|
|
|
51
58
|
## 2. Sync Model and Views with MySQL & Generate Model Interface
|
|
@@ -67,7 +74,11 @@ const migrator = new ModelGenerator(
|
|
|
67
74
|
|
|
68
75
|
await migrator.init()
|
|
69
76
|
await migrator.pushModelToDB()
|
|
77
|
+
|
|
78
|
+
// from file
|
|
70
79
|
await migrator.pushViewToDB("./views")
|
|
80
|
+
// from code
|
|
81
|
+
await migrator.pushViewToDB_v2(viewData)
|
|
71
82
|
await migrator.generateModelInterface({
|
|
72
83
|
appName: "app",
|
|
73
84
|
model: model,
|