Skip to content

Demo of using PLV8 for making JavaScript backend server inside PostgreSQL DBMS

Notifications You must be signed in to change notification settings

mustosoft/pg-plv-demo

Repository files navigation

pg-plv-demo

Steps to Run Server

0. install bun if not yet installed

npm i -g bun

1. Install dependencies:

bun install --frozen-lockfile

2. Generate SQL Scripts

./index.ts --init

3. Run the server:

Using docker compose:

docker compose -f docker-compose.yml up

Public Demo Server

The public demo server is available at https://plv8-demo.mustosoft.io/ (mind the HTTPS protocol!).

Examples:

Get All Books

curl -sL http://plv8-demo.mustosoft.io/books | jq

Get All Authors

curl -sL http://plv8-demo.mustosoft.io/authors | jq

Create Author

curl -sLX POST \
 -d '{"name": "mustosoft","bio": "the author"}' \
 http://plv8-demo.mustosoft.io/author | jq

Create Books

curl -sLX POST \
 -d \
'['\
'  {"title":"PostgreSQL: a Not Only DBMS","author":1,"description":"lol","isbn":1234567890123},'\
'  {"title":"PLV8: Make PostgreSQL Great Again","author":1,"description":"lol again","isbn":1234567890123}'\
']' \
 http://plv8-demo.mustosoft.io/books | jq

This project was created using bun init in bun v1.1.4. Bun is a fast all-in-one JavaScript runtime.

About

Demo of using PLV8 for making JavaScript backend server inside PostgreSQL DBMS

Topics

Resources

Stars

Watchers

Forks