Safe Haskell | None |
---|---|
Language | Haskell2010 |
Database.Schema.Migrations.Test.BackendTest
Description
A test that is not executed as part of this package's test suite but rather acts as a conformance test suit for database specific backend implementations. All backend specific executable packages are expected to have a test suite that runs this test.
- class BackendConnection c where
- tests :: BackendConnection bc => bc -> IO ()
Documentation
class BackendConnection c where Source #
A typeclass for database connections that needs to implemented for each specific database type to use this test.
Minimal complete definition
supportsTransactionalDDL, commit, withTransaction, getTables, catchAll, makeBackend
Methods
supportsTransactionalDDL :: c -> Bool Source #
Whether this backend supports transactional DDL; if it doesn't, we'll skip any tests that rely on that behavior.
Commits the current transaction.
withTransaction :: c -> (c -> IO a) -> IO a Source #
Executes an IO action inside a transaction.
getTables :: c -> IO [String] Source #
Retrieves a list of all tables in the current database/scheme.
catchAll :: c -> IO a -> IO a -> IO a Source #
makeBackend :: c -> Backend Source #
Returns a backend instance.
tests :: BackendConnection bc => bc -> IO () Source #