package caqti

  1. Overview
  2. Docs

(v1) Types and utility functions for query descriptions.

  • deprecated

    Don't use this in new code.

type typedesc = [
  1. | `Bool
  2. | `Int
  3. | `Float
  4. | `String
  5. | `Bytes
  6. | `Date
  7. | `Utc
  8. | `Other of string
  9. | `Unknown
]

Identification of a remote type. These correspond to the types described in Caqti_sigs.CONNECTION.Param. `Other s represents an backend-specific type s. The additional `Unknown tag is used by backends which are unable to determine parameter types.

type querydesc = {
  1. querydesc_params : typedesc array;
    (*

    The types of the expected parameters for a query. The number of parameters should always correspond to the length of the array, but the parameters may be `Unknown in case the backend is unable to determine them.

    *)
  2. querydesc_fields : (string * typedesc) array;
    (*

    The names and types of components of tuples returned by the query.

    *)
}

The result of Caqti_sigs.CONNECTION.describe.

val string_of_typedesc : typedesc -> string

An informative textual representation of a type.

val string_of_querydesc : querydesc -> string

An informative textual description of query parameters and results.