Use (select auth.uid()) instead of auth.uid() in policies
Wrapping auth.uid() in (select ...) ensures it's evaluated once per query instead of once per row.
Why This Matters
Without the select wrapper, auth.uid() may be re-evaluated for every row in the table, degrading performance on large tables.
Tags
nextjssupabaserls
Related Rules
Catch this automatically on every PR
BeforeMerge scans your pull requests against this rule and 3+ others. Get actionable feedback before code ships.