package ezsqlite

  1. Overview
  2. Docs

Module EzsqliteSource

Sourceexception Sqlite_error of string
Sourcemodule Value : sig ... end
Sourcetype t

sqlite3 handle

Sourceval load : string -> t

Load database from file

Sourceval auto_extension : (t -> unit) -> unit
Sourceval commit_hook : (unit -> int) -> unit
Sourceval update_hook : (int -> string -> string -> int64 -> unit) -> unit
Sourceval create_function : t -> string -> int -> (Value.value array -> Value.value) -> unit
Sourcetype stmt

sqlite3_stmt handle

Sourceval prepare : t -> string -> stmt

Prepare an SQL statement

Sourceval reset : stmt -> unit

Reset a statement -- this does not unbind bound values

Sourceval clear : stmt -> unit

Reset and clear bindings

Sourceval bind : stmt -> int -> Value.value -> unit
Sourceval bind_dict : stmt -> (string * Value.value) list -> unit
Sourceval bind_list : stmt -> Value.value list -> unit
Sourceval parameter_count : stmt -> int

Get the number of parameters

Sourceval parameter_index : stmt -> string -> int

Get the index of a named parameter

Sourceval text : stmt -> int -> string
Sourceval blob : stmt -> int -> Bytes.t
Sourceval int64 : stmt -> int -> int64
Sourceval int : stmt -> int -> int
Sourceval double : stmt -> int -> float
Sourceval column : stmt -> int -> Value.value

Get a value by index

Sourceval exec : stmt -> unit

Execute a statement that returns no response

Sourceval step : stmt -> bool
Sourceval iter : stmt -> (stmt -> unit) -> unit

Iterate over each step

Sourceval map : stmt -> (stmt -> 'a) -> 'a list

Iterate over each step returning a value each time

Sourceval fold : stmt -> (stmt -> 'a -> 'a) -> 'a -> 'a

Fold a function over each step returning a single accumulated value

Sourceval run : t -> string -> ?bind:Value.value list -> (stmt -> 'a) -> 'a list

Convert a string into a statement and execute it

Sourceval run_ign : t -> string -> ?bind:Value.value list -> unit -> unit
Sourceval data : stmt -> Value.value array

Get each column as an array

Sourceval dict : stmt -> (string * Value.value) list

Get each column as a list of tuples mapping from string to value

Sourceval column_type : stmt -> int -> Value.kind

Get a value's type by index

Sourceval data_count : stmt -> int

Get the number of columns with data

Sourceval database_name : stmt -> int -> string

Get the name of the database a statement is attached to

Sourceval table_name : stmt -> int -> string

Get the name of a table a statement is attached to

Sourceval origin_name : stmt -> int -> string

Get the name of a column a statement value is bound to

Sourceval column_name : stmt -> int -> string
Sourceval dump_sql : t -> string -> string
Sourcemodule Backup : sig ... end
Sourcemodule Blob : sig ... end
Sourcemodule Infix : sig ... end