The release of EdgeDB 2.0 has been presented, implementing a relational-graph data model and the EdgeQL query language, optimized for working with complex hierarchical data. The code is written in Python and Rust (for the parser and performance-critical parts) and is distributed under the Apache 2.0 license. The project is developed as an extension of PostgreSQL. Client libraries are available for Python, Go, Rust, and TypeScript/Javascript. A command-line toolbox is provided for managing the database and for interactively executing queries (REPL).
Instead of a table-based data model, EdgeDB employs a declarative system based on object types. Instead of foreign keys to define relationships between types, it uses links (one object can be used as a property of another object).
type Person { required property name -> str; } type Movie { required property title -> str; multi link actors -> Person; }
Indexes can be used to speed up query processing. Features such as strict property typing, property value constraints, computed properties, and stored procedures are also supported. Among the features of EdgeDB's object storage schema, which somewhat resembles ORM, are the ability to mix schemas, link properties from different objects, and integrated JSON support.
Built-in tools are provided for schema migration — after changing the schema defined in a separate esdl file, simply execute the command 'edgedb migration create' and the database will analyze the differences in the schema and interactively generate a script for migrating to the new schema. The history of schema changes is automatically tracked.
For forming queries, both GraphQL and EdgeDB's own query language, which is an adaptation of SQL for hierarchical data, are supported. Instead of lists, query results are presented in a structured form, and instead of subqueries and JOIN operations, it allows specifying one EdgeQL query as an expression within another query. Transactions and loops are supported.
select Movie { title, actors: { name } } filter .title = 'The Matrix' insert Movie { title := 'The Matrix Resurrections', actors := ( select Person filter .name in { 'Keanu Reeves', 'Carrie-Anne Moss', 'Laurence Fishburne' } ) } for number in {0, 1, 2, 3} union ( select { number, number + 0.5 } );
In the new version:
- A built-in web interface for database administration has been added, allowing the viewing and editing of data, executing EdgeQL queries, and analyzing the storage schema being used. The interface is launched with the command 'edgedb ui', after which it becomes accessible via localhost.

- The 'GROUP' expression has been implemented, allowing the segmentation and aggregation of data and performing data grouping based on arbitrary EdgeQL expressions similar to grouping in the SELECT operation.
- Object-level access management capabilities. Access rules are defined at the storage schema level and allow restricting the use of a specific set of objects in selection, insertion, deletion, and update operations. For example, a rule can be added to allow only the author to update a publication.
- The ability to use global variables in the storage schema has been added. A new global variable current_user is proposed for user binding.
- Support for types defining ranges of values has been added.
- An official client library for the Rust programming language has been prepared.
- The binary protocol EdgeDB has been stabilized, which now supports handling multiple different sessions simultaneously over a single network connection, tunneling through HTTP, and the use of global variables and local states.
- Support for socket activation has been added, allowing the server handler not to be kept in memory and to only launch upon an attempt to establish a connection (useful for saving resources on developer systems).
Source: opennet.ru

