Postgres@1 provider lets you read data from PostgreSQL databases, no drivers needed.

Postgres@1 provider works out-of-the-box, you don’t need any drivers installed.


Data sources:
- Name: MyPostgresDatabase
  Provider: Postgres@1
  Connection string: "Host=localhost;port=5432;database=my_database;CommandTimeout=10;User ID=my_user;Password=%TESTING_PASSWORD%;"

Notice you can use an environment variable instead of real password (enclose the environment variable name with percents). See How to work with Passwords.

Storing Test definitions and Data Source definitions in DB

Reading and testing data is not the only purpose of providers. You can also use them for retrieving (potentially also automatically generating) test defintions and / or data sources.

Any SQL statement that returns columns expected by Test definition or Data source defintition will work. But if you want to persist those, you might find useful these scripts that prepares the necessary tables:

CREATE TABLE test.cat_test_definition(
  "test_suite" VARCHAR(300) NULL,
  "order" INT NULL,
  "test_case" VARCHAR(300) NULL,
  "test_name" VARCHAR(300) NOT NULL,
  "description" TEXT NULL,
  "first_data_source" VARCHAR(200) NULL,
  "first_query" TEXT NULL,
  "second_data_source" VARCHAR(200) NULL,
  "second_query" TEXT NULL,
  "expectation" VARCHAR(50) NOT NULL,
  "categories" VARCHAR(100) NULL,
  "tolerance" DECIMAL(19, 4) NULL,
  "timeout" INT NULL,
  "key" VARCHAR(100) NULL,
  "maximum_errors_logged" INT NULL
CREATE TABLE test.cat_connection_definition(
  "name" VARCHAR(200) NOT NULL,
  "provider" VARCHAR(200) NOT NULL,
  "connection_string" VARCHAR(2000) NOT NULL

Just fill them up with data and let CAT know about them (see Project files).