Safe Haskell | None |
---|---|
Language | Haskell98 |
A sqlite backend for persistent.
Note: If you prepend WAL=off
to your connection string, it will disable
the write-ahead log. For more information, see
https://github.com/yesodweb/persistent/issues/363.
- withSqlitePool :: (MonadBaseControl IO m, MonadIO m, MonadLogger m) => Text -> Int -> (ConnectionPool -> m a) -> m a
- withSqliteConn :: (MonadBaseControl IO m, MonadIO m, MonadLogger m) => Text -> (SqlBackend -> m a) -> m a
- createSqlitePool :: (MonadIO m, MonadLogger m, MonadBaseControl IO m) => Text -> Int -> m ConnectionPool
- data SqliteConf = SqliteConf {
- sqlDatabase :: Text
- sqlPoolSize :: Int
- runSqlite :: (MonadBaseControl IO m, MonadIO m) => Text -> SqlPersistT (NoLoggingT (ResourceT m)) a -> m a
- wrapConnection :: Connection -> LogFunc -> IO SqlBackend
Documentation
withSqliteConn :: (MonadBaseControl IO m, MonadIO m, MonadLogger m) => Text -> (SqlBackend -> m a) -> m a Source
createSqlitePool :: (MonadIO m, MonadLogger m, MonadBaseControl IO m) => Text -> Int -> m ConnectionPool Source
data SqliteConf Source
Information required to connect to a sqlite database
SqliteConf | |
|
Show SqliteConf | |
PersistConfig SqliteConf | |
FromJSON SqliteConf | |
type PersistConfigPool SqliteConf = ConnectionPool | |
type PersistConfigBackend SqliteConf = SqlPersistT |
:: (MonadBaseControl IO m, MonadIO m) | |
=> Text | connection string |
-> SqlPersistT (NoLoggingT (ResourceT m)) a | database action |
-> m a |
A convenience helper which creates a new database connection and runs the
given block, handling MonadResource
and MonadLogger
requirements. Note
that all log messages are discarded.
Since 1.1.4
wrapConnection :: Connection -> LogFunc -> IO SqlBackend Source
Wrap up a raw Connection
as a Persistent SQL Connection
.
Since 1.1.5