Skip to content

Latest commit

 

History

History
76 lines (50 loc) · 1.27 KB

README.md

File metadata and controls

76 lines (50 loc) · 1.27 KB

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.