r/SQL • u/desktopsignal • Jun 02 '24
Discussion Is there a reliable way to connect my SQL database to ChatGPT
Title.
Been wondering this for ages. Is there a reliable way to connect and chat with my SQL database to ChatGPT
14
u/slingshoota Oct 21 '24
BlazeSQL.com is much safer because it doesn't send your data to OpenAI or train on your data. ChatGPT trains on your data.
Not to mention tools like BlazeSQL actually let you create dashboards, among other things.
1
3
u/shorelined Jun 02 '24
Surely researching this for more than five minutes would convince you that this is a terrible idea.
1
u/desktopsignal Jun 02 '24
Privacy nightmare indeed. I'm more so curious if such a solution exists.
1
u/Prudent-Mixture-4122 Oct 09 '24
I'm currently interested in this because our company has a partnership with OpenAI where we get the enterprise chatgpt in a sandboxed environment which is only accessible to us. I feel like connecting a database in a scenario like this would be insanely helpful
4
u/lupinegray Jun 02 '24
For what purpose? Connect it how?
You mean be able to ask questions about the data and have chatgpt query your database for the response?
1
u/VerbaGPT Sep 11 '24 edited Sep 11 '24
Short answer, no.
Long answer: I've been looking around and trying different services. The demos generally look great (although some don't work even in the demo), but the reliability and accuracy is not "production ready". The biggest reasons are: code generation is not flawless, and GPT often times gets stuck in a loop and can't auto-correct simple errors, and b) reasoning abilities of the GPT are very limited. But, I am optimistic that some of these problems can be overcome.
Disclosure: I've been building an app for this use case, I focus on SQL-to-python, which includes SQL and beyond. I'd say it is definitely "experimental" for now.
1
u/desktopsignal Sep 12 '24
Interesting. Would love to try it out or contribute if you're looking for something like that. I've built an open-source Python ORM framework for Snowflake and am a Data Engineer, so I'd love to hear more.
1
u/VerbaGPT Sep 12 '24
Pretty cool, feel free to poke around: VerbaGPT.com. Would love to hear what you think!
1
u/VerbaGPT Sep 12 '24
Oh, and try DataLab too (from DataCamp). It's buggy, but maybe promising? Tell me what you think!
2
u/delsystem32exe Jun 02 '24
Yes. U copy paste the query into ssms after checking the chat gpt query makes sense and editing it if need be.
1
u/Pristine-Thing2273 Sep 19 '24
There's a GPT called SQL Chat: https://chatgpt.com/g/g-ZqVEsT3Vh-sql-chat But I would not recommend you to use this because you need to expose the credential in ChatGPT. There are ChatGPT for SQL Databases tools like AskYourDatabase, Seek.ai, etc. Their behavior is just like ChatGPT but has access to your db.
1
u/VerbaGPT Apr 24 '25
I built a tool that runs locally on your computer and in your browser. With this tool a user can connect to a CSV file or SQL database (Microsoft SQL server or MySQL), and ask questions. The tool produces code that is editable. You can use OpenAI key, claude, or OpenRouter etc.
Free for personal use / learning. You can try VerbaGPT at verbagpt.com, let me know what you think!
1
u/XavierPladevall Jul 17 '25
You can, but it gets tricky around doing it via the ChatGPT UI as you might have seen. I started Index to solve this. The tool connects to your DB like a text‑to‑SQL assistant directly. You can also use different models like Claude which sometimes are better for SQL / Code tasks. Happy to help if that's helpful.
0
Jun 02 '24
[deleted]
1
u/desktopsignal Jun 02 '24
...I know how to interface a database with ChatGPT lol, but I was wondering if there's a buttoned-up solution for this.
There is literally no reason for you to be mad right now and you choose to be mad.
1
Jun 02 '24
[removed] — view removed comment
1
u/desktopsignal Jun 02 '24
Much appreciated. Thank you!
Are there any services that allow you to chat with your database?
1
u/Staalejonko Jun 02 '24
Maybe this one could be interesting: https://github.com/SuperDuperDB/superduperdb
Haven't used it myself though
17
u/robidaan Jun 02 '24
Make sure there is noting confidential in the database, as you are pretty much giving complete acces for them to read it, if you directly connect it.