1.0 Alpha 7​

This changelog summarizes new features and breaking changes in EdgeDB 1.0 alpha 7 “Lalande”.

EdgeQL​

  • Add support for per-database configuration by adding a new current database configuration scope (#1867).

    This allows to make changes that are more broad that session scope and less broad that system:

  1. ```
  2. configure current database set query_work_mem := '4MB';
  3. ```
  • Add support for altering enums in order to add new labels (#1956).
  1. ```
  2. create scalar type Color
  3. extending enum<Red, Green, Blue>;
  4. ```
  5. ```
  6. OK: CREATE
  7. ```
  8. ```
  9. alter scalar type Color
  10. extending enum<Red, Green, Blue, Magic>;
  11. ```
  12. ```
  13. OK: ALTER
  14. ```
  • Update std::decimal and std::bigint criteria to be sensitive to the presence of . so that 123.0e100n is a decimal, but 123e100n is a bigint (#1804).

  • Functions can now return a set of tuples (#2010).

  1. ```
  2. create function enumerate_letters(word: str)
  3. -> set of tuple<int64, str>
  4. using (
  5. enumerate(
  6. array_unpack(
  7. str_split(word, '')))
  8. );
  9. ```
  10. ```
  11. OK: CREATE
  12. ```
  13. ```
  14. select enumerate_letters('hello');
  15. ```
  16. ```
  17. {(0, 'h'), (1, 'e'), (2, 'l'), (3, 'l'), (4, 'o')}
  18. ```
  • Functions can no longer share a shortname with types in order to avoid name resolution issues (#1465).

  • Forbid taking implicit cross products with volatile operations to avoid unintuitive behavior (#1784).

  1. ```
  2. select ({1, 2}, random());
  3. ```
  4. ```
  5. error: can not take cross product of volatile operation
  6. ┌─ query:1:17
  7. 1 │ select ({1, 2}, random());
  8. │ ^^^^^^^^^ error
  9. ```
  10. ```
  11. for x in {1, 2} union (x, random());
  12. ```
  13. ```
  14. {(1, 0.25724045818607166), (2, 0.7268530965023459)}
  15. ```
  • Forbid scalar types from having more than one concrete base (#1790).

  • Forbid partial path expressions in limit/ offset clauses (#1919).

  • Forbid changing cardinality via inheritance (#1772).

  • Remove legacy unused .> token (#1648).

  • Fix cardinality inference on operators (#2001).

Migrations​

We’ve made a lot of progress in implementing features of the RFC 1000 migrations, although this is still a feature under development. Some of the works can be broadly categorized as overall improvement of the proposed migration DDL and the granularity of the control the user has over these proposed changes. More specifically we’ve made a lot of improvements in migrations that alter or remove things from the schema.

Here’s an example of creating a schema with a type that has a property with a default value:

  1. start migration to {
  2. module default {
  3. type Foo {
  4. property val -> str {
  5. default := 'n/a'
  6. }
  7. }
  8. }
  9. };

We use describe current migration as json to see what EdgeDB is proposing. The JSON format makes it easier to potentially integrate this with other tools. For this example it’s worth turning on json output mode for edgedb REPL:

  1. \set output-mode json
  1. describe current migration as json;
  1. [
  2. {
  3. "complete": false,
  4. "confirmed": [],
  5. "parent": "m16wif5skjyqd6dbp5uwa67qrgw422qcwa3vctx77z7r34yx5mbigq",
  6. "proposed": {
  7. "confidence": 1.0,
  8. "operation_id": "CREATE TYPE default::Foo",
  9. "prompt": "did you create object type 'default::Foo'?",
  10. "statements": [{"text": "CREATE TYPE default::Foo {\n
  11. CREATE OPTIONAL SINGLE PROPERTY val -> std::str {\n
  12. SET default := 'n/a';\n };\n};"}]
  13. }
  14. }
  15. ]

Since proposed statements look OK, we can go ahead and just apply the whole migration.

  1. populate migration;
  1. OK: POPULATE MIGRATION
  1. commit migration;
  1. OK: COMMIT MIGRATION

Now, let’s remove that default, after all the property is optional.

  1. start migration to {
  2. module default {
  3. type Foo {
  4. property val -> str;
  5. }
  6. }
  7. };
  1. describe current migration as json;
  1. [
  2. {
  3. "complete": false,
  4. "confirmed": [],
  5. "parent": "initial",
  6. "proposed": {
  7. "confidence": 0.9956623333333332,
  8. "operation_id": "ALTER TYPE default::Foo",
  9. "prompt": "did you alter object type 'default::Foo'?",
  10. "statements": [{"text": "ALTER TYPE default::Foo {\n
  11. ALTER PROPERTY val {\n DROP default;\n };\n};"}]
  12. }
  13. }
  14. ]

The proposed statements will drop default for our property, so all seems to be in order and we can apply this migration, too, using populate migration and commit migration.

We’re currently working on a CLI tool for managing migrations more gracefully and without the need for the user to rely on these low-level commands (like``start migration`` or describe current migration as json). The migration tool is going to use these commands behind the scenes, though.

We’ve also made improvements to the following migration features:

  • Better overall dependency tracking to make sure that migration to the new state can be resolved and produces valid command sequence.

  • Type, index and alias renaming while keeping track of affected expressions to make sure they don’t become invalid (#1841)

  • Function renaming (#1971)

  • Moving a type between modules (#1890).

  • Changing base types and changing where constraints are defined (#1996).

Command-Line Tools​

  • Default user and default database are now simply edgedb and no longer named after the system user.

  • Add --connect-timeout to control how long to wait for EdgeDB response (#191).

  • Add --dsn as a connection option (#176).

  • Add migration-log command to view applied migrations (#200).

  • Non-interactive error messages are prefixed by edgedb error: ..., to quickly spot which tool has errored in scripts.

  • Improve accuracy of syntax error reporting in REPL (#1959).

  • REPL now supports full range of datetime values (#192).

  • \lt in REPL doesn’t show implicit internal types (unions and intersections) (#169).

  • Remove \set introspect-types in REPL and show typenames by default.

Server Command-Line​

  • Make edgedb server install friendlier on linuxes without systemd allowing foreground run (#171).

  • When installing server DEBIAN_FRONTEND is now noninteractive by default and is overridable (#188).

  • Add edgedb server logs (#172).

  • Add edgedb server info command.

  • Deprecate --default-database and --default-database-user (#1879).

Bindings​

We now have an improved spec for client API (RFC 1004). Rolling out the support for the full spec will be done in the next release, but some implementation work has already started.

  • Move request methods into Executor interface (#76) as part of the RFC 1004 changes.

  • Update the edgedb-python driver to 0.12.0.