This type shares many of the same field names as the SqlBackend type.
It's useful for library authors to use this when migrating from using the
SqlBackend constructor directly to the mkSqlBackend function.
This type will only contain required fields for constructing a SqlBackend.
For fields that aren't present on this record, you'll want to use the various
set functions or
Constructors
MkSqlBackendArgsconnPrepare :: Text -> IO StatementThis function should prepare a Statement in the target database, which should allow for efficient query reuse.
connInsertSql :: EntityDef -> [PersistValue] -> InsertSqlResultThis function generates the SQL and values necessary for performing an insert against the database.
connStmtMap :: IORef (Map Text Statement)connClose :: IO ()Close the underlying connection.
connMigrateSql :: [EntityDef] -> (Text -> IO Statement) -> EntityDef -> IO (Either [Text] [(Bool, Text)])connBegin :: (Text -> IO Statement) -> Maybe IsolationLevel -> IO ()A function to begin a transaction for the underlying database.
connCommit :: (Text -> IO Statement) -> IO ()A function to commit a transaction to the underlying database.
connRollback :: (Text -> IO Statement) -> IO ()A function to roll back a transaction on the underlying database.
connEscapeFieldName :: FieldNameDB -> TextA function to extract and escape the name of the column corresponding to the provided field.
connEscapeTableName :: EntityDef -> TextA function to extract and escape the name of the table corresponding to the provided entity. PostgreSQL uses this to support schemas.
connEscapeRawName :: Text -> TextA function to escape raw DB identifiers. MySQL uses backticks, while PostgreSQL uses quotes, and so on.
connNoLimit :: TextconnRDBMS :: TextA tag displaying what database the
SqlBackendis for. Can be used to differentiate features in downstream libraries for different database backends.connLimitOffset :: (Int, Int) -> Text -> TextAttach a 'LIMIT/OFFSET' clause to a SQL query. Note that LIMIT/OFFSET is problematic for performance, and indexed range queries are the superior way to offer pagination.
connLogFunc :: LogFuncA log function for the
SqlBackendto use.