- Home
- Skills
- Rominirani
- Antigravity Skills
- Database Schema Validator
database-schema-validator_skill
- Python
103
GitHub Stars
1
Bundled Files
2 months ago
Catalog Refreshed
4 months ago
First Indexed
Readme & install
Copy the install command, review bundled files from the catalogue, and read any extended description pulled from the listing source.
Installation
Preview and clipboard use veilstrat where the catalogue uses aiagentskills.
npx veilstrat add skill rominirani/antigravity-skills --skill database-schema-validator- SKILL.md1.0 KB
Overview
This skill validates SQL schema files for compliance with internal safety, naming, and structural policies. It automates checks so schema changes are reviewed consistently and reliably before deployment. The skill reports clear error messages and suggests fixes when violations are found.
How this skill works
The skill runs a Python validator located at scripts/validate_schema.py against the provided SQL file and interprets the script's exit code and output. Exit code 0 indicates the schema passed all checks. Exit code 1 returns specific error messages printed by the validator, which the skill reports back with suggested remediation steps.
When to use it
- Before committing or merging SQL schema changes into version control.
- As part of CI pipelines to gate database migrations and DDL changes.
- When onboarding new database schemas to ensure consistency with team standards.
- Prior to running migrations in staging or production environments.
Best practices
- Do not rely on manual review; always run the validator to catch subtle policy violations.
- Keep SQL files small and focused so validator output maps easily to specific tables or statements.
- Address each reported error by following the suggested fix, then re-run the validator until it exits cleanly.
- Integrate the validator into pre-commit hooks or CI jobs to enforce policies automatically.
Example use cases
- Validate a new CREATE TABLE script to ensure table names use snake_case and include an id primary key.
- Scan migration files to detect and block unapproved DROP TABLE statements.
- Run automatic checks in a CI pipeline before merging database-related pull requests.
- Review third-party or legacy schema files for compliance before importing into a managed environment.
FAQ
It enforces three policies: no DROP TABLE statements, table names must be snake_case, and every table must have an id column declared as the PRIMARY KEY.
How do I run the check locally?
Execute the validator script against your SQL file: python scripts/validate_schema.py <path_to_sql_file>. The skill will interpret the script's exit code and output.