supabase-community / database-build

In-browser Postgres sandbox with AI assistance (formerly postgres.new)
https://database.build
Apache License 2.0
2.49k stars 197 forks source link

improvement: lock databases across tabs and windows #130

Closed jgoux closed 2 weeks ago

jgoux commented 3 weeks ago

Databases are now only usable in a single tab or window.

This is necessary due to PGlite single-user mode limitation to avoid race conditions if the user sends multiple queries from different locations. The postgres wire messages could be mixed resulting in unpredictable behaviours.

Web API features used to make it works:

Demo:

https://github.com/user-attachments/assets/f8df6e3b-f270-4932-acde-fc249a0ec28d

vercel[bot] commented 3 weeks ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
postgres-new ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 8, 2024 10:37am