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

UUID Marked as a Syntax Error in MySQL Adapter #544

Open
BenMorganMY opened this issue Apr 9, 2024 · 1 comment
Open

UUID Marked as a Syntax Error in MySQL Adapter #544

BenMorganMY opened this issue Apr 9, 2024 · 1 comment

Comments

@BenMorganMY
Copy link

I have begun a new dbdocs project with two legacy MariaDB databases. Currently, there is a column called api_key that is of uuid datatype and is causing a syntax error:

  `api_key` uuid NOT NULL,
$ sql2dbml ~/Repos/myhi/db/structure.sql -o ./database.dbml --mysql
  ERROR:
    You have a syntax error at "structure.sql" line 1899 column 12. no viable alternative at input '...,\n  `api_key` uuid'

  A complete log can be found in:
     /Users/ben/Repos/dbdocs/dbml-error.log

I'm wondering it it's possible to update the parser to recognize uuid's?

@huyleminh01
Copy link
Contributor

Hi @BenMorganMY ,

Currently, we are supporting import from native mysql database only so the uuid column is not valid.

To remove this error, you should try replace the uuid type by varchar(36) or binary(16) instead. You can check it out here https://dev.mysql.com/blog-archive/storing-uuid-values-in-mysql-tables/

Moreover, we will add your parser updating suggestion on our backlog and consider implementing it in the future. Anyway, if you're interested, please open a PR to remedy this issue; we highlly appreciate you contribution.

I hope this helps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants