This is a helper module for creating SQL backends. Regular users do not need to use this module.
- newtype SqlPersist m a = SqlPersist {
- unSqlPersist :: ReaderT Connection m a
- data Connection
- type ConnectionPool = Pool Connection
- data Statement
- runSqlConn :: MonadControlIO m => SqlPersist m a -> Connection -> m a
- runSqlPool :: MonadControlIO m => SqlPersist m a -> Pool Connection -> m a
- type Migration m = WriterT [Text] (WriterT CautiousMigration m) ()
- parseMigration :: Monad m => Migration m -> m (Either [Text] CautiousMigration)
- parseMigration' :: Monad m => Migration m -> m CautiousMigration
- printMigration :: MonadControlIO m => Migration (SqlPersist m) -> SqlPersist m ()
- getMigration :: MonadControlIO m => Migration (SqlPersist m) -> SqlPersist m [Sql]
- runMigration :: MonadControlIO m => Migration (SqlPersist m) -> SqlPersist m ()
- runMigrationSilent :: MonadControlIO m => Migration (SqlPersist m) -> SqlPersist m [Text]
- runMigrationUnsafe :: MonadControlIO m => Migration (SqlPersist m) -> SqlPersist m ()
- migrate :: (MonadControlIO m, PersistEntity val) => val -> Migration (SqlPersist m)
- commit :: MonadIO m => SqlPersist m ()
- rollback :: MonadIO m => SqlPersist m ()
- newtype Key backend entity = Key {}
Documentation
newtype SqlPersist m a Source
SqlPersist | |
|
MonadTrans SqlPersist | |
MonadControlIO m => PersistBackend SqlPersist m | |
Monad m => Monad (SqlPersist m) | |
Functor m => Functor (SqlPersist m) | |
MonadPlus m => MonadPlus (SqlPersist m) | |
Applicative m => Applicative (SqlPersist m) | |
MonadIO m => MonadIO (SqlPersist m) | |
MonadControlIO m => MonadControlIO (SqlPersist m) | |
SinglePiece (Key SqlPersist entity) | |
(PersistEntity one, PersistEntity many, Eq (Key SqlPersist one)) => RunJoin (SelectOneMany SqlPersist one many) |
data Connection Source
type ConnectionPool = Pool ConnectionSource
runSqlConn :: MonadControlIO m => SqlPersist m a -> Connection -> m aSource
runSqlPool :: MonadControlIO m => SqlPersist m a -> Pool Connection -> m aSource
parseMigration' :: Monad m => Migration m -> m CautiousMigrationSource
printMigration :: MonadControlIO m => Migration (SqlPersist m) -> SqlPersist m ()Source
getMigration :: MonadControlIO m => Migration (SqlPersist m) -> SqlPersist m [Sql]Source
runMigration :: MonadControlIO m => Migration (SqlPersist m) -> SqlPersist m ()Source
runMigrationSilent :: MonadControlIO m => Migration (SqlPersist m) -> SqlPersist m [Text]Source
Same as runMigration
, but returns a list of the SQL commands executed
instead of printing them to stderr.
runMigrationUnsafe :: MonadControlIO m => Migration (SqlPersist m) -> SqlPersist m ()Source
migrate :: (MonadControlIO m, PersistEntity val) => val -> Migration (SqlPersist m)Source
commit :: MonadIO m => SqlPersist m ()Source
Perform a database commit.
rollback :: MonadIO m => SqlPersist m ()Source
Perform a database rollback.