Errors on USE `dbname` ;
fijiwebdesign opened this issue · comments
SQL
USE `treks` ;
This will throw an error
Error: invalid syntax at line 26 col 1:
USE
^
Unexpected S_IDENTIFIER_UNQUOTED token: "USE"
at Parser.feed (/app/node_modules/nearley/lib/nearley.js:317:27)
at Parser.get results [as results] (/app/local_modules/sql-ddl-to-json-schema/lib/parser.js:150:21)
at Parser.toCompactJson (/app/local_modules/sql-ddl-to-json-schema/lib/parser.js:204:19)
at Parser.toJsonSchemaArray (/app/local_modules/sql-ddl-to-json-schema/lib/parser.js:221:21)
at Parser.toJsonSchemaFiles (/app/local_modules/sql-ddl-to-json-schema/lib/parser.js:242:26)
at Object.<anonymous> (/app/local_modules/caminte-cli/lib/sqlparser2.js:9:31)
at Module._compile (internal/modules/cjs/loader.js:654:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:665:10)
at Module.load (internal/modules/cjs/loader.js:566:32)
at tryModuleLoad (internal/modules/cjs/loader.js:506:12)
When generating from MySQL workbench the USE dbname
is included with default settings.
Thanks for raising this issue.
I can add support to this, but it'll be by next month.
I'd have to add the "USE" statement somewhere around here... https://github.com/duartealexf/sql-ddl-to-json-schema/blob/master/src/mysql/parser/lexer.ne#L33
Feel free to contribute :)
Cheers.