Supabase
p/supabase
The open source Firebase alternative
Chris Messina

postgres.new — The in-browser Postgres sandbox with AI assistance

Featured
75
In-browser Postgres sandbox with AI assistance.
Replies
Best
Chris Messina
Top Hunter
Hunter
📌
This is super interesting: With postgres.new, you can instantly spin up an unlimited number of Postgres databases that run directly in your browser (and soon, deploy them to S3). Each database is paired with a large language model (LLM) which opens the door to some interesting use cases: • Drag-and-drop CSV import (generate table on the fly) • Generate and export reports • Generate charts • Build database diagrams
Thor Schaeff
@chrismessina absolutely mind blowing stuff, can totally understand that you couldn’t wait to share it haha 😝 Congrats on a fantastic launch @supabase 🎉
Amy Liu
@chrismessina @supabase @schaeff_t omg this is insane what it does for you
Tony Han
Looking at this as someone who is not technical, I love how detailed the blog is at explaining the use cases and why this tool to solve it. Sounds like a great usage of this new PGLite that enables cheap, disposable databases to be ran locally so it's fast. The csv use case is a great demo of the tech! Congrats on the launch @ggrn and team!
Naveen MC
Top Product
Maker
Congrats on the launch 🎉 Finally, I can test and play with my SQL queries without blowing up the production database. and thanks to my little contribution. I've been added as a maker here. 🙏
Naveen MC
Top Product
Maker
@supa_community You're welcome. Keeping doing awesome things 🎉
Greg Richardson
Top Product
Maker
Had a blast building this 🚀 let me know if you have any questions or feedback, happy to help answer them 😄
Inian Parameshwaran
How does the meta table work? Does one get created automatically when new tables are created or is it on-demand when a query is run?
kiwicopple
Top Product
Maker
hey PH, supabase ceo here This is a new service that we're experimenting with that uses PGLite[0], a WASM build of Postgres that runs in the browser. You might remember an earlier WASM build[1] that was around ~30MB. The Electric team [2] have gone one step further and created a complete build of Postgres that’s under 3MB. Their implementation is technically interesting. Postgres is normally multi-process - each client connection is handed to a child process by the postmaster process. In WASM there’s limited/no support for process forking and threads. Fortunately, Postgres has a relatively unknown built-in “single user mode” [3] primarily designed for bootstrapping a new database and disaster recovery. Single-user mode only supports a minimal cancel REPL, so PGlite adds wire-protocol support which enables parametrised queries etc. We have created https://postgres.new as an experiment. You can think of it like a love-child between Postgres and ChatGPT: in-browser Postgres sandbox with AI assistance. You can spin up as many new Postgres databases as you want because they all live inside your browser. We pair PGlite with an LLM (currently GPT-4o) and give it full reign over the database with unrestricted permissions. This is an important detail - giving an LLM full autonomy means that it can run multiple operations back-to-back: any SQL errors from Postgres are fed back to the language model so that it can have a few more attempts to solve the problem. Since it’s in-browser it’s low risk. Some other features include: * CSV upload: you can upload a CSV and it will automatically create a Postgres table which you can query with natural language. * Charts: you can ask the LLM to create a chart with the data and change the colors of the charts. * RAG / pgvector: PGLite supports pgvector, so you can ask the LLM to create embeddings for RAG. The site uses transformers.js [4] to create embeddings inside the browser. We’re working on an update to deploy your databases and serve them from S3 using pg-gateway [5]. We expect to have a read-only deployments ready by the end of the week. You can access them using any postgres-compatible tool (eg: psql). Everything is open source. A huge shout-out to the Electric team who have been a pleasure to build with. [0] PGLite: https://github.com/electric-sql/... [1] Postgres-wasm: https://supabase.com/blog/postgr... [2] Electric: https://electric-sql.com/ [3] Single user mode: https://www.postgresql.org/docs/...... [4] transformers.js: https://github.com/xenova/transf... [5] pg-gateway: https://github.com/supabase-comm...
Thor Schaeff
@copple kudos @ggrn fantastic work. The experience of this is second to none!
Charlie Coppinger
I'm convinced database related stuff is one of the early golden use cases for LLM's — tools like this are so handy to quickly spin out new projects. Congrats on the launch team Supabase!
Wen Bo Xie
This is an incredible feat of engineering and I love how quickly I can spin up a lot of Postgres databases to prototype app ideas and play around with data. Having the AI there to help me along the way makes it so easy to figure out the tables I'll need and to visualize my database and my imported data. Last, but not least, I love that I'm one prompt away from generate embeddings right there in postgres.new.
Chuck Chen
Congratulations on the launch! A big fan of Supabase products here. Just curious what the LLM used and how does it trained or prompted to be so accurate on Postgres. I find it challenging even to get it write syntax valid SQL. Once again, great work by a great team!
David
This is just insane and if you weren't yet convinced about this being your future tech stack, I don't know what will. Big 🧠 moves! Congrats
Charis
This is amazing. Used it to debug SQL queries in a safe mock environment that took ... seconds (?) to set up
Nil Ni
Congrats on the 🚀 started using supabase earlier this year, it’s so good :) now it can even design DB for me, what an era I am living in :)
Christopher Gwilliams
Branching is one thing but having a test or dev environment with little to no effort is game changing
Jack Michalak
I'm sufficiently familiar with postgres that I don't care about the LLM part, but very cool to have it running in the browser!
Sumeet Pannu
This is easy and dare I say.. fun! Really makes schema design approachable. I think the biggest danger is that people will like it so much they'll just start using it in production - 'huh, it just created the graph I wanted, I'll just have it served up in an iframe in my app!" But seriously, supabase great product, UI and partnership on pglite. As always. Looking forward to digging into pglite more today.
Pamela Chia
Played around with it for hours. Why didn’t this existed earlier?! What a time to be a builder 🚀
Daniel W. Chen
I love Postgres and I love AI. will there be sqlite support in the future?
Tyler Shukert
Love it! It works great in other languages too! I tried it in Japanese, and it worked great!
Mathias Michel
I tried it out and it's really cool to sketch a database structure quickly and for basic data science. Just drop a CSV file and start asking questions about the data.
Angela Ni
Congrats on the launch! Postgres.new seems like a great tool for developers. I appreciate the simplicity it offers. Does it supports advanced configurations for more complex use cases?