Have you wished to access many databases without installing software or running a container? If yes, read on.
With https://database.build/, you can instantly spin up an unlimited number of Postgres databases that run directly in your browser.
According to https://github.com/supabase-community/database-build, 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
How does it all work?
PGLite, a WASM version of Postgres, allows it to run directly in your browser. There is no need for a remote Postgres container or a WebSocket proxy. Every database you create spins up a new instance of PGLite. This new instance exposes a fully functional Postgres database. Data is stored in IndexedDB so that changes persist upon refresh.
Let's head to database.build and try it. Every time you visit the site, you are asked to Sign in with Github to use the LLM. If you don't wish to sign in, you must provide your Open AI credentials and LLM.
I will create a simple schema for a highly simplified to-do app. We will ask the application to do the following using natural language
Create a user table and generate random users.
Create a tasks table, associate the task table with users, and generate random tasks for a user in the user table.
Run a count query to get the user's total count of tasks.
Chart the count of tasks by their status.
I asked the build system to create a new user table by simply stating, "create user table." The system made the table and provided information about it in both textual and diagrammatic form, as shown below.
Let's generate sample users by issuing the "generate sample users" command. The system holds the previous prompt in context and generates five random users for you.
To ensure the table has 5 users, I asked it to tell me the count by issuing a "How many users are there?" question. The response is
Let's create a tasks table and associate it with the users table by issuing the "create tasks table and link it to users table" prompt.
The system created a tasks table and linked it to the users' table using the user[id] field as the primary key and tasks[user_id] as the foreign key. Swell!
Let's use the "create sample tasks for Charlie with different statuses" prompt to create five tasks for user Charlie with different statuses.
As can be seen, three sample tasks were created with three different statuses.
I can filter the tasks based on status. To see the number of tasks that have not been completed, I issue the "count pending and in progress tasks for Charlie" command.
To see a chart of the count of tasks for charlie, issue this simple command "chart count of tasks for charlie" prompt.
As you can see, the system depicts the information using a bar chart and provides a textual synthesis of the data used to populate the chart.
Finally -- if you wish to see the actual SQL used to execute the query or statement, click on the Executed SQL dropdown and see the exact SQL statement being issued. This is great for learning the language.
That's all for now, my friends. Please keep visiting https://theganeshmoorthy.life for blogs like these: beautiful pictures, digital artwork, music, and music videos.
Have a great day!
Comments