package caqti
Install
dune-project
Dependency
Authors
Maintainers
Sources
sha256=b8ea432820154ec095132c4f7b244b06cd8553e0b2035185b844d9c4f30af8bb
sha512=b7e3ad8e6a9b587db2d517e15cd42df2945148f9223b2fa6f4bc2bcdd2709d53549cca4b65e54511d22466e4c9aa7f0b9c17305a07505519d8bf81d95de629b8
doc/caqti/Caqti_connection_sig/index.html
Module Caqti_connection_sigSource
Signature of connection handles.
The main signature S of this module represents a database connection handle. This is obtained by connection functions implemented in the subpackages caqti-async, caqti-eio, caqti-lwt, and caqti-mirage.
While values of Caqti_request.t hold SQL code to be sent to the database, connection handles defined here provide the means to execute them with actual parameters on an RDBMS. So, there is a separation between preparation and execution. This is motivated by the common support for prepared queries in database client libraries, and by the desire to keep the possibly deeply nested data-processing code uncluttered by strings of SQL code. For this separation to be reasonably safe, the request declares the types of parameters and result, and these type declarations are placed right next to the SQL code, so that we can rely on OCaml's powers of refactoring large code bases safely.
The result type of Caqti_request.t only describes how to decode individual rows, leaving the decision of how to process multiple rows to the execution interface. Therefore, for each request constructor from Caqti_request.Infix, there are one or more matching retrieval functions in the present signature.
This type is only to be extended by drivers.