HN user

msully4321

153 karma
Posts1
Comments14
View on HN

I talked a bit about this in my release day talk (https://www.youtube.com/watch?v=WRZ3o-NsU_4&t=8151s), but:

* Every edgedb type has a postgres table

* "single" properties and links are stored as columns in that table (links as the uuid of the target)

* "multi" properties/links are stored as a link table

So it's basically just translated to a relational database in normal form

What colin said, or (in every terminal emulator I've used), ctrl-d to send end of file, which will close it.

EdgeDB: EdgeQL 5 years ago

The most direct implementation of what you want would be:

  SELECT (Table1.id, Table1.name, Table2.level, Table2.table1_id)
  FILTER Table1.id = Table2.table1_id;
(This has a somewhat annoying extra output of table1_id, which could be projected away if necessary.)

If you want to use edgeql's shapes but still keep the essential join flavor, then something like:

  SELECT (Table1 { id, name }, Table2 { level })
  FILTER Table1.id = Table2.table1_id;
To make it a little more concrete, you can try this on the tutorial database (https://www.edgedb.com/tutorial)
  SELECT (Photo {uri}, User {name, email})
  FILTER Photo.author.id = User.id;
The tutorial database uses links, and so instead of having an author_id we have author.id, but having an author_id property would work just fine---except that then you'd have to do all the joins manually.