1.0 Beta 2​

This changelog summarizes new features and breaking changes in EdgeDB 1.0 beta 2 “Luyten”.

Migrations​

We’ve been working a lot on our migrations tools with the goal of improving the developer experience. Here’s a highlight of recent changes and fixes:

  • Fix sequence default values getting lost after some migrations (#2389).

  • Fix moving indexes around the type hierarchy (#2380).

  • Fix issues with renaming (#2353).

  • Fix an issue using a symbol defined in a with block in SDL (#2320).

  • Fix multiple issues with migrations to an empty schema (#2296).

  • Make it possible to add new values to enums in migrations (#2328).

  • Fix tuples in multi properties and in expressions (#2255).

  • Fix SDL handling of types with two or more indexes (#2301).

  • Fix a regression with array aliasing that made array aliases indistinguishable (#2287).

  • Fix a number of issues with constraints and provide better context information for constraint definition errors (#1370, #2250, #2305, #2307, #2311, #2410).

  • Fix drop owned on links and properties with defaults (#2306).

  • Fix set type on links and properties with constraints (#2309).

EdgeQL​

  • Make sure sequence state gets included in dumps (#2441).

  • Implement functions to explicitly advance or reset a sequence value (#2508).

    sequence_next() returns the next value for the specified sequence type.

    sequence_reset() resets the current value of the specified sequence, the next call to sequence_next will return the next value in sequence.

  • Drop the deprecated Port. The more general extension mechanism introduced in EdgeDB 1.0 beta 1 should be used (#2262).

  • Reduce the maximum length for names of databases and roles to 51 characters (#2465).

  • Enable br (or rb) as a valid bytes literal prefix (#2332).

  • Enable describe schema as sdl (#2481).

  • Support unless conflict on with two or more properties or links (#1939).

    This clause allows performing an alternative query when a conflict due to a constraint occurs during an insert:

  1. ```
  2. insert Person { name := "Alice" }
  3. unless conflict on .name # If a Person with this name exists,
  4. else (select Person) # select that existing Person instead.
  5. ```
  • Make min() and max() work more consistently across all supported types (#1920).

  • Improve cardinality inference (#2097).

  • Disallow use of Volatile functions in schema-defined computed expressions (#2467).

  • Fix handling of collection types of non-builtin scalars in dumps (#2349).

  • Fix inconsistent handling of {} by the if operator (#2460).

  • Fix duplicate values appearing when using += (#2455).

  • Fix an issue with empty sets (i.e. {}) inside set literals (#2154).

  • Fix backlinks when multiple types with the same link name exist (#2360).

  • Fix distinct on empty and nested tuples (#2333).

  • Fix some serialization issues of shapes inside arrays and tuples (#1818).

  • Make sure delete also applies to all sub-types of the selected type (#2265).

GraphQL​

  • Fix usage of enums as input variables in GraphQL (#2415).

  • Fix querying BaseObject via GraphQL (#2214).

Command-Line Tools​

We’ve added edgedb project init command to help manage EdgeDB credentials for your project. Running this in a new project directory will setup an EdgeDB instance, create a schema and migrations directory and link the credentials for that instance to the project directory.

  1. edgedb project init
  1. No `edgedb.toml` found in `/home/username/dev/hw` or above
  2. Do you want to initialize a new project? [Y/n]
  3. > Y
  4. Specify the name of EdgeDB instance to use with this project
  5. [default: myproject]:
  6. > myproject
  7. Type a number to select an option:
  8. How would you like to run EdgeDB for this project?
  9. 1. Local (docker)
  10. > 1
  11. Checking EdgeDB versions...
  12. Specify the version of EdgeDB to use with this project
  13. [default: 1-beta2]:
  14. > 1-beta2
  15. ┌─────────────────────┬──────────────────────────────────────────┐
  16. Project directory /home/username/dev/myproject
  17. Project config /home/username/dev/myproject/edgedb.toml
  18. Schema dir (empty) /home/username/dev/myproject/dbschema
  19. Installation method Docker Container
  20. Version 1-beta2-c23b7a1
  21. Instance name myproject
  22. └─────────────────────┴──────────────────────────────────────────┘
  23. Initializing EdgeDB instance...
  24. e740091d317687d1628f96e43a77ec02f098de68df3b8b95b3bd987f7c30080d
  25. Applying migrations...
  26. Everything is up to date. Revision initial
  27. Project initialialized.
  28. To connect to myproject, just run `edgedb`

As the last line indicates it is no longer necessary to supply the instance name explicitly to connect to the project instance, just edgedb will do the trick. This is also true for using any of EdgeDB’s client libraries, the instance name is no longer required.

Existing projects can be converted to use this feature by simply running edgedb project init in the existing project’s directory:

  1. edgedb project init
  1. No `edgedb.toml` found in `/home/username/dev/myproject` or above
  2. Do you want to initialize a new project? [Y/n]
  3. > Y
  4. Specify the name of EdgeDB instance to use with this project
  5. [default: myproject_uuyg1cr]:
  6. > myproject
  7. Do you want to use existing instance "myproject" for the project?
  8. [y/n]
  9. > y
  10. Applying migrations...
  11. Everything is up to date.
  12. Revision m1lsdptp5qk4sway5vc6ttknwignhm34xncyxwrus2fygnj6nuo7ra
  13. Project initialialized.
  14. To connect to myproject, just run `edgedb`

Bindings​