Safe Haskell | None |
---|---|
Language | Haskell2010 |
- runPooledQuery :: Pool Connection -> ThentosQuery e a -> IO (Either (ThentosError e) a)
- runVoidedQuery :: Pool Connection -> ThentosQuery Void a -> IO (Either (ThentosError Void) a)
- doQuery :: (ToRow q, FromRow r) => Pool Connection -> Query -> q -> IO [r]
- doQuery_ :: FromRow r => Pool Connection -> Query -> IO [r]
- rowCountShouldBe :: (?loc :: CallStack) => Pool Connection -> SBS -> Int -> IO ()
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!