SQL Extension
The SQL extension lets users query databases from inside inboard documents. It supports two connection modes.
Connection modes
Section titled “Connection modes”Direct mode
Section titled “Direct mode”Connects directly to a Turso HTTP API. Use this for cloud-hosted SQLite databases.
Configuration:
{ "url": "https://your-db.turso.io", "auth_token": "your-turso-auth-token"}Relay mode
Section titled “Relay mode”Routes queries through Concourse to on-premises databases via the relay. Use this for databases behind a corporate firewall.
Configuration:
{ "connection_id": "finance-prod", "concourse_url": "https://your-concourse.example.com", "auth_token": "user-jwt-token"}Query flow (relay mode)
Section titled “Query flow (relay mode)”Available tools
Section titled “Available tools”The SQL extension exposes four tools for use in documents:
| Tool | Description | Parameters |
|---|---|---|
execute_sql | Run a SQL query and return columns and rows. | sql (string) |
list_tables | List all tables in the connected database. | None |
describe_table | Get column names, types, and nullability for a table. | table (string) |
table_schema | Get detailed schema with normalized type information. | table (string) |
Examples
Section titled “Examples”Execute a query
Section titled “Execute a query”SELECT department, SUM(revenue) as total_revenueFROM salesWHERE fiscal_year = 2025GROUP BY departmentORDER BY total_revenue DESCReturns:
{ "columns": ["department", "total_revenue"], "rows": [ ["Enterprise", 4500000], ["SMB", 2100000], ["Consumer", 890000] ]}List tables
Section titled “List tables”Returns all tables in the database:
{ "tables": ["sales", "customers", "products", "invoices"]}Describe a table
Section titled “Describe a table”{ "columns": [ {"name": "id", "type": "integer", "nullable": false}, {"name": "department", "type": "text", "nullable": false}, {"name": "revenue", "type": "real", "nullable": true}, {"name": "fiscal_year", "type": "integer", "nullable": false} ]}API endpoints
Section titled “API endpoints”| Method | Path | Description |
|---|---|---|
POST | /api/v1/connections/{id}/query | Execute a SQL query. Body: {"sql": "..."} |
POST | /api/v1/connections/{id}/introspect | Schema introspection. Body: {"action": "list_tables"} or {"action": "describe_table", "table": "..."} |
See Connections API for full details.