Skip to main content
LanceDB Enterprise supports SQL through an Arrow Flight SQL endpoint. This reference covers statement syntax, data types and expressions. To set up a client and run your first query, see SQL.

The dialect

LanceDB uses Apache DataFusion for SQL planning and execution. These pages describe LanceDB’s supported statements and extensions. DataFusion’s reference is useful for expression syntax, but does not establish that every DataFusion statement or feature is exposed by LanceDB.

Connecting

Use Python’s execute_query or a Flight SQL client after configuring the Enterprise connection. TypeScript applications use a Flight SQL client for SQL queries.
SQL results arrive as Arrow record batches. Iterating over the reader avoids collecting the entire result in application memory. See Read and manage results for more.

Usage

The endpoint executes one statement per request and is meant for the queries and DDL/DML pages below. Reach for the SDKs instead for table-management operations that have no SQL form, such as a merge insert. See What SQL cannot do.

Reference

DDL, by object

DML

DQL

SQL limitations and alternatives

See Limits for the bounds these pages enforce.