{"id":39760706,"url":"https://github.com/constructive-io/drizzle-test-suite","last_synced_at":"2026-01-18T11:37:38.995Z","repository":{"id":325611542,"uuid":"1101739000","full_name":"constructive-io/drizzle-test-suite","owner":"constructive-io","description":"A friendly playground for building, testing and validating Drizzle ORM Row‑Level Security (RLS) ","archived":false,"fork":false,"pushed_at":"2025-12-16T09:34:52.000Z","size":367,"stargazers_count":0,"open_issues_count":2,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-12-19T20:44:35.324Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/constructive-io.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-11-22T06:25:13.000Z","updated_at":"2025-12-16T09:29:58.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/constructive-io/drizzle-test-suite","commit_stats":null,"previous_names":["launchql/drizzle-pgsql-test","constructive-io/drizzle-test-suite"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/constructive-io/drizzle-test-suite","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/constructive-io%2Fdrizzle-test-suite","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/constructive-io%2Fdrizzle-test-suite/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/constructive-io%2Fdrizzle-test-suite/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/constructive-io%2Fdrizzle-test-suite/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/constructive-io","download_url":"https://codeload.github.com/constructive-io/drizzle-test-suite/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/constructive-io%2Fdrizzle-test-suite/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28535169,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-18T10:13:46.436Z","status":"ssl_error","status_checked_at":"2026-01-18T10:13:11.045Z","response_time":98,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-01-18T11:37:38.814Z","updated_at":"2026-01-18T11:37:38.948Z","avatar_url":"https://github.com/constructive-io.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# drizzle-orm-test test suite\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://raw.githubusercontent.com/constructive-io/constructive/refs/heads/main/assets/outline-logo.svg\" width=\"250\"\u003e\u003cbr /\u003e\n    drizzle-orm-test demo\n\u003c/p\u003e\n\nThis demo shows how to use `drizzle-orm-test` for fast, isolated PostgreSQL testing with [Drizzle ORM](https://orm.drizzle.team/). The package is powered by [drizzle-orm-test](https://www.npmjs.com/package/drizzle-orm-test).\n\n## What is drizzle-orm-test?\n\n`drizzle-orm-test` provides a testing utility for Drizzle ORM with isolated PostgreSQL databases and transaction-based cleanup between tests.\n\n## Usage\n\nHere's how to use it:\n\n```typescript\nimport { drizzle } from 'drizzle-orm/node-postgres';\nimport { getConnections, PgTestClient } from 'drizzle-orm-test';\n\nlet db: PgTestClient;\nlet pg: PgTestClient;\nlet teardown: () =\u003e Promise\u003cvoid\u003e;\n\nbeforeAll(async () =\u003e {\n  ({ pg, db, teardown } = await getConnections());\n});\nafterAll(async () =\u003e { await teardown(); });\nbeforeEach(async () =\u003e { await db.beforeEach(); });\nafterEach(async () =\u003e { await db.afterEach(); });\n\ndescribe('your tests', () =\u003e {\n  it('should work with standard Drizzle pattern', async () =\u003e {\n    const drizzleDb = drizzle(db.client);\n    const result = await drizzleDb.execute('select 1 as num');\n    expect(result.rows[0].num).toBe(1);\n  });\n});\n```\n\n## RLS Testing\n\nTest Row Level Security with context management:\n\n```typescript\nit('user should only see their own rows', async () =\u003e {\n  db.setContext({\n    role: 'authenticated',\n    'jwt.claims.user_id': '1'\n  });\n\n  const drizzleDb = drizzle(db.client);\n  const rows = await drizzleDb.select().from(users);\n\n  expect(rows.every(r =\u003e r.userId === '1')).toBe(true);\n});\n```\n\nCheck out the [package source](./packages/drizzle) and [test examples](./packages/drizzle/__tests__) to see how it works!\n\n\n## Developing\n\n```sh\ndocker-compose up\npnpm install\ncd packages/drizzle\npnpm test:watch\n```\n\n## Education and Tutorials\n\n 1. 🚀 [Quickstart: Getting Up and Running](https://constructive.io/learn/quickstart)\nGet started with modular databases in minutes. Install prerequisites and deploy your first module.\n\n 2. 📦 [Modular PostgreSQL Development with Database Packages](https://constructive.io/learn/modular-postgres)\nLearn to organize PostgreSQL projects with pgpm workspaces and reusable database modules.\n\n 3. ✏️ [Authoring Database Changes](https://constructive.io/learn/authoring-database-changes)\nMaster the workflow for adding, organizing, and managing database changes with pgpm.\n\n 4. 🧪 [End-to-End PostgreSQL Testing with TypeScript](https://constructive.io/learn/e2e-postgres-testing)\nMaster end-to-end PostgreSQL testing with ephemeral databases, RLS testing, and CI/CD automation.\n\n 5. ⚡ [Supabase Testing](https://constructive.io/learn/supabase)\nUse TypeScript-first tools to test Supabase projects with realistic RLS, policies, and auth contexts.\n\n 6. 💧 [Drizzle ORM Testing](https://constructive.io/learn/drizzle-testing)\nRun full-stack tests with Drizzle ORM, including database setup, teardown, and RLS enforcement.\n\n 7. 🔧 [Troubleshooting](https://constructive.io/learn/troubleshooting)\nCommon issues and solutions for pgpm, PostgreSQL, and testing.\n\n## Credits\n\n**🛠 Built by the [Constructive](https://constructive.io) team — creators of modular Postgres tooling for secure, composable backends. If you like our work, contribute on [GitHub](https://github.com/constructive-io).**\n\n## Disclaimer\n\nAS DESCRIBED IN THE LICENSES, THE SOFTWARE IS PROVIDED “AS IS”, AT YOUR OWN RISK, AND WITHOUT WARRANTIES OF ANY KIND.\n\nNo developer or entity involved in creating this software will be liable for any claims or damages whatsoever associated with your use, inability to use, or your interaction with other users of the code, including any direct, indirect, incidental, special, exemplary, punitive or consequential damages, or loss of profits, cryptocurrencies, tokens, or anything else of value.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fconstructive-io%2Fdrizzle-test-suite","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fconstructive-io%2Fdrizzle-test-suite","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fconstructive-io%2Fdrizzle-test-suite/lists"}