extract-mysql-schema 0.6.3 → 0.6.6

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 (3) hide show
  1. package/index.js +2 -2
  2. package/package.json +1 -1
  3. package/run.js +5 -3
package/index.js CHANGED
@@ -207,7 +207,7 @@ const extractSchemas = async function (connection, options) {
207
207
  if(column.generated==="STORED") def = `${column.expression} STORED`;
208
208
  let notNull = column.isNullable?"NULL":"NOT NULL";
209
209
  if(column.generated==="STORED") {
210
- def = `(${column.expression}) STORED`;
210
+ def = ` AS (${column.expression}) STORED`;
211
211
  notNull=""
212
212
  }
213
213
  definition.push(`${name}\t${column.sqltype}\t${column.isAutoNumber && column.isPrimaryKey ?" auto_increment":""}${def}\t${notNull}${column.isPrimaryKey && !column.isCompoundKey?" PRIMARY KEY":""}${extra}`);
@@ -333,7 +333,7 @@ CREATE PROCEDURE ${name}(
333
333
  )
334
334
  ${definition}
335
335
  //
336
- DELIMITER;
336
+ DELIMITER ;
337
337
  `;
338
338
 
339
339
  let routine = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "extract-mysql-schema",
3
- "version": "0.6.3",
3
+ "version": "0.6.6",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "bin": "./run.js",
package/run.js CHANGED
@@ -88,6 +88,7 @@ async function main(options) {
88
88
  let options = {
89
89
  configFile:"",
90
90
  outputFile:"",
91
+ debug:false,
91
92
  columnISV:true,
92
93
  tableISV:false,
93
94
  procedureISV:false,
@@ -102,6 +103,7 @@ let argv = process.argv;
102
103
 
103
104
  for(let i=2;i<argv.length;i++) {
104
105
  if(argv[i]==="--columnISV") options.columnISV=true;
106
+ else if(argv[i]==="--debug") options.debug=true;
105
107
  else if(argv[i]==="--tableISV") options.tableISV=true;
106
108
  else if(argv[i]==="--procedureISV") options.procedureISV=true;
107
109
  else if(argv[i]==="--writeSql") options.writeSql=true;
@@ -125,11 +127,11 @@ try {
125
127
  main(options).then(()=>{
126
128
  if(options.debug) console.log("DONE");
127
129
  process.exit(0);
128
- },()=>{
129
- if(options.debug) console.log("ERROR");
130
+ },(e)=>{
131
+ console.log("ERROR",e);
130
132
  process.exit(1);
131
133
  })
132
134
  } catch (e) {
133
135
  process.exit(1);
134
136
  }
135
- })();
137
+ })();