$npx skillfedfor your agent

Drizzle

This skill covers Drizzle ORM usage in the `@internal/dashboard-agent-db` package, the agent's dedicated conversation store. Learn schema definition with pg-core, postgres.js driver configuration, drizzle-kit migrations, and the repo's access-pattern query layer enforcing tenant scoping and foreign-key-free design. Drizzle is isolated from the main Prisma database.

Drizzle helps you write and modify ORM schemas and queries for the dashboard agent's conversation datastore.

AI-generated summary based on this skill's SKILL.md

15,775 1,377 Apache-2.0updated by triggerdotdev

Decision gist · record as of 2026-07-27

Drizzle helps you write and modify ORM schemas and queries for the dashboard agent's conversation datastore. This skill covers Drizzle ORM usage in the `@internal/dashboard-agent-db` package, the agent's dedicated conversation store. Learn schema definition with pg-core, postgres.js driver configuration, drizzle-kit migrations, and the repo's access-pattern query layer enforcing tenant scoping and foreign-key-free design. Drizzle is isolated from the main Prisma database.

manual: git clone https://github.com/triggerdotdev/trigger.dev → cp -r trigger.dev/.claude/skills/drizzle ~/.claude/skills/drizzle
.claude/skills/drizzle/SKILL.md · version 50aa5c7a

Use it when

  • Drizzle migrations use drizzle-kit.
  • Drizzle's postgres.js setup requires instantiating a postgres client with pooler-safe options.

Verify before relying

Read SKILL.md below before installing (1 file). Open directory: indexed for reading, not audited.

Same gist for agents: .md · .json

Install

triggerdotdev/trigger.dev/drizzle · repository language: TypeScript

Open directory. Skills are indexed for reading, not audited. Review a skill's body before installing it.

Frequently asked questions

AI-generated answers based on this skill's SKILL.md and metadata

How do I write drizzle queries for the dashboard agent?

Drizzle queries in the dashboard agent use the `@internal/dashboard-agent-db` package's access-pattern layer. Import table definitions from pg-core schemas, then use Drizzle's select, insert, update, and delete methods. The repo enforces tenant scoping without foreign keys—queries filter by tenant ID at the application level. Use `db.query.tableName.findFirst()` or `db.select().from(table).where()` patterns. Drizzle is isolated from the main Prisma database, so connection setup uses postgres.js directly.

Drizzle migrations postgresql—how do I generate and apply them?

Drizzle migrations use drizzle-kit. Run `drizzle-kit generate migrate` to introspect your pg-core schemas and create SQL migration files. Then apply them with `drizzle-kit migrate` or execute the generated SQL directly against your postgres database. The dashboard agent stores migrations in the `@internal/dashboard-agent-db` package. Ensure your postgres.js connection is pooler-safe by configuring the client with appropriate timeout and connection settings before running migrations.

What's the postgres.js driver drizzle setup for pooler-safe connections?

Drizzle's postgres.js setup requires instantiating a postgres client with pooler-safe options. Pass the connection string to `postgres()`, then wrap it in Drizzle using `drizzle(client)`. For pooler safety, configure idle timeout, statement timeout, and disable prepared statements if using a connection pooler that doesn't support them. The dashboard agent's `@internal/dashboard-agent-db` package handles this configuration. Avoid long-lived connections; let the pooler manage lifecycle.

How does Drizzle handle schema isolation without foreign keys?

Drizzle in the dashboard agent enforces multi-tenant scoped queries without foreign keys. Define tables using `pgSchema()` and `pgTable()` from pg-core, then implement tenant filtering in the access-pattern query layer—not at the database level. Every query must explicitly filter by tenant ID. This design isolates conversation data per tenant and avoids foreign-key constraints. The `@internal/dashboard-agent-db` package provides pre-built queries that enforce this pattern automatically.

What should I know about drizzle prepared statements and pooler compatibility?

Drizzle prepared statements can conflict with connection poolers that don't support them. If you encounter Node16 module resolution or prepared statement errors, disable them in your postgres.js client configuration or use a pooler that supports prepared statements natively. The dashboard agent's setup handles this, but when debugging issues in `@internal/dashboard-agent-db`, check that your postgres.js version (3.4+) and drizzle-orm version (0.45+) are compatible and that pooler settings align with your connection strategy.

How do I define and query jsonb columns in Drizzle schemas?

Drizzle supports jsonb columns via `pgTable()` with the `jsonb()` type from pg-core. Define typed jsonb fields using generics: `jsonb('metadata').$type<MetadataType>()`. Query jsonb data using Drizzle's operators or raw SQL. For the dashboard agent, jsonb stores conversation metadata and agent state. Combine jsonb with soft deletes (timestamp-based) and composite indexes for efficient querying. The `@internal/dashboard-agent-db` package includes example schemas with typed jsonb and index definitions.

SKILL.md

Rendered from the published skill. Quoted content, verbatim.

Drizzle ORM (this repo)

Drizzle is used in exactly one place: internal-packages/dashboard-agent-db (@internal/dashboard-agent-db), the in-dashboard agent's conversation store. Everything else in the monorepo is Prisma (@trigger.dev/database). Keep them separate.

Pinned versions: drizzle-orm ^0.45, drizzle-kit ^0.31 (dev), postgres ^3.4 (postgres.js driver). drizzle-orm and drizzle-kit are intentionally on different version lines — 0.31.x is the correct companion for 0.45.x, there is no peer dependency between them.

Critical rules

  1. **Drizzle is only the agent's own

(truncated - see the full file via the links below)

File tree — 1 file
.claude/skills/drizzle/SKILL.md

Let your AI agent find skills like this

Example. Real query, live index.

You found this page by searching. An agent finds it by wishing: SkillFed indexes 56,283 agent skills by what they can do, searchable in plain language.

wish › “Write or modify Drizzle ORM schemas and queries for dashboard agent conversation storage”

Give your agent the search over MCP, or paste the wish link into any chat. No install? Search from any chat →

Related skills

postgres-drizzle
by ccheney · ccheney/robust-skills

Build type-safe database applications pairing PostgreSQL with Drizzle ORM. This skill covers schema design, relational queries, migrations via drizzle-kit, connection pooling, and common performance pitfalls like N+1 queries and missing indexes. Includes decision trees for modeling relationships and diagnosing slow queries.

MITupdated Jul 2026
★ 55repo stars
Drizzle Orm
by pedronauck · pedronauck/skills

This skill covers Drizzle ORM fundamentals for building type-safe database layers, including schema organization, prepared statements, and transaction patterns. Learn performance-first practices like indexing strategies, N+1 prevention, and safe migration workflows using package scripts. Covers common pitfalls and validation steps to ensure robust database code.

no license declared → metadata onlyupdated Jul 2026
★ 541repo stars
drizzle-best-practices
by honra-io · honra-io/drizzle-best-practices

Comprehensive reference for building PostgreSQL applications with Drizzle ORM, covering schema design, query patterns, and relational modeling across eight prioritized categories. Includes version-specific guidance for both v1 RC and legacy 0.45.x APIs, with correct and incorrect code examples for each pattern.

MITupdated May 2026
★ 18repo stars
Drizzle Postgres
by pedronauck · pedronauck/skills

Build type-safe PostgreSQL applications using Drizzle ORM with guidance on schema design, migrations, and query optimization. Covers essential patterns for relationships, transactions, and connection pooling alongside performance best practices like indexing foreign keys and avoiding N+1 queries.

no license declared → metadata onlyupdated Jul 2026
★ 541repo stars
drizzle-orm-d1
by secondsky · secondsky/claude-skills

drizzle-orm-d1 equips you with a complete type-safe ORM layer for Cloudflare D1 databases, handling schema definition, migration generation via Drizzle Kit, and D1-specific patterns like batch operations instead of traditional transactions. It includes templates for common queries, relations, and prepared statements, plus an error catalog addressing D1-specific issues like binding errors and foreign key constraints.

MITupdated Jul 2026
★ 196repo stars
drizzle-migrations
by curiositech · curiositech/some_claude_skills

This skill guides you through Drizzle ORM's migration workflow for SQLite databases, covering schema definition, column types, and common changes like adding tables or indexes. Learn production-ready strategies for generating migrations, applying them in code, and managing relations between tables.

MITfor claude-codeupdated Jul 2026
★ 164repo stars

More skills drizzle (MIT)

Tags
orm-frameworkpostgres-driverschema-migrationconnection-poolingmulti-tenant-isolationquery-layer-abstractiontype-safe-sqltransaction-management