xnuinside/simple-ddl-parser

Add support for INHERITS in postgres dialect

ahaessly opened this issue · 2 comments

Is your feature request related to a problem? Please describe.
I use INHERITS in my postgres schema. The parser does not recognize create table statements that use INHERITS

Describe the solution you'd like
Create entries for tables that use INHERITS with their inherited fields

Describe alternatives you've considered
Currently I have to manually edit my ddl for any tables that use INHERITS

Additional context

CREATE TABLE public.identifier (
    system text NOT NULL,
    value text NOT NULL
);

CREATE TABLE public."Diagnosis" (
    id text NOT NULL,
);

CREATE TABLE public."Diagnosis_identifier" (
    "Diagnosis_id" text NOT NULL
)
INHERITS (public.identifier);

resulting file does not include a table for Diagnosis_identifier

@ahaessly Thanks for reporting the issue! Sorry for the delay with answer, I had a lot of personal things to do. I added support for INHERITS. It will be available in 0.30.0 version - I will add one more comment when I will release it to pypi

@ahaessly I just released version 0.30.0, try it. Test was added - https://github.com/xnuinside/simple-ddl-parser/blob/main/tests/dialects/test_psql.py#L10, if will be needed anything more - open new issue. And thanks for reporting that!