HORIZON HASKELLDocslts/ghc-10.0.x8fef28d2026-11-02Search packagesCtrl K
Theme: |

GHC 10.0.0.20260917 · lts/ghc-10.0.x · 8fef28d · 2026-11-02

Moduledirect-sqlite-2.3.29Haskell2010

Database.SQLite3.Direct

This API is a slightly lower-level version of Database.SQLite3. Namely:

  • It returns errors instead of throwing them.

  • It only uses cheap conversions. None of these bindings convert from String or Text.

Contents
  1. Connection management
  2. Simple query execution
  3. Statement management
  4. Parameter and column information
  5. Binding values to a prepared statement
  6. Reading the result row
  7. control loading of extensions
  8. Result statistics
  9. Create custom SQL functions
  10. Extract function arguments
  11. Set the result of a function
  12. Create custom collations
  13. Interrupting a long-running query
  14. Incremental blob I/O
  15. Online Backup API
  16. Types
  17. Results and errors
  18. Special types
Synopsis

Connection management

Simple query execution

Statement management

Parameter and column information

Binding values to a prepared statement

Reading the result row

control loading of extensions

Result statistics

Create custom SQL functions

Extract function arguments

Set the result of a function

Create custom collations

Interrupting a long-running query

valueinterrupt :: Database -> IO ()

https://www.sqlite.org/c3ref/interrupt.html

Cause any pending operation on the Database handle to stop at its earliest opportunity. This simply sets a flag and returns immediately. It does not wait for the pending operation to finish.

You'll need to compile with -threaded for this to do any good. Without -threaded, FFI calls block the whole RTS, meaning interrupt would never run at the same time as step.

Incremental blob I/O

Online Backup API

Types

datadata Blob

The type of blob handles used for incremental blob I/O

Constructors

Instances2Eq, Show
  • Eq BlobDefined in direct-sqlite-2.3.29 · Database.SQLite3.Direct
  • Show BlobDefined in direct-sqlite-2.3.29 · Database.SQLite3.Direct

Results and errors

datadata Error

Constructors

Instances5Eq, Show, Generic, FFIType, Rep

Special types

newtypenewtype Utf8

A ByteString containing UTF8-encoded text with no NUL characters.

Constructors

Instances6Eq, Ord, Show, IsString, Semigroup, Monoid
  • Eq Utf8Defined in direct-sqlite-2.3.29 · Database.SQLite3.Direct
  • Ord Utf8Defined in direct-sqlite-2.3.29 · Database.SQLite3.Direct
  • Show Utf8Defined in direct-sqlite-2.3.29 · Database.SQLite3.Direct
  • IsString Utf8Defined in direct-sqlite-2.3.29 · Database.SQLite3.Direct
    fromString = Utf8 . encodeUtf8 . pack
  • Semigroup Utf8Defined in direct-sqlite-2.3.29 · Database.SQLite3.Direct
  • Monoid Utf8Defined in direct-sqlite-2.3.29 · Database.SQLite3.Direct
newtypenewtype ParamIndex

Index of a parameter in a parameterized query. Parameter indices start from 1.

When a query is prepared, SQLite allocates an array indexed from 1 to the highest parameter index. For example:

>Right stmt <- prepare conn "SELECT ?1, ?5, ?3, ?"
>bindParameterCount stmt
ParamIndex 6

This will allocate an array indexed from 1 to 6 (? takes the highest preceding index plus one). The array is initialized with null values. When you bind a parameter with bindSQLData, it assigns a new value to one of these indices.

See https://www.sqlite.org/lang_expr.html#varparam for the syntax of parameter placeholders, and how parameter indices are assigned.

Constructors

Instances9Bounded, Enum, Eq, Integral, Num, Ord, …
  • Bounded ParamIndexDefined in direct-sqlite-2.3.29 · Database.SQLite3.Bindings.Types

    Limit min/max bounds to fit into SQLite's native parameter ranges.

  • Enum ParamIndexDefined in direct-sqlite-2.3.29 · Database.SQLite3.Bindings.Types
  • Eq ParamIndexDefined in direct-sqlite-2.3.29 · Database.SQLite3.Bindings.Types
  • Integral ParamIndexDefined in direct-sqlite-2.3.29 · Database.SQLite3.Bindings.Types
  • Num ParamIndexDefined in direct-sqlite-2.3.29 · Database.SQLite3.Bindings.Types
  • Ord ParamIndexDefined in direct-sqlite-2.3.29 · Database.SQLite3.Bindings.Types
  • Real ParamIndexDefined in direct-sqlite-2.3.29 · Database.SQLite3.Bindings.Types
  • Show ParamIndexDefined in direct-sqlite-2.3.29 · Database.SQLite3.Bindings.Types

    This just shows the underlying integer, without the data constructor.

  • FFIType ParamIndex CParamIndexDefined in direct-sqlite-2.3.29 · Database.SQLite3.Bindings.Types
newtypenewtype ColumnIndex

Index of a column in a result set. Column indices start from 0.

Constructors

Instances9Bounded, Enum, Eq, Integral, Num, Ord, …
  • Bounded ColumnIndexDefined in direct-sqlite-2.3.29 · Database.SQLite3.Bindings.Types

    Limit min/max bounds to fit into SQLite's native parameter ranges.

  • Enum ColumnIndexDefined in direct-sqlite-2.3.29 · Database.SQLite3.Bindings.Types
  • Eq ColumnIndexDefined in direct-sqlite-2.3.29 · Database.SQLite3.Bindings.Types
  • Integral ColumnIndexDefined in direct-sqlite-2.3.29 · Database.SQLite3.Bindings.Types
  • Num ColumnIndexDefined in direct-sqlite-2.3.29 · Database.SQLite3.Bindings.Types
  • Ord ColumnIndexDefined in direct-sqlite-2.3.29 · Database.SQLite3.Bindings.Types
  • Real ColumnIndexDefined in direct-sqlite-2.3.29 · Database.SQLite3.Bindings.Types
  • Show ColumnIndexDefined in direct-sqlite-2.3.29 · Database.SQLite3.Bindings.Types

    This just shows the underlying integer, without the data constructor.

  • FFIType ColumnIndex CColumnIndexDefined in direct-sqlite-2.3.29 · Database.SQLite3.Bindings.Types
newtypenewtype ArgCount

Number of arguments of a user defined SQL function.

Constructors

Instances9Bounded, Enum, Eq, Integral, Num, Ord, …
  • Bounded ArgCountDefined in direct-sqlite-2.3.29 · Database.SQLite3.Bindings.Types
  • Enum ArgCountDefined in direct-sqlite-2.3.29 · Database.SQLite3.Bindings.Types
  • Eq ArgCountDefined in direct-sqlite-2.3.29 · Database.SQLite3.Bindings.Types
  • Integral ArgCountDefined in direct-sqlite-2.3.29 · Database.SQLite3.Bindings.Types
  • Num ArgCountDefined in direct-sqlite-2.3.29 · Database.SQLite3.Bindings.Types
  • Ord ArgCountDefined in direct-sqlite-2.3.29 · Database.SQLite3.Bindings.Types
  • Real ArgCountDefined in direct-sqlite-2.3.29 · Database.SQLite3.Bindings.Types
  • Show ArgCountDefined in direct-sqlite-2.3.29 · Database.SQLite3.Bindings.Types

    This just shows the underlying integer, without the data constructor.

  • FFIType ArgCount CArgCountDefined in direct-sqlite-2.3.29 · Database.SQLite3.Bindings.Types