--- id: databricks-labs-lsql version: "0.17.0" license: unclear license_treatment: unclear maintenance: active --- # databricks-labs-lsql — Lightweight stateless SQL execution for Databricks with minimal dependencies License: unclear · Maintenance: active · Downloads: 5.2M/mo ## 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 above — verify before relying. Executes SQL queries against Databricks through the Python SDK with minimal dependencies, returning results as iterators or single values without requiring a persistent connection. 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 pip install databricks-labs-lsql uv add databricks-labs-lsql poetry add databricks-labs-lsql ## Installing databricks-labs-lsql 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. 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) Requires Databricks workspace credentials and a running warehouse; WorkspaceClient must be authenticated via environment or configuration. 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_current - Install friction: low - Maintenance: active - Downloads: 5.2M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags databricks sql execution python, lightweight sql queries databricks, stateless sql client databricks, databricks sdk sql wrapper, sql result fetching databricks, serverless sql databricks, databricks statement execution, databricks, serverless, sql-execution [View on SkillFed](https://skillfed.io/packages/databricks-labs-lsql) · [View on PyPI](https://pypi.org/project/databricks-labs-lsql/)