Open guillempuche opened 7 months ago
Are you applying the migration via the Electric migration proxy?
https://electric-sql.com/docs/usage/data-modelling/migrations#migrations-proxy
If not, the DDLX syntax will not be supported.
Good advice James!
Indeed, the guide says:
If migrations do use DDLX syntax or do affect the electrified part of your schema, then they must be applied via the proxy. If not, they will be rejected and an error will be raised.
[TODO] When finish this database code, I'll open source in this thread, and close the thread if necessary.
One immediate issue I hit was that enums are wrapped in DO..END blocks and they're not supported
https://github.com/electric-sql/electric/issues/1492
I’d love to contribute to this effort, but I’m not sure where to start or if I’m currently equipped to help effectively. Any guidance on the initial steps or how I might best contribute would be greatly appreciated.
Describe what you want
ElectricSQL https://electric-sql.com/ is a growing open source reactive, realtime, local-first apps directly on Postgres.
Drizzle ORM's
migrate
(the one I'm using'drizzle-orm/postgres-js/migrator'
) can't handle "electrifying" of tables in.sql
files.Steps:
I generate the migration file
0000_xxx.sql
withyarn drizzle-kit generate:pg --config=./database/drizzle.config.ts
.I add manually the electrifiying of tables https://electric-sql.com/docs/usage/data-modelling/migrations to
.sql
generated file.Run Drizzle migration
yarn drizzle-kit generate:pg --config=./database/drizzle.config.ts
Error. See terminal logs: