package petrol
Library
Module
Module type
Parameter
Class
Class type
module Expr : sig ... end
Defines an extensible embedding of SQL expressions.
module Type : sig ... end
('ret_ty, 'query_tag) query
represents an SQL query that returns values of type 'ret_ty
and is a SQL query of kind 'query_kind
-- see Petrol.Query.t
.
module Request : sig ... end
module Sqlite3 : sig ... end
module Postgres : sig ... end
module Schema : sig ... end
Provides an E-DSL for specifying SQL tables in OCaml.
module Query : sig ... end
Provides an E-DSL for specifying SQL queries in OCaml.
module StaticSchema : sig ... end
Provides a helper interface, primarily for prototyping/debugging, that declares a static table without any versioning.
module VersionedSchema : sig ... end
Provides an interface that declares a versioned schema.
val exec :
(module Caqti_lwt.CONNECTION) ->
(unit, [< `Zero ]) request ->
(unit, [> Caqti_error.call_or_retrieve ]) Stdlib.result Lwt.t
exec db req
executes a unit SQL request req
on the SQL database db
.
val find :
(module Caqti_lwt.CONNECTION) ->
('a, [< `One ]) request ->
('a, [> Caqti_error.call_or_retrieve ]) Stdlib.result Lwt.t
find db req
executes a singleton SQL request req
on the SQL database db
returning the result.
val find_opt :
(module Caqti_lwt.CONNECTION) ->
('a, [< `One | `Zero ]) request ->
('a option, [> Caqti_error.call_or_retrieve ]) Stdlib.result Lwt.t
find_opt db req
executes a zero-or-one SQL request req
on the SQL database db
returning the result if it exists.
val collect_list :
(module Caqti_lwt.CONNECTION) ->
('a, [< `Many | `One | `Zero ]) request ->
('a list, [> Caqti_error.call_or_retrieve ]) Stdlib.result Lwt.t
collect_list db req
executes a SQL request req
on the SQL database db
and collects the results into a list.