News for hackers. Stuff that matters.
Re:Ben Forta – How to Generate SQL Statements with ChatGPT by simonw on Wednesday July 12, 2023 @01:23PM (#36698195)
If you can export your data to SQLite first (my https://datasette.io/tools/db-to-sqlite tool can help with that) you can upload the SQLite database directly to ChatGPT Code Interpreter and have it run the queries for you, since sqlite3 is in the Python standard library

If you do this, it will automatically retry with a new SQL query if it gets any error messages.

Re:Ben Forta – How to Generate SQL Statements with ChatGPT by mritchie712 on Wednesday July 12, 2023 @02:18PM (#36699260)
It's really good at generating sqlite db's[0] too.

0 - https://chat.openai.com/share/5534e0b2-4010-4da6-99b9-a3aa02...

Re:Ben Forta – How to Generate SQL Statements with ChatGPT by liquids on Wednesday July 12, 2023 @03:06PM (#36700082)
I listened to you on the latentspacepod the other day and tried this method myself.

  1. Used GPT-4 to build functions that pulled in sample datasets from my BigQuery.

  2. Used GPT-4 to insert them into a sqlite database.

  3. Upload the zip file into Code Interpreter.

  4. Now I'm in an environment to quickly self-iterate on GPT-4 generated SQL.
It felt incredibly powerful. Previously I was developing with the latency of 100Gb+ tables – now the sqlite db responds instantly, and I don't even need to write the code.