.esdl Convention/ Best PracticeJune 24, 2020 at 6:54pm
When saving .esdl files I'm often tempted to include the whole
CREATE MIGRATION ...to
COMMIT MIGRATION;. Since EdgeDB doesn't read these files itself, they need to be send via one of the clients, at which point they're just strings. What should be the best practice here? While I like the idea of schema being a schema file (and not a schema command +/-), it's convenient. What does the EdgeDB team do and what would you recommend?
June 24, 2020 at 6:57pm
.esdl files are supposed to only contain the schema text (i.e no
MIGRATIONcommands). We are working on the implementation of RFC 1000 which would add a reference implementation for schema management to edgedb-cli (along with the necessary command changes).
To clarify, the intended workflow is as follows:
- Modify schema definition in your favorite editor.
edgedb create-migration. This generates a migration file.
- Apply the migration file with
edgedb migraiteor read and send it with a language client: migrations are valid EdgeQL scripts.
June 25, 2020 at 12:17pm