Skip to content
cccskills
FreePublished on GitHub

drizzle-schema-architect

Generates strictly typed Drizzle ORM schemas for PostgreSQL with indexes, foreign keys, and Zod schema deduction.

The English summary is being prepared. Showing the original description.

Works withPostgreSQL
See how to install

Files included (1)

  • SKILL.md1.9 KB

SKILL.md (original)

Review the instructions the agent will receive before you install.

Drizzle Schema Architect

Core Principles

  1. Strict Typing: All table columns must be explicitly typed. Do not rely on loose implicit types.
  2. PostgreSQL Focus: Use pg-specific column types (e.g. pgTable, uuid, timestamp, varchar, integer).
  3. Zod Validation Integration: Always output Zod schemas inferred from Drizzle schemas using drizzle-zod's createInsertSchema and createSelectSchema.

Schema Guidelines

  • Primary Keys: Prefer UUIDs generated by gen_random_uuid() or autoincrementing integers depending on the table volume.
  • Indices: Declare explicit indexes on foreign key columns and query filters.
  • Dates: Always store timestamps using timestamp('created_at', { withTimezone: true, mode: 'date' }).defaultNow().notNull().

Example Schema Pattern

import { pgTable, uuid, varchar, timestamp, index } from 'drizzle-orm/pg-core';
import { createInsertSchema, createSelectSchema } from 'drizzle-zod';

export const users = pgTable('users', {
  id: uuid('id').defaultRandom().primaryKey(),
  email: varchar('email', { length: 255 }).notNull().unique(),
  name: varchar('name', { length: 255 }),
  createdAt: timestamp('created_at', { withTimezone: true, mode: 'date' }).defaultNow().notNull(),
}, (table) => [
  index('email_idx').on(table.email)
]);

export const insertUserSchema = createInsertSchema(users);
export const selectUserSchema = createSelectSchema(users);

Reviews

No reviews yet. Tell others what you thought.

Comments

No login needed. Share how it worked for you, ask a question, or note where it did not run.

No comments yet. Be the first to write one.

Comments are published right away. Do not include personal information such as email addresses or phone numbers. Up to 2 URLs.

0 / 1,000 characters

This form is protected by reCAPTCHA, and the Google Privacy Policy and Terms of Service apply.

More skills from this repository

Use when adding monitoring, metrics, logging, or tracing to Spring AI or LLM integration code. Covers token tracking, latency measurement, cost estimation, and prompt/response logging. Use when user mentions AI monitoring, token costs, or LLM observability.

The English summary is being prepared. Showing the original description.

lgzarturo/springboot-course3Updated Oct 20, 2026

Provides expert knowledge for building modern native Android apps using Kotlin, Jetpack Compose, Material Design 3, MVI architecture, Hilt dependency injection, and Media3/ExoPlayer.

The English summary is being prepared. Showing the original description.

lgzarturo/springboot-course3Updated Oct 20, 2026

Design, implement, review, and audit Android Jetpack Compose UI/UX for phone interfaces. Use when a request concerns concrete Compose layout, components, interaction, accessibility, or visual behavior. Do not activate for framework or dependency presence alone; non-UI Android work is excluded.

The English summary is being prepared. Showing the original description.

lgzarturo/springboot-course3Updated Oct 20, 2026

Provides expert knowledge for designing, implementing, and managing REST API versioning strategies with deprecation workflows.

The English summary is being prepared. Showing the original description.

lgzarturo/springboot-course3Updated Oct 20, 2026

astro

Free

Provides expert knowledge for building Astro 5+ sites with Islands Architecture, Content Collections, TypeScript, and performance-first rendering strategies.

The English summary is being prepared. Showing the original description.

lgzarturo/springboot-course3Updated Oct 20, 2026

Audits token storage mechanisms to prevent XSS-based JWT theft.

The English summary is being prepared. Showing the original description.

lgzarturo/springboot-course3Updated Oct 20, 2026

See all skills by lgzarturo

Report a problem with this skill