database.build - In Browser Postgres Sandbox With AI Assistance
Written by Nikos Vaggalis   
Tuesday, 07 January 2025

Courtesy of Supabase, database.build lets you run Postgres inside your browser local-first and ask questions on your data in natural language.

If it wasn't already great enough to have a Postgres instance
running inside your browser, then add to it spawning any number of instances and use LLMs to query your data.

Of course, the first part is materialized thanks to Webassembly and PGlite, something that we explored in Running PostgreSQL Inside Your Browser With PGLite:

PGlite is a WASM Postgres build packaged into a TypeScript client library that enables you to run Postgres in the browser with no need to install any other dependencies. That is, Postgres stepping into SQLite's shoes, acting as a library that can be called by code with the added bonus of being able to persist to storage in the file system (Node/Bun) or indexedDB (Browser).

database.build is based on PGlite and Postgres database version 16, lives directly in your browser's IndexedDB storage and as such is only accessible by yourself.

The second part, about LLMs, is materialized thanks to pgvector, which the database.build sandbox comes with out-of-the box and is something we explored in Turn PostgreSQL Into A Vector Store:

pg_vector allows you to replace Chroma or any other specialized vector engine with Postgres, so that you can have your embeddings stored alongside your JSON or relation data under the same roof.

Using it is simple. After you login with Oauth, (my Github account in this case) you are presented with a live template. From there on you can automatically create a database by issuing a request i.e "create a Slack clone" and then by clicking on the staple icon load your data in csv format to populate it.
The other way is to go straight to the staple icon and load a csv from which the AI will auto recognize the column types and create the according tables. The third option is do it by writing your SQL or importing your DDL file.

To put it into test, I've downloaded the medals.csv of Paris 2024 Olympics from Kaggle, which contains the medals each country has received, and loaded it into the playground. It auto-magically created a Medals table with the relevant columns and mapped data types.

Then I asked it "show me the data" to get an idea of what the table looked like, and then "which country had the most silver medals?" to get the response that "The country with the most silver medals is the United States, with a total of 44 silver medals". I can't but imagine how useful such a platform is for quick throw away demos, presentations or quick prototypes.

database.build is the brain child of Supabase who offer it for free. The only relation to a paid product is that you can deploy the database created in the playground using your Supabase managed cloud account; otherwise it is totally free, no strings attached.

To conclude, is it a sign of the times that the browser having established itself as the global UI for all sorts of applications, is going to conquer the database world as well? Webassembly has paved the way...

 supabase

 

More Information

database.build playground/live template

database.build on Github 

Related Articles

Running PostgreSQL Inside Your Browser With PGLite

Turn PostgreSQL Into A Vector Store  

To be informed about new articles on I Programmer, sign up for our weekly newsletter, subscribe to the RSS feed and follow us on Twitter, Facebook or Linkedin.

Banner


Google Releases Gemini 2 And Jules Code Agent
18/12/2024

Google has announced an updated version of Gemini, saying that Gemini 2.0 Flash Experimental will "enable even more immersive and interactive applications", along with new coding agents that can take  [ ... ]



Microsoft Releases Update For VSCode SQL Extension
30/12/2024

There's a new version of the Microsoft MSSQL extension for Visual Studio Code that aims to make it easier to write VSCode apps for database use, specifically for Azure SQL, SQL Database in Fabric, and [ ... ]


More News

espbook

 

Comments




or email your comment to: comments@i-programmer.info

Last Updated ( Tuesday, 07 January 2025 )