Replies: 1 comment 1 reply
-
Yes! Drift's schema support for Postgres is a bit limited compared to how well it supports SQLite, but since you're using other tools to manage the schema, that should mostly be fine. For questions 2 and 3, unfortunately the steps are a little harder than with SQLite and I'm not aware of a standalone tool that automates everything (but I think @davidmartos96 has worked on something similar generating drift table classes for the electric SQL client, that is probably a really good starting point). |
Beta Was this translation helpful? Give feedback.
-
Question
Hi everyone,
I'm setting up a Dart server and want to use Drift to manage database interactions. My database is already set up in Postgres, and I want to avoid rewriting all the table definitions manually in Drift. Ideally, I'd like to introspect my Postgres database to pull the table definitions directly and generate Drift code based on that.
My main questions are:
Any guidance or examples would be greatly appreciated! Thanks in advance for your help!
Additional Context
I’m running my server with Dart and connecting to a Postgres instance. My goal is to leverage Drift’s type-safe querying capabilities but without redefining all my existing schema manually. Ideally, I’m looking for a solution that’s both efficient and minimizes the risk of introducing inconsistencies between my Postgres schema and Drift’s generated code.
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions