feat: add supa_privacy and supa_profile TLE extensions - #12
Open
JesseVent wants to merge 8 commits into
Open
Conversation
Add guarded GRANTs so anon/authenticated can call the masking helpers directly (PostgREST RPC / invoker-side wrappers). Role-existence checks keep CREATE EXTENSION working on non-Supabase Postgres, and @extschema@ keeps it relocatable. create_masked_view runs dynamic DDL, so it stays admin-only via REVOKE from PUBLIC/anon/authenticated.
…0.1) feat(supa_privacy): grant schema usage/execute to Supabase roles
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Adds two Trusted Language Extensions (TLEs) and a small Makefile update for the newer
dbdevCLI.What's added
supa_privacy— Column-level anonymisation, masking & redaction primitives. Email/phone/name masking, deterministic hashing for joinable de-identified data, redaction helpers usable under RLS or inside views for safe data sharing.supa_profile— Lightweight table & column profiling: row counts, null ratios, distinct counts, min/max/avg sketches, type inference, quick "data shape" summaries. Built for fast onboarding into unfamiliar schemas without external tooling.dbdev publishtargets to match the current CLI flags.Why
Pure PL/pgSQL TLEs — no compilation, no external deps. Fits the spirit of this repo: small, copy-pasteable building blocks. Both are already published on database.dev as
jvent@supa_privacyandjvent@supa_profile, and referenced as examples in supabase/dbdev#490.A note on discoverability
Worth flagging while I'm here — finding what TLEs already exist is genuinely hard right now. supabase/dbdev#341 is open with this exact complaint at the catalogue level ("it's very difficult to explore dbdev to see if there is what we want"), and supabase/dbdev#197 sat open for ~2 years because there was no documented way to list installed packages. Curated indexes like this repo are one of the few discoverability surfaces TLE users actually have, which is partly why I wanted these two extensions to land here rather than only on database.dev. Happy to follow up with a README pass that lists the current extensions in this repo with one-line descriptions if useful.
Usage
Happy to split into atomic PRs (Makefile / supa_privacy / supa_profile) if preferred.