package caqti

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

Install

Dune Dependency

Authors

Maintainers

Sources

caqti-0.10.1.tbz
sha256=e2b1d83b54f4583fc1cf4775d006c68cab4ec0b95a359ab724d5305ada737280
md5=7abd1ee41a02eb7483617cbc22b09691

doc/caqti.v1/Caqti1_sigs/module-type-PARAM/index.html

Module type Caqti1_sigs.PARAMSource

Parameter encoding functions.

Sourcetype t

An abstract type for a query parameter. Only the backend knows the actual type.

Sourceval null : t

A designated value to replace a missing parameter. For SQL, null is NULL.

Sourceval option : ('a -> t) -> 'a option -> t

option f None is null and option f (Some x) is f x.

Sourceval bool : bool -> t

Constructs a boolean parameter. If the database does not have booleans, an integer value of 0 for false and 1 for true is used.

Sourceval int : int -> t

Constructs an integer parameter. The remote end may have a different range. For SQL, works with all integer types.

Sourceval int32 : int32 -> t

Constructs an integer parameter. The remote end may have a different range. For SQL, works with all integer types.

Sourceval int64 : int64 -> t

Constructs an integer parameter. The remote end may have a different range. For SQL, works with all integer types.

Sourceval float : float -> t

Constructs a floating point parameter. Note that the precision in the database may be different from that of the OCaml float. If conversion to string is requried by the backend, this is done with the %.*g format specifier, which may incur a small loss of precision, as well.

Sourceval string : string -> t

Given an UTF-8 encoded text, constructs a textual parameter with backend-specific encoding.

Sourceval bytes : bytes -> t

Constructs a parameter from an arbirary octet string. For SQL, the parameter is compatible with the BINARY type.

Sourceval date_string : string -> t

Construct a date paramater from a string using ISO 8601 format.

Sourceval date_tuple : (int * int * int) -> t

Construct a date parameter from the year, month, and day of the month, using the literal enumeration. I.e. Epoch is (1970, 1, 1).

Sourceval date_cl : CalendarLib.Date.t -> t

Construct a parameter representing a date.

Sourceval utc_float : float -> t

Construct a parameter representing date and time in the UTC time zone, converted from a float representing the number of non-leap seconds passed since 1970-01-01T00:00:00Z.

Sourceval utc_string : string -> t

Create a parameter for an UTC timestamp field from a UTC time string in ISO 8601 format.

Construct a parameter representing an date and time in the UTC time zone.

OCaml

Innovation. Community. Security.