persistent-sqlite-0.0.0: Backend for the persistent library using sqlite3.

Database.Persist.Sqlite

Contents

Description

A sqlite backend for persistent.

Synopsis

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

persist :: QuasiQuoter

Converts a quasi-quoted syntax into a list of entity definitions, to be used as input to the backend-specific template haskell generation code.