Skip to content

Releases: edgedb/edgedb-python

v1.1.0

02 Nov 22:50
v1.1.0
7d63029
Compare
Choose a tag to compare

Codegen Fixes

  • Add missing std::json (#387)
  • Support optional argument (#387)
  • Fix camelcase generation (#387)
  • Allow symlinks in project dir (#387)
  • Use Executor on generated code for Client/Tx (#390)

v1.0.0

21 Oct 19:22
v1.0.0
314ec4a
Compare
Choose a tag to compare

This is the v1.0 release for the edgedb-python client library. It is accompanied by the introduction of a new module edgedb.codegen which can be executed to generate code from .edgeql files.

Breaking Changes

Query Result Type Changes

#366

  1. In edgedb-python 1.0, we dropped many custom data structure implementations, and replaced them with Python builtins:

    Impl Dropped Replacement Breaking Changes
    edgedb.Tuple tuple weakref.ref() will stop working on tuples
    edgedb.Set list * Immutability is broken
    * weakref.ref() will stop working on sets
    * hash() will stop working on sets
    * repr() produces different results
    edgedb.Array list * Immutability is broken
    * weakref.ref() will stop working on lists
    * hash() will stop working on lists

    While the implementations are dropped, the reference name is still there, like edgedb.Tuple is simply an alias of the builtin tuple.

  2. edgedb.NamedTuple is reimplemented.

    • [Breaking Change] weakref.ref() will stop working on named tuples.
    • edgedb.NamedTuple is now a subclass of Python builtin tuple.
    • Before named tuple instances are created, a transient heap type DerivedNamedTuple will be created first as a subclass of edgedb.NamedTuple, which is then used to create instances with naming data.
    • DerivedNamedTuple classes are usually cached in codecs, and garbage-collected when all its references are cleared.
  3. edgedb.EnumValue is reimplemented.

    • [Breaking Change] The result of repr() is slightly changed to have the edgedb. prefix.
    • edgedb.EnumValue is now a subclass of Python builtin enum.Enum.
    • Before enum values are created, a transient heap type DerivedEnumValue will be created first as a subclass of edgedb.EnumValue, which is then used to create instances with full enumeration. Enum member names are simply upper case strings of corresponding values.
    • DerivedEnumValue classes are usually cached in codecs, and garbage-collected when all its references are cleared.
  4. edgedb.Object changes.

    • [Breaking Change] The custom implementation of __hash__() on edgedb.Object is dropped, now hash() simply returns a hash on the memory address.
    • [Breaking Change] The custom implementation of rich comparion is dropped, that means <, >, <=, >= will stop working on edgedb.Object instances, and == is now equivalent to is for edgedb.Object instances.
    • edgedb.Object instances will now yield True for dataclasses.is_dataclass() check.
    • edgedb.Object instances can now be used in dataclasses.as_dict() to recursively generate a dict containing all properties and links (excluding link properties).
  5. The performance impact is minimal. We are still using the most efficient C-API and C/Cython implementations to offer query results,

No more Python 3.6

As Python 3.6 is no longer supported itself 10 months ago, edgedb-python is also dropping support for Python 3.6.

edgedb-python 1.0 now supprots only Pyhton 3.7 to Python 3.11.

New Features

Code generation

#363

Now you can create one or more .edgeql files in your EdgeDB project directory, and run:

$ python -m edgedb.codegen

or alternatively:

$ edgedb-py

This command will search through the EdgeDB project directory and generate typesafe query code for the .edgeql files.

Access of link properties

#379

edgedb.Link and edgedb.LinkSet types, as well as the way to access them, are deprecated in edgedb-python 1.0 and will be dropped in 2.0. For example, with a given schema:

type Person {
    multi link friends -> Person {
        property strength -> float32;
    }
}

Expression like person["friends"] will now emit a DeprecationWarning. This deprecates the old way to access link properties like person["friends"][0].strength. Instead, a new way is introduced: you should now use person.friends[0]["@strength"].

Detail Changelog

Changes

Fixes

Deprecations

v0.24.0

28 Jul 03:07
v0.24.0
4a4f066
Compare
Choose a tag to compare

Changes

v0.23.0

22 Mar 18:04
v0.23.0
f978953
Compare
Choose a tag to compare

Changes

v0.22.0

21 Oct 19:32
v0.22.0
deea761
Compare
Choose a tag to compare

Changes

v0.18.0

21 Oct 19:33
v0.18.0
36efb5f
Compare
Choose a tag to compare

Changes

Deprecations

Fixes

v0.17.2

12 Aug 16:54
v0.17.2
Compare
Choose a tag to compare
null

v0.17.0

21 Oct 19:34
v0.17.0
3b21559
Compare
Choose a tag to compare

Fixes

v0.13.0

25 Feb 20:33
v0.13.0
5b74051
Compare
Choose a tag to compare
  • New APIs: conn.retrying_transaction() and conn.raw_transaction().
  • conn.transaction() has been deprecated.
  • conn.aclose() implements graceful disconnect from the DB server.
  • Starting transactions in conn.execute() is no longer allowed.
  • wait_until_available parameter for connection APIs.

v0.7.0a5

30 Dec 22:03
v0.7.0a5
d13cd38
Compare
Choose a tag to compare

Fixes