drizzle-orm

Define TypeScript schemas, build queries, and manage migrations with Drizzle ORM.

17|1|Updated Apr 20, 2022
One-click install
npx skills add https://github.com/jvegaf/harmony --skill drizzle-orm-jvegaf
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: drizzle-orm
Source: https://github.com/jvegaf/harmony/tree/main/.agents/skills/drizzle-orm
Command: npx skills add https://github.com/jvegaf/harmony --skill drizzle-orm-jvegaf

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve?

This Skill simplifies database interactions in TypeScript applications by providing a type-safe way to define schemas, write queries, and manage migrations, eliminating runtime errors and improving developer productivity.

Core Features & Use Cases

  • Type-Safe Schema Definition: Define your database schema directly in TypeScript, ensuring type consistency between your code and database.
  • SQL-like Query Builder: Write expressive and performant queries using a familiar syntax that compiles down to efficient SQL.
  • Automated Migrations: Generate and apply database schema changes with Drizzle Kit, ensuring your database stays in sync with your code.
  • Use Case: When building a new API backend, use this Skill to define your user and post tables, write queries to fetch and manipulate data, and manage schema evolution seamlessly.

Quick Start

Use the drizzle-orm skill to define a 'users' table with 'id' and 'email' columns and then insert a new user with the email '[email protected]'.

Frequently Asked Questions about drizzle-orm

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

FAQPage Schema
How do I define a type-safe SQL schema in TypeScript?

To define a type-safe SQL schema in TypeScript, declare your database tables and columns directly in TypeScript code, ensuring type consistency between your application logic and your database without runtime overhead.

How do I generate and apply database migrations with Drizzle Kit?

Generate and apply database migrations by using Drizzle Kit to automatically create migration files from your TypeScript schema changes and apply them, ensuring your database structure stays synchronized with your codebase.

Does this type-safe ORM support PostgreSQL, MySQL, and SQLite?

Yes, this type-safe ORM supports PostgreSQL, MySQL, and SQLite, allowing you to build expressive SQL-like queries and manage database interactions across multiple database engines in Node.js and edge environments.

What is the best way to write type-safe SQL queries in Node.js?

The best way to write type-safe SQL queries in Node.js is using a SQL-like query builder that compiles expressive TypeScript syntax down to efficient SQL, eliminating runtime errors and improving developer productivity.

Does this ORM have runtime overhead when executing SQL queries?

No, this ORM operates with zero runtime overhead, facilitating database interactions by providing type safety during development that compiles directly to efficient SQL without adding extra execution cost.