10 stable releases
Uses new Rust 2024
| 1.9.0 | Jul 31, 2025 |
|---|---|
| 1.8.0 | Jul 5, 2025 |
| 1.7.0 | Jun 26, 2025 |
| 1.5.0 | Apr 28, 2025 |
| 0.1.0 | Apr 2, 2025 |
#1711 in Database interfaces
105 downloads per month
29KB
673 lines
sql-fingerprint
A SQL fingerprinter.
sql-fingerprint reduces SQL queries to recognizable fingerprints for easier comparison. The goal is to provide readable traces from queries captured during tests, so that changes can be tracked over time.
For example, given a query like:
SELECT name, age /* computed */ FROM cheeses WHERE origin = 'France'
…it will output a fingerprint like:
SELECT ... FROM cheeses WHERE ...
The fingerprinting process applies these changes:
- Comments are dropped.
- Whitespace is normalized to a single space.
- Identifier and value lists are reduced to '...'.
- Identifiers consisting of letters, numbers, and underscores have any quoting removed.
- Savepoint IDs are replaced with 's1', 's2', etc.
- Unparsable SQL is returned unchanged.
Dependencies
~3MB
~64K SLoC