package caqti

  1. Overview
  2. Docs
Unified interface to relational database libraries

Install

Dune Dependency

Authors

Maintainers

Sources

caqti-v1.8.0.tbz
sha256=2630233f335f910290e24b318ac7f6e712b3109fb55581b2b8c324127a9a4b12
sha512=9ce23cbc02b9d6c856a8db0713dbb1aa393aa43bc1d565121420636f7f6fa1ed64c7269e98cfeb92b5e9c8e23e42e2e8e1705b5fe978abd3c3f0cc3259d32b98

doc/tweaks.html

Database Tweaks

TL;DR

The ?tweaks_version parameter tells Caqti drivers to enable all tweaks introduced up to and including the given major and minor version of Caqti.

The Tweaks Parameter

Occasionally Caqti makes changes to the database session parameters or otherwise how it interacts with specific database systems. This may be done to improve consistency across databases, to make it easier to detect mistakes, to avoid obsolete behaviour, etc. However, this can break backwards compatibility with applications, sometimes in subtle ways, which is the motivation for the ?tweaks_version parameter of the connecting functions.

Passing ~tweaks_version:(major_version, minor_verson) declares that the application is compatible with all tweaks introduced up to and including that version of Caqti. The default is to omit all tweaks introduced since the last major version. On each major release, all tweaks up to that point becomes permanent and requesting an earlier tweaks version will have no effect.

Production code should either omit the parameter or pass the largest major and minor version pair for which the code has been tested. This offers the choice of adapting only on major versions or incrementally.

Code in development can declare a progressive value, like the next major version, in order to always use the latest set of tweaks.

Current Tweaks

Introduced with (1, 8) and later

  • SQLite3: Checking of foreign key constraints has been enabled by issuing a PRAGMA foreign_keys = ON for the session.
OCaml

Innovation. Community. Security.