edgedb / edgedb-python

The official Python client library for EdgeDB
https://edgedb.com
Apache License 2.0
366 stars 43 forks source link

Schema management #27

Open agritheory opened 4 years ago

agritheory commented 4 years ago

For comment:

My expectation is that these are not likely to and should not be run in an async context, but maybe I'm just not aware of the use case. I would be happy to work on this piece of the project.

Fogapod commented 3 years ago

One of EdgeDB's goals is live migrations (from roadmap page), so async interface for migrate could be useful in some cases?

1st1 commented 3 years ago

Maybe. We are working on getting https://github.com/edgedb/rfcs/blob/master/text/1000-migrations.rst implemented as soon as possible. Migrations can be quite complicated so they necessitate an interactive process. So far we don't have a good idea how to expose that process as a high-level Pythonic API. We'll see if that's possible once the RFC is implemented and we get some experience with using it.

cc @elprans

Fogapod commented 3 years ago

Any updates on this one? Looks like there is a working CLI migration functionality now. edgedb migrate is not interactive and can probably be easily implemented here. Or no? Does the CLI do any work other than shipping .esdl .edgeql files to database in correct order?

I deploy my app using docker and it'd be nice to not depend on large edgedb-cli binary just for migrations.

elprans commented 3 years ago

On the edgedb migrate path the CLI isn't doing anything special other than sending the content of *.edgeql files from dbschema/migrations (which is where edgedb create-migration puts them). The only complication is determining which migrations have been applied already by querying schema::Migration and parsing the migration ids from the files.

it'd be nice to not depend on large edgedb-cli binary just for migrations.

Most of the binary weight is debug symbols, which we ship while the thing is still in beta for better crash dumps when things go south. A stripped release edgedb-cli binary is currently around 10MB.

fantix commented 1 year ago

Circling back on this - we are discussing to add a Python entrypoint to run migrations without the CLI.