{"repo":"iloveitaly/sql-ai-prompt-generator","free":true,"listed":false,"github":"https://github.com/iloveitaly/sql-ai-prompt-generator","clone":"git clone https://github.com/iloveitaly/sql-ai-prompt-generator.git","description":"Utility to generate ChatGPT prompts for SQL writing, offering table structure snapshots and sample row data from Postgres and sqlite databases.","language":"Python","stars":10,"topics":["chatgpt","database","llms","postgres","prompt","sql","sqlite"],"license":"MIT","category":"databases-storage","readme_excerpt":"ChatGPT Prompt for SQL Writing Generate a prompt for writing SQL queries with LLMs like ChatGPT. Drop your database URL and table name into the script and it will generate a prompt for you to copy and paste into your favorite LLM. What this does - Snapshot of Table Structure: Understand the columns, types, and organization of your table at a glance. - Sample Rows: Includes INSERT statements to describe the data in your table. - Extracts Table and Field Comments: If you have comments on your tables or columns, they will be included in the prompt. Usage Install the package: Here's how to use it: Generate a prompt from a postgres database: From a local sqlite database: Tunneling to a remote port If you find yourself wanting to tunnel into a remote box and work with a production database, here's some helpful commands so you don't need to remember the weird SSH tunneling syntax: TODO Super basic script, needs a lot of work - [x] pg support - [x] one entrypoint - [x] use DB comments on columns + tables - [x] multiple tables - [ ] prompt tweaking - [ ] understand prompt size limits and sample records until one fits","default_branch":null,"files":null,"tree":[],"storefront":"/r/iloveitaly","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/iloveitaly/sql-ai-prompt-generator/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}