Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Errors on USE dbname ; #42

Closed
fijiwebdesign opened this issue Mar 9, 2019 · 2 comments
Closed

Errors on USE dbname ; #42

fijiwebdesign opened this issue Mar 9, 2019 · 2 comments
Labels
bug Something isn't working enhancement New feature or request

Comments

@fijiwebdesign
Copy link

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.

@duartealexf
Copy link
Owner

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.

@duartealexf duartealexf added bug Something isn't working enhancement New feature or request labels Mar 13, 2019
@duartealexf
Copy link
Owner

Hi @fijiwebdesign, i just added support for USE statements.

Check out version 3.1.0 ;)

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants