Skip to content

feat: add supa_privacy and supa_profile TLE extensions - #12

Open
JesseVent wants to merge 8 commits into
kiwicopple:mainfrom
JesseVent:main
Open

feat: add supa_privacy and supa_profile TLE extensions#12
JesseVent wants to merge 8 commits into
kiwicopple:mainfrom
JesseVent:main

Conversation

@JesseVent

@JesseVent JesseVent commented Jun 9, 2026

Copy link
Copy Markdown

Description

Adds two Trusted Language Extensions (TLEs) and a small Makefile update for the newer dbdev CLI.

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.
  • Makefile — Updated dbdev publish targets 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_privacy and jvent@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

select dbdev.install('jvent-supa_privacy');
create extension "jvent-supa_privacy" version '0.0.1';

Supabase Masking & Profiling

Happy to split into atomic PRs (Makefile / supa_privacy / supa_profile) if preferred.

JesseVent added 8 commits June 8, 2026 17:42
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant