integration-0.1.0
Safe HaskellNone
LanguageGHC2021

Testlib.PG

Description

Helpers for executing raw SQL against the galley Postgres database from integration tests (via the psql binary).

Synopsis

Documentation

execSql :: HasCallStack => BackendResource -> Text -> App () Source #

Execute a SQL statement against the given backend's galley Postgres database by spawning psql with the connection parameters read from galley's configuration. Dynamic backends share the static Postgres server and differ only in postgresql.dbname, which is taken from the backend resource. The optional top-level postgresqlPassword secret file takes precedence over the optional inline postgresql.password value — same precedence as galley (see lookupPassword for the accepted file formats). Fails if psql exits non-zero.