Enterprise-only LanceDB Enterprise comes with an SQL endpoint that can be used for analytical queries and data exploration. The SQL endpoint is designed to be compatible with the Arrow FlightSQL protocol, which allows you to use any Arrow FlightSQL-compatible client to query your data.Documentation Index
Fetch the complete documentation index at: https://lancedb-bcbb4faf-docs-namespace-typescript-examples.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
Installing the client
There are Flight SQL clients available for most languages and tools. If you find that your preferred language or tool is not listed here, please reach out to us and we can help you find a solution. The following examples demonstrate how to install the Python and TypeScript clients.Usage
LanceDB uses the powerful DataFusion query engine to execute SQL queries. This means that you can use a wide variety of SQL syntax and functions to query your data. For more detailed information on the SQL syntax and functions supported by DataFusion, please refer to the DataFusion documentation.Setting Up the Client
Establish a connection to your LanceDB Enterprise SQL endpoint using your preferred FlightSQL client:Executing a Query
Run SQL queries against your LanceDB tables. Different clients may handle the FlightSQL protocol differently:Processing Results
Handle the query results returned by your FlightSQL client:Inspecting query plans
The SQL endpoint runs queries through DataFusion, which means DataFusion’sEXPLAIN family of statements is available unchanged. They’re the SQL counterpart of the Python/TypeScript explain_plan and analyze_plan methods and are useful for the same things: confirming index usage, checking filter pushdown, and finding the slow operator in a query that’s underperforming.
| Statement | What it returns |
|---|---|
EXPLAIN <query> | Logical and physical plan, without executing the query. |
EXPLAIN ANALYZE <query> | Executes the query and annotates each operator with runtime metrics (rows, timing). |
EXPLAIN VERBOSE <query> | Adds intermediate optimizer plans on top of EXPLAIN. |
plan_type and plan columns:
LanceScan, ScalarIndexQuery, KNNVectorDistance, ANNIvfPartition, and so on), so the same reasoning about index coverage and filter pushdown applies — just read the plan from a SQL client instead of a query builder.