[HN Gopher] Show HN: I built a database GUI with ChatGPT integra...
       ___________________________________________________________________
        
       Show HN: I built a database GUI with ChatGPT integration
        
       Hey there! I've been working on DB Pilot for the last couple of
       months, and I recently added an AI assistant powered by GPT 3.5 to
       help you write SQL queries tailored to your DB schema.  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.
        
       Author : Dennizz
       Score  : 65 points
       Date   : 2023-04-30 12:36 UTC (10 hours ago)
        
 (HTM) web link (www.dbpilot.io)
 (TXT) w3m dump (www.dbpilot.io)
        
       | paulnovacovici wrote:
       | Curious, what software did you use to make your videos on the
       | landing page?
        
         | Dennizz wrote:
         | They are made with https://www.screen.studio/
        
       | RandomUser4976 wrote:
       | Any plans to get this on windows?
        
         | Dennizz wrote:
         | If I can get some traction on this, I plan to support Windows
         | and Linux eventually.
        
       | endorphine wrote:
       | How come you didn't use ChatGPT 4?
        
         | Dennizz wrote:
         | I'd like to use it eventually but as of now API usage is too
         | limited.
        
       | throwaway8689 wrote:
       | There have been a few products like this announced recently and
       | they all have intro level examples on the home page. Can yours
       | deal with things like entity-attribute-value model tables?
        
         | Dennizz wrote:
         | No, currently it doesn't.
         | 
         | 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.
        
       | swah wrote:
       | Looks good - typo on the front-end: "AI assitant for your SQL
       | needs".
       | 
       | By the way, is this a template you used here? Looks modern and
       | similar to a few other apps.
        
         | Dennizz wrote:
         | Thanks for the hint!
         | 
         | Yeah I started with a landing page template from TailwindUI,
         | then mixed in a few other building blocks also from TailwindUI,
         | plus some customization.
        
           | chrisshroba wrote:
           | Also variaty -> variety, "can not" -> "cannot", and there's
           | at least one more place on the page that says "assitant" :)
        
       | juujian wrote:
       | Quick question out of curiosity: how do you handle the token
       | limit of ChatGPT?
        
         | Dennizz wrote:
         | Right now it's pretty simple: First I drop the table/column
         | information if the token limit gets exceeded otherwise (this is
         | shown as a warning in the UI). Then if the limit still gets
         | exceeded, the I show an error to the user.
         | 
         | I plan to make this process more smart eventually.
        
       | httpjames wrote:
       | [dead]
        
       | Closi wrote:
       | Considering it is a one-time payment, it would be nice if I could
       | use my own API key.
       | 
       | 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 wrote:
         | That's fair. The "no-tricks pricing" wording was taken 1-to-1
         | from the UI template I used :)
         | 
         | 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.
        
       | cloudking wrote:
       | This is cool, could you expand this into an API/SDK to plug the
       | chat feature into existing apps?
        
         | Dennizz wrote:
         | Interesting idea. Do you have some examples of how you would
         | like to use that, or maybe even an app where you'd like to
         | integrate it?
        
       | dingledork69 wrote:
       | How to run this on linux?
        
         | Dennizz wrote:
         | So far it's Mac only. If I can get some traction on this, I
         | plan to support Windows and Linux eventually.
        
       | la64710 wrote:
       | Cool can I use LLama or BERT with it?
        
         | Dennizz wrote:
         | It's GPT-3.5 only so far but I might add additional models at
         | some point.
        
       | khazhoux wrote:
       | Very cool.
       | 
       | 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_).
        
         | calmoo wrote:
         | Not my experience, nearly every time GPT 4 has produced code
         | that compiles / runs first time without errors.
        
           | Dennizz wrote:
           | I've had mostly the same experience as calmoo.
           | 
           | And when it does go wrong, I've had good success telling it
           | what it did do wrong. It will usually correct itself then.
        
       | mmaia wrote:
       | This is looking nice. Would definitely try it if I was still
       | doing SQL daily.
       | 
       | 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.
        
         | Dennizz wrote:
         | Thanks for the feedback, I'll try to improve that.
        
         | squeegee_scream wrote:
         | It'sa lifetime license for the gui but the AI is annual $49
        
           | Dennizz wrote:
           | Correct. When you buy the lifetime license you get one year
           | of the AI included, afterwards it is $49 per year for the AI
           | then.
           | 
           | I should make that more clear on the website.
        
       | ShadowBanThis01 wrote:
       | Does this use a common ChatGPT account, or do users have to sign
       | up themselves?
       | 
       | 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!
        
         | Dennizz wrote:
         | Thank you!
         | 
         | It does use one common OpenAI AI account.
         | 
         | Thanks for the hints, typos should be fixed now.
        
       | metalspot wrote:
       | the concern i would have here is that if you don't know SQL then
       | you have no way of knowing whether or not the results are correct
       | and if the results are wrong you have no way to debug the query.
       | 
       | 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?
        
         | truevelvet wrote:
         | This is the problem with these models in general, right?
         | 
         | 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.
        
           | abirch wrote:
           | Thoughts on a view?
        
         | Dennizz wrote:
         | Correct, you probably should know SQL.
         | 
         | 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.
        
           | tomhallett wrote:
           | I 100% agree. This is why I think that LLM's will help
           | encourage _better_ coding practices, not worse. The more that
           | you can write  "clean code" (things which are named
           | correctly, follow the single responsibility pricinciple,
           | don't violate the law of demeter, build the correct data-
           | models/data-marts), then the easier it will be for LLM's to
           | assist senior engineers in writing code/sql faster.
           | 
           | And if there is an interface given to people who will
           | struggle to evaluate the correct-ness of something, ie: a
           | Business Intelligence tool for people who don't know/care
           | about the data model, then the question becomes "How can the
           | tool facilitate getting the people who can verify the
           | correctness of the sql/code do so in an efficient manner?"
           | I'm thinking like a short-term pull-request, where the "code
           | committer" is the LLM and the reviewer is a human. Said in
           | another way: the chatbot is going in reverse, where chatgpt
           | is asking the questions and the human gives the answers......
           | haha
        
       | alexandargyurov wrote:
       | Doesn't seem to work with a Supabase Postgres DB.
        
         | kiwicopple wrote:
         | fwiw, there is an OpenAI assistant built into the Supabase
         | dashboard now -
         | 
         | https://supabase.com/blog/supabase-studio-2.0#supabase-ai--a...
        
         | Dennizz wrote:
         | Thanks for reporting. I'll have a look what's missing.
        
         | Dennizz wrote:
         | I just pushed a new release. It should work now!
         | 
         | To install the new version, just restart the app. It should
         | then prompt you to install the update.
        
       | hegem0n wrote:
       | This is brilliant, but please do MongoDB. It's less intuitive to
       | query and could benefit greatly from GPT
        
         | tillvz wrote:
         | At Veezoo (https://veezoo.com) we're about to launch a MongoDB
         | connector leveraging Trino, hit me up if you wanna test it.
        
         | Dennizz wrote:
         | Noted!
        
       | gomezjdaniel wrote:
       | Which language did you use to code the application?
        
         | Dennizz wrote:
         | Typescript and Rust, with SvelteKit and Tauri.
        
       ___________________________________________________________________
       (page generated 2023-04-30 23:02 UTC)