Safe Haskell | None |
---|
- data SQliteConnection = SQliteConnection {
- scDatabase :: MVar (Maybe Database)
- scConnString :: Text
- scStatements :: ChildList SQliteStatement
- data SQliteStatement = SQliteStatement {}
- data SQState
- = SQNew { }
- | SQExecuted { }
- | SQFetching { }
- | SQFinished
- connectSqlite3 :: Text -> IO SQliteConnection
- encodeUTF8 :: Text -> Utf8
- encodeLUTF8 :: Text -> Utf8
- encodeSUTF8 :: String -> Utf8
- decodeUTF8 :: Utf8 -> Text
- decodeLUTF8 :: Utf8 -> Text
- fetchValue :: Statement -> ColumnIndex -> IO SqlValue
- bindParam :: Database -> Statement -> ParamIndex -> SqlValue -> IO ()
- throwErrMsg :: Database -> String -> IO a
- sqliteMsg :: String -> String
- withConnectionUnlocked :: SQliteConnection -> (Database -> IO a) -> IO a
types
data SQliteConnection Source
Connection to the database
SQliteConnection | |
|
data SQliteStatement Source
Prepared statement
Internal state of the statement. There is two similar constructors
SQFetching
and SQExecuted
to simulate proper behaviour according to
tests.
connecting
auxiliary functions
encodeUTF8 :: Text -> Utf8Source
encodeLUTF8 :: Text -> Utf8Source
encodeSUTF8 :: String -> Utf8Source
decodeUTF8 :: Utf8 -> TextSource
decodeLUTF8 :: Utf8 -> TextSource
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.
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.