sqlvalidator
SQL queries formatting, syntactic and semantic validation
Decision gist · record as of 2026-08-14
Yes, if you need lightweight SELECT-only SQL formatting and basic semantic validation in a Python project and can accept that the package is dormant. No, if you need support for INSERT/UPDATE/DELETE, expect regular maintenance, or require validation of complex or dialect-specific SQL. The low install friction and permissive license make it low-risk to try, but the Alpha status and dormant maintenance mean you should not rely on it for critical workflows.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Only SELECT statements are supported; INSERT, UPDATE, DELETE, and other statement types will not parse or validate.
- Low install friction with no runtime dependencies.
- Maintenance is dormant—last release was 2022-12-25 and last commit 2024-03-14.
License · maintenance · safety
MIT (permissive) — MIT license permits unrestricted use, modification, and distribution with minimal obligations—suitable for both open-source and proprietary projects.
last release 2022-12-25 (1328 days) · last repo commit 2024-03-14 · 74 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 162,127 downloads/mo, #10,615 on PyPI
Alternatives
Verify before relying
pip install sqlvalidator
import sqlvalidator
formatted = sqlvalidator.format_sql("SELECT * FROM table")
sql_query = sqlvalidator.parse("SELECT col FROM table")
if not sql_query.is_valid():
print(sql_query.errors)- Whether validation rules (missing columns, function existence, aggregation correctness) work reliably on complex queries or only simple cases.
- How well the formatter handles edge cases, dialect-specific syntax, or non-standard SQL extensions.
- Whether the package will receive bug fixes or security updates given the dormant maintenance status.
What it is and what it does
sqlvalidator is a Python tool for formatting and validating SQL SELECT statements. It offers both a command-line interface and a Python API to reformat SQL code to a consistent style, check whether files conform to that style (useful in CI/CD), and validate SELECT queries for semantic correctness—such as detecting missing columns, invalid function calls, and type mismatches in expressions. The validation is schemaless, meaning it does not require a live database connection or schema definition.
The package has no runtime dependencies and installs easily, but it is in Alpha and has been dormant since its latest release. It only handles SELECT statements; INSERT, UPDATE, DELETE, and other SQL operations are out of scope. The author has stated they want to retain full control over the project direction and do not guarantee acceptance of pull requests, so community-driven improvements are unlikely.
Use it for
- Enforce consistent SQL formatting in Python codebases that embed SQL strings, using the CLI in pre-commit hooks or CI pipelines.
- Catch common SQL errors (missing columns, invalid aggregations, type mismatches) in SELECT queries without needing a live database.
- Reformat ad-hoc or poorly formatted SQL strings in Python code to a standard style for readability.
- Validate SQL queries in data-processing scripts or ETL tools before execution.
- Integrate SQL validation into linting workflows for projects that generate or manipulate SELECT statements programmatically.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you need lightweight SELECT-only SQL formatting and basic semantic validation in a Python project and can accept that the package is dormant.
No, if you need support for INSERT/UPDATE/DELETE, expect regular maintenance, or require validation of complex or dialect-specific SQL. The low install friction and permissive license make it low-risk to try, but the Alpha status and dormant maintenance mean you should not rely on it for critical workflows.
Install
sqlvalidator on PyPI
Before you install
Low install friction with no runtime dependencies. Maintenance is dormant—last release was 2022-12-25 and last commit 2024-03-14. The project is marked Alpha and the author explicitly reserves control over contributions, so expect limited updates.
Only SELECT statements are supported; INSERT, UPDATE, DELETE, and other statement types will not parse or validate.
License in practice
MIT license permits unrestricted use, modification, and distribution with minimal obligations—suitable for both open-source and proprietary projects.
Quickstart
pip install sqlvalidator
import sqlvalidator
formatted = sqlvalidator.format_sql("SELECT * FROM table")
sql_query = sqlvalidator.parse("SELECT col FROM table")
if not sql_query.is_valid():
print(sql_query.errors)
Verify before relying
- Whether validation rules (missing columns, function existence, aggregation correctness) work reliably on complex queries or only simple cases.
- How well the formatter handles edge cases, dialect-specific syntax, or non-standard SQL extensions.
- Whether the package will receive bug fixes or security updates given the dormant maintenance status.
Package facts
| License | MIT permissive |
| Python support | Not specified |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | None |
| Maintenance | Dormant 1,328 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 162,127 / month, #10,615 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 3 - AlphaIntended Audience :: DevelopersProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9 |
Evidence: sqlvalidator-0.0.20-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “sql validator”
- sqlvalidatorFormats, validates, and checks SQL SELECT statements for syntactic…
- squawk-cliLinter that analyzes PostgreSQL migrations and SQL statements to…
- acryl-sqlglotParses, transpiles, and optimizes SQL across 23 different dialects…
Give your agent the search over MCP, or paste the wish link into any chat.
More Quality Assurance packages
Coverage.py measures which lines of Python code are executed during test runs, reporting coverage percentages and identifying untested code paths.
Install it if you want to measure test completeness or enforce coverage thresholds in your project.
Ruff is a Python linter and code formatter written in Rust that combines linting, formatting, and code fixing into a single tool, replacing Flake8, Black, isort, and related utilities.
Pexpect spawns and controls interactive console applications by sending input and matching output patterns, automating tasks that would otherwise require manual interaction.
Black reformats Python source code to a consistent style by parsing entire files and rewriting them according to an opinionated, deterministic set of rules, eliminating manual formatting decisions.
pytest-xdist distributes pytest tests across multiple CPU cores or machines to speed up test execution, with the simplest usage being `pytest -n auto` to spawn workers equal to available CPUs.
Install it if your test suite takes long enough that parallelization would save meaningful time.
Validates AWS CloudFormation templates in YAML or JSON format against resource provider schemas and best practices, checking property values and configuration correctness.
Install it if you work with CloudFormation templates.
See also sql-formatter · syntaqlite · sqllineage · sqlparse · jinjasql2 · collate-sqllineage · sqlglot · sql-metadata · pgsanity · moz-sql-parser