SQL job pack for Tessera: lint SQL files/migrations into a statement and table catalog.
Project description
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) —DELETEwith noWHEREremoves every rowupdate_without_where(warning) —UPDATEwith noWHEREwrites every rowselect_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 NULLwith noDEFAULTrewrites the table and fails on existing rowstruncate_table(warning) —TRUNCATEwipes all rows and is often non-transactional / irreversibledrop_column(warning) — dropping a column is destructive and irreversiblerename_breaks_compatibility(warning) —RENAMEbreaks code referencing the old name; prefer add-new + backfill + drop-olddrop_without_if_exists(warning) —DROPwithoutIF EXISTSfails if the object is absentcreate_table_without_if_not_exists(info) — non-idempotent if the migration re-runs
Schema:
table_without_primary_key(warning) — aCREATE TABLEdeclares noPRIMARY KEYno_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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file tesserakit_sql-0.4.0.tar.gz.
File metadata
- Download URL: tesserakit_sql-0.4.0.tar.gz
- Upload date:
- Size: 8.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5272d4513c911ac956a3cd3e5553bd0cfb5ece8d7b6514fcb2d0b78acb4b276c
|
|
| MD5 |
bbaa0a5606d5ca43c937ecedf978301e
|
|
| BLAKE2b-256 |
da07f1020f9dbb230079260e09ecb2f6f615989568bcadbe9056da967ac26522
|
File details
Details for the file tesserakit_sql-0.4.0-py3-none-any.whl.
File metadata
- Download URL: tesserakit_sql-0.4.0-py3-none-any.whl
- Upload date:
- Size: 10.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9f21cb70c7d261a31f98b678b60ea350d3e36ed80002b2daa16b68d8b72a50f4
|
|
| MD5 |
d391efdfd9ea8fa53f45e983ff1a54c3
|
|
| BLAKE2b-256 |
a45b12ce777a0dece28b6ab3a3230ae77b37f8c1bddc465d689cd51422d99b58
|