gg-mysql-connector 1.0.59 → 1.0.64
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):
|
|
28
|
+
getPossibleColumnValue(model: MyModel[], tableName: string, columnName: string, columnType: string): string[] | false;
|
|
29
29
|
generateModelInterface(params: {
|
|
30
30
|
appName: string;
|
|
31
31
|
model: MyModel[];
|
|
@@ -177,12 +177,12 @@ class MyDBMigrator {
|
|
|
177
177
|
.finally(() => {
|
|
178
178
|
console.log("");
|
|
179
179
|
});
|
|
180
|
-
loopCount++;
|
|
181
|
-
if (loopCount > viewModel.length * 5) {
|
|
182
|
-
console.log("error while updating view, reason is loop update counter is over 5 time fail");
|
|
183
|
-
process.exit(1);
|
|
184
|
-
}
|
|
185
180
|
}
|
|
181
|
+
if (loopCount > viewModel.length * 5) {
|
|
182
|
+
console.error("error while updating view, reason is loop update counter is over 5 time fail");
|
|
183
|
+
process.exit(1);
|
|
184
|
+
}
|
|
185
|
+
loopCount++;
|
|
186
186
|
}
|
|
187
187
|
}
|
|
188
188
|
async checkIsPrimaryKey(databaseName, tableName, columnName) {
|
package/package.json
CHANGED
|
@@ -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,15 +282,14 @@ export default class MyDBMigrator {
|
|
|
282
282
|
.finally(() => {
|
|
283
283
|
console.log("")
|
|
284
284
|
})
|
|
285
|
-
loopCount++
|
|
286
|
-
|
|
287
|
-
if (loopCount > viewModel.length * 5) {
|
|
288
|
-
console.log(
|
|
289
|
-
"error while updating view, reason is loop update counter is over 5 time fail"
|
|
290
|
-
)
|
|
291
|
-
process.exit(1)
|
|
292
|
-
}
|
|
293
285
|
}
|
|
286
|
+
if (loopCount > viewModel.length * 5) {
|
|
287
|
+
console.error(
|
|
288
|
+
"error while updating view, reason is loop update counter is over 5 time fail"
|
|
289
|
+
)
|
|
290
|
+
process.exit(1)
|
|
291
|
+
}
|
|
292
|
+
loopCount++
|
|
294
293
|
}
|
|
295
294
|
}
|
|
296
295
|
|