drizzle-factory

Generate database test data and seeds for Drizzle ORM applications.

2|Updated Oct 18, 2025
One-click install
npx skills add https://github.com/symbiosika/symbiosika-framework --skill drizzle-factory
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: drizzle-factory
Source: https://github.com/symbiosika/symbiosika-framework/tree/main/docs/skills/drizzle-factory
Command: npx skills add https://github.com/symbiosika/symbiosika-framework --skill drizzle-factory

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Use when creating test data with Drizzle ORM. Use @praha/drizzle-factory to define factories, create single/multiple records, traits, seeds, compose factories, and reset sequences. Use when the user asks for database record factories, test data, or fixtures for Drizzle.

Core Features & Use Cases

  • Define factories with defineFactory for a given schema and table
  • Compose multiple factories with composeFactory
  • Use traits and seeds to model variants and fixed datasets
  • Reset sequences between tests to ensure deterministic IDs
  • Use use inside resolvers to create related records automatically

Quick Start

Define a factory with defineFactory and then create records via the factory for your database.

Frequently Asked Questions about drizzle-factory

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

FAQPage Schema
How do I generate test data and fixtures for Drizzle ORM?

You generate test data for Drizzle ORM by defining a schema, table, and resolver with default values using defineFactory, then creating single or multiple records for tests or development.

How do I create related database records automatically when seeding test data?

You can create related records automatically by using the use function inside resolvers within your Drizzle factory to generate associated records during test data creation.

Can I model different variants of test records using Drizzle factories?

Yes, you can model test record variants using Drizzle factories by defining traits to create record variations and using seeds to establish fixed datasets for consistent fixtures.

How do I ensure deterministic IDs when running database tests with Drizzle?

You ensure deterministic IDs in Drizzle database tests by using resetSequence to reinitialize sequences between tests, guaranteeing consistent fixtures and predictable record identifiers.

Does Drizzle factory support composing multiple factories together?

Yes, Drizzle factory supports composing multiple factories together using composeFactory, allowing you to combine individual factories for complex test data generation across related database tables.

What do I need to define before creating a factory for Drizzle ORM test data?

Before creating a Drizzle ORM test data factory, you need to define a database schema, a target table, and a resolver function returning default values for the records you intend to generate.