thentos-tests-0.0.1.1: Test infrastructure for thentos-*

Safe HaskellNone
LanguageHaskell2010

Thentos.Test.Transaction

Synopsis

Documentation

runPooledQuery :: Pool Connection -> ThentosQuery e a -> IO (Either (ThentosError e) a)

Like runThentosQuery, but take connection from pool.

runVoidedQuery :: Pool Connection -> ThentosQuery Void a -> IO (Either (ThentosError Void) a)

Like runPooledQuery, but specialize error type to Void.

doQuery :: (ToRow q, FromRow r) => Pool Connection -> Query -> q -> IO [r]

Take a connection from the pool and execute the query.

doQuery_ :: FromRow r => Pool Connection -> Query -> IO [r]

rowCountShouldBe :: (?loc :: CallStack) => Pool Connection -> SBS -> Int -> IO ()

Check that a database table contains the expected number of rows. DON'T use this in production case, it's totally unprotected against SQL injection!