package caqti
Install
Dune Dependency
Authors
Maintainers
Sources
sha256=e2b1d83b54f4583fc1cf4775d006c68cab4ec0b95a359ab724d5305ada737280
md5=7abd1ee41a02eb7483617cbc22b09691
doc/caqti.v1/Caqti1_query/index.html
Module Caqti1_query
Source
(v1) One-shot and prepared queries.
The exception to raise in a callback passed to the various query functions below, to indicate that a query language is unsupported.
The type of one-shot queries.
type prepared_query = private {
pq_index : int;
(*A relatively small integer unique to each query, made available to backends for efficient caching of language dependent data.
*)pq_name : string;
(*A name to use for the prepared query.
*)pq_encode : Caqti_driver_info.t -> string;
(*The SQL for each query language.
*)
}
The type of prepared queries.
type query =
| Oneshot of oneshot_query
(*A one-shot query.
*)| Prepared of prepared_query
(*A prepared query.
*)
The type of queries accepted by the CONNECTION API.
Create a one-shot family of query strings indexed by full query language descriptors.
Create a one-shot family of query strings indexed by language tags.
Create a one-shot query string indiscriminately passed to any backend.
Create a one-shot query string expected to work with any SQL dialect.
val oneshot_sql_p :
?env:(Caqti_driver_info.dialect_tag -> string -> string) ->
string ->
query
Create a one-shot query string expected to work with any SQL dialect after conversion of parameters.
Create a prepared statement dispatching on the full query language descriptor.
Create a prepared statement dispatching on the language tag.
Create a prepared statement accepted by any backend. This only makes sense if backend are known to be restricted to a set sharing a common query string. Consider using prepare_sql
or oneshot
instead.
Create a prepared statement expected to work with any SQL dialect.
val prepare_sql_p :
?name:string ->
?env:(Caqti_driver_info.dialect_tag -> string -> string) ->
string ->
query
Create a prepared statement expected to work with any SQL dialect after conversion of parameters.
An informative analogue of query
, used for error reporting. For prepared queries, the first constructor argument is the name of the query.
make_query_info backend query
extracts the query string from query
as seen by backend
, for use in logging and error reporting.