Safe Haskell | None |
---|
Database.Persist.GenericSql.Internal
Description
Code that is only needed for writing GenericSql backends.
- data Connection = Connection {
- prepare :: Text -> IO Statement
- insertSql :: DBName -> [DBName] -> Either Text (Text, Text)
- stmtMap :: IORef (Map Text Statement)
- close :: IO ()
- migrateSql :: forall v. PersistEntity v => [EntityDef] -> (Text -> IO Statement) -> v -> IO (Either [Text] [(Bool, Text)])
- begin :: (Text -> IO Statement) -> IO ()
- commitC :: (Text -> IO Statement) -> IO ()
- rollbackC :: (Text -> IO Statement) -> IO ()
- escapeName :: DBName -> Text
- noLimit :: Text
- data Statement = Statement {
- finalize :: IO ()
- reset :: IO ()
- execute :: [PersistValue] -> IO ()
- withStmt :: forall m. MonadResource m => [PersistValue] -> Source m [PersistValue]
- withSqlConn :: (MonadIO m, MonadBaseControl IO m) => IO Connection -> (Connection -> m a) -> m a
- withSqlPool :: MonadIO m => IO Connection -> Int -> (Pool Connection -> m a) -> m a
- createSqlPool :: MonadIO m => IO Connection -> Int -> m (Pool Connection)
- mkColumns :: PersistEntity val => [EntityDef] -> val -> ([Column], [UniqueDef])
- data Column = Column {}
- logSQL :: Q Exp
Documentation
data Connection Source
Constructors
Connection | |
Fields
|
Constructors
Statement | |
Fields
|
withSqlConn :: (MonadIO m, MonadBaseControl IO m) => IO Connection -> (Connection -> m a) -> m aSource
Arguments
:: MonadIO m | |
=> IO Connection | create a new connection |
-> Int | connection count |
-> (Pool Connection -> m a) | |
-> m a |
createSqlPool :: MonadIO m => IO Connection -> Int -> m (Pool Connection)Source
mkColumns :: PersistEntity val => [EntityDef] -> val -> ([Column], [UniqueDef])Source
Create the list of columns for the given entity.
Constructors
Column | |