Run unitautogen <command> --help for a command's full option list. There are four commands.
The everyday command, and the default, so unitautogen --schema public runs it with no command word. For each function and procedure it generates a full set of pgTAP tests, runs them, and measures how much of the routine they exercised, then does the same for your triggers.
unitautogen --schema public --out unit_tests --html report.html --json report.json
Key options:
--schema a,b the schemas to cover--like pat a name filter--out DIR where the test files go--html PATH the unified HTML report--json PATH a machine-readable summary--report also emit every CI report format--no-coverage generate and run only, faster--include-extension also test extension-owned routinesIt writes one test_<routine>.sql per function, a trigger_tests/ sub-folder, and a JSON summary with one entry per routine. Every routine gets valid inputs, low and high boundaries, one test per branch, a stable result-set-shape check, a rows-match check, a touches-only-expected-tables check, and a hand-built expectation scaffold you can fill in. Triggers are tested by behaviour, firing INSERT, UPDATE and DELETE and asserting what the trigger did.
Where unit testing checks a routine on its own, integration runs it together with the functions it calls and the triggers its writes fire, for real, and measures coverage across all of it.
unitautogen integration --schema public --out integration_tests --html integration.html --json integration.json
Requires a Team licence or above. Provide it with --license PATH, the UAG_LICENSE environment variable, or a unitautogen.lic file in the working directory. The report has one row per root function; click a root for its call map in real call order.
The entire security-coverage pass, unfiltered. It checks, database-wide, whether data can cross trust boundaries through every kind of object, SECURITY DEFINER functions, views, triggers, and Row-Level-Security-protected tables, classifying each as leaking, safely contained, or not judgeable.
unitautogen seccover --schema public --out sec_out --sec-html sec.html --sec-json sec.json
Key options: --sec-html PATH and --sec-json PATH report paths, --sec-gate (exit code 4 if a leak is found, for release pipelines), --sec-emit DIR to write the security tests. Requires an Enterprise licence.
A focused audit that runs the security pass and, in addition, invokes each routine so as to trigger its error and RAISE paths, then inspects the resulting messages for leaked personal data, names, emails, card-like numbers, and similar.
unitautogen seccover --pii --schema public --out sec_out --sec-html sec.html --sec-json sec.json
The findings are written to a dedicated PII-in-error report at <out>/pii_tests/pii_report.html, with pii_findings.json alongside. Every leak is proven by real output, never inferred from the source text.