SQL Copilot

What does it do

The SQL copilot is here to answer your data need. It finds the good tables and write SQL with these. It is embedded directly on your SQL cloud editors. Ask your questions, it will get you to the right SQL query. Use it in the app web app here or in the Catalog chrome extension

Here are some examples of question you can ask

  • Get me the number of users per customers

  • What is our revenue per country per month

  • Give me a list of the newly signed customers of last quarter

  • How can I join these two tables

  • Please fix this query (add query after)

How to use it

To write SQL, one needs knowledge about tables and columns. You can pick the tables manually inside the copilot, or you can use the Table auto-select

Where you can use it

SQL Copilot in the web app

Go to app.castordoc.com/ai/copilot, describe the query you want to write. Iterate with follow up requests if needed. The job is done.

SQL Copilot in the Browser Extension

First install the CastorDoc browser extension following this guide Browser Extensions. Then open it up when you're about to write SQL on your editor, and ask it your question

Supported cloud editors by CastorDoc Browser Extension

  • Snowflake SQL Editor

  • BigQuery SQL Editor

  • Count SQL Editor

  • Hex SQL Editor

  • dbt Cloud IDE

  • Metabase SQL Editor

Note: We can easily add more editors. Please let us know your preferences.

Iterate

This is a key strength of our assistant. If you're not happy with the first answer simply tell the assistant, and iterate, as you would do with ChatGPT. One thing to keep in mind, Table Auto-Select only works for the first message.

Tables Auto-select

When starting a new query, simply describe what you are looking for and keep the Auto-select tables toggle on. Catalog AI will automatically find the best tables to write your SQL query.

You can then later review these tables and edit them by clicking on the Edit tables selected button. You'll be able to remove tables automatically added, search for other ones you want to add.

How it works

Leverage your query history to find the the best tables

Catalog checks across all previously ran SQL queries, by you, by others, even by your BI tool. It tries to find the best matching queries to answer your need. These queries will serve as examples for our LLM.

We'll also extract the tables used by these queries. These tables, along with all the metadata Catalog has (columns names and types, descriptions, ...) will fed our LLM, added to the context

About joining tables

Thanks to our systematic parsing of all your SQL queries, if anyone joined tables together, our assistant will know how to do it. This will feed our assistant as well.

Build the query

Finally, we'll provide our LLM with your question, the best past queries, the best tables to answer and the relevant metadata. Now the LLM will answer you.

The assistant knows which SQL flavor you're using. It will adapt its answer to it.

Improving it answers

This is where data stewards, analyst and data engineer play a key role. The better the tables and columns are documented, they better the copilot will answer.

  • When documenting columns, do add frequent column values for enums.

  • Pin queries to tables in the Query tab in the app

  • Certify tables to trust

Privacy concerns

Please refer to our Catalog AI safetynotice for more information.

Last updated

Was this helpful?