evidence sources command executes your SQL queries and generates .parquet data files from your configured data sources.
Syntax
Description
This command:- Connects to configured data sources
- Executes SQL queries from the
sources/directory - Generates
.parquetfiles containing query results - Creates a manifest file for the Evidence runtime
- Stores outputs in
.evidence/template/static/data/
sources command is essential for making data available to your Evidence pages.
Options
Only build sources whose queries have changed since the last run. Significantly speeds up incremental builds.
Only build queries from the specified source directories. Accepts a comma-separated list of source names.
Only build the specified queries. Accepts comma-separated list of query names or source-qualified names (e.g.,
source.query).Show debug output during query execution. Useful for troubleshooting connection and query issues.
Fail the entire build when any source query fails. By default, individual query failures are logged but don’t stop the build.
Usage Examples
Build all sources
Build only changed queries
Build specific sources
Build specific queries
Build with strict error handling
Debug query execution
Output Location
Data files are written to:Environment Variables
The sources command uses:EVIDENCE_DATA_DIR- Output directory for data files (default:./.evidence/template/static/data)EVIDENCE_DATA_URL_PREFIX- URL prefix for accessing data (default:static/data)EVIDENCE_SOURCE__[source]__[option]- Source-specific credentials and optionsEVIDENCE_VAR__[name]- Variables for query interpolation
Variable Interpolation
You can use${var} syntax in your queries, which will be replaced with EVIDENCE_VAR__[var] environment variables:
Exit Codes
0- All queries executed successfully (or with errors in non-strict mode)- Non-zero - Build failed (connection errors, strict mode query failures)
Alias
The old command name is still supported:Related Commands
- evidence dev - Start development server (loads source data)
- evidence build - Build production outputs (run sources first)
- Configuration File - Configure data sources