A friendly playground for building and validating Supabase Row-Level Security (RLS) using LaunchQL. It includes real-world examples, migrations, and a comprehensive test suite you can run locally.
Built with supabase-test — a Supabase-optimized version of pgsql-test for instant, isolated Postgres test databases with automatic rollbacks and Supabase defaults.
- 🔐 RLS Policy Testing - Real-world examples with users and products tables
- 🧪 Comprehensive Test Suite - End-to-end tests against native Supabase schemas
- 🐘 Zero-Setup Postgres - Supabase CLI local stack for instant development
- ⚡ Jest Integration - Fast, isolated tests with automatic rollbacks
- 🚀 CI/CD Ready - GitHub Actions workflows for automated testing
- 🧩 Modular Architecture - Reusable schema packages you can extend
# Initialize and start local Supabase stack
npx supabase init
npx supabase start
# Install dependencies
pnpm install
# Run tests in watch mode
cd packages/hello-world
pnpm test:watchThis is a LaunchQL workspace combining pnpm and lql for modular Postgres packages:
packages/supabase- Supabase-focused SQL, tests, and helperspackages/hello-world- Demo extension showcasing RLS with users/products
Run tests in different modes:
# Run all tests from root
pnpm test
# Watch mode for specific package
cd packages/hello-world
pnpm test:watch
# Run Supabase package tests
cd packages/supabase
pnpm test:watch- Node.js 20+
- pnpm 10+
- Supabase CLI 2+
If you encounter connection issues, set your environment variables:
export PGPORT=54322
export PGHOST=localhost
export PGUSER=postgres
export PGPASSWORD=postgresCommon issues:
- Ensure Supabase services are running (
npx supabase status) - Check that ports match those shown by
npx supabase start - Use Node.js 20+ to avoid compatibility issues
- launchql/pgsql-test: 📊 Isolated testing environments with per-test transaction rollbacks—ideal for integration tests, complex migrations, and RLS simulation.
- launchql/supabase-test: 🧪 Supabase-native test harness preconfigured for the local Supabase stack—per-test rollbacks, JWT/role context helpers, and CI/GitHub Actions ready.
AS DESCRIBED IN THE LICENSES, THE SOFTWARE IS PROVIDED "AS IS", AT YOUR OWN RISK, AND WITHOUT WARRANTIES OF ANY KIND.
No 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.