Skip to content
For the complete documentation index, see llms.txt. This page is also available as Markdown.

SQL query

Query a data connection, or a dataframe from another block, with SQL.

A query block runs a query and saves the result as a dataframe, which the blocks after it can use. You don't need to install a database driver or write connection code.

Querying a data connection

Choose one of the project's data connections, such as Snowflake or PostgreSQL, and write your SQL.

For a Weaviate vector database, write a GraphQL query instead.

Querying a dataframe

You can also run SQL directly on a pandas dataframe. Connect a Python block that creates the dataframe to the query block, and query the dataframe as if it were a table.

This is useful for quick aggregations and joins on data you've already loaded.

Using the result

The query's result is saved as a dataframe, which you can use in Python or R blocks connected after it. See Language interoperability.

Last updated

Was this helpful?