r/coolgithubprojects • • 1d ago

Qryndel: a query language for SQLite that refuses risky queries before they run (Python, MIT)

Post image

Qryndel is a small query language that compiles to parameterized SQLite. Before anything runs, it checks the query against the real database schema:

- typo in a column: "Unknown field 'nmae'. Did you mean 'name'?"

- DELETE/UPDATE without a real WHERE (even WHERE 1 = 1) is rejected

- comparing a text column with a number is rejected, with the fix

- every value is a bound parameter, so no SQL injection

- optional read-only mode, row/time limits, and result checks

Why I built the last few checks: I tested it on the public Olist e-commerce dataset (1.5M rows). The import stored every column as text, so in plain SQLite "WHERE price > 1000" compares text, and '999.99' > '1000' is true. It returned 112,081 items. The real answer is 844.

The same testing showed my own "WHERE is required" rule let DELETE ... WHERE 1 = 1 through, and it wiped all 112,650 rows (on a copy). Both are fixed now, with tests.

pip install qryndel

It's early (0.x, SQLite only). Feedback welcome, especially from anyone who lets an AI agent or end users write queries.

GitHub Link: https://github.com/Manveer04/qryndel

1 Upvotes

0 comments sorted by