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

Import from SQL: postgresql default type can't be parsed #158

Open
krhubert opened this issue Jul 23, 2024 · 2 comments
Open

Import from SQL: postgresql default type can't be parsed #158

krhubert opened this issue Jul 23, 2024 · 2 comments

Comments

@krhubert
Copy link

It is not possible to import postgresql schema with defaults and type casting into drawDB.

Steps to reproduce

Choose a database -> PostgreSQL -> Go to File -> Import from SQL -> upload SQL schema -> Click import

Schema file:

CREATE SCHEMA public;

CREATE TABLE public.tok1 (
    description text NOT NULL
);

CREATE TABLE public.tok2 (
    description text default '' NOT NULL
);

CREATE TABLE public.tnotok (
    description text DEFAULT ''::text NOT NULL
);

Error

SyntaxError [Ln 12, Col 32]: Expected ")", ",", "--", "/*", "AUTO_INCREMENT", "CHARACTER", "COLLATE", "COLUMN_FORMAT", "COMMENT", "DEFAULT", "KEY", "NOT NULL", "NULL", "ON", "PRIMARY", "REFERENCES", "STORAGE", "UNIQUE", [ \t\n\r], or [\n] but ":" found.

Expected behaviour

Import flow completes without errors.

@1ilit
Copy link
Member

1ilit commented Jul 23, 2024

Hey! Thanks for reporting.

The parser fails on ':'. I just created an issue in the parser repository. Hopefully it will be supported soon.

@Paulpatou
Copy link

I'm having the same problem, but I just saw that the docker image tag I'm using xinsodev/drawdb:latest was built before the problem was fixed. Will a new version be built soon?

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

3 participants