sqlite3 v0.1.0 XQLite3 View Source

XQLite3 driver for Elixir.

Link to this section Summary

Functions

Returns a supervisor child specification for a DBConnection pool.

Runs a query and returns the result as {:ok, %XQLite3.Result{}} or {:error, %XQLite3.Error{}} if there was a database error. Parameters can be set in the query as $1 embeddded in the query string. Parameters are given as a list of Elixir values.

Runs a query and returns the result or raises XQLite3.Error if there was an error. See query/3.

Start the connection process and connect to the database.

Link to this section Functions

Returns a supervisor child specification for a DBConnection pool.

Link to this function

query(conn, statement, params, opts \\ [])

View Source

Runs a query and returns the result as {:ok, %XQLite3.Result{}} or {:error, %XQLite3.Error{}} if there was a database error. Parameters can be set in the query as $1 embeddded in the query string. Parameters are given as a list of Elixir values.

Link to this function

query!(conn, statement, params, opts \\ [])

View Source

Runs a query and returns the result or raises XQLite3.Error if there was an error. See query/3.

Link to this function

start_link(path, opts \\ [])

View Source

Start the connection process and connect to the database.

Options

  • :path - the path to the database. If no database exists at that path, one will be created there. For in-memory database, provide :memory:
  • :timeout - configure the default statement timeout in ms. Default is provided by esqlite3 and is currently 5000 ms.

Examples

iex> {:ok, pid} = XQLite3.start_link(":memory:")