- Home
- Skills
- Ehtbanton
- Claudeskillsrepo
- Sql Schema Generator
sql-schema-generator_skill
- TypeScript
0
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 ehtbanton/claudeskillsrepo --skill sql-schema-generator- SKILL.md12.3 KB
Overview
This skill generates complete, production-ready SQL database schema files for PostgreSQL, MySQL, or SQLite. It produces normalized tables, relationships, indexes, constraints, and optional triggers following common naming and data-type best practices. Output defaults to PostgreSQL unless another dialect is requested. Files are organized with sensible naming so they can be applied directly with a migration tool or database client.
How this skill works
On trigger phrases like "create SQL schema" or "generate database schema", the skill builds a full schema based on the requested domain and dialect. It creates primary and foreign keys, unique and check constraints, recommended indexes, standard timestamp columns, and optional features such as full-text search and updated_at triggers. The generator validates common rules (primary keys, ON DELETE behavior, index placement) before producing the final .sql output.
When to use it
- Start of a new project that needs a canonical relational model
- Designing or standardizing schemas for PostgreSQL, MySQL, or SQLite
- Generating baseline schemas for testing, CI, or migrations
- Converting a domain description (e.g., e-commerce, SaaS, blog) into SQL
- Adding best-practice indexes, constraints, or triggers to an existing design
Best practices
- Use plural, snake_case table names and singular, snake_case column names
- Prefer BIGSERIAL/UUID for primary keys and matching types for foreign keys
- Add created_at, updated_at, and optional deleted_at for soft deletes
- Place indexes on foreign keys, unique lookup columns, and frequent filters
- Add check constraints for domain validation and explicit ON DELETE actions
- Use JSONB or JSON for flexible metadata and enum types for constrained states
Example use cases
- Generate a PostgreSQL auth schema with users, sessions, and password resets
- Create an e-commerce schema: customers, products, categories, orders, items
- Design a SaaS multi-tenant schema with organizations, projects, and audit logs
- Produce a blog schema with posts, comments, tags, and search vector support
- Build inventory or booking schemas including stock movements and availability
FAQ
PostgreSQL (default), MySQL, and SQLite are supported, with syntax and type adjustments per dialect.
Does the skill add triggers or full-text search support?
Yes—optional patterns include updated_at triggers and PostgreSQL full-text search with tsvector and GIN indexes.