Overview
This page provides the ANTLR4 grammar specification for CoinbaSeQL (pronounced “coinbase QL”), the SQL dialect used by the SQL API.This page is designed for AI/LLM consumption. If you’re using AI tools like ChatGPT, Claude, or Cursor to help write SQL queries, provide this grammar along with the schema reference to generate syntactically correct queries.
- Quickstart - Try queries in the SQL Playground
- Schema Reference - Explore available tables and columns
- FAQ - Common questions about supported features
For AI tools and query validators
The complete ANTLR4 grammar specification below defines exactly what SQL syntax is supported by CoinbaSeQL.Design Principles
CoinbaSeQL is created with the following principles:- As similar to standard SQL as possible
- Support all common SQL features per the SQL standard
- Provide understandable, actionable, and helpful error messages
Grammar Specification
You can also retrieve this grammar programmatically via the Get SQL Grammar endpoint.How to use this with AI tools
When using AI assistants to write SQL queries:- Provide context: Give your AI tool both this grammar specification and the schema reference
- Be specific: Ask for queries that match your specific use case (e.g., “Write a query to find all USDC transfers over $1000 in the last 24 hours”)
- Validate: Always test AI-generated queries in the SQL Playground before using them in production