Merge pull request #259 from drsugiaichigo00781vn/continue-when-generate-error
ignore table have numberic column name
This commit is contained in:
commit
c7d768cca6
@ -80,9 +80,19 @@ function generateModels(
|
||||
)
|
||||
: rendered
|
||||
);
|
||||
const formatted = Prettier.format(withImportStatements, {
|
||||
parser: "typescript"
|
||||
});
|
||||
let formatted = "";
|
||||
try {
|
||||
formatted = Prettier.format(withImportStatements, {
|
||||
parser: "typescript"
|
||||
});
|
||||
} catch (error) {
|
||||
console.error(
|
||||
"There were some problems with model generation for table: ",
|
||||
element.sqlName
|
||||
);
|
||||
console.error(error);
|
||||
formatted = withImportStatements;
|
||||
}
|
||||
fs.writeFileSync(resultFilePath, formatted, {
|
||||
encoding: "UTF-8",
|
||||
flag: "w"
|
||||
|
Loading…
Reference in New Issue
Block a user