Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Schema management #27

Open
agritheory opened this issue Sep 14, 2019 · 5 comments
Open

Schema management #27

agritheory opened this issue Sep 14, 2019 · 5 comments

Comments

@agritheory
Copy link

For comment:

  • Add an .edsl reader interface (blocking/ not async)
  • Add validation for .edsl files (blocking/ not async)
  • Add a direct migrate or apply_schema interface (blocking/ not async)
  • Add a direct export interface, (also blocking) perhaps something like:

from pathlib import Path
from typing import Union
export(db: str, path: Path, tables: Union[set, list, tuple]) # what other options?

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
Copy link
Contributor

Fogapod commented Jul 31, 2020

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

@1st1
Copy link
Member

1st1 commented Jul 31, 2020

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
Copy link
Contributor

Fogapod commented Mar 7, 2021

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
Copy link
Member

elprans commented Mar 8, 2021

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
Copy link
Member

fantix commented May 25, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants