Open colinhacks opened 2 years ago
$ npx edgedb-migrate
call it edgedb-ci-migrate?
I already dislike npx edgedb-migrate
and I like edgedb-ci-migrate
even less. Hyphenated commands like this just aren't very elegant and feel too technical/hackery. I propose an alternative command naming scheme here: https://github.com/edgedb/edgedb-js/issues/361
Per a recent team call, I'm putting down some thoughts relating our plans to provide a better DX for users looking to generate the query builder and apply migrations in CI.
1. Offline generation
Add a
--offline
flag tonpx edgeql-js
that would do a temp install of the CLI and spin up an ephemeral instance from which to generate the query builder. This would ignore the migration files and generate a fresh instance from the given SDL.2 DDL-only mode for migrate
We should implement a way to execute migrations s.t. all DML statements are ignored, to prevent possible errors when executing a migration against an empty database.
3 SDL/migration integrity checking
The
npx edgeql-js
command should check that the SDL is in sync with the latest migrations. This can be achieved by attempting to create a migration and checking if the list of proposed statements is empty.4 Run migrations with
npx
There should be a way to apply migrations with
npx
. Installing the CLI binary in build environments like Vercel doesn't feel idiomatic in the JS ecosystem. Theedgedb-js
package should expose another command (alongsideedgeql-js
) for executing migrations. This would install the CLI using the logic fromsetup-edgedb
and use to to apply the migrations. Per #361: