Integration
Integration
The integration command runs integration tests on Trilogy scripts with real database connections. It validates that all datasources are configured properly but does not execute the actual queries.
Arguments:
@argument("input", type=Path())
@argument("dialect", type=str, required=False)
@option("--param", multiple=True, help="Environment parameters as key=value pairs")
@option("--parallelism", "-p", default=None, help="Maximum parallel workers for directory execution")
@option("--config", type=Path(exists=True), help="Path to trilogy.toml configuration file")
@argument("conn_args", nargs=-1, type=UNPROCESSED)
Full Examples
# Integration test against Postgres
trilogy integration tests/ postgres "postgresql://localhost/testdb"
# Integration test single file
trilogy integration query.preql duckdb
# Integration test with parallelism
trilogy integration . snowflake -p 4 --account myaccount
# Integration test with config
trilogy integration scripts/ --config trilogy.toml
What It Does
- Parses the script(s)
- Connects to the specified database
- Validates that all datasources exist and are accessible
- Does NOT execute any data-modifying statements
Notes
- Use this after
trilogy runto set up new tables, then validate the setup - Validates schema compatibility between your models and the actual database
- Useful for CI/CD pipelines to verify deployments
