drawdb
drawdb copied to clipboard
Import from SQL: postgresql default type can't be parsed
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.
Hey! Thanks for reporting.
The parser fails on ':'. I just created an issue in the parser repository. Hopefully it will be supported soon.
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?