ari-becker / pgcuid2

Installs cuid2 as a PostgreSQL extension

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

pgcuid2

Use cuid2 from directly within PostgreSQL.

This allows you to write DDL like:

CREATE TABLE foo (
    id TEXT DEFAULT cuid2_create_id() PRIMARY KEY,
    name TEXT
);

then inserting data:

INSERT INTO foo (name) values ('Foo');

and running SELECT * from foo; will return something like

            id            | name 
--------------------------+------
 v11s7ykor7sv3uo1lcdkgs1p | Foo
(1 row)

Appreciation

This would not be possible without pgrx, which made it so easy. Thank you!

About

Installs cuid2 as a PostgreSQL extension

License:MIT License


Languages

Language:Rust 100.0%