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

edgedb crate structure #259

Open
tailhook opened this issue Jun 19, 2023 · 0 comments
Open

edgedb crate structure #259

tailhook opened this issue Jun 19, 2023 · 0 comments

Comments

@tailhook
Copy link
Contributor

We has always wanted to expose bindings under edgedb crate instead of the edgedb-tokio/whatever. But the structure of that is not very clear. Here is a sketch of my current thinking.

  1. Expose edgedb::model, edgedb::error, and whatever is needed for derive macros.
  2. Feature tokio: exposes edgedb::tokio
  3. Feature blocking: exposes edgedb::blocking (which probably a blocking wrapper around tokio)
  4. We might have default-tokio and default-blocking client which expose respective clients to the top-level namespace edgedb::tokio::Client -> edgedb::client, edgedb::blocking::Client -> edgedb::Client.
  5. Potentically async-std/glommio or whatever new runtime can be done via it's own crate and brought here via feature flag. Also blocking implementation that doesn't depend on tokio could be implemented in the future too.

Ideally when async traits arrive to the stable Rust here is how it should work:

  1. There is an edgedb-async crate which contains traits for executing queries
  2. Libraries (which are not end-user apps) depend on edgedb-model and edgedb-async, but not edgedb crate (it's unclear how that would work with edgedb-derive, though).
  3. When we bump major version of edgedb only app could be updated
  4. When we bump major version of edgedb-model and edgedb-async we do adapters that allow libraries using older versions to work (i.e. transform to new types, see log crate for an inspiration)

But I'm not sure whether this is practical enough, and/or when this will become practical.

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

1 participant