mirror of
https://github.com/usetrmnl/byos_next.git
synced 2026-08-13 14:29:08 -07:00
Recreates tenant RLS policies with current_setting() wrapped in a scalar subquery so Postgres evaluates it once per statement (InitPlan) instead of once per row. Idempotent DROP/CREATE; covers USING + WITH CHECK incl. INSERT policies. Regenerates lib/database/sql-statements.ts so the migration is actually registered and run. Closes #81. Co-authored-by: dmitrymaranik <40249835+dmitrymaranik@users.noreply.github.com>