-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | A persistent companion library for sydtest -- -- A persistent companion library for sydtest @package sydtest-persistent @version 0.0.0.2 -- | Testing with an in-memory sqlite database using persistent-sqlite module Test.Syd.Persistent -- | Get a connection from the pool, run the given action, and then return -- the connection to the pool. -- -- This function performs the given action in a transaction. If an -- exception occurs during the action, then the transaction is rolled -- back. -- -- Note: This function previously timed out after 2 seconds, but this -- behavior was buggy and caused more problems than it solved. Since -- version 2.1.2, it performs no timeout checks. runSqlPool :: forall backend m a. (MonadUnliftIO m, BackendCompatible SqlBackend backend) => ReaderT backend m a -> Pool backend -> m a -- | A flipped version of runSqlPool to run your tests runPersistentTest :: ConnectionPool -> SqlPersistM a -> IO a -- | Helper function to run a Migration before/in a test suite that -- works accross versions of persistent. migrationRunner :: MonadIO m => Migration -> ReaderT SqlBackend m () -- | Test that the given migration succeeds, when applied to the current -- database. -- -- This uses two tests: -- --
    --
  1. A golden test for the current migration.
  2. --
  3. A test that first applies the golden migration, and then the -- current migration, tee see if that fails.
  4. --
migrationsSucceedsSpecHelper :: (Migration -> SetupFunc ConnectionPool) -> FilePath -> Migration -> Spec instance Test.Syd.Run.IsTest (Database.Persist.Sql.Types.SqlPersistM ()) instance Test.Syd.Run.IsTest (outerArgs -> Database.Persist.Sql.Types.SqlPersistM ())