Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source
Page
Library
Module
Module type
Parameter
Class
Class type
Source
Petrol.StaticSchemaSourceProvides a helper interface, primarily for prototyping/debugging, that declares a static table without any versioning.
A global schema, primarily intended for testing.
See also VersionedSchema.t, which is the recommended alternative, especially if you expect the schema to change in the future.
Note A schema t here represents a collection of table schemas but doesn't have to be an exhaustive enumeration - i.e it is possible to have multiple t valid for a given SQL database provided they refer to disjoint collections of tables.
val declare_table :
t ->
?constraints:[ `Table ] Schema.constraint_ list ->
name:string ->
'a Schema.table ->
table_name * 'a Expr.expr_listdeclare_table t ?constraints ~name table_spec declares a new table on the schema t with the name name.
constraints are a list of SQL constraints on the columns of the table.
val initialise :
t ->
(module Caqti_lwt.CONNECTION) ->
(unit, [> Caqti_error.t ]) Lwt_result.tinitialise t conn initialises the SQL schema on conn.