{"id":35214731,"url":"https://github.com/ah-naf/nlsql","last_synced_at":"2026-04-07T13:32:13.456Z","repository":{"id":288720623,"uuid":"968977019","full_name":"ah-naf/nlsql","owner":"ah-naf","description":"Natural Language to SQL using LLM","archived":false,"fork":false,"pushed_at":"2025-04-26T16:15:25.000Z","size":35957,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"origin","last_synced_at":"2025-04-26T16:39:22.251Z","etag":null,"topics":["gin","golang","llm","postgresql"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ah-naf.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-04-19T05:30:07.000Z","updated_at":"2025-04-26T16:15:29.000Z","dependencies_parsed_at":"2025-04-19T13:46:38.941Z","dependency_job_id":"0fa3f688-9543-4d43-9fb2-768d0b88b7d8","html_url":"https://github.com/ah-naf/nlsql","commit_stats":null,"previous_names":["ah-naf/nlsql"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ah-naf/nlsql","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ah-naf%2Fnlsql","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ah-naf%2Fnlsql/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ah-naf%2Fnlsql/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ah-naf%2Fnlsql/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ah-naf","download_url":"https://codeload.github.com/ah-naf/nlsql/tar.gz/refs/heads/origin","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ah-naf%2Fnlsql/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31515144,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-07T03:10:19.677Z","status":"ssl_error","status_checked_at":"2026-04-07T03:10:13.982Z","response_time":105,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["gin","golang","llm","postgresql"],"created_at":"2025-12-29T21:23:30.063Z","updated_at":"2026-04-07T13:32:13.451Z","avatar_url":"https://github.com/ah-naf.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# NL→SQL\n\nA simple web application that lets you ask natural-language questions about your PostgreSQL database and have them converted into SQL queries by an LLM. It includes schema browsing, query confirmation for destructive statements, and result display with pagination and hover-tooltips.\n\n---\n\n## ✨ Features\n\n- **Natural Language → SQL**: Describe what you want in plain English, and the app generates a SQL statement.\n- **Schema Browser**: View tables, columns, data types, primary/foreign key badges, and search/filter tables.\n- **Confirmation Flow**: Destructive operations (INSERT, UPDATE, DELETE, etc.) require confirmation.\n- **Result Rendering**: Paginated, responsive table with hover popovers for long content.\n- **Database Connection**: Connect to or create databases directly from the UI.\n\n---\n\n## 🔧 Environment Variables\n\nPlace a `.env` file at the project root with the following:\n\n```ini\n# For Together AI (default)\nLLM_API_KEY=your-together-api-key\nLLM_API_URL=https://api.together.xyz/v1/chat/completions\nLLM_API_MODEL_NAME=meta-llama/Llama-3-70B-Instruct\n\n# OR for Gemini (optional alternative)\nGEMINI_API_URL=https://generativelanguage.googleapis.com/v1beta/models/gemini-2.0-flash:generateContent?key=your-gemini-api-key\n````\n\n## 🚀 Local Development\n\n### 1. Clone the repository\n\n```bash\ngit clone https://github.com/ah-naf/nlsql.git\ncd nlsql\n```\n\n### 2. Backend setup\n\n```bash\ncd backend\ngo mod tidy\n```\n\n### 3. Frontend setup\n\n```bash\ncd ../frontend\nnpm install\nnpm run build\n```\n\n### 4. Run the application\n\n```bash\ncd ../backend\ngo run cmd/main.go\n```\n\nOpen `http://localhost:8080` in your browser.\n\n---\n\n## 🐳 Run with Docker\n\nThis project supports multi-stage Docker builds (frontend + backend). Here's how to build and run:\n\n### 1. Build the image\n\n```bash\ndocker build -t nlsql-app .\n```\n\n### 2. Run the container\n\n```bash\ndocker run -p 8080:8080 nlsql-app\n```\n\n\u003e Make sure your PostgreSQL instance is accessible from the container.\n\n### 3. Open the app\n\nVisit: [http://localhost:8080](http://localhost:8080)\n\n---\n\n## 💡 Example Prompts\n\n* `Show all orders placed in the last 24 hours`\n* `Add a new user named Alice with email alice@example.com`\n* `Delete all rows from temp_sessions table`\n\n---\n\n## 📄 License\n\nThis project is open-source and available under the [MIT License](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fah-naf%2Fnlsql","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fah-naf%2Fnlsql","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fah-naf%2Fnlsql/lists"}