drawdb-io / drawdb

Free, simple, and intuitive online database design tool and SQL generator.
https://drawdb.vercel.app
MIT License
12.08k stars 851 forks source link

No support for SQL backticks? (`) #126

Closed Tazi0 closed 3 weeks ago

Tazi0 commented 1 month ago

When I import a SQL with backticks, it gives me the following error:

SyntaxError [Ln 1, Col 32]: Expected "#", "--", "/*", [ \t\n\r], or [A-Za-z_] but "`" found.
1ilit commented 1 month ago

Backticks are supported. Could you please give an example of what you're trying to import

Tazi0 commented 1 month ago

Backticks are supported. Could you please give an example of what you're trying to import

@1ilit I used a SQL export generated by PhpMyAdmin, since the error is at the beginning I will share the start:

CREATE DATABASE  IF NOT EXISTS `gouden_draak` /*!40100 DEFAULT CHARACTER SET latin1 */;
USE `gouden_draak`;

I did test it without those 2 lines and then the SQL did import, but I would expect drawdb would ignore these lines.

1ilit commented 1 month ago

@Tazi0 thanks for bringing this up.

drawdb does ignore the lines. What's happening in this case is that the parser fails to parse the names with backticks in 'create database' statements.

I just created an issue in the parser repository. It will probably be fixed in the next release