PyDBML
PyDBML copied to clipboard
Trailing comma in generated SQL for DBML enums
When converting a DBML enum to sql, the last entry of the generated CREATE TYPE statement has a trailing comma, which must not be there for PostgreSQL (see https://www.postgresql.org/docs/current/sql-createtype.html). Executing this statements fails with an error.
Example:
enum test_enum {
valA
valB
}
to sql
>>> from pydbml import PyDBML
>>> from pathlib import Path
>>> parsed = PyDBML(Path('test.dbml'))
>>> print(parsed.sql)
CREATE TYPE "test_enum" AS ENUM (
'valA',
'valB',
);
It should be
CREATE TYPE "test_enum" AS ENUM (
'valA',
'valB'
);
Thanks for the report! Fixed in 1.1.4