Is it possible to generate without schema at hand? #1551
-
Hi, sqlc is very helpful for me when using for personal projects but I am thinking of how to implement it for my work tasks. Most of them time, the database (all tables and etc) are created by DB engineers, so I do not have schema file at hand. Of course I can ask to get schema file which can be feed to sqlc but I wonder whether it is possible to generate without schema? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Without the schema information, sqlc cannot know what types each columns is - and therefore it is (basically) impossible to know which data types to use. What I have done in the past for this is to just issue a pg_dump - assuming you have permissions to do so. pg_dump --no-privileges --no-acl --no-owner --schema-only --no-comments --encoding=utf8 postgres://your_db_here |
Beta Was this translation helpful? Give feedback.
Without the schema information, sqlc cannot know what types each columns is - and therefore it is (basically) impossible to know which data types to use.
What I have done in the past for this is to just issue a pg_dump - assuming you have permissions to do so.