Ideas
- Video
- My 5 favorite EdgeDB 3.0 features
- Could break these up into individual video posts for Twitter
- Could embed it into a blog post
- splats
- watch and development workflow
- query performance analysis
- UI
- triggers/mutation rewrites (plus
assert)
- My 5 favorite EdgeDB 3.0 features
- Blog post
- Could derive heavily from the changelog
- Twitter
- Post announcing release
- Posts throughout the rest of the week promoting individual features (maybe the videos?)
- Office hours
- Early June
- Recorded and released to YouTube
Scripts
Query perf analysis
EdgeDB 3.0’s query performance analysis helps you quickly understand how your queries perform and where the bottlenecks are. You can use it in the CLI REPL as you see here, but it really shines in our web-based UI.
Here it is in the UI’s query editor. The size of the different areas shows the relative impact on performance in terms of the metric you’ve selected: “Time,” in which we run the query and measure the actual timings, or “Cost,” which runs a static analysis of the query.
As you hover over the areas, you’ll see that part of the query highlighted in the editor on the left. This makes it quick and easy to know what you should focus your optimizations on. It also works in our Web REPL.
EdgeDB 3.0 is out, so head over to edgedb.com to try it out for yourself!
Queries
select Movie {
title,
release_year,
director,
actors: {name},
actors_in_movie := count(.actors),
franchise := .<entries[is Franchise].name,
movies_in_franchise := count(
.<entries[is Franchise].entries
)
};
UI
V1
The EdgeDB UI got a major refresh with our 3.0 release. Here’s what’s new and improved.
We have a new REPL inside the UI that closely mimics the CLI REPL. It’s great for running a few queries quickly to explore your database.
The query editor is a great way to refine and test your queries. Add analyze to the front of a query to visualize the performance. Set your globals and configuration easily in the UI. You can also do this in the REPL.
If you’re new to EdgeQL, the visual query builder is your friend. You can quickly prototype a query by clicking around in your schema. You can run it here, or you can copy and paste it where ever else you need it.
Check in on your schema and see how the pieces fit together in the schema view, or browse your data in the data explorer, all in our new UI.
Yury’s feedback
I think this script needs the most work. I suggest covering these topics (just a direction, the script might need some shortening, but I think it’s OK if this one gets longer than 1 minute, can be up to 2 or so) 1/ EdgeDB 3.0 a significantly improved UI. We are introducing two distinct querying modes: Web REPL and Query Editor. 1.1/ Web REPL closely mimics the Terminal experience. Quickly fire away multiple queries and navigate through the results, this is the best way to quickly explore your database. 1.1.1/ Maybe mention \retro. 1.1.2/ You can show the copying UI. 1.2/ Query editor allows you to comfortably compose complex queries and reports. Use it to progressively edit your query. 1.3/ The query editor ships with a visual editor. With it you can quickly build EdgeQL queries with the power of your mouse or trackpad. 1.4/ The new history panel gives you an overview of your past edits. 2/ The new connection configuration panel lets you to set global variables and configuration. It affects the Web REPL, the query editor, and the data editor views. With it you can work with your access control policies and set configuration options, such as the implicit limit.
V2 (final)
The EdgeDB UI got a major overhaul in EdgeDB 3.0. Sometimes, you want to write queries to explore your data. Our new web REPL which mimics the command line REPL facilitates this perfectly. Fire off multiple queries and navigate your results.
In other cases, you want to refine a query that you’ll use elsewhere, like maybe in your application. Our new query editor is built just for that. We give you plenty of space to easily refine until you have the perfect query for the job. You can even drop an analyze in front of it to see how it performs.
[Show myself introducing a problem in a text query.] Remember how awesome that query used to be? The history panel does.
If you’re not super familiar with EdgeQL yet or you’re just tired of typing, swap into the visual builder instead to build queries with a few clicks!
We’ve added a super handy connection configuration panel too. It lets you set global variables and configurations that apply to the Web REPL, query editor, and data explorer views. With it, you can try a query with or without access policies applied or change the limit of objects returned, among other things.
watch/new dev workflow
Check out the watch command we’ve added to EdgeDB 3.0. Keep it running in a tab while you’re building out your schema. It will monitor your dbschema directory for changes and automatically apply them to your database.
Here, I’m going to create a really basic schema in my default.esdl file. Once I save the file, it is immediately applied.
If there’s still more to do, I can continue to make changes and iterate on my schema. Once I’m done and ready to ship this off to the rest of my team, I can run edgedb migration create to generate a single migration that encapsulates all the changes I’ve made.
Triggers/Mutation Rewrites
Mutation rewrites and triggers are two new EdgeDB 3.0 features that enable some really powerful use cases.
I want to track when an object has been updated, so I’ve created a last_updated property. I’ve set it a default value, but that gets set only when the object is created. By adding a mutation rewrite, I can update the value automatically every time the object is mutated.
If I want even more detailed logging, it might make sense to create a Log type and insert a new one each time my objects are mutated. This trigger will do just that: it will write a Log object with a link to the target of the change, a string representation of the change, and the time the change was made.
And that’s just one of many possibilities for how you might use mutation rewrites and triggers in your EdgeDB 3.0 database.
SQL support
In EdgeDB 3.0, you can run read-only SQL queries on your EdgeDB databases with the Postgres protocol. This means your database will talk to favorite BI tools so you can stay on top of things with your established business intelligence workflows.
As an example, here’s how you could connect your EdgeDB database to the Cluvio analytics platform. Open your datasources and add a new source. Input your connection details. Be sure to tick “Require SSL.” Hit “Next” to test your connection. And now you’re ready to use your EdgeDB data in Cluvio.
We’ll set up a basic report to show our movies by how many actors we list for them. After running this query, Cluvio shows me the data as a table. I want this one on my dashboard as a bar chart, so I’ll switch up the format. Now, I can Create the report, and I see it on my dashboard.
Query:
select "Movie".title, count("Person".id) as "Number of actors"
from "Movie.actors"
join "Movie" on source = "Movie".id
join "Person" on "Movie.actors".target = "Person".id
group by "Movie".title;Splats
Splats are the EdgeDB 3.0 feature that’s fun to say and more fun to use.
It’s great for exploring your data in the REPL. If you just want a quick picture of what’s in your database for a given type, you would have previously needed to list out each of the type’s properties in your query. With splats, you can instead just drop an asterisk inside the curly braces.
Drop a double-splat instead to get not only the type’s properties, but also the properties of the first level of links on that type. You can also use splats in paths and with type intersections to further refine the shape of your results.
Cloud
EdgeDB Cloud is the best and most intuitive way to deploy EdgeDB. Once you’ve authenticated with GitHub, it takes just one CLI command to create a new Cloud instance.
It’s effortless to interact with your new Cloud instance. Just specify the instance name in your commands, and they work just like they do on your local instances. You don’t have to mess with URLs, DSNs, or TLS certificates.
You can also manage your instances with our rich graphical UI at cloud.edgedb.com.
EdgeDB Cloud is in private beta today! Sign up on at edgedb.com or by messaging us in the cloud channel on our Discord.