Code that is only needed for writing GenericSql backends.
- data Connection = Connection {
- prepare :: Text -> IO Statement
- insertSql :: RawName -> [RawName] -> Either Text (Text, Text)
- stmtMap :: IORef (Map Text Statement)
- close :: IO ()
- migrateSql :: forall v. PersistEntity v => (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 :: RawName -> String
- noLimit :: String
- data Statement = Statement {
- finalize :: IO ()
- reset :: IO ()
- execute :: [PersistValue] -> IO ()
- withStmt :: forall a m. MonadControlIO m => [PersistValue] -> (RowPopper m -> m a) -> m a
- withSqlConn :: MonadControlIO m => IO Connection -> (Connection -> m a) -> m a
- withSqlPool :: MonadControlIO m => IO Connection -> Int -> (Pool Connection -> m a) -> m a
- type RowPopper m = m (Maybe [PersistValue])
- mkColumns :: PersistEntity val => val -> ([Column], [UniqueDef'])
- data Column = Column {}
- type UniqueDef' = (RawName, [RawName])
- refName :: RawName -> RawName -> RawName
- tableColumns :: EntityDef -> [(RawName, String, [String])]
- rawFieldName :: ColumnDef -> RawName
- rawTableName :: EntityDef -> RawName
- rawTableIdName :: EntityDef -> RawName
- newtype RawName = RawName {}
- filterClause :: PersistEntity val => Bool -> Connection -> [Filter val] -> String
- filterClauseNoWhere :: PersistEntity val => Bool -> Connection -> [Filter val] -> String
- getFieldName :: EntityDef -> String -> RawName
- dummyFromFilts :: [Filter v] -> v
- orderClause :: PersistEntity val => Bool -> Connection -> SelectOpt val -> String
- getFiltsValues :: forall val. PersistEntity val => Connection -> [Filter val] -> [PersistValue]
Documentation
data Connection Source
Connection | |
|
Statement | |
|
withSqlConn :: MonadControlIO m => IO Connection -> (Connection -> m a) -> m aSource
withSqlPool :: MonadControlIO m => IO Connection -> Int -> (Pool Connection -> m a) -> m aSource
type RowPopper m = m (Maybe [PersistValue])Source
mkColumns :: PersistEntity val => val -> ([Column], [UniqueDef'])Source
Create the list of columns for the given entity.
type UniqueDef' = (RawName, [RawName])Source
:: PersistEntity val | |
=> Bool | include table name? |
-> Connection | |
-> [Filter val] | |
-> String |
:: PersistEntity val | |
=> Bool | include table name? |
-> Connection | |
-> [Filter val] | |
-> String |
getFieldName :: EntityDef -> String -> RawNameSource
dummyFromFilts :: [Filter v] -> vSource
orderClause :: PersistEntity val => Bool -> Connection -> SelectOpt val -> StringSource
getFiltsValues :: forall val. PersistEntity val => Connection -> [Filter val] -> [PersistValue]Source