Schema Badge Generator
Add a live schema health badge to your GitHub README. It updates automatically when your schema changes.
1. Enter your schema URL
Link to a raw SQL file (e.g., from GitHub raw). The file must be publicly accessible.
2. Preview
Enter a URL above to see your badge
3. Copy to README
[](https://schemalens.tech)
Example Badges
PostgreSQL Sample Schema
?url=https://raw.githubusercontent.com/.../schema.sql
Flat-Square Style
?url=...&style=flat-square
How It Works
- Fetches your SQL schema from the provided URL
- Parses table definitions, indexes, and constraints
- Calculates a health score (0-100) based on best practices
- Returns an SVG badge with table count and letter grade
- Updates every 5 minutes — no manual refresh needed
Health Score Criteria
| Factor | Impact |
|---|---|
| PRIMARY KEY coverage | Up to +10 points |
| FOREIGN KEY relationships | Up to +10 points |
| Index coverage | Up to +10 points |
| Reserved word usage | -2 points each |
| Schema complexity (>50 tables) | -5 points |