drizzle-queries

Write type-safe Drizzle ORM queries for CRUD, joins, and transactions.

Updated Apr 10, 2026
One-click install
npx skills add https://github.com/theslashdojo/dojo --skill drizzle-queries
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: drizzle-queries
Source: https://github.com/theslashdojo/dojo/tree/main/nodes/drizzle/queries
Command: npx skills add https://github.com/theslashdojo/dojo --skill drizzle-queries

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires drizzle-orm, postgres, and includes scripts (resource) components.

What problem does it solve?

This Skill streamlines writing safe, type-checked SQL queries and nested relational loads by providing idiomatic Drizzle ORM patterns, examples, and notes that reduce runtime errors and developer guesswork.

Core Features & Use Cases

  • Type-safe query builder: Idiomatic SQL-like chaining for selects, inserts, updates, deletes with full TypeScript inference.
  • Relational API: Load nested relations with db.query.* and with clauses to simplify common nested data patterns.
  • Transactions, prepared statements & dialect notes: Guidance for atomic transactions, prepared statements, returning/upsert semantics, and cross-dialect considerations for PostgreSQL, SQLite, and MySQL.
  • Use Case: Backend engineers building paginated APIs, transactional imports, or analytical aggregations can rely on these patterns to implement robust, type-safe data access.

Quick Start

Use the drizzle-queries skill to select recent users with their published posts and return up to 10 results including each author's basic profile.

Frequently Asked Questions about drizzle-queries

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I write type-safe SQL queries with Drizzle ORM in TypeScript?

Drizzle ORM enables type-safe database queries by using an SQL-like builder chain for CRUD operations. It provides full TypeScript inference for selects, inserts, updates, and deletes, preventing runtime errors and reducing developer guesswork.

What is the best way to load nested relations using Drizzle ORM?

Loading nested relations in Drizzle ORM is done through the relational API using db.query.* and with clauses. This approach simplifies nested data patterns by retrieving related records alongside the primary model in a single operation.

Does Drizzle ORM support transactions and prepared statements for PostgreSQL?

Yes, Drizzle ORM supports atomic transactions and prepared statements for PostgreSQL. It provides specific guidance on transaction atomicity, returning/upsert semantics, and cross-dialect behavior for PostgreSQL, SQLite, and MySQL.

How do I perform upsert operations and use returning semantics in Drizzle ORM?

Upsert operations and returning semantics in Drizzle ORM are handled through the query builder. The Skill provides guidance on these features alongside transaction atomicity and prepared statement support for robust backend services and data pipelines.

Can I use Drizzle ORM query builder for both SQLite and MySQL dialects?

Yes, the Drizzle ORM query builder supports cross-dialect behavior for PostgreSQL, SQLite, and MySQL. It applies type-safe patterns to CRUD operations, joins, aggregations, and nested relational loading across all supported dialects.