| ||||||||
| ||||||||
Description | ||||||||
Simple wrappers for Sqlite functions (FFI). | ||||||||
Synopsis | ||||||||
Documentation | ||||||||
data DBHandleStruct | ||||||||
| ||||||||
type DBHandle = Ptr DBHandleStruct | ||||||||
data StmtStruct | ||||||||
| ||||||||
type StmtHandle = Ptr StmtStruct | ||||||||
type Blob = Ptr Word8 | ||||||||
type SqliteCallback a = FunPtr (Ptr a -> CInt -> Ptr CString -> Ptr CString -> IO Int) | ||||||||
type FreeFunPtr = FunPtr (Ptr Word8 -> IO ()) | ||||||||
data SqliteException | ||||||||
| ||||||||
catchSqlite :: IO a -> (SqliteException -> IO a) -> IO a | ||||||||
throwSqlite :: SqliteException -> a | ||||||||
sqliteOK :: CInt | ||||||||
sqliteERROR :: CInt | ||||||||
sqliteROW :: CInt | ||||||||
sqliteDONE :: CInt | ||||||||
cStr :: CStringLen -> CString | ||||||||
cStrLen :: CStringLen -> CInt | ||||||||
type UTF16CString = CString | ||||||||
type UTF8CString = CString | ||||||||
sqliteOpen :: UTF8CString -> Ptr DBHandle -> IO CInt | ||||||||
sqliteClose :: DBHandle -> IO CInt | ||||||||
sqlitePrepare :: DBHandle -> UTF8CString -> CInt -> Ptr StmtHandle -> Ptr CString -> IO CInt | ||||||||
sqliteExec :: DBHandle -> UTF8CString -> SqliteCallback a -> Ptr a -> Ptr CString -> IO CInt | ||||||||
sqliteColumnCount :: StmtHandle -> IO CInt | ||||||||
sqliteStep :: StmtHandle -> IO CInt | ||||||||
sqliteFinalise :: StmtHandle -> IO CInt | ||||||||
sqliteReset :: StmtHandle -> IO CInt | ||||||||
sqliteChanges :: DBHandle -> IO CInt | ||||||||
sqliteLastInsertRowid :: DBHandle -> IO CLLong | ||||||||
sqliteFree :: Ptr a -> IO () | ||||||||
sqliteErrcode :: DBHandle -> IO CInt | ||||||||
sqliteErrmsg :: DBHandle -> IO UTF8CString | ||||||||
sqliteColumnBytes :: StmtHandle -> CInt -> IO Int | ||||||||
sqliteColumnBlob :: StmtHandle -> CInt -> IO Blob | ||||||||
sqliteColumnDouble :: StmtHandle -> CInt -> IO CDouble | ||||||||
sqliteColumnInt :: StmtHandle -> CInt -> IO CInt | ||||||||
sqliteColumnInt64 :: StmtHandle -> CInt -> IO CLLong | ||||||||
sqliteColumnText :: StmtHandle -> CInt -> IO UTF8CString | ||||||||
sqliteColumnText16 :: StmtHandle -> CInt -> IO UTF16CString | ||||||||
sqliteBindBlob :: StmtHandle -> CInt -> Blob -> CInt -> FreeFunPtr -> IO CInt | ||||||||
sqliteBindDouble :: StmtHandle -> CInt -> CDouble -> IO CInt | ||||||||
sqliteBindInt :: StmtHandle -> CInt -> CInt -> IO CInt | ||||||||
sqliteBindInt64 :: StmtHandle -> CInt -> CLLong -> IO CInt | ||||||||
sqliteBindNull :: StmtHandle -> CInt -> IO CInt | ||||||||
sqliteBindText :: StmtHandle -> CInt -> UTF8CString -> CInt -> FreeFunPtr -> IO CInt | ||||||||
sqliteBindText16 :: StmtHandle -> CInt -> UTF16CString -> CInt -> FreeFunPtr -> IO CInt | ||||||||
getError :: DBHandle -> IO SqliteException | ||||||||
getAndRaiseError :: Int -> DBHandle -> IO a | ||||||||
errorTest :: DBHandle -> CInt -> IO a -> IO a | ||||||||
testForError :: DBHandle -> CInt -> a -> IO a | ||||||||
testForErrorWithPtr :: Storable a => DBHandle -> CInt -> Ptr a -> IO a | ||||||||
openDb :: String -> IO DBHandle | ||||||||
closeDb :: DBHandle -> IO () | ||||||||
stmtExec :: DBHandle -> String -> IO Int | ||||||||
This function is not used internally, so it's only provided as a user convenience. | ||||||||
stmtChanges :: DBHandle -> IO Int | ||||||||
stmtPrepare :: DBHandle -> String -> IO StmtHandle | ||||||||
stmtFetch :: DBHandle -> StmtHandle -> IO CInt | ||||||||
stmtFinalise :: DBHandle -> StmtHandle -> IO () | ||||||||
stmtReset :: DBHandle -> StmtHandle -> IO () | ||||||||
checkColumnRange :: StmtHandle -> Int -> IO () | ||||||||
colValInt :: StmtHandle -> Int -> IO Int | ||||||||
Column numbers are zero-indexed, so subtract one from given index (we present a one-indexed interface). | ||||||||
colValInt64 :: StmtHandle -> Int -> IO Int64 | ||||||||
colValDouble :: StmtHandle -> Int -> IO Double | ||||||||
colValString :: StmtHandle -> Int -> IO (Maybe String) | ||||||||
colValBlob :: StmtHandle -> Int -> IO (ForeignPtr Blob) | ||||||||
bindDouble :: DBHandle -> StmtHandle -> Int -> Double -> IO () | ||||||||
bindInt :: DBHandle -> StmtHandle -> Int -> Int -> IO () | ||||||||
bindInt64 :: DBHandle -> StmtHandle -> Int -> Int64 -> IO () | ||||||||
bindNull :: DBHandle -> StmtHandle -> Int -> IO () | ||||||||
bindString :: DBHandle -> StmtHandle -> Int -> String -> IO () | ||||||||
bindBlob :: DBHandle -> StmtHandle -> Int -> Blob -> Int -> IO () | ||||||||
Produced by Haddock version 0.7 |