It's a matter of taste. We decided to do a "looks like SQL + GraphQL" style because that's what most people are familiar when they think about a query language.
That said, the functional variant is a likely way to represent EdgeQL in programming languages.
Keep in mind that EdgeQL is a query language that can be used from any programming language (either over the official libraries, or over HTTP). Functional JS-inspired dialects aren't appealing to everybody.
Your query returns 5 rows total. The EdgeDB query returns all movies that Zendaya is in [1] and, along with each movie, the first 5 credited actors.
Also, it looks like your version also does implicit joins (like EdgeDB), but I'm not sure how they would work in that style. [1] Or maybe only movies where Zendaya is in the first 5 credited actors; I'm not sure.
This is so exciting. We can definitely do better than SQL in 2022 and EdgeDB is a step in the right direction. Been using Prisma[0] in production in the past year and a half (which takes the same approach as EdgeDB but currently works for TypeScript and Golang) and I'm so happy.
[0]: https://www.prisma.io/
Prisma did a lot of things right, and we have a ton of respect for the team over there! At the end of the day, building a good, idiomatic API for doing CRUD operations is a hard problem. But building an entirely new query language that fundamentally solves some underlying design flaws and usability issues with SQL is a whole other level of hard.
With EdgeQL, we conclusively solved a lot of these fundamental issues. Now, we're able to use EdgeQL as the foundation of our query builders, which is a huge advantage. We built the first version of the TypeScript QB in ~4 months) and it immediately leapfrogs all the major ORMs in power & expressiveness. But that's only possible because the hard work of designing EdgeQL was already done. We'll be working on communicating how our query builder works and how it compares to ORMs in some of upcoming posts, stay tuned.
How do you folks solve the large amount of joins that are the result of graph queries?
Any worst-case-optimal multi-way-join secret sauce :D? Also, with DBs like Datomic competing in the same area, do you have an immutability/versioning story?
Sounds like this is not dissimilar from the GraphQL-to-SQL compiler in Hasura, which also brings out surprising performance for wildly nested frontend queries.
Our topmost priority now is launching a hosted version of the product, all hands on deck. Having a proper (and potentially fully type-safe) query builder for Python is literally the next to-do.
How do we migrate from existing Postgres database to EdgeDB? Can traditional app still access all the relational as before and new app access via EdgeDB? We're making use of existing environment and extending it with our own frontend. I would like to understand how I can mix legacy and new code.
We plan to introduce a tool for assisting migration from SQL databases, but at this very moment, the only way to migrate an existing app is to re-create your DB schema in EdgeDB and then write a script to import the data. EdgeDB right now is definitely more geared towards starting new projects with it.
Maybe if you move all data to be managed by EdgeDB, then create a separate "legacy" schema that just contains views & triggers that forwards queries and mutations to the EdgeDB database.
do you have plans to integrate with prisma? it's almost a DIRECT translation of how the query is expressed in Prisma compared to edgedb. Googling quickly, it seems there is a ticket already. I wonder if this could be a low hanging fruit and a great growth channel since prisma is very popular.
I have a few questions I can't find after skimming the documentation..
Can someone use Postgres extensions with EdgeDB, like TimescaleDB, PostGIS, Zombodb and Postgres_fdw? How are sum types (called enums in Rust) modelled in EdgeDB? (like Rust's Result). Do I need to define it with inheritance, where each variant inherits from it? What about adding specific syntax for sum types? edit: also, I see there's a WIP custom #[derive] for Rust in https://github.com/edgedb/edgedb-rust - can it store Rust types on EdgeDB? Something like http://diesel.rs/ or even https://lib.rs/crates/turbosql
Regarding extensions: we plan to wrap the most popular ones like PostGIS to give them idiomatic EdgeQL flavor. We need to do a bit of work to make that the right way.
Sum types can be modeled with inheritance. You can create an abstract base type and use that as target for the links. You can then derive types from it and write polymorphic EdgeQL queries to select/match data. Rust client is still work on progress, not really open to tinkering unless you want to experiment.
Hell yeah. This is what I've wanted ever since I first learned about Apple's CoreData.
This seems great. I have a highly interrelated data model (think parsed natural language text with annotations), and writing SQL to keep all of that data aligned and synced is a pain with an ORM. Am I right in imagining this works similarly to how Apple's CoreData does?
It lets you build objects linked to each other but handles all of the joining and syncing of the data for you to keep the object model in mind. In the same vein will you be creating a Swift client?
I'm not too familiar with the CoreData API, but from a quick googling it seems like this is some sort of an ORM on top of SQLite.
We position EdgeDB as a database server, not a library, partly because you can interact with it from different programming languages. But we design our client library with focus on API composability, check out our edgedb-js library for example: https://www.edgedb.com/docs/clients/01_js/index As for the Swift, it would be great to have it one day. I have a counter question: how many of you use Swift to write server-side logic?
Right, but conceptually the way you interact with it is the same. I'm not trying to belittle what you've done. I'm in fact very excited about it.
And EdgeDB is very needed because it's just an Apple library currently. Conceptually, my impression is that EdgeDb is relational tables (highly-typed) queried, combined, and modeled as nodes in a graph/tree. Is that conceptually correct? I don't, but I would like to if I could deploy Swift code to Azure. I love Swift as a language.
That's correct! Though that's true for most ORMs as well, and we try not to get lumped into the ORM bucket...too much bad blood.
I've dabbled with CoreData myself and it's a phenomenal API. Apple comes up with a lot of great stuff. In fact, given how much server-side Swift there is these days, we'll have to look into building a Swift client library at some point.
Comments (323) 88 threads
Earlier commentsThat said, the functional variant is a likely way to represent EdgeQL in programming languages.
Also, it looks like your version also does implicit joins (like EdgeDB), but I'm not sure how they would work in that style.
[1] Or maybe only movies where Zendaya is in the first 5 credited actors; I'm not sure.
With EdgeQL, we conclusively solved a lot of these fundamental issues. Now, we're able to use EdgeQL as the foundation of our query builders, which is a huge advantage. We built the first version of the TypeScript QB in ~4 months) and it immediately leapfrogs all the major ORMs in power & expressiveness. But that's only possible because the hard work of designing EdgeQL was already done.
We'll be working on communicating how our query builder works and how it compares to ORMs in some of upcoming posts, stay tuned.
Live launch stream: https://www.youtube.com/watch?v=WRZ3o-NsU_4
How do you folks solve the large amount of joins that are the result of graph queries? Any worst-case-optimal multi-way-join secret sauce :D?
Also, with DBs like Datomic competing in the same area, do you have an immutability/versioning story?
Continue this thread — 2 replies
https://github.com/prisma/prisma/issues/10210
See also this reply by Colin: https://news.ycombinator.com/item?id=30293544
Continue this thread — 1 reply
Can someone use Postgres extensions with EdgeDB, like TimescaleDB, PostGIS, Zombodb and Postgres_fdw?
How are sum types (called enums in Rust) modelled in EdgeDB? (like Rust's Result). Do I need to define it with inheritance, where each variant inherits from it? What about adding specific syntax for sum types?
edit: also, I see there's a WIP custom #[derive] for Rust in https://github.com/edgedb/edgedb-rust - can it store Rust types on EdgeDB? Something like http://diesel.rs/ or even https://lib.rs/crates/turbosql
Sum types can be modeled with inheritance. You can create an abstract base type and use that as target for the links. You can then derive types from it and write polymorphic EdgeQL queries to select/match data.
Rust client is still work on progress, not really open to tinkering unless you want to experiment.
Do you offer fully managed service to host this or do I need to spin up some compute instances of my own ?
Can't wait for edgeDB cloud!
Continue this thread — 1 reply
This seems great. I have a highly interrelated data model (think parsed natural language text with annotations), and writing SQL to keep all of that data aligned and synced is a pain with an ORM.
Am I right in imagining this works similarly to how Apple's CoreData does? It lets you build objects linked to each other but handles all of the joining and syncing of the data for you to keep the object model in mind.
In the same vein will you be creating a Swift client?
We position EdgeDB as a database server, not a library, partly because you can interact with it from different programming languages. But we design our client library with focus on API composability, check out our edgedb-js library for example: https://www.edgedb.com/docs/clients/01_js/index
As for the Swift, it would be great to have it one day. I have a counter question: how many of you use Swift to write server-side logic?
And EdgeDB is very needed because it's just an Apple library currently.
Conceptually, my impression is that EdgeDb is relational tables (highly-typed) queried, combined, and modeled as nodes in a graph/tree. Is that conceptually correct?
I don't, but I would like to if I could deploy Swift code to Azure. I love Swift as a language.
Continue this thread — 1 reply
I've dabbled with CoreData myself and it's a phenomenal API. Apple comes up with a lot of great stuff. In fact, given how much server-side Swift there is these days, we'll have to look into building a Swift client library at some point.
Continue this thread — 2 replies
All comments shown.
Couldn't load more comments. Check your connection and try again.