A sqlite backend for persistent.
- type SqliteReader = ReaderT Database
- persistSqlite :: [EntityDef] -> Q [Dec]
- runSqlite :: MonadCatchIO m => SqliteReader m a -> Database -> m a
- withSqlite :: MonadCatchIO m => String -> (Database -> m a) -> m a
- data Database
- open :: String -> IO Database
- close :: Database -> IO ()
- data Int64
- module Database.Persist.Helper
- persist :: QuasiQuoter
Documentation
type SqliteReader = ReaderT DatabaseSource
A ReaderT monad transformer holding a sqlite database connection.
persistSqlite :: [EntityDef] -> Q [Dec]Source
Generate data types and instances for the given entity definitions. Can
deal directly with the output of the persist
quasi-quoter.
runSqlite :: MonadCatchIO m => SqliteReader m a -> Database -> m aSource
Run a series of database actions within a single transactions. On any exception, the transaction is rolled back.
withSqlite :: MonadCatchIO m => String -> (Database -> m a) -> m aSource
Handles opening and closing of the database connection automatically.
Re-exports
data Int64
64-bit signed integer type
module Database.Persist.Helper
Converts a quasi-quoted syntax into a list of entity definitions, to be used as input to the backend-specific template haskell generation code.