Zero Codegen is a tool that generates table and relationship definitions for Zero based on your existing Postgres database.
DISCLAIMER: Zero Codegen is under heavy development and may not function as expected. I'm currently updating this project when I encounter issues in my own work.
- Install with
yarn add zero-codegenornpm install zero-codegen - Find your Postgres database connection string.
- Run
zero-codegen --database-url <connection-string> - Optionally, you can specify the file path to the tables and relationships files with
--tables-pathand--relationships-pathparameters.
- Find a better way to name relationships when a table has multiple foreign keys referencing the same table.
- Only import tables and zero data types that are actually used in the generated code.
- Support JSON and JSONB data types.
- Support enums.