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 · 1 comment
Open

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

krhubert opened this issue Jul 23, 2024 · 1 comment

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.

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