Skip to main content
The squirrels.yml file is the main manifest configuration file for a Squirrels project. It defines your project’s metadata, database connections, datasets, and other settings. The file supports Jinja templating, allowing you to use environment variables and dynamic values.

File structure overview

The manifest file contains the following top-level sections:
SectionRequiredDescription
project_variablesYesCore project metadata like name and version
packagesNoExternal Squirrels packages to import
connectionsNoDatabase connection definitions
parametersNoParameter widget definitions
configurablesNoProject-level configurable placeholders
datasetsNoDataset endpoint configurations
selection_test_setsNoTest sets for parameter selections

project_variables

Defines the core metadata for your Squirrels project. This section is required.
project_variables:
  name: my_project
  label: "My Analytics Project"
  description: This is a sample Squirrels project
  major_version: 1
The project_variables section allows additional custom fields beyond the ones listed above. These extra fields can be accessed in your Python configurations and Jinja templates.

packages

Defines external Squirrels packages to import. Packages allow you to reuse models, macros, and other assets across projects.
packages:
  - git: https://github.com/org/shared-analytics.git
    revision: v1.0.0
    directory: shared_analytics
Each package is defined as a list item with the following properties:
Run sqrl deps to download and install all packages defined in this section.

connections

Defines database connections used by your models. Alternatively, connections can be defined with Python in pyconfigs/connections.py.
connections:
  - name: default
    label: Main Database
    type: sqlalchemy
    uri: sqlite:///{project_path}/assets/database.db
Each connection is defined as a list item with the following properties:

URI formats

The connections URI format varies depending on the connection type and database:
Standard format: dialect://username:password@host:port/databaseExamples:
  • SQLite: sqlite:///{project_path}/assets/database.db
  • PostgreSQL: postgresql://user:pass@localhost:5432/mydb
  • MySQL: mysql+pymysql://user:pass@localhost:3306/mydb
See the SQLAlchemy documentation for more details.
Similar to SQLAlchemy but with subtle differences for some databases.Examples:
  • SQLite: sqlite://{project_path}/assets/database.db (note: two slashes, not three)
  • PostgreSQL: postgresql://user:pass@localhost:5432/mydb
See the ConnectorX documentation for more details.Note that ConnectorX and ADBC do not support placeholders in SQL queries.
For attaching external databases directly to DuckDB.Examples:
  • DuckDB: {project_path}/assets/database.duckdb
  • SQLite: sqlite:{project_path}/assets/database.db
  • PostgreSQL: postgres:dbname=mydb user=user password=pass host=localhost port=5432
  • DuckLake:
    • DuckLake with DuckDB: ducklake:{project_path}/assets/database.duckdb
    • DuckLake with PostgreSQL: ducklake:postgres:dbname=mydb user=user password=pass host=localhost port=5432
Use Jinja templating to substitute environment variables in your connection URIs:
connections:
  - name: production_db
    uri: {{ env_vars.DATABASE_URL }}

parameters

Defining parameters here in yaml is not recommended. Defining parameters with Python in pyconfigs/parameters.py is preferred, especially when using an IDE that provides autocomplete and type checking for Python.
Defines parameter widgets for your datasets. Alternatively, parameters can be defined with Python in pyconfigs/parameters.py.
parameters:
  - type: SingleSelectParameter
    factory: CreateWithOptions
    arguments:
      name: region
      label: Region
      all_options:
        - id: na
          label: North America
          is_default: true
        - id: eu
          label: Europe
Each parameter is defined as a list item with the following properties:
For detailed information on parameter types and their options, see the Python reference for parameters.

configurables

Defines project-level configurables that can be set at runtime via HTTP headers. Unlike parameters, these do not get exposed as arguments for MCP tools (i.e., AI agents cannot control them). The default values can also be overridden at the dataset level.
configurables:
  - name: schema_name
    label: Database Schema
    description: The schema to query from
    default: public
Each configurable is defined as a list item with the following properties:

datasets

Defines the dataset endpoints exposed by your Squirrels API. Each dataset maps to a data model, and can specify parameters and access scopes.
datasets:
  - name: sales_report
    label: Sales Report
    description: Daily sales transactions
    model: sales_model
    scope: protected
    parameters:
      - date_range
      - region
    configurables:
      - name: schema_name
        default: sales
Each dataset is defined as a list item with the following properties:

selection_test_sets

Defines test sets for parameter selections. Test sets are useful for testing and compiling models with specific parameter values.
selection_test_sets:
  - name: q1_report
    user:
      access_level: admin
      custom_fields:
        department: sales
    parameters:
      date_range: ["2024-01-01", "2024-03-31"]
      region: na
    configurables:
      schema_name: test
Each test set is defined as a list item with the following properties:
A test set named default is automatically used when no test set is specified during compilation. You can override the default behavior by defining a test set with this name.

Using Jinja templating

The squirrels.yml file supports Jinja templating, allowing you to:
  • Reference environment variables
  • Use conditional logic
  • Include dynamic content

Environment variables

Access environment variables using the env_vars dictionary:
connections:
  - name: main_db
    uri: {{ env_vars.DATABASE_URL }}
Environment variables are loaded from .env and .env.local files in your project directory, as well as from system environment variables.

Complete example

Here’s a complete example of a squirrels.yml file:
squirrels.yml
project_variables:
  name: expense_analytics
  label: "Expense Analytics"
  description: Analytics project for expense tracking
  major_version: 1

packages:
  - git: https://github.com/org/shared-macros.git
    revision: v1.0.0

connections:
  - name: default
    label: Expenses Database
    type: sqlalchemy
    uri: {{ env_vars.SQLITE_URI }}

datasets:
  - name: expense_transactions
    label: Expense Transactions
    description: All expense transactions
    model: expense_model
    scope: protected
    parameters:
      - date_range
      - category

  - name: expense_summary
    label: Expense Summary
    description: Aggregated expense data
    scope: public

selection_test_sets:
  - name: default
    parameters:
      date_range: [2024-01-01, 2024-12-31]

  - name: admin_view
    user:
      access_level: admin
    parameters:
      date_range: [2024-01-01, 2024-12-31]
      category: all