Show HN: I built a database GUI with ChatGPT integration
89 points| Dennizz | 2 years ago |dbpilot.io | reply
Simply ask what data you are looking for - GPT will figure out which tables to use, how to join them, and then write a query for you.
The AI assistant knows which tables and columns exist in your database, meaning it can write queries specific to your schema.
Besides that, it doesn't have access to any actual data from your database though, meaning your data doesn't get exposed to OpenAI.
[+] [-] khazhoux|2 years ago|reply
But nearly every time I've asked ChatGPT for code, it gives me either plausible-but-wrong code, or total hallucinations (flags and APIs that could exist, but don't).
[+] [-] Closi|2 years ago|reply
1) GPT4 is a must, the code quality is so much better than GPT3
2) You can use a longer explanation than you think. Be detailed in exactly what you want. Clearly describe function inputs and outputs.
3) Provide GPT3 with the APIs to use, and break these down. If you want it to call an API and do some logic, you can prompt it twice - once to build a function to get data from the API and once to build a function that requests from the function in the first request. Do both of these as separate chat GPT sessions.
4) Give GPT a chance to fix errors - pipe the exact errors back in after you have run them so GPT can amend its code.
5) if you want the code to operate/be written in a particular way then tell GPT and even provide pseudo code if worthwhile. If you want error handling, request it. If you want the SQL statements to be run in a transaction, request it. It probably won’t do these things by default.
6) don’t use even slightly obscure languages.
[+] [-] calmoo|2 years ago|reply
[+] [-] Closi|2 years ago|reply
Although you call it a "no-tricks pricing" model, a 'one time lifetime license' for a product that I can't use the key feature of without a subscription after a year isn't a 'no-tricks pricing model'. Unless I am misunderstanding?
Although the product looks great - just maybe needs the words changing and making it clear what capabilities don't require the subscription.
Might even be better removing the term "no-tricks pricing model" too, because if anything the license model is a bit more tricksy and more ambiguous compared to most other applications imho.
[+] [-] Dennizz|2 years ago|reply
I'll update the copy, and try to explain the pricing model more clearly.
Also a good idea to make it possible to use one's own API key. I'll consider that.
[+] [-] hegem0n|2 years ago|reply
[+] [-] AdieuToLogic|2 years ago|reply
C-sharp: https://github.com/mongodb-labs/mongo-csharp-search
Java: https://github.com/streamx-co/FluentMongo
Scala: https://github.com/osxhacker/scala-bson-query
Typescript: https://www.npmjs.com/package/ts-mongodb-orm
HTH
[+] [-] tillvz|2 years ago|reply
[+] [-] Dennizz|2 years ago|reply
[+] [-] throwaway8689|2 years ago|reply
[+] [-] Dennizz|2 years ago|reply
This is a case where it could help to give the AI some example values of the actual data. The same applies for e.g. JSON fields.
I've been thinking about ways to make it possible for users to easily provide examples to the AI. Essentially that would mean selectively giving access for specific rows/columns to the AI.
[+] [-] metalspot|2 years ago|reply
to construct an SQL query you need to know the database schema, you need to be able to specify the relationships between tables, and you need to specify what data you are trying to retrieve.
the only way using plain written language can work is if you can infer the correct table names and relationships from the input text, which can only work if the database follows very strict naming conventions and/or proper foreign key usage and is small enough that none of the table or column names are ambiguous.
plain written language is much more ambiguous than a formal language like SQL.
how do you resolve ambiguities in the naming of tables and columns in the schema and in the input text for queries? if the output is wrong, is there an iterative process that can help the user refine the query?
[+] [-] Accujack|2 years ago|reply
This, by the way, is why programmers won't be out of a job due to AI any time soon... using an AI for non trivial generation of code just moves the code-run-debug loop from the computer language to AI prompts in English... which can be much harder to debug than e.g. Python.
Programmers will work hand in hand with large language models, but they're not going to be replaced with AI powered low code solutions any time soon.
[+] [-] Dennizz|2 years ago|reply
In my experience though it is often a significant time saver if I only have to review the output of the AI vs. coming up with everything myself.
Re: ambiguities: You are right, the AI won't always be able to infer the correct fields to use. In such cases though it is often enough to help the AI out a little. E.g. by saying "information X is stored in field Y of table Z".
Even if you have to do that, you can still save time and more importantly mental effort by letting AI help you, compared to writing all the SQL yourself.
Re: iterative process: You can simply send a follow up message saying "You did X wrong". It is usually happy to correct itself.
[+] [-] truevelvet|2 years ago|reply
I think it can help you write the queries faster but you have to know these things already. For example, at work, I can recall I need to join 5 tables to perform a certain lookup. It'd be cool if I didn't have to type all that, but without that knowledge, it would be useless.
[+] [-] ShadowBanThis01|2 years ago|reply
I find it depressing that so many people are willing to give their phone number to OpenAI.
FYI, there are a couple of typos on your homepage:
"It allows you to easily run SQL queries on a variaty of file formats"
"Combine the two, and you get a straigtforward way"
Good luck with the project!
[+] [-] suddenclarity|2 years ago|reply
[+] [-] Dennizz|2 years ago|reply
It does use one common OpenAI AI account.
Thanks for the hints, typos should be fixed now.
[+] [-] mmaia|2 years ago|reply
Small suggestion: show that it's a one time payment closer to the price. I kept staring at the price and thinking if it was yearly, until I looked at the button.
[+] [-] squeegee_scream|2 years ago|reply
[+] [-] Dennizz|2 years ago|reply
[+] [-] swah|2 years ago|reply
By the way, is this a template you used here? Looks modern and similar to a few other apps.
[+] [-] Dennizz|2 years ago|reply
Yeah I started with a landing page template from TailwindUI, then mixed in a few other building blocks also from TailwindUI, plus some customization.
[+] [-] jonaldomo|2 years ago|reply
[+] [-] Dennizz|2 years ago|reply
[+] [-] numerousEnt|2 years ago|reply
[+] [-] Dennizz|2 years ago|reply
To clarify, the common API key is known only by my server, not by the app!
[+] [-] replwoacause|2 years ago|reply
[+] [-] cloudking|2 years ago|reply
[+] [-] Dennizz|2 years ago|reply
[+] [-] RandomUser4976|2 years ago|reply
[+] [-] Dennizz|2 years ago|reply
[+] [-] juujian|2 years ago|reply
[+] [-] Dennizz|2 years ago|reply
I plan to make this process more smart eventually.
[+] [-] paulnovacovici|2 years ago|reply
[+] [-] Dennizz|2 years ago|reply
[+] [-] dingledork69|2 years ago|reply
[+] [-] Dennizz|2 years ago|reply
[+] [-] alexandargyurov|2 years ago|reply
[+] [-] kiwicopple|2 years ago|reply
https://supabase.com/blog/supabase-studio-2.0#supabase-ai--a...
[+] [-] Dennizz|2 years ago|reply
To install the new version, just restart the app. It should then prompt you to install the update.
[+] [-] Dennizz|2 years ago|reply
[+] [-] gomezjdaniel|2 years ago|reply
[+] [-] Dennizz|2 years ago|reply
[+] [-] endorphine|2 years ago|reply
[+] [-] Dennizz|2 years ago|reply
[+] [-] la64710|2 years ago|reply
[+] [-] Dennizz|2 years ago|reply