payload-drizzle

Combine PayloadCMS local API with direct Drizzle access for bulk database operations.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/perimetre/ai-toolkit --skill payload-drizzle
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: payload-drizzle
Source: https://github.com/perimetre/ai-toolkit/tree/main/plugins/perimetre-apps/skills/payload-drizzle
Command: npx skills add https://github.com/perimetre/ai-toolkit --skill payload-drizzle

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Payload developers need to perform high-volume database operations without triggering Payload's full lifecycle, hooks, and access checks. This skill guides how to safely combine Payload's local API with direct Drizzle access to optimize performance for migrations, bulk operations, and advanced SQL tasks while preserving safety defaults.

Core Features & Use Cases

  • Dual-API workflow: use the safe local Payload API for standard ops and direct Drizzle for bulk or complex queries.
  • Join-table management guidance: explicitly handle hasMany join tables when bypassing the local API.
  • Type-safety and tooling: leverage generated Drizzle schemas to enable strong typing in direct DB work.

Quick Start

Run a bulk update against the Payload database using payload.db.drizzle with proper join-table management.

Frequently Asked Questions about payload-drizzle

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

FAQPage Schema
How do I perform bulk database updates in PayloadCMS without triggering hooks?

To perform bulk PayloadCMS database updates without hooks, use the local API for standard operations and direct Drizzle access via payload.db.drizzle for high-volume data migrations, bypassing the full request lifecycle for performance.

What is the best way to run complex SQL queries against a PayloadCMS database?

The best way to run complex SQL queries against a PayloadCMS database is combining the local API for standard operations with direct Drizzle access, leveraging generated Drizzle schemas for strong typing and bypassing the request lifecycle for performance-critical tasks.

Do I need a generated Drizzle schema to access the PayloadCMS database directly?

Yes, you need a generated Drizzle schema to access the PayloadCMS database directly, as it provides the type-safety and tooling required to manage hasMany join tables explicitly and execute high-volume operations safely.

How do I manage hasMany join tables when bypassing the PayloadCMS local API?

When bypassing the PayloadCMS local API for bulk operations, you must explicitly manage hasMany join tables using direct Drizzle queries, ensuring proper data relationships are maintained without relying on the standard request lifecycle.

When should I use direct Drizzle access instead of the PayloadCMS local API?

Direct Drizzle access should be used for high-volume database operations, complex SQL queries, and performance-critical imports where bypassing Payload's full lifecycle, hooks, and access checks provides a necessary speed advantage over the local API.

Can I combine the PayloadCMS local API with direct Drizzle access in the same workflow?

Yes, you can combine them in a dual-API workflow by using the safe local Payload API for standard operations and direct Drizzle access for bulk data migrations or complex queries, preserving safety defaults while optimizing performance.