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.
Files changed (2) hide show
  1. package/README.md +11 -0
  2. 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,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gg-mysql-connector",
3
- "version": "1.0.39",
3
+ "version": "1.0.41",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {