{"categories":[{"label":"Utilities","url":"https://skillfed.io/packages/category/utilities/5"},{"label":"Testing","url":"https://skillfed.io/packages/category/software-development-testing/3"},{"label":"Database","url":"https://skillfed.io/packages/category/database/3"},{"label":"Quality Assurance","url":"https://skillfed.io/packages/category/software-development-quality-assurance/2"},{"label":"Database Engines/Servers","url":"https://skillfed.io/packages/category/database-database-engines-servers"}],"enrichment":{"capability":"PgSanity validates PostgreSQL SQL syntax by wrapping the ecpg parser, reporting syntax errors with line numbers and exit codes suitable for CI/CD and pre-commit hooks.","skillfed_tags":["sql-linting","postgres","ci-cd"],"use_cases":["Validate SQL files in CI/CD pipelines before deployment to catch syntax errors early","Use as a pre-commit hook to prevent malformed SQL from being committed to version control","Batch-check multiple SQL files with find and xargs to audit a codebase for syntax problems","Integrate into development workflows to catch typos and dialect mismatches interactively via stdin","Enforce SQL standards in teams by running validation on all .sql files in a repository"],"what_it_does":"PgSanity is a command-line tool and Python package that checks PostgreSQL SQL files for syntax errors. It works by converting SQL into a C file with embedded SQL, then running it through the ecpg preprocessor\u2014the same parser PostgreSQL uses internally\u2014to catch syntax problems before deployment. The tool accepts filenames as arguments, reads from stdin if none are provided, and exits with status 0 for valid SQL or 1 when errors are found.\n\nThe package requires ecpg (part of PostgreSQL development libraries) to be installed on your system, plus Python 3.9 or later. It integrates well with Unix pipelines and find/xargs workflows, and can be used as a pre-commit hook for automated validation in version control. Error messages come directly from ecpg and include line numbers, though the reported line may point to the statement after the actual error.","worth_installing":"Yes, if you need PostgreSQL SQL syntax validation in CI/CD or pre-commit workflows and have ecpg available on your system. The package is lightweight, permissively licensed, and well-integrated with Unix tooling. The aging maintenance status is not a blocker for a stable, narrow-purpose tool, but verify that ecpg is available in your deployment environment before committing to it."},"id":"pgsanity","links":{"html":"https://skillfed.io/packages/pgsanity","md":"https://skillfed.io/packages/pgsanity.md","pypi":"https://pypi.org/project/pgsanity/"},"maintenance":{"status":"aging"},"meta":{"latest_release":"2025-09-20","license_spdx":"MIT","license_treatment":"permissive","name":"pgsanity","python_support":"supports_current","summary":"Check syntax of sql for PostgreSQL"},"popularity":{"monthly_downloads":537526,"position":6119,"tier":"top_15000"},"security":{"n_vulnerabilities":0},"version":"0.3.0"}
