[ANN] Caqti 2.3.0

I would like to announce the release of Caqti 2.3.0.

TL;DR: Consider adding the caqti.classic to your link line (available since this version). It currently only re-exports the caqti library, but will be replaced by a compatibility layer for the Caqti 2 API in Caqti 3 to allow incremental migration.

Release Notes

Note that some of the new features of this release are only accessible
through the still unstable caqti.template library, which will soon be
stabilized as part of an upcoming Caqti 3 API. Due to adjustments to module
names, switching to caqti.template will not ensure future compatibility.
Instead, users are encouraged to add the new caqti.classic to their
dependencies to ease migration to Caqti 3.

  • Added an alias caqti.classic for the caqti library. This will be
    turned into a library providing compatibility with the current Caqti 2
    API when Caqti 3 is released. The two APIs can be used side-by-side to
    allow incremental migration.

  • The dialect descriptor for MariaDB in caqti.template now provides the
    server version.

  • Added Query.parens, Query.litf, Query.vars, Row_type.fields to
    the caqti.template library.

  • Revised the interface for creating row types to allow instantiating
    parametric types applicatively. Before this change, each application of
    a function representing a parametric type would generate a new type ID
    even when applied to the same type parameter argument. The key part of
    this interface is the Caqti_template.Constructor_type module.

  • The query functions provided to request templates are now memoized, so
    that they are only called once per dialect. This is meant as an
    optimization; it’s still good practise to avoid side-effects here.

  • The new function Query.with_pos_of allows query generators to add
    source locations to the syntax tree, which will be emitted as SQL
    comments in the query string if the enable_query_annotations is set.
    This should simplify debugging when the query is assembled from
    different parts of the application code.

  • The still unstable caqti.template library now supports multiple
    statements in a single request template, sent opportunistically as a
    single query where allowed. This is still experimental.

  • Fixed package scoping of shim rules for sqlite3 (#133 by mefyl).

  • Fixed the error classification for the SQLite3 driver (#132).

  • Fixed reconnect after connection loss for PostgreSQL.

10 Likes