Skip to main content

tesserakit-sql

Lint SQL files and migrations into a statement and table catalog.

tessera-sql parses .sql files with lightweight heuristics (no database connection, no execution), builds a catalog of statements and declared tables, and flags high-signal migration-safety issues.

Lint SQL

tessera sql lint --input migrations/ --output ./out/sql_pack
tessera sql lint --input schema.sql --output ./out/sql_pack

Artifacts written:

statements.jsonl         one SqlStatement per parsed statement (kind, target, flags)
tables.jsonl             one SqlTable per CREATE TABLE (columns, primary-key flag)
index.md                 statement catalog
validation_report.md     safety findings
coverage_report.md       statement-kind distribution
tables.md                table catalog with columns and PK status

Lint rules

Query safety:

  • delete_without_where (error) — DELETE with no WHERE removes every row
  • update_without_where (warning) — UPDATE with no WHERE writes every row
  • select_star (info) — SELECT * couples the query to column shape

Migration safety (the costly, easy-to-miss class):

  • add_not_null_without_default (error) — ALTER TABLE ... ADD COLUMN ... NOT NULL with no DEFAULT rewrites the table and fails on existing rows
  • truncate_table (warning) — TRUNCATE wipes all rows and is often non-transactional / irreversible
  • drop_column (warning) — dropping a column is destructive and irreversible
  • rename_breaks_compatibility (warning) — RENAME breaks code referencing the old name; prefer add-new + backfill + drop-old
  • drop_without_if_exists (warning) — DROP without IF EXISTS fails if the object is absent
  • create_table_without_if_not_exists (info) — non-idempotent if the migration re-runs

Schema:

  • table_without_primary_key (warning) — a CREATE TABLE declares no PRIMARY KEY
  • no_statements — nothing parsed

Limitations (v0.1)

Parsing is heuristic: comments are stripped, statements are split on top-level semicolons (quote-aware), and classification is keyword/regex based. It is tuned for migration and schema files, not for validating arbitrary vendor SQL dialects.

Metadata

Release files for tesserakit-sql 0.4.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for tesserakit-sql 0.4.0
File Size Uploaded
tesserakit_sql-0.4.0.tar.gz 8.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for tesserakit-sql 0.4.0
File Interpreter ABI Platform
tesserakit_sql-0.4.0-py3-none-any.whl Python 3 none any Details

Total release size: 18.9 kB

Release files / tesserakit_sql-0.4.0.tar.gz

Download URL tesserakit_sql-0.4.0.tar.gz
Size 8.6 kB
Tags Source
SHA-256 checksum
How to use checksums
5272d4513c911ac956a3cd3e5553bd0cfb5ece8d7b6514fcb2d0b78acb4b276c
BLAKE2b-256 checksum
How to use checksums
da07f1020f9dbb230079260e09ecb2f6f615989568bcadbe9056da967ac26522
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.5

Release files / tesserakit_sql-0.4.0-py3-none-any.whl

Download URL tesserakit_sql-0.4.0-py3-none-any.whl
Size 10.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9f21cb70c7d261a31f98b678b60ea350d3e36ed80002b2daa16b68d8b72a50f4
BLAKE2b-256 checksum
How to use checksums
a45b12ce777a0dece28b6ab3a3230ae77b37f8c1bddc465d689cd51422d99b58
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.5

Release history Release notifications | RSS feed

This release

0.4.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page