hdbi-sqlite-1.3.0: SQlite driver for HDBI

Safe HaskellNone

Database.HDBI.SQlite.Implementation

Contents

Synopsis

types

data SQliteConnection Source

Connection to the database

Constructors

SQliteConnection 

Fields

scDatabase :: MVar (Maybe Database)
 
scConnString :: Text
 
scStatements :: ChildList SQliteStatement

List of statements to finish before disconnect

data SQState Source

Internal state of the statement. There is two similar constructors SQFetching and SQExecuted to simulate proper behaviour according to tests.

connecting

connectSqlite3Source

Arguments

:: Text

Connection string

-> IO SQliteConnection 

Connect to SQlite3 database

auxiliary functions

fetchValue :: Statement -> ColumnIndex -> IO SqlValueSource

fetch value from particular column of current row in particular statement

bindParam :: Database -> Statement -> ParamIndex -> SqlValue -> IO ()Source

bind SqlValue to the particular parameter of query of particular statement.

throwErrMsg :: Database -> String -> IO aSource

Get error description from the database and throw exception with it.

sqliteMsg :: String -> StringSource

prepend package name to the string for error reporting

withConnectionUnlocked :: SQliteConnection -> (Database -> IO a) -> IO aSource

Get internal Database from the SQliteConnection and execute and action with it. Or throw an error if connection is already closed.