Skip to content

Instantly share code, notes, and snippets.

View lavellotron's full-sized avatar

Patrick Greenwood lavellotron

View GitHub Profile
@lavellotron
lavellotron / nanoid_supabase.sql
Last active November 4, 2023 21:50
Nano ID for PostgreSQL on Supabase
/*
* --------------------------
*
* NANO ID on SUPABASE
* Modified the original (link below) to work as Supabase function instead of adding to pgcrypto extension.
* - remove statements for modifying pgcrypto extension
* - commented LEAKPROOF as it requires superadmin which we do not have
* - change gen_random_bytes(step); to extensions.gen_random_bytes(step);
*
* https://github.com/viascom/nanoid-postgres/blob/main/nanoid.sql