Sandbox — LSD is in active testing. All systems operational·payments are test-mode (no real charges).
Overview Use Cases News Docs Tool Store Support Community Get LSD
All docs
Source· classmethod

Source.sql

builds a sql source from a connection and a query

Python
sql(db, query: str) -> Source

Returns Source — a SQL source that runs the query against db

Parameters#

name type default description
db str a connection string / DSN, e.g. "sqlite:///mine.db"
query str the SQL query whose result set becomes the Table

Example#

Python
from lsdtools import Source

Source.sql("sqlite:///mine.db", "select * from holes")

Notes#

The query's result set is read into a Table when you call read(). A SQL source resolves to no files, so paths() returns [].

See also#

API: file · of · read · paths

Guides: Load steps

By LSD Team · Last updated Jul 17, 2026 Ask on Discord View as Markdown