This release is a pre-release and may not be stable for production use.
rbtr-lang-sql
SQL support for rbtr. Optional plugin — install with
pip install rbtr[sql].
What it ingests
One chunk per top-level SQL statement (plus one per CTE). SQL has no classes or functions in the object-oriented sense and no native import mechanism, so statements map onto rbtr's capture conventions by shape: structural definitions become classes, routines and executable statements become functions, and standalone named objects become variables.
- Structural definitions —
CREATE TABLE,CREATE VIEW/MATERIALIZED VIEW,CREATE TYPE ... AS ENUM/ composite types. - Routines & statements —
CREATE FUNCTION,SELECT,INSERT,UPDATE,DELETE,WITH ... AS(CTEs),ALTER/DROP. - Named objects —
CREATE INDEX/SEQUENCE/SCHEMA/ROLE/TRIGGER.
CREATE PROCEDURE and PRAGMA are not extracted — the generic grammar
has no node for them.
Chunks produced
name is the statement's target object; scope is always empty (SQL
has no nesting). A statement with no nameable target (SELECT 1, a
UNION) carries no name.
CREATE TABLE users (id INT, name TEXT); -- class "users"
CREATE VIEW active AS SELECT * FROM users; -- class "active"
CREATE TYPE mood AS ENUM ('sad','happy'); -- class "mood"
CREATE FUNCTION add(a INT) ... -- function "add"
SELECT id, name FROM users; -- function "users"
INSERT INTO logs (msg) VALUES ('hi'); -- function "logs"
WITH ranked AS (...) SELECT ... -- function "ranked" (per CTE)
CREATE INDEX idx_name ON users (name); -- variable "idx_name"
CREATE SEQUENCE order_id START 1; -- variable "order_id"
Embedded / injected chunks
None. SQL does not embed other languages.
Grammar & dependencies
Uses the tree-sitter-sql grammar (one generic grammar for all
dialects). No dependency on other language plugins.
Metadata
Release files for rbtr-lang-sql 2026.9.0.dev1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| rbtr_lang_sql-2026.9.0.dev1.tar.gz | 12.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| rbtr_lang_sql-2026.9.0.dev1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 35.0 kB
Release files / rbtr_lang_sql-2026.9.0.dev1.tar.gz
| Download URL | rbtr_lang_sql-2026.9.0.dev1.tar.gz |
|---|---|
| Size | 12.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
68e66f060a7501e57da27dd0f3366ef64a2313433f5a20b23c94dab5137a30c7
|
|
BLAKE2b-256 checksum How to use checksums |
191e97cc9931d11ef521195ef7b6bba5710f830fece189e0178fa6cc4f3f86df
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.13 {"installer":{"name":"uv","version":"0.12.13","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / rbtr_lang_sql-2026.9.0.dev1-py3-none-any.whl
| Download URL | rbtr_lang_sql-2026.9.0.dev1-py3-none-any.whl |
|---|---|
| Size | 22.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
3596349e009f0f0ffbf308f74a410274410c20eee53808a31201a2d9ac3f9c94
|
|
BLAKE2b-256 checksum How to use checksums |
4ceb44e2b38539d9fa210ddfc9f1ef8371471c3586942e152edbfa63b0d70348
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.13 {"installer":{"name":"uv","version":"0.12.13","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|