package caqti
- Overview
- No Docs
You can search for identifiers within the package.
in-package search v0.2.0
Install
dune-project
Dependency
Authors
Maintainers
Sources
sha256=2fc68b60d90281e11a3272fa0e760cc22282a317b734778ab0bf987ed08a2f72
sha512=c0f214776bd2eda73f54ab0f64b89a90d12afc0b793308ee21374d70fc096073a24ae66fe0516304a4dc5da8ac5b98cd7df2d2eb88b002f616ef788105c1ec64
doc/caqti/Caqti_type/index.html
Module Caqti_typeSource
Type descriptors for fields and tuples.
Primitive Field Types
The following is normally only needed for drivers and to define new field types. Everything needed for common usage is covered in Row Types.
An extensible type describing primitive SQL types and types which can be converted to and from such types. When adding a new constructor, register the coding with Field.define_coding if possible. Otherwise, the type will only work with drivers which handle it themselves. The shipped drivers only handle the constructors listed here.
Row Types
type _ t = private Type descriptor for row types.
Note. The concrete representation of this type should be considered private, including pattern-matching usage; use the below functions for compatibility with future versions.
pp ppf t prints a human presentation of t on ppf.
pp_any ppf t prints a human presentation of t on ppf.
field ft is a row of a single field of type ft. This function can be used when adding new field types; use the below functions otherwise.
Standard type descriptors provided as a submodule for easy inclusion.
include Caqti_type_sig.Std with type 'a t := 'a t
Composite
The following provides constructors for narrow tuple types; to describe wider tuple types, use nested application.
A holding no fields. This is used to pass no parameters and as the result for queries which does not return any rows. It can also be nested in tuples, in which case it will not contribute to the total number of fields.
val custom :
encode:('a -> ('b, string) result) ->
decode:('b -> ('a, string) result) ->
'b t ->
'a tcustom ~encode ~decode rep creates a custom type represented by rep, where encode is used to encode parameters into rep and decode is used to decode result rows from rep.
Note. This should be considered experimental and may be revised or removed in a future version.
Singular
An UTF-8 string. The database should accept UTF-8 if non-ASCII characters are present.
An absolute time with driver-dependent precision. This corresponds to an SQL timestamp type with UTC time zone.
A period of time. If the database lacks a dedicated representation, the integer number of seconds is used.