drizzle
LobeHub Drizzle ORM schema and query style. Use for pgTable schemas, indexes, joins, inferred types, db.select/db.query, schema fields, foreign keys, junction tables, or postgres query patterns.
npx skills add lobehub/lobehub --skill drizzle --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
# Drizzle ORM Schema Style Guide > **Adding a Model or Repository?** Ship a sibling test in the same PR — every new > file under `packages/database/src/models/**` or `src/repositories/**` needs a > matching `__tests__/<name>.test.ts`. See the **testing** skill > (`.agents/skills/testing/references/db-model-test.md`) for the `getTestDB()` > integration pattern, user-isolation tests, the BM25 `describe.skipIf(!isServerDB)` > guard, and schema gotchas. CI's coverage patch gate won't reliably catch a brand-new > untested file, so this is on you. ## Configuration - Config: `drizzle.config.ts` - Schemas: `packages/database/src/schemas/` - Migrations: `packages/database/migrations/` - Dialect: `postgresql` with `strict: true` ## Helper Functions Location: `packages/database/src/schemas/_helpers.ts` - `timestamptz(name)`: Timestamp with timezone - `createdAt()`, `updatedAt()`, `accessedAt()`: Standard timestamp columns - `timestamps`: Object with all three for easy spread ## Naming Conventions - **Tables**: Plural snake\_case (`users`, `session_groups`) - **Columns**: snake\_case (`user_id`, `created_at`) - **New tables**: Check nearby existing tables before naming a new one. Preserve the
- Configuration
- Helper Functions
- Naming Conventions
- Column Definitions
- Primary Keys
- Foreign Keys
- Timestamps
- Optional and Undefined Values
- Database Enums
- Field Descriptions
- JSONB Types
- Indexes
- Type Inference
- Example Pattern
What does the drizzle skill do?
LobeHub Drizzle ORM schema and query style. Use for pgTable schemas, indexes, joins, inferred types, db.select/db.query, schema fields, foreign keys, junction tables, or postgres query patterns.
How do I install it?
Run `npx skills add lobehub/lobehub --skill drizzle --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From lobehub/lobehub, a repository with 81,252 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.