https://supabase.com/ logo
#help
Title
# help
p

poutingemoji

04/09/2022, 2:01 AM
is there a way to generate shorter uuids? rn im using uuid_generate_v4() but id like something thats preferably 5 symbols long
n

Needle

04/09/2022, 2:01 AM
Hello @poutingemoji! This thread has been automatically created from your message in #843999948717555735 a ``few seconds ago``. Pinging @User so that they see this as well! Want to unsubscribe from this thread? Right-click the thread in Discord (or use the ... menu) and select Leave Thread to unsubscribe from future updates. Want to change the title? Use the
/title
command! We have solved your problem? Click the button below to archive it.
f

fernandolguevara

04/09/2022, 4:44 AM
n

Needle

04/09/2022, 4:44 AM
poutingemoji (2022-04-09)
p

poutingemoji

04/09/2022, 4:48 AM
how do i use it for my supabase db?
f

fernandolguevara

04/09/2022, 4:53 AM
p

poutingemoji

04/09/2022, 4:53 AM
ok
done
how do i set the type to trigger
im trying to look for it in the dropdown
f

fernandolguevara

04/09/2022, 4:58 AM
on the repo u can find other example
p

poutingemoji

04/09/2022, 5:07 AM
ah i see
ok so i got the trigger working but
what i dont get is
can i not make the trigger field my primary key?
because primary keys require a value before and triggers only run after i insert
im trying to insert through the interactive editor on supabase
f

fernandolguevara

04/09/2022, 2:21 PM
@User the repo has an example, if u ran the script then u can use de new domain created as a new type in your Columns
Copy code
CREATE TABLE test (id SHORTKEY PRIMARY KEY, name TEXT);
SHORTKEY
to generate a new value run
select shortkey_generate()