Safe Haskell | None |
---|---|
Language | Haskell98 |
Database.Sqlite
Description
A port of the direct-sqlite package for dealing directly with
PersistValue
s.
- data Connection
- data Statement
- data Error
- = ErrorOK
- | ErrorError
- | ErrorInternal
- | ErrorPermission
- | ErrorAbort
- | ErrorBusy
- | ErrorLocked
- | ErrorNoMemory
- | ErrorReadOnly
- | ErrorInterrupt
- | ErrorIO
- | ErrorNotFound
- | ErrorCorrupt
- | ErrorFull
- | ErrorCan'tOpen
- | ErrorProtocol
- | ErrorEmpty
- | ErrorSchema
- | ErrorTooBig
- | ErrorConstraint
- | ErrorMismatch
- | ErrorMisuse
- | ErrorNoLargeFileSupport
- | ErrorAuthorization
- | ErrorFormat
- | ErrorRange
- | ErrorNotAConnection
- | ErrorRow
- | ErrorDone
- data SqliteException = SqliteException {}
- data StepResult
- data Config = ConfigLogFn LogFunction
- data LogFunction
- open :: Text -> IO Connection
- close :: Connection -> IO ()
- prepare :: Connection -> Text -> IO Statement
- step :: Statement -> IO StepResult
- reset :: Connection -> Statement -> IO ()
- finalize :: Statement -> IO ()
- bindBlob :: Statement -> Int -> ByteString -> IO ()
- bindDouble :: Statement -> Int -> Double -> IO ()
- bindInt :: Statement -> Int -> Int -> IO ()
- bindInt64 :: Statement -> Int -> Int64 -> IO ()
- bindNull :: Statement -> Int -> IO ()
- bindText :: Statement -> Int -> Text -> IO ()
- bind :: Statement -> [PersistValue] -> IO ()
- column :: Statement -> Int -> IO PersistValue
- columns :: Statement -> IO [PersistValue]
- changes :: Connection -> IO Int64
- mkLogFunction :: (Int -> String -> IO ()) -> IO LogFunction
- freeLogFunction :: LogFunction -> IO ()
- config :: Config -> IO ()
Documentation
data Connection Source
Constructors
data SqliteException Source
A custom exception type to make it easier to catch exceptions.
Since 2.1.3
Constructors
SqliteException | |
Instances
Configuration option for SQLite to be used together with the config
function.
Since 2.1.4
Constructors
ConfigLogFn LogFunction | A function to be used for logging |
data LogFunction Source
Since 2.1.4
open :: Text -> IO Connection Source
close :: Connection -> IO () Source
step :: Statement -> IO StepResult Source
reset :: Connection -> Statement -> IO () Source
bind :: Statement -> [PersistValue] -> IO () Source
columns :: Statement -> IO [PersistValue] Source
changes :: Connection -> IO Int64 Source
mkLogFunction :: (Int -> String -> IO ()) -> IO LogFunction Source
Wraps a given function to a LogFunction
to be further used with ConfigLogFn
.
First argument of given function will take error code, second - log message.
Returned value should be released with freeLogFunction
when no longer required.
freeLogFunction :: LogFunction -> IO () Source
Releases a native FunPtr for the LogFunction
.
Since 2.1.4
config :: Config -> IO () Source
Sets SQLite global configuration parameter. See SQLite documentation for the sqlite3_config function. In short, this must be called prior to any other SQLite function if you want the call to succeed.
Since 2.1.4