drizzle-orm-test

Test Drizzle ORM PostgreSQL CRUD operations and RLS policies with type-safe queries.

1|Updated Jan 20, 2026
One-click install
npx skills add https://github.com/constructive-io/constructive-skills --skill drizzle-orm-test
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: drizzle-orm-test
Source: https://github.com/constructive-io/constructive-skills/tree/main/skills/drizzle-orm-test
Command: npx skills add https://github.com/constructive-io/constructive-skills --skill drizzle-orm-test

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill streamlines the process of writing type-safe database tests for applications using Drizzle ORM, ensuring data integrity and simplifying RLS policy verification.

Core Features & Use Cases

  • Type-Safe Queries: Write database queries with full TypeScript type safety using Drizzle ORM.
  • RLS Testing: Easily test Row-Level Security policies by setting user contexts and verifying query results.
  • Test Isolation: Leverages drizzle-orm-test for automatic transaction management and test isolation, similar to pgsql-test.
  • Use Case: When developing a feature that involves user-specific data access, use this Skill to write tests that confirm only the logged-in user can access or modify their own records, and that unauthorized access is blocked.

Quick Start

Use the drizzle-orm-test skill to write type-safe database tests for your Drizzle ORM application.

Frequently Asked Questions about drizzle-orm-test

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

FAQPage Schema
How do I test Row-Level Security policies with Drizzle ORM and PostgreSQL?

You can test Row-Level Security (RLS) policies in Drizzle ORM by setting specific user contexts during test execution and asserting query behavior. This verifies that unauthorized access to user-specific data is blocked while authorized access succeeds.

What is the best way to achieve test isolation for PostgreSQL database tests?

Achieve test isolation for PostgreSQL database tests by leveraging automatic transaction management that wraps each test case. This approach rolls back database changes after execution, ensuring a clean state and preventing data leakage between tests.

Can I use Drizzle ORM to write type-safe database queries in Vitest or Jest?

Yes, you can use Drizzle ORM to write type-safe database queries in Vitest or Jest. The ORM integrates seamlessly with these testing frameworks, allowing you to verify CRUD operations with full TypeScript type safety during test execution.

Does Drizzle ORM support verifying CRUD operations with TypeScript type safety?

Yes, Drizzle ORM supports verifying CRUD operations with full TypeScript type safety. You can use the query builder within your tests to ensure that data manipulation queries are type-checked and functionally correct against your PostgreSQL database.

How do I set user contexts for isolated database testing in PostgreSQL?

Set user contexts for isolated database testing in PostgreSQL by utilizing context management features within your test setup. This allows you to simulate different user sessions and verify that Row-Level Security policies enforce proper data access boundaries.