-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Backend for the persistent library using sqlite3. -- -- This package includes a thin sqlite3 wrapper based on the -- direct-sqlite package, as well as the entire C library, so there are -- no system dependencies. @package persistent-sqlite @version 0.1.1 -- | A port of the direct-sqlite package for dealing directly with -- PersistValues. module Database.Sqlite data Connection -- | The MVar is only used for insuring the statement is not -- double-finalized. It won't stop you from using a statement after it's -- been finalized. data Statement data Error ErrorOK :: Error ErrorError :: Error ErrorInternal :: Error ErrorPermission :: Error ErrorAbort :: Error ErrorBusy :: Error ErrorLocked :: Error ErrorNoMemory :: Error ErrorReadOnly :: Error ErrorInterrupt :: Error ErrorIO :: Error ErrorNotFound :: Error ErrorCorrupt :: Error ErrorFull :: Error ErrorCan'tOpen :: Error ErrorProtocol :: Error ErrorEmpty :: Error ErrorSchema :: Error ErrorTooBig :: Error ErrorConstraint :: Error ErrorMismatch :: Error ErrorMisuse :: Error ErrorNoLargeFileSupport :: Error ErrorAuthorization :: Error ErrorFormat :: Error ErrorRange :: Error ErrorNotAConnection :: Error ErrorRow :: Error ErrorDone :: Error data StepResult Row :: StepResult Done :: StepResult open :: String -> IO Connection close :: Connection -> IO () prepare :: Connection -> String -> IO Statement step :: Statement -> IO StepResult reset :: 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 -> String -> IO () bind :: Statement -> [PersistValue] -> IO () column :: Statement -> Int -> IO PersistValue columns :: Statement -> IO [PersistValue] instance Eq ColumnType instance Show ColumnType instance Eq StepResult instance Show StepResult instance Eq Error instance Show Error -- | A sqlite backend for persistent. module Database.Persist.Sqlite -- | A ReaderT monad transformer holding a sqlite database connection. data SqliteReader m a -- | Run a series of database actions within a single transactions. On any -- exception, the transaction is rolled back. runSqlite :: (MonadCatchIO m) => SqliteReader m a -> Pool Connection -> m a -- | Run a series of database actions within a single transactions. On any -- exception, the transaction is rolled back. You probably want to take -- advantage of connection pooling by using runSqlite instead runSqliteConn :: (MonadCatchIO m) => SqliteReader m a -> Connection -> m a -- | Handles opening and closing of the database connection automatically. withSqlite :: (MonadCatchIO m) => String -> Int -> (Pool Connection -> m a) -> m a -- | Handles opening and closing of the database connection automatically. -- You probably want to take advantage of connection pooling by using -- withSqlite instead withSqliteConn :: (MonadCatchIO m) => String -> (Connection -> m a) -> m a data Connection data Pool a :: * -> * instance (Monad m) => Monad (SqliteReader m) instance (MonadIO m) => MonadIO (SqliteReader m) instance MonadTrans SqliteReader instance (MonadCatchIO m) => MonadCatchIO (SqliteReader m) instance (Functor m) => Functor (SqliteReader m) instance (Applicative m) => Applicative (SqliteReader m) instance (MonadCatchIO m) => PersistBackend (SqliteReader m)