Skip to content

2.0.0

Compare
Choose a tag to compare
@paurkedal paurkedal released this 10 Aug 12:41
· 119 commits to master since this release

CHANGES:

New features:

  • Added driver based on the pure-OCaml PGX library (#38). However, due to
    lack of TLS support it is not suitable for production, unless you have a
    dedicated secure network.

  • Added support for MirageOS. This only works for the PGX driver, since
    the other drivers link against external C libraries.

  • Added experimental support for Eio, both pure-OCaml and Unix. The
    former supports PGX while the latter supports all drivers.

  • Implemented single-row mode for PostgreSQL (#24), but while this avoids
    uncontrolled memory consumption when a large number of rows is returned,
    it is a lot less efficient.

  • A new pool connection parameter ?max_idle_age provides removal
    resources from pools which have been unused for the given period.

  • Printf-style function Caqti_query.qprintf for dynamic queries
    (GPR#103, Basile Clément).

  • Added general-purpose product type to provide functionality covering
    both product and custom types.

  • Added new tuple types t3, ..., t8 based on the new product type and
    deprecated tup2, tup3, tup4 which are now aliases for these.

Breaking changes:

  • The minimal OCaml requirement is now 4.08.0.

  • The connection functions previously found in caqti-lwt has been moved
    into a sublibrary caqti-lwt.unix as part of the addition of
    caqti-mirage, whereas shared functionality remains in caqti-lwt.
    The LWT connection function is therefore now found in Caqti_lwt_unix.

  • Removed all deprecated functionality and a few unintended or
    undocumented definitions like the type Caqti_blocking.future and
    Caqti_driver_info.describe_has_typed_*.

  • Reworked the driver API to accommodate the addition of the PGX driver
    and MirageOS and Eio support, and to avoid exposting internal interfaces
    in the main library. These modules are now found in the sublibraries
    caqti.platform and caqti.platform.unix, depending on their external
    depnedencies. They are not meant for use by applications, though this
    might not have fully clear previously.

  • Removed constructors Custom, Unit, Tup2, Tup3, Tup4 from Caqti_type.t.
    They were private but could in prinicle be matched against.

  • The extensibility of Caqti_type.Field.t has been dropped along with
    the associated functions for registering conversions. This means that
    there are no custom field types any more, only custom row types. The
    purpose of custom field types where to support non-standard types for
    3rd party drivers; we should coordinate additions to the core type
    instead if needed.

  • According to the above point, the caqti-type-calendar is reimplemented
    as a row type, which means the Cdate and Ctime constructors are
    gone.

  • There are adjustments for the pretty printer for types. (The context is
    assumed to start at the lowest precedence, meaning parentheses around
    lowest-precedence expressions are dropped. Also, redacted is shown
    with suffix notation, allowing us to remove one precedence level.)

  • Moved pool tuning parameters into a configuration object.

Fixes:

  • Fixed a missing Preemptive.detach call for to_stream for Sqlite3.

  • Incorrect error reporting related to type conversions were discovered by
    exhaustiveness checks when making field types non-extensible.

Other:

  • The documentation of call now makes clear that the result must be
    retrieved in order to make sure the request is performed. This is made
    relevant by the addition of the PGX driver where request and retrieval
    are fused.

  • Customized the top-level index and some other documentation work.
    Removal of private modules from the main library should also help to
    make the documentation more accessible.

  • Added a benchmark to measure row decoding performance.

  • Improved decoding performance by partially applying the type descriptor.