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

Use DDL instead of a running Postgres database as the source of type information #513

Open
bohndthi opened this issue Apr 11, 2023 · 0 comments

Comments

@bohndthi
Copy link

bohndthi commented Apr 11, 2023

Is your feature request related to a problem? Please describe.
I find it cumbersome when developing that I have to connect to the production database instance or a clone. In my case, a full DDL of the database would be available. As far as I understand it, all type information should also be derivable from the DDL.
I would appreciate a way to be able to use the DDL instead of a direct connection. I realize that in this case you have possible discrepancies in the generation if, for example, the live database has been modified but the DLL has not.

Describe the solution you'd like
Instead of providing a database connection, i would like to provide one or more files with the DDL for the Database.
Additional context
I am not aware of any typescirpt library that generates types from DDL. However, i found a python package: https://pypi.org/project/omymodels/

Example DDL:

CREATE table user_history (
     runid                 decimal(21) null
    ,job_id                decimal(21)  null
    ,id                    varchar(100) not null
    ,user              varchar(100) not null
    ,status                varchar(10) not null
    ,event_time            timestamp not null default now()
    ,comment           varchar(1000) not null default 'none'
    ) ;
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant