Edgemorph: EdgeDB Manipulation of Relational Polymorphic Hierarchies #1811
dmgolembiowski
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Hi EdgeDB community,
I've began efforts to make a relational mapper for EdgeDB in Rust to support easy-to-use client APIs in both Rust and Python at the application level. It would be great if edgemorph's expressiveness could sit adjacent to Agritheory's Edgewise ORM since it already has some powerful features figured out -- and I don't want to reinvent the wheel. 😄
Here's the general design I'm going for!
Please give me some feedback on how you think it could be improved!
EdgeQL Schema Definition
Here's a baseline SDL example
shamelessly ripped from the tutorial:abstract type Named { required property name -> str; } abstract type HasAddress { property address -> str; } type User extending Named, HasAddress { # define some user-specific properties and a link multi link friends -> User; # define an index for User based on name index on (__subject__.name); }Rust API
Macros in Rust can be tricky to write, but the payoff is enormous. They enable the user to generate tons of boilerplate code at compile time. Plus, they look nice; even resembling the Pythonic decorator style.
Python API
Speaking of Pythonic, there's something magical-looking about type annotations. They create an intuitive form that can be translated into SDL and DDL. When coupled with the appropriate Rust bindings, they provide an excellent option for describing data maps.
All reactions