Chalk SQL can join data from connected databases and warehouses with data in your Chalk environment, including feature values, datasets, and resolver outputs. It also lets you call deployed Chalk Functions in SQL expressions.

​
Run your first query

In the SQL Explorer, open a worksheet and select Chalk SQL as the dialect. Run this query to check that the worksheet can execute Chalk SQL without needing any tables.

SELECT
  1 AS ready;

Run SHOW CATALOGS to discover the catalogs in your environment, then run SHOW TABLES FROM chalk to find tables in the built-in chalk catalog. Use DESCRIBE with a table name to inspect its columns before querying it. See the catalog guide for ways to filter the table list.

​
Query across data sources

This example joins PostgreSQL users to spending totals from BigQuery. The catalog names my_postgres and my_bigquery refer to example integrations.

Hover over a table or column to see its catalog details. The results drawer shows the sample output.

​
Referencing the Chalk Catalog

Use catalog.schema.table to name a table or view. The first part identifies the catalog. For example, in my_postgres.public.users, my_postgres is the registered data source name, public is the PostgreSQL schema, and users is the table. Quote individual identifiers when they contain spaces or literal dots, as in chalk.historical_values."user.name".

See Available tables for examples and ways to find tables in your environment.

​
Running Chalk SQL

Chalk SQL is automatically enabled and available for use in any environment that has at least one gRPC query server running. Both new and existing environments can start running Chalk SQL queries with no additional setup.

​
Use Chalk SQL through MCP

  1. Call search_sql_catalog to browse catalogs and schemas. For a table search, set include_columns: true to see column names and Arrow types.
  2. For function signatures, call search_docs_functions with source: "chalksql".
  3. Call lint_sql_query to plan your statement and check for errors without executing it.
  4. Call execute_sql_query to run the statement. Set preview: true to include a sample of the result.

​
See also