gg-mysql-connector 1.0.59 → 1.0.61

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.
@@ -25,7 +25,7 @@ export default class ModelGenerator {
25
25
  getColumnFullList(tableName: string): Promise<mysql.RowDataPacket[]>;
26
26
  private isTableNameExistInModel;
27
27
  private isColumnExistInModel;
28
- getPossibleColumnValue(model: MyModel[], tableName: string, columnName: string, columnType: string): false | string[] | undefined;
28
+ getPossibleColumnValue(model: MyModel[], tableName: string, columnName: string, columnType: string): string[] | false;
29
29
  generateModelInterface(params: {
30
30
  appName: string;
31
31
  model: MyModel[];
@@ -154,6 +154,7 @@ class ModelGenerator {
154
154
  return word;
155
155
  }
156
156
  }
157
+ return false;
157
158
  }
158
159
  async generateModelInterface(params) {
159
160
  const tableList = [
@@ -177,12 +177,12 @@ class MyDBMigrator {
177
177
  .finally(() => {
178
178
  console.log("");
179
179
  });
180
- loopCount++;
181
180
  if (loopCount > viewModel.length * 5) {
182
181
  console.log("error while updating view, reason is loop update counter is over 5 time fail");
183
182
  process.exit(1);
184
183
  }
185
184
  }
185
+ loopCount++;
186
186
  }
187
187
  }
188
188
  async checkIsPrimaryKey(databaseName, tableName, columnName) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gg-mysql-connector",
3
- "version": "1.0.59",
3
+ "version": "1.0.61",
4
4
  "description": "",
5
5
  "main": "dist/src/index.js",
6
6
  "scripts": {
@@ -171,7 +171,7 @@ export default class ModelGenerator {
171
171
  tableName: string,
172
172
  columnName: string,
173
173
  columnType: string
174
- ) {
174
+ ): string[] | false {
175
175
  const foundTable = model.find((row) => row.tableName === tableName)
176
176
  // search in table model
177
177
  if (foundTable) {
@@ -196,6 +196,7 @@ export default class ModelGenerator {
196
196
  return word
197
197
  }
198
198
  }
199
+ return false
199
200
  }
200
201
  async generateModelInterface(params: {
201
202
  appName: string
@@ -282,7 +282,6 @@ export default class MyDBMigrator {
282
282
  .finally(() => {
283
283
  console.log("")
284
284
  })
285
- loopCount++
286
285
 
287
286
  if (loopCount > viewModel.length * 5) {
288
287
  console.log(
@@ -291,6 +290,7 @@ export default class MyDBMigrator {
291
290
  process.exit(1)
292
291
  }
293
292
  }
293
+ loopCount++
294
294
  }
295
295
  }
296
296