Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/snaplet/postgres-wasm
A PostgresQL server running in your browser
https://github.com/snaplet/postgres-wasm
playground postgres wasm
Last synced: about 2 months ago
JSON representation
A PostgresQL server running in your browser
- Host: GitHub
- URL: https://github.com/snaplet/postgres-wasm
- Owner: snaplet
- License: mit
- Archived: true
- Created: 2022-08-24T06:07:27.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-04-08T07:06:05.000Z (7 months ago)
- Last Synced: 2024-09-25T13:34:28.671Z (about 2 months ago)
- Topics: playground, postgres, wasm
- Language: Shell
- Homepage:
- Size: 299 MB
- Stars: 2,317
- Watchers: 22
- Forks: 73
- Open Issues: 10
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
Postgres WASM
A PostgreSQL server instance running in a virtual machine running in the browser
by Supabase & Snaplet
Demo
•
Discord
•
Snaplet
•
Supabase
## The future is now
Since we worked on this project, awesome and more usable solutions exist:
- [PGlite by ElectricSQL](https://github.com/electric-sql/pglite) which is a native WASM build of Postgres
- [pgmock by Stackframe](https://github.com/stackframe-projects/pgmock) which is using the same approach as this project, emulating the Postgres server in an x86 emulatorWhile `postgres-wasm` was more of a proof of concept, both the above solutions can be used to run PostgreSQL in the browser or getting in-memory PostgreSQL databases!
## Quickstart
```terminal
cd packages/runtime && npx serve
```Go to http://localhost:3000 and have fun!
## Packages
This repo is split into three packages that build up the environment for running PostgreSQL in the browser.
- [runtime](/packages/runtime): The v86 emulator that starts the `buildroot` image
- [Buildroot](/packages/buildroot): Scripts to build the CPU and memory snapshot run by v86.
- [Websockproxy](/packages/websockproxy): Networking## Acknowledgements
- [v86](https://github.com/copy/v86) which is **the** emulator for running x86 operating systems in the browser, without it none of the following projects would be possible
- [crunchydata playground](https://www.crunchydata.com/developers/playground) for leading the way and showing the world that it was possible to run PostgreSQL in the browser
- [browser-shell](https://github.com/humphd/browser-shell) which was already way ahead of its time, especially on the filesystem part
- [browser-linux](https://github.com/Darin755/browser-linux) for showing us how we can make the pieces fit together
- [Websockets Proxy](https://github.com/benjamincburns/websockproxy) the ingenious workaround that opened up the world for **v86** emulators everywhere