databricks-labs-lsql
Lightweight stateless SQL execution for Databricks with minimal dependencies
Decision gist · record as of 2026-08-14
Yes, if you are building serverless or containerized applications on Databricks and need lightweight SQL execution without the overhead of the full SQL Connector. The low install friction, active maintenance, and lack of known vulnerabilities make it a safe choice. However, verify the unclear license terms before committing to a production deployment, and confirm that the REST-based result fetching meets your performance requirements if you are moving large datasets.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Databricks workspace credentials and a running warehouse; WorkspaceClient must be authenticated via environment or configuration.
- Low install friction with a pure-Python wheel and only three runtime dependencies.
- Actively maintained as of 2026-08-03 with recent releases, though marked as Alpha status.
License · maintenance · safety
(unclear) — License treatment is unclear—no SPDX identifier or raw license text is available in the metadata. Verify the actual license terms before use in proprietary or commercial projects.
last release 2026-03-23 (144 days) · last repo commit 2026-08-03 · 36 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 5,245,959 downloads/mo, #2,129 on PyPI
Alternatives
Verify before relying
from databricks.sdk import WorkspaceClient
from databricks.labs.lsql.core import StatementExecutionExt
w = WorkspaceClient()
see = StatementExecutionExt(w)
for row in see.fetch_all('SELECT * FROM table LIMIT 10'):
print(row)- Whether the unclear license is compatible with your project's legal requirements.
- Performance characteristics when fetching hundreds of megabytes or gigabytes of data compared to Databricks SQL Connector.
- Stability guarantees beyond Alpha status and whether breaking changes are expected.
What it is and what it does
Databricks Labs LSQL is a lightweight wrapper around the Databricks Python SDK that simplifies executing SQL queries and fetching results without maintaining a persistent connection. It is designed for stateless, short-lived applications—such as serverless functions—where minimal dependencies and fast startup time matter more than high-throughput data transfer. The package provides methods to execute queries, iterate over results as Row-like objects, fetch single records or values, and map results to strongly-typed Python dataclasses.
The library abstracts over multiple SQL backends (REST-based statement execution, Databricks Connect, runtime execution, and mocks for testing) so you can swap implementations without changing application code. It trades the efficient binary serialization and low-latency result fetching of the full Databricks SQL Connector for a smaller footprint and simpler dependency chain, making it well-suited for containerized or Lambda-like deployments where startup overhead is a constraint.
Use it for
- Execute ad-hoc SQL queries from AWS Lambda or Azure Functions without heavy client libraries.
- Fetch a single aggregated value (count, sum, max) from a Databricks table in a lightweight script.
- Map query results directly to Python dataclasses for type-safe data handling in microservices.
- Unit test code that interacts with Databricks SQL using the MockBackend without a live warehouse.
- Build CLI tools or batch jobs that run SQL statements and iterate over results with minimal startup latency.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you are building serverless or containerized applications on Databricks and need lightweight SQL execution without the overhead of the full SQL Connector.
The low install friction, active maintenance, and lack of known vulnerabilities make it a safe choice. However, verify the unclear license terms before committing to a production deployment, and confirm that the REST-based result fetching meets your performance requirements if you are moving large datasets.
Install
databricks-labs-lsql on PyPI
Before you install
Low install friction with a pure-Python wheel and only three runtime dependencies. Actively maintained as of 2026-08-03 with recent releases, though marked as Alpha status.
Requires Databricks workspace credentials and a running warehouse; WorkspaceClient must be authenticated via environment or configuration.
License in practice
License treatment is unclear—no SPDX identifier or raw license text is available in the metadata. Verify the actual license terms before use in proprietary or commercial projects.
Quickstart
from databricks.sdk import WorkspaceClient
from databricks.labs.lsql.core import StatementExecutionExt
w = WorkspaceClient()
see = StatementExecutionExt(w)
for row in see.fetch_all('SELECT * FROM table LIMIT 10'):
print(row)
Verify before relying
- Whether the unclear license is compatible with your project's legal requirements.
- Performance characteristics when fetching hundreds of megabytes or gigabytes of data compared to Databricks SQL Connector.
- Stability guarantees beyond Alpha status and whether breaking changes are expected.
Package facts
| License | Not declared unclear |
| Python support | Supports the current Python release <3.15,>=3.10 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 3 packagesdatabricks-labs-blueprintdatabricks-sdksqlglot |
| Maintenance | Actively maintained 144 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 5,245,959 / month, #2,129 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 3 - AlphaLicense :: Other/Proprietary LicenseProgramming Language :: PythonProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: Implementation :: CPythonProgramming Language :: Python :: Implementation :: PyPy |
Evidence: databricks_labs_lsql-0.17.0-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “databricks sql execution python”
- databricks-labs-lsqlExecutes SQL queries against Databricks through the Python SDK with…
- databricks-sql-connectorA Python client library that connects to Databricks clusters and SQL…
- dbt-databricksdbt-databricks is a dbt adapter that enables data transformation…
Give your agent the search over MCP, or paste the wish link into any chat.
More Database packages
psycopg2-binary is a PostgreSQL database adapter for Python that implements the DB API 2.0 specification, enabling Python applications to connect to and query PostgreSQL databases with thread-safe concurrent operations.
Python client library for connecting to and executing commands against Redis key-value stores, supporting both synchronous and asynchronous operations.
Install it if your application needs to interact with Redis; the only prerequisite is a running Redis server instance.
YDB Python SDK is the official client library for connecting to and querying YDB databases from Python applications.
Install it if you need to connect Python applications to YDB databases.
Connects Python applications to Snowflake data warehouses using the DB API 2.0 specification, enabling SQL queries, data transfers, and warehouse operations.
sqlparse tokenizes SQL text into a tree of statements, clauses, and expressions, and provides functions to split scripts, format queries, and inspect parsed tokens without validating dialect or syntax.
Install it if you need to manipulate, format, or analyze SQL text programmatically.
Provides base adapter protocols and shared functionality that database adapters use to integrate with dbt-core, handling connections, dialect translation, relation caching, and core interface management.
See also databricks-sql · databricks-labs-blueprint · databricks-sql-connector · databricks-sqlalchemy · databricks-labs-remorph · dbt-databricks · sqlalchemy-databricks · dbl-discoverx · databricks-labs-dqx · dbldatagen