{"enrichment":{"faq":[{"a":"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\u2014queries 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.","q":"How do I write drizzle queries for the dashboard agent?"},{"a":"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.","q":"Drizzle migrations postgresql\u2014how do I generate and apply them?"},{"a":"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.","q":"What's the postgres.js driver drizzle setup for pooler-safe connections?"},{"a":"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\u2014not 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.","q":"How does Drizzle handle schema isolation without foreign keys?"},{"a":"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.","q":"What should I know about drizzle prepared statements and pooler compatibility?"},{"a":"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.","q":"How do I define and query jsonb columns in Drizzle schemas?"}],"shadow_tags":["orm-framework","postgres-driver","schema-migration","connection-pooling","multi-tenant-isolation","query-layer-abstraction","type-safe-sql","transaction-management"],"summary_rewrite":"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."},"files":[{"bytes":11259,"path":".claude/skills/drizzle/SKILL.md","sha256":"d90f2971f9537fb5b88813a228c8cd74f8144e4057fe6f5e13edb8c6eadb48bc","url":"https://skillfed.io/files/triggerdotdev/trigger.dev/drizzle/50aa5c7a/SKILL.md"}],"id":"triggerdotdev/trigger.dev/drizzle","links":{"html":"https://skillfed.io/triggerdotdev/trigger.dev/drizzle","md":"https://skillfed.io/triggerdotdev/trigger.dev/drizzle.md","repo":"https://github.com/triggerdotdev/trigger.dev"},"meta":{"agents_supported":["claude-code"],"first_seen":"2026-07-28","forks":1377,"language":"TypeScript","last_updated":"2026-07-27","license":"Apache-2.0","name":"Drizzle","publisher":"triggerdotdev","stars":15775},"relations":{"similar":[{"id":"ccheney/robust-skills/postgres-drizzle"},{"id":"honra-io/drizzle-best-practices/drizzle-best-practices"},{"id":"pedronauck/skills/drizzle-postgres"},{"id":"andrelandgraf/fullstackrecipes/drizzle-queries"},{"id":"secondsky/claude-skills/drizzle-orm-d1"},{"id":"curiositech/some_claude_skills/drizzle-migrations"},{"id":"bobmatnyc/claude-mpm-skills/drizzle"},{"id":"alinaqi/maggy/cloudflare-d1"},{"id":"secondsky/claude-skills/bun-drizzle-integration"},{"id":"alinaqi/maggy/supabase-node"}]},"slug":{"owner":"triggerdotdev","repo":"trigger.dev","skill":"drizzle"},"version":"50aa5c7a"}
