After the database and schema are set up, we can add some actual data.             For this tutorial we will use the command-line REPL tool to do that

3. EdgeQL - Getting Started | EdgeDB Docs

submited by
Style Pass
2021-07-10 14:30:08

After the database and schema are set up, we can add some actual data. For this tutorial we will use the command-line REPL tool to do that, so let’s start it up:

Now, let’s add “Blade Runner 2049” to the database. It’s possible to add movie, director and actor data all at once:

The specific id values will be different from the one above. They are shown explicitly here so that the tutorial can refer to the Movie objects by their id.

In principle, we could have first used individual INSERT statements to create all the people records and then refer to them using SELECT when creating a Movie. To show how existing data can be combined with new data let’s add another movie directed by Denis Villeneuve - “Dune”:

The above query simply returned all the Movie objects. Since we didn’t specify any details, the results only referred to the objects by their id. Let’s add some more data to the result by describing the shape of the data we want to fetch:

Leave a Comment