supabase / postgres-deno

A PostgreSQL extension for Deno: run Typescript in PostgreSQL functions and triggers.
https://supabase.io
MIT License
107 stars 5 forks source link

Adds deno example using pgx #6

Open kiwicopple opened 2 years ago

kiwicopple commented 2 years ago

Adds a basic POC to see whether Deno can be using inside Postgres.

Why:

If we can get this running, then supabase devs get an isomorphic development language - running both on the edge and in the database. This is particularly useful for some of the ABAC ideas, which currently use plv8. This would be a replacement for plv8 and would give developers the benefit of a "write once, run anywhere" environment

POC:

Next steps:

Currently this runs as an extension. We need to convert this over to a language extension. There is some prior art here, where plrust is implemented using pgx.

Usage:

cargo build
cargo pgx init # one time
cargo pgx run pg13

see full history here: https://github.com/supabase/pldeno-test

alternative approaches: