Readit News logoReadit News
1st1 · 4 years ago
Hah, I'm not sure how our dev staging URL ended up on HN :)

Here's a direct link to the documentation page about EdgeQL: https://www.edgedb.com/docs/edgeql/index.

EdgeQL, the query language of EdgeDB, is a very interesting piece of tech. It's a new, strictly typed query language, that aims to surpass SQL in querying power. Functional in its nature it was designed to be composable and easy to learn. Happy to answer any kind of questions.

EdgeDB itself is almost ready for its 1.0 release, stay tuned. The GH link: https://github.com/edgedb/edgedb/

// Disclaimer: I'm a co-founder & CEO.

default-kramer · 4 years ago
Wow, EdgeQL looks amazing! I've spent a good amount of time looking into SQL alternatives and building my own, and this is the only one that feels like "I must try this!" (Too bad my current project has no need for a DB; now I have a dilemma...)

> You can run EdgeDB as a query engine on top of an externally hosted Postgres instance or let EdgeDB manage Postgres for you under the hood.

This is excellent. Allows me to use EdgeDB for the majority of my application, but still treat it as a "plain old Postgres DB" when needed.

divan · 4 years ago
I found EdgeDB today via the article "Against SQL" (which triggered so many pain points), and now rewriting one of the projects to use it. I know it's not production ready, but it looks too good not to try.
1st1 · 4 years ago
Thanks for the kind words!
1st1 · 4 years ago
Also feel free to play with EdgeDB in your browser with our interactive EdgeQL tutorial: https://www.edgedb.com/tutorial
tgb · 4 years ago
I'm a SQL newbie so maybe I lack context for this decision, but why did you decide to keep the "SELECT" keyword? Going through your tutorial, SELECT seems redundant and could just be dropped without any loss of information. In that way look a lot more like most non-SQL languages. Why do I need to SELECT "string" instead of just "string"?
mikeyhew · 4 years ago
I'm trying to understand how this tutorial works, I noticed it doesn't make any network requests when run one of the examples, but then if I edit the code in an example it does make a request. Is this the magic of next.js and server-side components at work, and do you have a real edgedb running on the server side that is used to pre-render the page and also handle updates? I would love to hear more about how this setup works and even look at the code if it's available.
guigze · 4 years ago
If there is one piece of techno I have my eyes on since some time, and am the most exited about, it’s EdgeDB. You guys have nothing to prove anymore. I’m using your work on a daily basis: asynpcg, uvloop, black and … python !

When I came across the EdgeDB project, I thought: “damn it’s too good on the paper to be true”. And when I watched the 6th video of “import asyncio” from Łukasz on your YouTube channel, it blew my mind the kind of queries one could achieve, and how flexible was the schema definition with the abstract types.

Although I’ll have to be a bit more patient to push this techno at work, I’m even orienting my personal projects to be a fit for edgedb usage.

Please keep up with the awesome work !

My top features on the roadmap for 1.x:

- LSP

- Query Builders and Schema Reflection

- Fine-grained Data Access Control Rules

1st1 · 4 years ago
Thank you :)
burlesona · 4 years ago
Do you have any simple mechanism for bulk import, either from CSV or JSON files, or existing Postgres? Googled a bit and didn't see how to bulk load an existing dataset.
RedCrowbar · 4 years ago
There aren't any special "bulk" interfaces at the moment, you can load data via a small program using our language bindings (INSERT in a loop). We'll add support for batched `executemany()` soon to cater to very large loads specifically. A similar optimization in asyncpg [1] led to a 10x improvement in throughput (~100Krec/sec per connection), and we expect similar performance from EdgeDB once the protocol and the bindings are updated.

Loading arbitrary JSON by introspecting the data, and auto-generating the schema and the necessary DML statements is fairly straightforward too. I have a rough Python proof-of-concept, will need to find time to finish and publish it.

[1] https://github.com/MagicStack/asyncpg/pull/295

okhuman · 4 years ago
Really nice 1st1 - congrats, all your resources look so clean.
1st1 · 4 years ago
Thanks! :)
assface · 4 years ago
> that aims to surpass SQL in querying power.

What makes your approach likely to succeed versus all previous attempts to supplant SQL in the last 40 years?

1st1 · 4 years ago
We've spent years in R&D mode working on the data model, the query language, APIs and architecture to make sure that everything clicks together to create one vertically integrated, cohesive, and language agnostic solution. Everything in EdgeDB is optimized for DX (while not sacrificing perf or type safety), and as far as I know there's no other database company out there which does what we do. So fingers crossed, our attempt at evolving relational databases will be successful.
burlesona · 4 years ago
Just discovering EdgeDB. How does it handle graph queries (specifically, traversing joins across > 3 tables under the hood)?
1st1 · 4 years ago
It handles them just fine. Any single EdgeQL query always compiles to just one SQL query under the hood. We wrap nested hierarchy levels subqueries in array_agg and our binary protocol is designed in such a way that unpacking the results is very fast.
historyloop · 4 years ago
Question: why do you claim EdgeDB is a "relational" database when you can't actually do relational algebra with it? How do you join?

Materialized edges (i.e. what you call "links") are not part of any relational model, it's a part of the graph model. You seem to have implemented a graph database, but possibly without the graph walking capabilities of graph databases.

RedCrowbar · 4 years ago
EdgeQL lets you do arbitrary joins as well. Here's how you could compute salaries of employees by department even if you for some reason don't have a link between Employee and Department:

    SELECT Department {
        name,
        employees := (
            SELECT Employee { name, salary } 
            FILTER Employee.department_name = Department.name
        )
    }
   
Links in EdgeQL are merely an abstraction over the fact that most joins in a well-normalized schema are done over primary keys.

1st1 · 4 years ago
You do joins when you traverse schema type paths in EdgeQL, it's just that the actual joins are implicit (well, compared to SQL):

  SELECT User {
    email,
    preferences: {
      name,
      value
    }
  } FILTER .id = '...'
E.g. in the above example we'd join the underlying User and Preferences tables for you.

You can also do cross joins and all other funky stuff.

mirekrusin · 4 years ago
Is supporting MSSQL completely out of scope in not too distant future time frame?
1st1 · 4 years ago
Currently out of scope, sadly.
anotherhue · 4 years ago
The actual website: https://www.edgedb.com/

Apache 2 license: https://github.com/edgedb/edgedb

mirekrusin · 4 years ago
Hey, after 1 minute of looking at it, it looks very interesting (composable etc), especially after reading recent sql rants like [0]

[0] https://news.ycombinator.com/item?id=27791539

1st1 · 4 years ago
Thanks! You can also read our own rant here: https://www.edgedb.com/blog/we-can-do-better-than-sql (We can do better than SQL, it was on the front page of HN a couple of times).
continuational · 4 years ago
Hmm 'select' before 'filter'. This is one of the things that's clunky in SQL; you have to select what you want before you know what you have.
ricardobeat · 4 years ago
You select the collection here, then specify the fields. The opposite of SQL.
historyloop · 4 years ago
It's interesting that you know SELECT being first is clunky, without understanding why.

SELECT in SQL is clunky because it comes before FROM and JOIN. Do you see FROM or JOIN anywhere here? No.

The collections you're selecting from are literally written before the fields you select.

The real WTF for me is this claims to be a relational database and you can't join seemingly.

1st1 · 4 years ago
I replied to another similar comment here: https://news.ycombinator.com/item?id=27795685
continuational · 4 years ago
That seems a bit snarky to me?

In any case, the collection you're selecting from is presumably the filtered one, not the original one. Or am I misunderstanding the semantics?

aeaa3 · 4 years ago
The tech looks impressive and interesting.

How will you guys make money? As a prospective user, what are the chances of being rethinkdb'd?

1st1 · 4 years ago
Cloud & enterprise solutions.

There are a few reasons why RethinkDB failed; there's an excellent blog post written by the founder. I think there are many areas where we are quite different:

- We are building on top of Postgres, so we are not investing too much time into the hardest technical problems like creating robust DB storage and query planning/execution engines.

- Instead we focus our time on designing proper high level APIs, the EdgeQL language, migrations, and the DX.

- Yet still, EdgeDB is a relational DB; it's strictly typed and fast. Which is still what the majority of companies want.

your_challenger · 4 years ago
When will EdgeDB be production ready? Also will it handle large scale deployment with Fail-Over and Replication?
1st1 · 4 years ago
> Also will it handle large scale deployment with Fail-Over and Replication?

Built-in support for that is coming, but it's already possible to run EdgeDB on top of Amazon RDS, for example. Ultimately EdgeDB is built on top of Postgres, so it will support replication and fail-over and many of the existing deployment strategies.

your_challenger · 4 years ago
For me to use EdgeDB with RDS I would need to compile it [1]. But I don't think this is recommended usage of EdgeDB and there isn't enough documentation on using EdgeDB with an external postgres instance.

I see that I could use:

edb server --postgres-dsn

But I guess you'll release more docs on using EdgeDB with external instances soon, maybe before 1.0 release.

[1] https://www.edgedb.com/docs/internals/dev

Aeolun · 4 years ago
Do you ever intend to replace it with a custom backend? Just asking due to the article yesterday that said the only way to start is with an abstraction over an existing RDBMS, but could potentially evolve later.
1st1 · 4 years ago
We plan to release 1.0 in a month or two. The upcoming beta 3 (in 1-2 weeks) will be the last beta before the RC.

That said, EdgeDB is already stable and solid thanks to the amazing Postgres that we're building it on top of. It's definitely ready now to play with and learn.

Aeolun · 4 years ago
What I really like about Prisma et al is that they provide me with a native client. I don’t have to think about my queries as strings, I have autocomplete for everything that can possibly be part of the select/delete/update (in typescript at least).

Now that I’ve gone there I don’t think I can go back, even if this looks otherwise amazing.

vosper · 4 years ago
Agreed, Prisma with TS is really nice. I’ve recently been using Blitz, which integrates Prisma and Zod (amongst other things) and it feels like so much of the old webapp plumbing is either now gone or is practically writing itself through autocomplete.
Aeolun · 4 years ago
Blitz feels like beta software, but I agree it makes the whole React single page development experience really nice.
1st1 · 4 years ago
Yeah, we'll have it all for EdgeDB too.

Deleted Comment