direct-sqlite-2.3.29: Low-level binding to SQLite3. Includes UTF8 and BLOB support.

Safe Haskell | None
Language | Haskell2010

Database.SQLite3.Direct

Contents

- 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
- Incremental blob I/O
- Online Backup API
- Types
  - Results and errors
  - Special types

Description

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`.

Synopsis

- open :: Utf8 -> IO (Either (Error, Utf8) Database)
- open2 :: Utf8 -> Int -> Maybe Utf8 -> IO (Either (Error, Utf8) Database)
- close :: Database -> IO (Either Error ())
- errcode :: Database -> IO Error
- extendedErrcode :: Database -> IO Error
- errmsg :: Database -> IO Utf8
- setExtendedResultCodes :: Database -> Bool -> IO (Either Error ())
- setTrace :: Database -> Maybe (Utf8 -> IO ()) -> IO ()
- getAutoCommit :: Database -> IO Bool
- setSharedCacheEnabled :: Bool -> IO (Either Error ())
- exec :: Database -> Utf8 -> IO (Either (Error, Utf8) ())
- execWithCallback :: Database -> Utf8 -> ExecCallback -> IO (Either (Error, Utf8) ())
- type ExecCallback = ColumnCount -> [Utf8] -> [Maybe Utf8] -> IO ()
- prepare :: Database -> Utf8 -> IO (Either Error (Maybe Statement))
- getStatementDatabase :: Statement -> IO Database
- step :: Statement -> IO (Either Error StepResult)
- stepNoCB :: Statement -> IO (Either Error StepResult)
- reset :: Statement -> IO (Either Error ())
- finalize :: Statement -> IO (Either Error ())
- clearBindings :: Statement -> IO ()
- statementSql :: Statement -> IO (Maybe Utf8)
- bindParameterCount :: Statement -> IO ParamIndex
- bindParameterName :: Statement -> ParamIndex -> IO (Maybe Utf8)
- bindParameterIndex :: Statement -> Utf8 -> IO (Maybe ParamIndex)
- columnCount :: Statement -> IO ColumnCount
- columnName :: Statement -> ColumnIndex -> IO (Maybe Utf8)
- bindInt64 :: Statement -> ParamIndex -> Int64 -> IO (Either Error ())
- bindDouble :: Statement -> ParamIndex -> Double -> IO (Either Error ())
- bindText :: Statement -> ParamIndex -> Utf8 -> IO (Either Error ())
- bindBlob :: Statement -> ParamIndex -> ByteString -> IO (Either Error ())
- bindZeroBlob :: Statement -> ParamIndex -> Int -> IO (Either Error ())
- bindNull :: Statement -> ParamIndex -> IO (Either Error ())
- columnType :: Statement -> ColumnIndex -> IO ColumnType
- columnInt64 :: Statement -> ColumnIndex -> IO Int64
- columnDouble :: Statement -> ColumnIndex -> IO Double
- columnText :: Statement -> ColumnIndex -> IO Utf8
- columnBlob :: Statement -> ColumnIndex -> IO ByteString
- setLoadExtensionEnabled :: Database -> Bool -> IO (Either Error ())
- lastInsertRowId :: Database -> IO Int64
- changes :: Database -> IO Int
- totalChanges :: Database -> IO Int
- createFunction :: Database -> Utf8 -> Maybe ArgCount -> Bool -> (FuncContext -> FuncArgs -> IO ()) -> IO (Either Error ())
- createAggregate :: Database -> Utf8 -> Maybe ArgCount -> a -> (FuncContext -> FuncArgs -> a -> IO a) -> (FuncContext -> a -> IO ()) -> IO (Either Error ())
- deleteFunction :: Database -> Utf8 -> Maybe ArgCount -> IO (Either Error ())
- funcArgCount :: FuncArgs -> ArgCount
- funcArgType :: FuncArgs -> ArgIndex -> IO ColumnType
- funcArgInt64 :: FuncArgs -> ArgIndex -> IO Int64
- funcArgDouble :: FuncArgs -> ArgIndex -> IO Double
- funcArgText :: FuncArgs -> ArgIndex -> IO Utf8
- funcArgBlob :: FuncArgs -> ArgIndex -> IO ByteString
- funcResultInt64 :: FuncContext -> Int64 -> IO ()
- funcResultDouble :: FuncContext -> Double -> IO ()
- funcResultText :: FuncContext -> Utf8 -> IO ()
- funcResultBlob :: FuncContext -> ByteString -> IO ()
- funcResultZeroBlob :: FuncContext -> Int -> IO ()
- funcResultNull :: FuncContext -> IO ()
- getFuncContextDatabase :: FuncContext -> IO Database
- createCollation :: Database -> Utf8 -> (Utf8 -> Utf8 -> Ordering) -> IO (Either Error ())
- deleteCollation :: Database -> Utf8 -> IO (Either Error ())
- interrupt :: Database -> IO ()
- blobOpen :: Database -> Utf8 -> Utf8 -> Utf8 -> Int64 -> Bool -> IO (Either Error Blob)
- blobClose :: Blob -> IO (Either Error ())
- blobReopen :: Blob -> Int64 -> IO (Either Error ())
- blobBytes :: Blob -> IO Int
- blobRead :: Blob -> Int -> Int -> IO (Either Error ByteString)
- blobReadBuf :: Blob -> Ptr a -> Int -> Int -> IO (Either Error ())
- blobWrite :: Blob -> ByteString -> Int -> IO (Either Error ())
- backupInit :: Database -> Utf8 -> Database -> Utf8 -> IO (Either Error Backup)
- backupFinish :: Backup -> IO (Either Error ())
- backupStep :: Backup -> Int -> IO (Either Error BackupStepResult)
- backupRemaining :: Backup -> IO Int
- backupPagecount :: Backup -> IO Int
- newtype Database = Database (Ptr CDatabase)
- newtype Statement = Statement (Ptr CStatement)
- data ColumnType
  - = IntegerColumn
  - | FloatColumn
  - | TextColumn
  - | BlobColumn
  - | NullColumn
- newtype FuncContext = FuncContext (Ptr CContext)
- data FuncArgs = FuncArgs CArgCount (Ptr (Ptr CValue))
- data Blob = Blob Database (Ptr CBlob)
- data Backup = Backup Database (Ptr CBackup)
- data StepResult
  - = Row
  - | Done
- data BackupStepResult
  - = BackupOK
  - | BackupDone
- data Error
  - = ErrorOK
  - | ErrorError
  - | ErrorInternal
  - | ErrorPermission
  - | ErrorAbort
  - | ErrorBusy
  - | ErrorLocked
  - | ErrorNoMemory
  - | ErrorReadOnly
  - | ErrorInterrupt
  - | ErrorIO
  - | ErrorCorrupt
  - | ErrorNotFound
  - | ErrorFull
  - | ErrorCan'tOpen
  - | ErrorProtocol
  - | ErrorEmpty
  - | ErrorSchema
  - | ErrorTooBig
  - | ErrorConstraint
  - | ErrorMismatch
  - | ErrorMisuse
  - | ErrorNoLargeFileSupport
  - | ErrorAuthorization
  - | ErrorFormat
  - | ErrorRange
  - | ErrorNotADatabase
  - | ErrorNotice
  - | ErrorWarning
  - | ErrorRow
  - | ErrorDone
  - | ErrorErrorMissingCollatingSquence
  - | ErrorErrorRetry
  - | ErrorErrorSnapshot
  - | ErrorIORead
  - | ErrorIOShortRead
  - | ErrorIOWrite
  - | ErrorIOFsync
  - | ErrorIODirectoryFsync
  - | ErrorIOTruncate
  - | ErrorIOFstat
  - | ErrorIOUnlock
  - | ErrorIOReadLock
  - | ErrorIOBlocked
  - | ErrorIODelete
  - | ErrorIONoMemory
  - | ErrorIOAccess
  - | ErrorIOCheckReservedLock
  - | ErrorIOLock
  - | ErrorIOClose
  - | ErrorIODirectoryClose
  - | ErrorIOShmOpen
  - | ErrorIOShmSize
  - | ErrorIOShmLock
  - | ErrorIOShmMap
  - | ErrorIOSeek
  - | ErrorIODeleteNoEntity
  - | ErrorIOMmap
  - | ErrorIOGetTempPath
  - | ErrorIOConvertedPath
  - | ErrorIOVNode
  - | ErrorIOAuth
  - | ErrorIOBeginAtomic
  - | ErrorIOCommitAtomic
  - | ErrorIORollbackAtomic
  - | ErrorIOData
  - | ErrorIOCorruptFilesystem
  - | ErrorLockedSharedCache
  - | ErrorLockedVirtualTable
  - | ErrorBusyRecovery
  - | ErrorBusySnapshot
  - | ErrorBusyTimeout
  - | ErrorCan'tOpenNotTempDirectory
  - | ErrorCan'tOpenIsDirectory
  - | ErrorCan'tOpenFullPath
  - | ErrorCan'tOpenConvertedPath
  - | ErrorCan'tOpenDirtyWriteAheadLog
  - | ErrorCan'tOpenSymlink
  - | ErrorCorruptVirtualTable
  - | ErrorCorruptSequence
  - | ErrorCorruptIndex
  - | ErrorReadOnlyRecovery
  - | ErrorReadOnlyCan'tLock
  - | ErrorReadOnlyRollback
  - | ErrorReadOnlyDatabaseMoved
  - | ErrorReadOnlyCan'tInit
  - | ErrorReadOnlyDirectory
  - | ErrorAbortRollback
  - | ErrorConstraintCheck
  - | ErrorConstraintCommitHook
  - | ErrorConstraintForeignKey
  - | ErrorConstraintFunction
  - | ErrorConstraintNotNull
  - | ErrorConstraintPrimaryKey
  - | ErrorConstraintTrigger
  - | ErrorConstraintUnique
  - | ErrorConstraintVirtualTable
  - | ErrorConstraintRowId
  - | ErrorConstraintPinned
  - | ErrorConstraintDataType
  - | ErrorNoticeRecoverWriteAheadLog
  - | ErrorNoticeRecoverRollback
  - | ErrorWarningAutoIndex
  - | ErrorAuthUser
  - | ErrorOkLoadPermanently
- newtype Utf8 = Utf8 ByteString
- newtype ParamIndex = ParamIndex Int
- newtype ColumnIndex = ColumnIndex Int
- type ColumnCount = ColumnIndex
- newtype ArgCount = ArgCount Int
- type ArgIndex = ArgCount

# Connection management

open :: Utf8 -> IO (Either (Error, Utf8) Database) #

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

open2 :: Utf8 -> Int -> Maybe Utf8 -> IO (Either (Error, Utf8) Database) #

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

close :: Database -> IO (Either Error ()) #

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

errcode :: Database -> IO Error #

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

extendedErrcode :: Database -> IO Error #

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

errmsg :: Database -> IO Utf8 #

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

setExtendedResultCodes :: Database -> Bool -> IO (Either Error ()) #

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

setTrace :: Database -> Maybe (Utf8 -> IO ()) -> IO () #

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

Enable/disable tracing of SQL execution. Tracing can be disabled by setting `Nothing` as the logger callback.

Warning: If the logger callback throws an exception, your whole program will crash. Enable only for debugging!

getAutoCommit :: Database -> IO Bool #

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

Return `True` if the connection is in autocommit mode, or `False` if a transaction started with `BEGIN` is still active.

Be warned that some errors roll back the transaction automatically, and that `ROLLBACK` will throw an error if no transaction is active. Use `getAutoCommit` to avoid such an error:

     autocommit <- getAutoCommit conn
     when (not autocommit) $
         exec conn "ROLLBACK"

setSharedCacheEnabled :: Bool -> IO (Either Error ()) #

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

Enable or disable shared cache for all future connections.

# Simple query execution

https://sqlite.org/c3ref/exec.html

exec :: Database -> Utf8 -> IO (Either (Error, Utf8) ()) #

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

execWithCallback :: Database -> Utf8 -> ExecCallback -> IO (Either (Error, Utf8) ()) #

Like `exec`, but invoke the callback for each result row.

If the callback throws an exception, it will be rethrown by `execWithCallback`.

type ExecCallback #

Arguments

= ColumnCount | Number of columns, which is the number of items in the following lists. This will be the same for every row.
-> [Utf8] | List of column names. This will be the same for every row.
-> [Maybe Utf8] | List of column values, as returned by `columnText`.
-> IO () |

# Statement management

prepare :: Database -> Utf8 -> IO (Either Error (Maybe Statement)) #

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

If the query contains no SQL statements, this returns ``Right` `Nothing``.

getStatementDatabase :: Statement -> IO Database #

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

step :: Statement -> IO (Either Error StepResult) #

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

stepNoCB :: Statement -> IO (Either Error StepResult) #

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

Faster step for statements that don't callback to Haskell functions (e.g. by using custom SQL functions).

reset :: Statement -> IO (Either Error ()) #

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

Warning:

- If the most recent `step` call failed, this will return the corresponding error.
- This does not reset the bindings on a prepared statement. Use `clearBindings` to do that.

finalize :: Statement -> IO (Either Error ()) #

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

Warning: If the most recent `step` call failed, this will return the corresponding error.

clearBindings :: Statement -> IO () #

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

Set all parameters in the prepared statement to null.

statementSql :: Statement -> IO (Maybe Utf8) #

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

Return a copy of the original SQL text used to compile the statement.

# Parameter and column information

bindParameterCount :: Statement -> IO ParamIndex #

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

This returns the index of the largest (rightmost) parameter. Note that this is not necessarily the number of parameters. If numbered parameters like `?5` are used, there may be gaps in the list.

See `ParamIndex` for more information.

bindParameterName :: Statement -> ParamIndex -> IO (Maybe Utf8) #

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

bindParameterIndex :: Statement -> Utf8 -> IO (Maybe ParamIndex) #

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

columnCount :: Statement -> IO ColumnCount #

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

columnName :: Statement -> ColumnIndex -> IO (Maybe Utf8) #

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

# Binding values to a prepared statement

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

bindInt64 :: Statement -> ParamIndex -> Int64 -> IO (Either Error ()) #

bindDouble :: Statement -> ParamIndex -> Double -> IO (Either Error ()) #

bindText :: Statement -> ParamIndex -> Utf8 -> IO (Either Error ()) #

bindBlob :: Statement -> ParamIndex -> ByteString -> IO (Either Error ()) #

bindZeroBlob :: Statement -> ParamIndex -> Int -> IO (Either Error ()) #

bindNull :: Statement -> ParamIndex -> IO (Either Error ()) #

# Reading the result row

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

columnType :: Statement -> ColumnIndex -> IO ColumnType #

columnInt64 :: Statement -> ColumnIndex -> IO Int64 #

columnDouble :: Statement -> ColumnIndex -> IO Double #

columnText :: Statement -> ColumnIndex -> IO Utf8 #

columnBlob :: Statement -> ColumnIndex -> IO ByteString #

# control loading of extensions

setLoadExtensionEnabled :: Database -> Bool -> IO (Either Error ()) #

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

Enable or disable extension loading.

# Result statistics

lastInsertRowId :: Database -> IO Int64 #

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

changes :: Database -> IO Int #

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

Return the number of rows that were changed, inserted, or deleted by the most recent `INSERT`, `DELETE`, or `UPDATE` statement.

totalChanges :: Database -> IO Int #

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

Return the total number of row changes caused by `INSERT`, `DELETE`, or `UPDATE` statements since the `Database` was opened.

# Create custom SQL functions

createFunction #

Arguments

:: Database |
-> Utf8 | Name of the function.
-> Maybe ArgCount | Number of arguments. `Nothing` means that the function accepts any number of arguments.
-> Bool | Is the function deterministic?
-> (FuncContext -> FuncArgs -> IO ()) | Implementation of the function.
-> IO (Either Error ()) |

https://sqlite.org/c3ref/create_function.html

Create a custom SQL function or redefine the behavior of an existing function.

createAggregate #

Arguments

:: Database |
-> Utf8 | Name of the function.
-> Maybe ArgCount | Number of arguments.
-> a | Initial aggregate state.
-> (FuncContext -> FuncArgs -> a -> IO a) | Process one row and update the aggregate state.
-> (FuncContext -> a -> IO ()) | Called after all rows have been processed. Can be used to construct the returned value from the aggregate state.
-> IO (Either Error ()) |

Like `createFunction` except that it creates an aggregate function.

deleteFunction :: Database -> Utf8 -> Maybe ArgCount -> IO (Either Error ()) #

Delete an SQL function (scalar or aggregate).

## Extract function arguments

funcArgCount :: FuncArgs -> ArgCount #

funcArgType :: FuncArgs -> ArgIndex -> IO ColumnType #

funcArgInt64 :: FuncArgs -> ArgIndex -> IO Int64 #

funcArgDouble :: FuncArgs -> ArgIndex -> IO Double #

funcArgText :: FuncArgs -> ArgIndex -> IO Utf8 #

funcArgBlob :: FuncArgs -> ArgIndex -> IO ByteString #

## Set the result of a function

funcResultInt64 :: FuncContext -> Int64 -> IO () #

funcResultDouble :: FuncContext -> Double -> IO () #

funcResultText :: FuncContext -> Utf8 -> IO () #

funcResultBlob :: FuncContext -> ByteString -> IO () #

funcResultZeroBlob :: FuncContext -> Int -> IO () #

funcResultNull :: FuncContext -> IO () #

getFuncContextDatabase :: FuncContext -> IO Database #

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

# Create custom collations

createCollation #

Arguments

:: Database |
-> Utf8 | Name of the collation.
-> (Utf8 -> Utf8 -> Ordering) | Comparison function.
-> IO (Either Error ()) |

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

deleteCollation :: Database -> Utf8 -> IO (Either Error ()) #

Delete a collation.

# Interrupting a long-running query

interrupt :: 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

blobOpen #

Arguments

:: Database |
-> Utf8 | The symbolic name of the database (e.g. "main").
-> Utf8 | The table name.
-> Utf8 | The column name.
-> Int64 | The `ROWID` of the row.
-> Bool | Open the blob for read-write.
-> IO (Either Error Blob) |

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

Open a blob for incremental I/O.

blobClose :: Blob -> IO (Either Error ()) #

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

blobReopen #

Arguments

:: Blob |
-> Int64 | The `ROWID` of the row.
-> IO (Either Error ()) |

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

blobBytes :: Blob -> IO Int #

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

blobRead #

Arguments

:: Blob |
-> Int | Number of bytes to read.
-> Int | Offset within the blob.
-> IO (Either Error ByteString) |

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

blobReadBuf :: Blob -> Ptr a -> Int -> Int -> IO (Either Error ()) #

blobWrite #

Arguments

:: Blob |
-> ByteString |
-> Int | Offset within the blob.
-> IO (Either Error ()) |

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

# Online Backup API

https://www.sqlite.org/backup.html and https://www.sqlite.org/c3ref/backup_finish.html

backupInit #

Arguments

:: Database | Destination database handle.
-> Utf8 | Destination database name.
-> Database | Source database handle.
-> Utf8 | Source database name.
-> IO (Either Error Backup) |

https://www.sqlite.org/c3ref/backup_finish.html#sqlite3backupinit

backupFinish :: Backup -> IO (Either Error ()) #

https://www.sqlite.org/c3ref/backup_finish.html#sqlite3backupfinish

backupStep #

Arguments

:: Backup |
-> Int | Number of pages to copy; if negative, all remaining source pages are copied.
-> IO (Either Error BackupStepResult) |

https://www.sqlite.org/c3ref/backup_finish.html#sqlite3backupstep

backupRemaining :: Backup -> IO Int #

https://www.sqlite.org/c3ref/backup_finish.html#sqlite3backupremaining

backupPagecount :: Backup -> IO Int #

https://www.sqlite.org/c3ref/backup_finish.html#sqlite3backuppagecount

# Types

newtype Database #

Constructors

Database (Ptr CDatabase) |

#### Instances

Instances details

Show Database # |
Instance details Defined in Database.SQLite3.Direct Methods showsPrec :: Int -> Database -> ShowS # show :: Database -> String # showList :: [Database] -> ShowS #
Eq Database # |
Instance details Defined in Database.SQLite3.Direct Methods (==) :: Database -> Database -> Bool # (/=) :: Database -> Database -> Bool #

newtype Statement #

Constructors

Statement (Ptr CStatement) |

#### Instances

Instances details

Show Statement # |
Instance details Defined in Database.SQLite3.Direct Methods showsPrec :: Int -> Statement -> ShowS # show :: Statement -> String # showList :: [Statement] -> ShowS #
Eq Statement # |
Instance details Defined in Database.SQLite3.Direct Methods (==) :: Statement -> Statement -> Bool # (/=) :: Statement -> Statement -> Bool #

data ColumnType #

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

Constructors

IntegerColumn |
FloatColumn |
TextColumn |
BlobColumn |
NullColumn |

#### Instances

Instances details

Show ColumnType # |
Instance details Defined in Database.SQLite3.Bindings.Types Methods showsPrec :: Int -> ColumnType -> ShowS # show :: ColumnType -> String # showList :: [ColumnType] -> ShowS #
Eq ColumnType # |
Instance details Defined in Database.SQLite3.Bindings.Types Methods (==) :: ColumnType -> ColumnType -> Bool # (/=) :: ColumnType -> ColumnType -> Bool #
FFIType ColumnType CColumnType # |
Instance details Defined in Database.SQLite3.Bindings.Types Methods toFFI :: ColumnType -> CColumnType # fromFFI :: CColumnType -> ColumnType #

newtype FuncContext #

The context in which a custom SQL function is executed.

Constructors

FuncContext (Ptr CContext) |

#### Instances

Instances details

Show FuncContext # |
Instance details Defined in Database.SQLite3.Direct Methods showsPrec :: Int -> FuncContext -> ShowS # show :: FuncContext -> String # showList :: [FuncContext] -> ShowS #
Eq FuncContext # |
Instance details Defined in Database.SQLite3.Direct Methods (==) :: FuncContext -> FuncContext -> Bool # (/=) :: FuncContext -> FuncContext -> Bool #

data FuncArgs #

The arguments of a custom SQL function.

Constructors

FuncArgs CArgCount (Ptr (Ptr CValue)) |

data Blob #

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

Constructors

Blob Database (Ptr CBlob) |

#### Instances

Instances details

Show Blob # |
Instance details Defined in Database.SQLite3.Direct Methods showsPrec :: Int -> Blob -> ShowS # show :: Blob -> String # showList :: [Blob] -> ShowS #
Eq Blob # |
Instance details Defined in Database.SQLite3.Direct Methods (==) :: Blob -> Blob -> Bool # (/=) :: Blob -> Blob -> Bool #

data Backup #

A handle for an online backup process.

Constructors

Backup Database (Ptr CBackup) |

#### Instances

Instances details

Show Backup # |
Instance details Defined in Database.SQLite3.Direct Methods showsPrec :: Int -> Backup -> ShowS # show :: Backup -> String # showList :: [Backup] -> ShowS #
Eq Backup # |
Instance details Defined in Database.SQLite3.Direct Methods (==) :: Backup -> Backup -> Bool # (/=) :: Backup -> Backup -> Bool #

## Results and errors

data StepResult #

Constructors

Row |
Done |

#### Instances

Instances details

Show StepResult # |
Instance details Defined in Database.SQLite3.Direct Methods showsPrec :: Int -> StepResult -> ShowS # show :: StepResult -> String # showList :: [StepResult] -> ShowS #
Eq StepResult # |
Instance details Defined in Database.SQLite3.Direct Methods (==) :: StepResult -> StepResult -> Bool # (/=) :: StepResult -> StepResult -> Bool #

data BackupStepResult #

Constructors

BackupOK | There are still more pages to be copied.
BackupDone | All pages were successfully copied.

#### Instances

Instances details

Show BackupStepResult # |
Instance details Defined in Database.SQLite3.Direct Methods showsPrec :: Int -> BackupStepResult -> ShowS # show :: BackupStepResult -> String # showList :: [BackupStepResult] -> ShowS #
Eq BackupStepResult # |
Instance details Defined in Database.SQLite3.Direct Methods (==) :: BackupStepResult -> BackupStepResult -> Bool # (/=) :: BackupStepResult -> BackupStepResult -> Bool #

data Error #

https://www.sqlite.org/c3ref/c_abort.html https://www.sqlite.org/c3ref/c_abort_rollback.html

Constructors

ErrorOK | Successful result
ErrorError | SQL error or missing database
ErrorInternal | Internal logic error in SQLite
ErrorPermission | Access permission denied
ErrorAbort | Callback routine requested an abort
ErrorBusy | The database file is locked
ErrorLocked | A table in the database is locked
ErrorNoMemory | A `malloc()` failed
ErrorReadOnly | Attempt to write a readonly database
ErrorInterrupt | Operation terminated by `sqlite3_interrupt()`
ErrorIO | Some kind of disk I/O error occurred
ErrorCorrupt | The database disk image is malformed
ErrorNotFound | Unknown opcode in `sqlite3_file_control()`
ErrorFull | Insertion failed because database is full
ErrorCan'tOpen | Unable to open the database file
ErrorProtocol | Database lock protocol error
ErrorEmpty | Database is empty
ErrorSchema | The database schema changed
ErrorTooBig | String or BLOB exceeds size limit
ErrorConstraint | Abort due to constraint violation
ErrorMismatch | Data type mismatch
ErrorMisuse | Library used incorrectly
ErrorNoLargeFileSupport | Uses OS features not supported on host
ErrorAuthorization | Authorization denied
ErrorFormat | Auxiliary database format error
ErrorRange | 2nd parameter to sqlite3_bind out of range
ErrorNotADatabase | File opened that is not a database file
ErrorNotice | Notifications from sqlite3_log()
ErrorWarning | Warnings from sqlite3_log()
ErrorRow | `sqlite3_step()` has another row ready
ErrorDone | `sqlite3_step()` has finished executing
ErrorErrorMissingCollatingSquence |
ErrorErrorRetry |
ErrorErrorSnapshot |
ErrorIORead |
ErrorIOShortRead |
ErrorIOWrite |
ErrorIOFsync |
ErrorIODirectoryFsync |
ErrorIOTruncate |
ErrorIOFstat |
ErrorIOUnlock |
ErrorIOReadLock |
ErrorIOBlocked |
ErrorIODelete |
ErrorIONoMemory |
ErrorIOAccess |
ErrorIOCheckReservedLock |
ErrorIOLock |
ErrorIOClose |
ErrorIODirectoryClose |
ErrorIOShmOpen |
ErrorIOShmSize |
ErrorIOShmLock |
ErrorIOShmMap |
ErrorIOSeek |
ErrorIODeleteNoEntity |
ErrorIOMmap |
ErrorIOGetTempPath |
ErrorIOConvertedPath |
ErrorIOVNode |
ErrorIOAuth |
ErrorIOBeginAtomic |
ErrorIOCommitAtomic |
ErrorIORollbackAtomic |
ErrorIOData |
ErrorIOCorruptFilesystem |
ErrorLockedSharedCache |
ErrorLockedVirtualTable |
ErrorBusyRecovery |
ErrorBusySnapshot |
ErrorBusyTimeout |
ErrorCan'tOpenNotTempDirectory |
ErrorCan'tOpenIsDirectory |
ErrorCan'tOpenFullPath |
ErrorCan'tOpenConvertedPath |
ErrorCan'tOpenDirtyWriteAheadLog |
ErrorCan'tOpenSymlink |
ErrorCorruptVirtualTable |
ErrorCorruptSequence |
ErrorCorruptIndex |
ErrorReadOnlyRecovery |
ErrorReadOnlyCan'tLock |
ErrorReadOnlyRollback |
ErrorReadOnlyDatabaseMoved |
ErrorReadOnlyCan'tInit |
ErrorReadOnlyDirectory |
ErrorAbortRollback |
ErrorConstraintCheck |
ErrorConstraintCommitHook |
ErrorConstraintForeignKey |
ErrorConstraintFunction |
ErrorConstraintNotNull |
ErrorConstraintPrimaryKey |
ErrorConstraintTrigger |
ErrorConstraintUnique |
ErrorConstraintVirtualTable |
ErrorConstraintRowId |
ErrorConstraintPinned |
ErrorConstraintDataType |
ErrorNoticeRecoverWriteAheadLog |
ErrorNoticeRecoverRollback |
ErrorWarningAutoIndex |
ErrorAuthUser |
ErrorOkLoadPermanently |

#### Instances

Instances details

Generic Error # |
Instance details Defined in Database.SQLite3.Bindings.Types Associated Types
type Rep Error |
Instance details Defined in Database.SQLite3.Bindings.Types type Rep Error = D1 ('MetaData "Error" "Database.SQLite3.Bindings.Types" "direct-sqlite-2.3.29-3eK4nw71xlG3w1cx1KDDCb" 'False) ((((((C1 ('MetaCons "ErrorOK" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "ErrorError" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "ErrorInternal" 'PrefixI 'False) (U1 :: Type -> Type))) :+: (C1 ('MetaCons "ErrorPermission" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "ErrorAbort" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "ErrorBusy" 'PrefixI 'False) (U1 :: Type -> Type)))) :+: ((C1 ('MetaCons "ErrorLocked" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "ErrorNoMemory" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "ErrorReadOnly" 'PrefixI 'False) (U1 :: Type -> Type))) :+: ((C1 ('MetaCons "ErrorInterrupt" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "ErrorIO" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "ErrorCorrupt" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "ErrorNotFound" 'PrefixI 'False) (U1 :: Type -> Type))))) :+: (((C1 ('MetaCons "ErrorFull" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "ErrorCan'tOpen" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "ErrorProtocol" 'PrefixI 'False) (U1 :: Type -> Type))) :+: (C1 ('MetaCons "ErrorEmpty" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "ErrorSchema" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "ErrorTooBig" 'PrefixI 'False) (U1 :: Type -> Type)))) :+: ((C1 ('MetaCons "ErrorConstraint" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "ErrorMismatch" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "ErrorMisuse" 'PrefixI 'False) (U1 :: Type -> Type))) :+: ((C1 ('MetaCons "ErrorNoLargeFileSupport" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "ErrorAuthorization" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "ErrorFormat" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "ErrorRange" 'PrefixI 'False) (U1 :: Type -> Type)))))) :+: ((((C1 ('MetaCons "ErrorNotADatabase" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "ErrorNotice" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "ErrorWarning" 'PrefixI 'False) (U1 :: Type -> Type))) :+: (C1 ('MetaCons "ErrorRow" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "ErrorDone" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "ErrorErrorMissingCollatingSquence" 'PrefixI 'False) (U1 :: Type -> Type)))) :+: ((C1 ('MetaCons "ErrorErrorRetry" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "ErrorErrorSnapshot" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "ErrorIORead" 'PrefixI 'False) (U1 :: Type -> Type))) :+: ((C1 ('MetaCons "ErrorIOShortRead" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "ErrorIOWrite" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "ErrorIOFsync" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "ErrorIODirectoryFsync" 'PrefixI 'False) (U1 :: Type -> Type))))) :+: (((C1 ('MetaCons "ErrorIOTruncate" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "ErrorIOFstat" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "ErrorIOUnlock" 'PrefixI 'False) (U1 :: Type -> Type))) :+: (C1 ('MetaCons "ErrorIOReadLock" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "ErrorIOBlocked" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "ErrorIODelete" 'PrefixI 'False) (U1 :: Type -> Type)))) :+: ((C1 ('MetaCons "ErrorIONoMemory" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "ErrorIOAccess" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "ErrorIOCheckReservedLock" 'PrefixI 'False) (U1 :: Type -> Type))) :+: ((C1 ('MetaCons "ErrorIOLock" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "ErrorIOClose" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "ErrorIODirectoryClose" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "ErrorIOShmOpen" 'PrefixI 'False) (U1 :: Type -> Type))))))) :+: (((((C1 ('MetaCons "ErrorIOShmSize" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "ErrorIOShmLock" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "ErrorIOShmMap" 'PrefixI 'False) (U1 :: Type -> Type))) :+: (C1 ('MetaCons "ErrorIOSeek" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "ErrorIODeleteNoEntity" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "ErrorIOMmap" 'PrefixI 'False) (U1 :: Type -> Type)))) :+: ((C1 ('MetaCons "ErrorIOGetTempPath" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "ErrorIOConvertedPath" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "ErrorIOVNode" 'PrefixI 'False) (U1 :: Type -> Type))) :+: ((C1 ('MetaCons "ErrorIOAuth" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "ErrorIOBeginAtomic" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "ErrorIOCommitAtomic" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "ErrorIORollbackAtomic" 'PrefixI 'False) (U1 :: Type -> Type))))) :+: (((C1 ('MetaCons "ErrorIOData" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "ErrorIOCorruptFilesystem" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "ErrorLockedSharedCache" 'PrefixI 'False) (U1 :: Type -> Type))) :+: (C1 ('MetaCons "ErrorLockedVirtualTable" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "ErrorBusyRecovery" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "ErrorBusySnapshot" 'PrefixI 'False) (U1 :: Type -> Type)))) :+: ((C1 ('MetaCons "ErrorBusyTimeout" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "ErrorCan'tOpenNotTempDirectory" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "ErrorCan'tOpenIsDirectory" 'PrefixI 'False) (U1 :: Type -> Type))) :+: ((C1 ('MetaCons "ErrorCan'tOpenFullPath" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "ErrorCan'tOpenConvertedPath" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "ErrorCan'tOpenDirtyWriteAheadLog" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "ErrorCan'tOpenSymlink" 'PrefixI 'False) (U1 :: Type -> Type)))))) :+: ((((C1 ('MetaCons "ErrorCorruptVirtualTable" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "ErrorCorruptSequence" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "ErrorCorruptIndex" 'PrefixI 'False) (U1 :: Type -> Type))) :+: (C1 ('MetaCons "ErrorReadOnlyRecovery" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "ErrorReadOnlyCan'tLock" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "ErrorReadOnlyRollback" 'PrefixI 'False) (U1 :: Type -> Type)))) :+: ((C1 ('MetaCons "ErrorReadOnlyDatabaseMoved" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "ErrorReadOnlyCan'tInit" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "ErrorReadOnlyDirectory" 'PrefixI 'False) (U1 :: Type -> Type))) :+: ((C1 ('MetaCons "ErrorAbortRollback" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "ErrorConstraintCheck" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "ErrorConstraintCommitHook" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "ErrorConstraintForeignKey" 'PrefixI 'False) (U1 :: Type -> Type))))) :+: (((C1 ('MetaCons "ErrorConstraintFunction" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "ErrorConstraintNotNull" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "ErrorConstraintPrimaryKey" 'PrefixI 'False) (U1 :: Type -> Type))) :+: ((C1 ('MetaCons "ErrorConstraintTrigger" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "ErrorConstraintUnique" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "ErrorConstraintVirtualTable" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "ErrorConstraintRowId" 'PrefixI 'False) (U1 :: Type -> Type)))) :+: ((C1 ('MetaCons "ErrorConstraintPinned" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "ErrorConstraintDataType" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "ErrorNoticeRecoverWriteAheadLog" 'PrefixI 'False) (U1 :: Type -> Type))) :+: ((C1 ('MetaCons "ErrorNoticeRecoverRollback" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "ErrorWarningAutoIndex" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "ErrorAuthUser" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "ErrorOkLoadPermanently" 'PrefixI 'False) (U1 :: Type -> Type))))))))
Methods from :: Error -> Rep Error x # to :: Rep Error x -> Error #
Show Error # |
Instance details Defined in Database.SQLite3.Bindings.Types Methods showsPrec :: Int -> Error -> ShowS # show :: Error -> String # showList :: [Error] -> ShowS #
Eq Error # |
Instance details Defined in Database.SQLite3.Bindings.Types Methods (==) :: Error -> Error -> Bool # (/=) :: Error -> Error -> Bool #
FFIType Error CError # |
Instance details Defined in Database.SQLite3.Bindings.Types Methods toFFI :: Error -> CError # fromFFI :: CError -> Error #
type Rep Error # |
Instance details Defined in Database.SQLite3.Bindings.Types type Rep Error = D1 ('MetaData "Error" "Database.SQLite3.Bindings.Types" "direct-sqlite-2.3.29-3eK4nw71xlG3w1cx1KDDCb" 'False) ((((((C1 ('MetaCons "ErrorOK" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "ErrorError" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "ErrorInternal" 'PrefixI 'False) (U1 :: Type -> Type))) :+: (C1 ('MetaCons "ErrorPermission" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "ErrorAbort" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "ErrorBusy" 'PrefixI 'False) (U1 :: Type -> Type)))) :+: ((C1 ('MetaCons "ErrorLocked" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "ErrorNoMemory" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "ErrorReadOnly" 'PrefixI 'False) (U1 :: Type -> Type))) :+: ((C1 ('MetaCons "ErrorInterrupt" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "ErrorIO" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "ErrorCorrupt" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "ErrorNotFound" 'PrefixI 'False) (U1 :: Type -> Type))))) :+: (((C1 ('MetaCons "ErrorFull" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "ErrorCan'tOpen" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "ErrorProtocol" 'PrefixI 'False) (U1 :: Type -> Type))) :+: (C1 ('MetaCons "ErrorEmpty" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "ErrorSchema" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "ErrorTooBig" 'PrefixI 'False) (U1 :: Type -> Type)))) :+: ((C1 ('MetaCons "ErrorConstraint" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "ErrorMismatch" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "ErrorMisuse" 'PrefixI 'False) (U1 :: Type -> Type))) :+: ((C1 ('MetaCons "ErrorNoLargeFileSupport" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "ErrorAuthorization" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "ErrorFormat" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "ErrorRange" 'PrefixI 'False) (U1 :: Type -> Type)))))) :+: ((((C1 ('MetaCons "ErrorNotADatabase" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "ErrorNotice" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "ErrorWarning" 'PrefixI 'False) (U1 :: Type -> Type))) :+: (C1 ('MetaCons "ErrorRow" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "ErrorDone" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "ErrorErrorMissingCollatingSquence" 'PrefixI 'False) (U1 :: Type -> Type)))) :+: ((C1 ('MetaCons "ErrorErrorRetry" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "ErrorErrorSnapshot" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "ErrorIORead" 'PrefixI 'False) (U1 :: Type -> Type))) :+: ((C1 ('MetaCons "ErrorIOShortRead" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "ErrorIOWrite" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "ErrorIOFsync" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "ErrorIODirectoryFsync" 'PrefixI 'False) (U1 :: Type -> Type))))) :+: (((C1 ('MetaCons "ErrorIOTruncate" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "ErrorIOFstat" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "ErrorIOUnlock" 'PrefixI 'False) (U1 :: Type -> Type))) :+: (C1 ('MetaCons "ErrorIOReadLock" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "ErrorIOBlocked" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "ErrorIODelete" 'PrefixI 'False) (U1 :: Type -> Type)))) :+: ((C1 ('MetaCons "ErrorIONoMemory" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "ErrorIOAccess" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "ErrorIOCheckReservedLock" 'PrefixI 'False) (U1 :: Type -> Type))) :+: ((C1 ('MetaCons "ErrorIOLock" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "ErrorIOClose" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "ErrorIODirectoryClose" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "ErrorIOShmOpen" 'PrefixI 'False) (U1 :: Type -> Type))))))) :+: (((((C1 ('MetaCons "ErrorIOShmSize" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "ErrorIOShmLock" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "ErrorIOShmMap" 'PrefixI 'False) (U1 :: Type -> Type))) :+: (C1 ('MetaCons "ErrorIOSeek" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "ErrorIODeleteNoEntity" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "ErrorIOMmap" 'PrefixI 'False) (U1 :: Type -> Type)))) :+: ((C1 ('MetaCons "ErrorIOGetTempPath" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "ErrorIOConvertedPath" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "ErrorIOVNode" 'PrefixI 'False) (U1 :: Type -> Type))) :+: ((C1 ('MetaCons "ErrorIOAuth" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "ErrorIOBeginAtomic" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "ErrorIOCommitAtomic" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "ErrorIORollbackAtomic" 'PrefixI 'False) (U1 :: Type -> Type))))) :+: (((C1 ('MetaCons "ErrorIOData" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "ErrorIOCorruptFilesystem" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "ErrorLockedSharedCache" 'PrefixI 'False) (U1 :: Type -> Type))) :+: (C1 ('MetaCons "ErrorLockedVirtualTable" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "ErrorBusyRecovery" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "ErrorBusySnapshot" 'PrefixI 'False) (U1 :: Type -> Type)))) :+: ((C1 ('MetaCons "ErrorBusyTimeout" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "ErrorCan'tOpenNotTempDirectory" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "ErrorCan'tOpenIsDirectory" 'PrefixI 'False) (U1 :: Type -> Type))) :+: ((C1 ('MetaCons "ErrorCan'tOpenFullPath" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "ErrorCan'tOpenConvertedPath" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "ErrorCan'tOpenDirtyWriteAheadLog" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "ErrorCan'tOpenSymlink" 'PrefixI 'False) (U1 :: Type -> Type)))))) :+: ((((C1 ('MetaCons "ErrorCorruptVirtualTable" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "ErrorCorruptSequence" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "ErrorCorruptIndex" 'PrefixI 'False) (U1 :: Type -> Type))) :+: (C1 ('MetaCons "ErrorReadOnlyRecovery" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "ErrorReadOnlyCan'tLock" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "ErrorReadOnlyRollback" 'PrefixI 'False) (U1 :: Type -> Type)))) :+: ((C1 ('MetaCons "ErrorReadOnlyDatabaseMoved" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "ErrorReadOnlyCan'tInit" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "ErrorReadOnlyDirectory" 'PrefixI 'False) (U1 :: Type -> Type))) :+: ((C1 ('MetaCons "ErrorAbortRollback" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "ErrorConstraintCheck" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "ErrorConstraintCommitHook" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "ErrorConstraintForeignKey" 'PrefixI 'False) (U1 :: Type -> Type))))) :+: (((C1 ('MetaCons "ErrorConstraintFunction" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "ErrorConstraintNotNull" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "ErrorConstraintPrimaryKey" 'PrefixI 'False) (U1 :: Type -> Type))) :+: ((C1 ('MetaCons "ErrorConstraintTrigger" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "ErrorConstraintUnique" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "ErrorConstraintVirtualTable" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "ErrorConstraintRowId" 'PrefixI 'False) (U1 :: Type -> Type)))) :+: ((C1 ('MetaCons "ErrorConstraintPinned" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "ErrorConstraintDataType" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "ErrorNoticeRecoverWriteAheadLog" 'PrefixI 'False) (U1 :: Type -> Type))) :+: ((C1 ('MetaCons "ErrorNoticeRecoverRollback" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "ErrorWarningAutoIndex" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "ErrorAuthUser" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "ErrorOkLoadPermanently" 'PrefixI 'False) (U1 :: Type -> Type))))))))

## Special types

newtype Utf8 #

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

Constructors

Utf8 ByteString |

#### Instances

Instances details

Monoid Utf8 # |
Instance details Defined in Database.SQLite3.Direct Methods mempty :: Utf8 # mappend :: Utf8 -> Utf8 -> Utf8 # mconcat :: [Utf8] -> Utf8 #
Semigroup Utf8 # |
Instance details Defined in Database.SQLite3.Direct Methods (<>) :: Utf8 -> Utf8 -> Utf8 # sconcat :: NonEmpty Utf8 -> Utf8 # stimes :: Integral b => b -> Utf8 -> Utf8 #
IsString Utf8 # |
    fromString = Utf8 . encodeUtf8 . pack
Instance details Defined in Database.SQLite3.Direct Methods fromString :: String -> Utf8 #
Show Utf8 # |
Instance details Defined in Database.SQLite3.Direct Methods showsPrec :: Int -> Utf8 -> ShowS # show :: Utf8 -> String # showList :: [Utf8] -> ShowS #
Eq Utf8 # |
Instance details Defined in Database.SQLite3.Direct Methods (==) :: Utf8 -> Utf8 -> Bool # (/=) :: Utf8 -> Utf8 -> Bool #
Ord Utf8 # |
Instance details Defined in Database.SQLite3.Direct Methods compare :: Utf8 -> Utf8 -> Ordering # (<) :: Utf8 -> Utf8 -> Bool # (<=) :: Utf8 -> Utf8 -> Bool # (>) :: Utf8 -> Utf8 -> Bool # (>=) :: Utf8 -> Utf8 -> Bool # max :: Utf8 -> Utf8 -> Utf8 # min :: Utf8 -> Utf8 -> Utf8 #

newtype ParamIndex #

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

When a query is `prepare`d, 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

ParamIndex Int |

#### Instances

Instances details

Bounded ParamIndex # | Limit min/max bounds to fit into SQLite's native parameter ranges.
Instance details Defined in Database.SQLite3.Bindings.Types Methods minBound :: ParamIndex # maxBound :: ParamIndex #
Enum ParamIndex # |
Instance details Defined in Database.SQLite3.Bindings.Types Methods succ :: ParamIndex -> ParamIndex # pred :: ParamIndex -> ParamIndex # toEnum :: Int -> ParamIndex # fromEnum :: ParamIndex -> Int # enumFrom :: ParamIndex -> [ParamIndex] # enumFromThen :: ParamIndex -> ParamIndex -> [ParamIndex] # enumFromTo :: ParamIndex -> ParamIndex -> [ParamIndex] # enumFromThenTo :: ParamIndex -> ParamIndex -> ParamIndex -> [ParamIndex] #
Num ParamIndex # |
Instance details Defined in Database.SQLite3.Bindings.Types Methods (+) :: ParamIndex -> ParamIndex -> ParamIndex # (-) :: ParamIndex -> ParamIndex -> ParamIndex # (*) :: ParamIndex -> ParamIndex -> ParamIndex # negate :: ParamIndex -> ParamIndex # abs :: ParamIndex -> ParamIndex # signum :: ParamIndex -> ParamIndex # fromInteger :: Integer -> ParamIndex #
Integral ParamIndex # |
Instance details Defined in Database.SQLite3.Bindings.Types Methods quot :: ParamIndex -> ParamIndex -> ParamIndex # rem :: ParamIndex -> ParamIndex -> ParamIndex # div :: ParamIndex -> ParamIndex -> ParamIndex # mod :: ParamIndex -> ParamIndex -> ParamIndex # quotRem :: ParamIndex -> ParamIndex -> (ParamIndex, ParamIndex) # divMod :: ParamIndex -> ParamIndex -> (ParamIndex, ParamIndex) # toInteger :: ParamIndex -> Integer #
Real ParamIndex # |
Instance details Defined in Database.SQLite3.Bindings.Types Methods toRational :: ParamIndex -> Rational #
Show ParamIndex # | This just shows the underlying integer, without the data constructor.
Instance details Defined in Database.SQLite3.Bindings.Types Methods showsPrec :: Int -> ParamIndex -> ShowS # show :: ParamIndex -> String # showList :: [ParamIndex] -> ShowS #
Eq ParamIndex # |
Instance details Defined in Database.SQLite3.Bindings.Types Methods (==) :: ParamIndex -> ParamIndex -> Bool # (/=) :: ParamIndex -> ParamIndex -> Bool #
Ord ParamIndex # |
Instance details Defined in Database.SQLite3.Bindings.Types Methods compare :: ParamIndex -> ParamIndex -> Ordering # (<) :: ParamIndex -> ParamIndex -> Bool # (<=) :: ParamIndex -> ParamIndex -> Bool # (>) :: ParamIndex -> ParamIndex -> Bool # (>=) :: ParamIndex -> ParamIndex -> Bool # max :: ParamIndex -> ParamIndex -> ParamIndex # min :: ParamIndex -> ParamIndex -> ParamIndex #
FFIType ParamIndex CParamIndex # |
Instance details Defined in Database.SQLite3.Bindings.Types Methods toFFI :: ParamIndex -> CParamIndex # fromFFI :: CParamIndex -> ParamIndex #

newtype ColumnIndex #

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

Constructors

ColumnIndex Int |

#### Instances

Instances details

Bounded ColumnIndex # | Limit min/max bounds to fit into SQLite's native parameter ranges.
Instance details Defined in Database.SQLite3.Bindings.Types Methods minBound :: ColumnIndex # maxBound :: ColumnIndex #
Enum ColumnIndex # |
Instance details Defined in Database.SQLite3.Bindings.Types Methods succ :: ColumnIndex -> ColumnIndex # pred :: ColumnIndex -> ColumnIndex # toEnum :: Int -> ColumnIndex # fromEnum :: ColumnIndex -> Int # enumFrom :: ColumnIndex -> [ColumnIndex] # enumFromThen :: ColumnIndex -> ColumnIndex -> [ColumnIndex] # enumFromTo :: ColumnIndex -> ColumnIndex -> [ColumnIndex] # enumFromThenTo :: ColumnIndex -> ColumnIndex -> ColumnIndex -> [ColumnIndex] #
Num ColumnIndex # |
Instance details Defined in Database.SQLite3.Bindings.Types Methods (+) :: ColumnIndex -> ColumnIndex -> ColumnIndex # (-) :: ColumnIndex -> ColumnIndex -> ColumnIndex # (*) :: ColumnIndex -> ColumnIndex -> ColumnIndex # negate :: ColumnIndex -> ColumnIndex # abs :: ColumnIndex -> ColumnIndex # signum :: ColumnIndex -> ColumnIndex # fromInteger :: Integer -> ColumnIndex #
Integral ColumnIndex # |
Instance details Defined in Database.SQLite3.Bindings.Types Methods quot :: ColumnIndex -> ColumnIndex -> ColumnIndex # rem :: ColumnIndex -> ColumnIndex -> ColumnIndex # div :: ColumnIndex -> ColumnIndex -> ColumnIndex # mod :: ColumnIndex -> ColumnIndex -> ColumnIndex # quotRem :: ColumnIndex -> ColumnIndex -> (ColumnIndex, ColumnIndex) # divMod :: ColumnIndex -> ColumnIndex -> (ColumnIndex, ColumnIndex) # toInteger :: ColumnIndex -> Integer #
Real ColumnIndex # |
Instance details Defined in Database.SQLite3.Bindings.Types Methods toRational :: ColumnIndex -> Rational #
Show ColumnIndex # | This just shows the underlying integer, without the data constructor.
Instance details Defined in Database.SQLite3.Bindings.Types Methods showsPrec :: Int -> ColumnIndex -> ShowS # show :: ColumnIndex -> String # showList :: [ColumnIndex] -> ShowS #
Eq ColumnIndex # |
Instance details Defined in Database.SQLite3.Bindings.Types Methods (==) :: ColumnIndex -> ColumnIndex -> Bool # (/=) :: ColumnIndex -> ColumnIndex -> Bool #
Ord ColumnIndex # |
Instance details Defined in Database.SQLite3.Bindings.Types Methods compare :: ColumnIndex -> ColumnIndex -> Ordering # (<) :: ColumnIndex -> ColumnIndex -> Bool # (<=) :: ColumnIndex -> ColumnIndex -> Bool # (>) :: ColumnIndex -> ColumnIndex -> Bool # (>=) :: ColumnIndex -> ColumnIndex -> Bool # max :: ColumnIndex -> ColumnIndex -> ColumnIndex # min :: ColumnIndex -> ColumnIndex -> ColumnIndex #
FFIType ColumnIndex CColumnIndex # |
Instance details Defined in Database.SQLite3.Bindings.Types Methods toFFI :: ColumnIndex -> CColumnIndex # fromFFI :: CColumnIndex -> ColumnIndex #

type ColumnCount = ColumnIndex #

Number of columns in a result set.

newtype ArgCount #

Number of arguments of a user defined SQL function.

Constructors

ArgCount Int |

#### Instances

Instances details

Bounded ArgCount # |
Instance details Defined in Database.SQLite3.Bindings.Types Methods minBound :: ArgCount # maxBound :: ArgCount #
Enum ArgCount # |
Instance details Defined in Database.SQLite3.Bindings.Types Methods succ :: ArgCount -> ArgCount # pred :: ArgCount -> ArgCount # toEnum :: Int -> ArgCount # fromEnum :: ArgCount -> Int # enumFrom :: ArgCount -> [ArgCount] # enumFromThen :: ArgCount -> ArgCount -> [ArgCount] # enumFromTo :: ArgCount -> ArgCount -> [ArgCount] # enumFromThenTo :: ArgCount -> ArgCount -> ArgCount -> [ArgCount] #
Num ArgCount # |
Instance details Defined in Database.SQLite3.Bindings.Types Methods (+) :: ArgCount -> ArgCount -> ArgCount # (-) :: ArgCount -> ArgCount -> ArgCount # (*) :: ArgCount -> ArgCount -> ArgCount # negate :: ArgCount -> ArgCount # abs :: ArgCount -> ArgCount # signum :: ArgCount -> ArgCount # fromInteger :: Integer -> ArgCount #
Integral ArgCount # |
Instance details Defined in Database.SQLite3.Bindings.Types Methods quot :: ArgCount -> ArgCount -> ArgCount # rem :: ArgCount -> ArgCount -> ArgCount # div :: ArgCount -> ArgCount -> ArgCount # mod :: ArgCount -> ArgCount -> ArgCount # quotRem :: ArgCount -> ArgCount -> (ArgCount, ArgCount) # divMod :: ArgCount -> ArgCount -> (ArgCount, ArgCount) # toInteger :: ArgCount -> Integer #
Real ArgCount # |
Instance details Defined in Database.SQLite3.Bindings.Types Methods toRational :: ArgCount -> Rational #
Show ArgCount # | This just shows the underlying integer, without the data constructor.
Instance details Defined in Database.SQLite3.Bindings.Types Methods showsPrec :: Int -> ArgCount -> ShowS # show :: ArgCount -> String # showList :: [ArgCount] -> ShowS #
Eq ArgCount # |
Instance details Defined in Database.SQLite3.Bindings.Types Methods (==) :: ArgCount -> ArgCount -> Bool # (/=) :: ArgCount -> ArgCount -> Bool #
Ord ArgCount # |
Instance details Defined in Database.SQLite3.Bindings.Types Methods compare :: ArgCount -> ArgCount -> Ordering # (<) :: ArgCount -> ArgCount -> Bool # (<=) :: ArgCount -> ArgCount -> Bool # (>) :: ArgCount -> ArgCount -> Bool # (>=) :: ArgCount -> ArgCount -> Bool # max :: ArgCount -> ArgCount -> ArgCount # min :: ArgCount -> ArgCount -> ArgCount #
FFIType ArgCount CArgCount # |
Instance details Defined in Database.SQLite3.Bindings.Types Methods toFFI :: ArgCount -> CArgCount # fromFFI :: CArgCount -> ArgCount #

type ArgIndex = ArgCount #

Index of an argument to a custom function. Indices start from 0.