{"repo":"chand1012/sql2gpt","free":true,"listed":false,"github":"https://github.com/chand1012/sql2gpt","clone":"git clone https://github.com/chand1012/sql2gpt.git","description":"Python tool to turn SQL Database Schemas into ChatGPT Prompts","language":"Python","stars":15,"topics":["chatgpt","gpt-3","gpt-35-turbo","sql","database","mysql","postgresql","sqlite"],"license":"MIT","category":"databases-storage","readme_excerpt":"SQL2GPT SQL2GPT is a Python-based tool that extracts the schema of a SQL database and generates a prompt for ChatGPT, a large language model by OpenAI. The goal of this project is to enable users to interact with ChatGPT to generate code or ask questions related to the given database schema. Table of Contents Prerequisites Installation Usage + Adding a Database Connection + Printing the Schema + Generating the ChatGPT Prompt License Prerequisites Python 3.10 or higher Installation Via uvx (no install needed) Via pip/uv From source Database URLs - PostgreSQL: postgresql://user:pass@localhost/dbname - MySQL: mysql+pymysql://user:pass@localhost/dbname - SQLite: sqlite:///path/to/db.sqlite Note: MySQL URLs must use mysql+pymysql:// prefix (not just mysql:// ). Usage Adding a Database Connection Add a new database connection by running: Where is the name you want to give to the connection, and is the URI for the database. Printing the Schema To print the schema of a database, run: Replace with the appropriate database URL for your SQL database or the name of the connection you added previously. Generating the ChatGPT Prompt To generate the ChatGPT prompt for a given database, run: Replace with the appropriate database URL for your SQL database or the name of the connection you added previously. The generated prompt can be passed to ChatGPT to obtain code or ask questions about the database. License This project is licensed under the MIT License.","default_branch":null,"files":null,"tree":[],"storefront":"/r/chand1012","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/chand1012/sql2gpt/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."}