Spaces:
No application file
No application file
FORGE-X: Upload source (chrome_extension.zip)
Browse files- README.md +92 -7
- background/service-worker.js +15 -0
- content/content.js +18 -0
- icons/icon128.png +0 -0
- icons/icon16.png +0 -0
- icons/icon32.png +0 -0
- icons/icon48.png +0 -0
- manifest.json +54 -0
- popup/popup.css +11 -0
- popup/popup.html +16 -0
- popup/popup.js +19 -0
README.md
CHANGED
|
@@ -1,13 +1,98 @@
|
|
| 1 |
---
|
| 2 |
-
title:
|
| 3 |
-
emoji:
|
| 4 |
-
colorFrom:
|
| 5 |
-
colorTo:
|
| 6 |
sdk: gradio
|
| 7 |
-
sdk_version:
|
| 8 |
-
python_version: '3.13'
|
| 9 |
app_file: app.py
|
| 10 |
pinned: false
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 11 |
---
|
|
|
|
| 12 |
|
| 13 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
+
title: "AI SQL Query Builder and Optimizer Extension"
|
| 3 |
+
emoji: 💻
|
| 4 |
+
colorFrom: blue
|
| 5 |
+
colorTo: gray
|
| 6 |
sdk: gradio
|
| 7 |
+
sdk_version: 4.44.0
|
|
|
|
| 8 |
app_file: app.py
|
| 9 |
pinned: false
|
| 10 |
+
license: mit
|
| 11 |
+
tags:
|
| 12 |
+
- code
|
| 13 |
+
- software-engineering
|
| 14 |
+
- development
|
| 15 |
+
- programming
|
| 16 |
+
- saas
|
| 17 |
+
- api
|
| 18 |
+
- rate
|
| 19 |
+
- limiter
|
| 20 |
+
- quota
|
| 21 |
+
- indie
|
| 22 |
---
|
| 23 |
+
# AI SQL Query Builder and Optimizer Extension
|
| 24 |
|
| 25 |
+
Spend hours debugging SQL queries and optimizing database calls? The AI SQL Query Builder and Optimizer Extension eliminates query guesswork by generating, refining, and accelerating your SQL directly in your browser.
|
| 26 |
+
|
| 27 |
+
This extension transforms how developers write SQL—no more switching between IDEs and database tools, no more syntax errors or suboptimal performance. With AI-powered query generation and real-time optimization suggestions, you'll write production-ready SQL 10x faster while reducing database load and improving application speed.
|
| 28 |
+
|
| 29 |
+
## What's Included
|
| 30 |
+
|
| 31 |
+
- AI-powered SQL query generation from plain English descriptions
|
| 32 |
+
- Automatic query optimization with performance impact analysis
|
| 33 |
+
- Real-time syntax validation and error detection
|
| 34 |
+
- Multi-database support (MySQL, PostgreSQL, SQL Server, SQLite)
|
| 35 |
+
- One-click query formatting and explanation in natural language
|
| 36 |
+
|
| 37 |
+
## Who Is This For
|
| 38 |
+
|
| 39 |
+
- Full-stack developers tired of manual SQL query optimization and testing cycles
|
| 40 |
+
- Backend engineers building APIs who need to write efficient queries under time pressure
|
| 41 |
+
- Database administrators managing performance bottlenecks across multiple applications
|
| 42 |
+
- Junior developers learning SQL who need guidance on query structure and optimization
|
| 43 |
+
|
| 44 |
+
## How It Works
|
| 45 |
+
|
| 46 |
+
Install the extension in seconds, then pin it to your toolbar. As you work in your code editor or database management tool, describe the query you need in plain English or paste existing SQL. The extension analyzes your request, generates optimized queries with explanations, and shows performance recommendations instantly. Copy the result directly into your code—no friction, no context switching.
|
| 47 |
+
|
| 48 |
+
## Frequently Asked Questions
|
| 49 |
+
|
| 50 |
+
**Does this work with my database (PostgreSQL/MySQL/etc)?**
|
| 51 |
+
Yes. The extension supports PostgreSQL, MySQL, SQL Server, SQLite, and MariaDB. It auto-detects your database type and generates syntax-correct queries for your platform.
|
| 52 |
+
|
| 53 |
+
**Will it slow down my browser?**
|
| 54 |
+
No. The extension runs lightweight locally and only sends queries to our AI when you explicitly request optimization. Zero performance impact on your browsing.
|
| 55 |
+
|
| 56 |
+
**Is my SQL data private?**
|
| 57 |
+
Absolutely. Queries are encrypted in transit and never logged or stored. We process your requests to optimize them, then discard them immediately.
|
| 58 |
+
|
| 59 |
+
**Can it handle complex queries with joins, subqueries, and aggregations?**
|
| 60 |
+
Yes. The AI handles complex multi-table queries, nested selects, window functions, CTEs, and more. It even suggests indexes and restructuring for better performance.
|
| 61 |
+
|
| 62 |
+
**What if I'm already a SQL expert?**
|
| 63 |
+
You'll love it as a productivity tool—instantly validate syntax, explore alternative query structures, and catch performance issues before they hit production.
|
| 64 |
+
|
| 65 |
+
## What You Get
|
| 66 |
+
|
| 67 |
+
- Instant digital download
|
| 68 |
+
- Complete browser extension with full documentation
|
| 69 |
+
- Free updates for life — pay once, own forever
|
| 70 |
+
- Setup guide and usage instructions
|
| 71 |
+
|
| 72 |
+
**Stop wasting time on SQL—get the AI Query Builder extension today for $19.99 and reclaim hours of your development week.**
|
| 73 |
+
|
| 74 |
+
## 🚀 Usage
|
| 75 |
+
|
| 76 |
+
1. Click **Use in Spaces** above to run the demo directly
|
| 77 |
+
2. Or clone the repository and run locally:
|
| 78 |
+
|
| 79 |
+
```bash
|
| 80 |
+
git clone https://huggingface.co/spaces/WealthFromAI/ai-sql-query-builder-and-optimizer-extension-2a0e
|
| 81 |
+
cd ai-sql-query-builder-and-optimizer-extension-2a0e
|
| 82 |
+
pip install -r requirements.txt
|
| 83 |
+
python app.py
|
| 84 |
+
```
|
| 85 |
+
|
| 86 |
+
## 💰 Pricing
|
| 87 |
+
|
| 88 |
+
- **Demo**: Free on Hugging Face Spaces
|
| 89 |
+
- **Full Source Code**: $19.99
|
| 90 |
+
- Available on [Gumroad](https://gumroad.com) and [Whop](https://whop.com)
|
| 91 |
+
|
| 92 |
+
## 📄 License
|
| 93 |
+
|
| 94 |
+
MIT License — free to use, modify, and distribute.
|
| 95 |
+
|
| 96 |
+
---
|
| 97 |
+
|
| 98 |
+
*Built with [FORGE-X](https://github.com/WealthFromAI) — automated digital product engine*
|
background/service-worker.js
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
chrome.runtime.onInstalled.addListener((details) => {
|
| 2 |
+
if (details.reason === 'install') {
|
| 3 |
+
console.log('AI SQL Query Builder and Optimizer Extension installed');
|
| 4 |
+
chrome.storage.local.set({ installDate: Date.now(), version: '1.0.0' });
|
| 5 |
+
}
|
| 6 |
+
});
|
| 7 |
+
|
| 8 |
+
chrome.runtime.onMessage.addListener((message, sender, sendResponse) => {
|
| 9 |
+
if (message.type === 'getState') {
|
| 10 |
+
chrome.storage.local.get(null, (data) => {
|
| 11 |
+
sendResponse(data);
|
| 12 |
+
});
|
| 13 |
+
return true;
|
| 14 |
+
}
|
| 15 |
+
});
|
content/content.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
chrome.runtime.onMessage.addListener((request, sender, sendResponse) => {
|
| 2 |
+
if (request.action === 'analyze') {
|
| 3 |
+
try {
|
| 4 |
+
var data = {
|
| 5 |
+
status: 'ok',
|
| 6 |
+
title: document.title,
|
| 7 |
+
url: window.location.href,
|
| 8 |
+
headings: document.querySelectorAll('h1,h2,h3').length,
|
| 9 |
+
links: document.querySelectorAll('a[href]').length,
|
| 10 |
+
images: document.querySelectorAll('img').length
|
| 11 |
+
};
|
| 12 |
+
sendResponse(data);
|
| 13 |
+
} catch (e) {
|
| 14 |
+
sendResponse({ status: 'error', message: e.message });
|
| 15 |
+
}
|
| 16 |
+
}
|
| 17 |
+
return true;
|
| 18 |
+
});
|
icons/icon128.png
ADDED
|
|
icons/icon16.png
ADDED
|
|
icons/icon32.png
ADDED
|
|
icons/icon48.png
ADDED
|
|
manifest.json
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"manifest_version": 3,
|
| 3 |
+
"name": "AI SQL Query Builder and Optimizer Extension",
|
| 4 |
+
"short_name": "AI SQL Query",
|
| 5 |
+
"version": "1.0.0",
|
| 6 |
+
"description": "",
|
| 7 |
+
"author": "ForgeX Empire",
|
| 8 |
+
"homepage_url": "https://gumroad.com",
|
| 9 |
+
"permissions": [
|
| 10 |
+
"activeTab",
|
| 11 |
+
"storage",
|
| 12 |
+
"scripting"
|
| 13 |
+
],
|
| 14 |
+
"host_permissions": [
|
| 15 |
+
"http://*/*",
|
| 16 |
+
"https://*/*"
|
| 17 |
+
],
|
| 18 |
+
"background": {
|
| 19 |
+
"service_worker": "background/service-worker.js",
|
| 20 |
+
"type": "module"
|
| 21 |
+
},
|
| 22 |
+
"action": {
|
| 23 |
+
"default_popup": "popup/popup.html",
|
| 24 |
+
"default_title": "AI SQL Query Builder and Optimizer Extension",
|
| 25 |
+
"default_icon": {
|
| 26 |
+
"16": "icons/icon16.png",
|
| 27 |
+
"32": "icons/icon32.png",
|
| 28 |
+
"48": "icons/icon48.png",
|
| 29 |
+
"128": "icons/icon128.png"
|
| 30 |
+
}
|
| 31 |
+
},
|
| 32 |
+
"content_scripts": [
|
| 33 |
+
{
|
| 34 |
+
"matches": [
|
| 35 |
+
"http://*/*",
|
| 36 |
+
"https://*/*"
|
| 37 |
+
],
|
| 38 |
+
"js": [
|
| 39 |
+
"content/content.js"
|
| 40 |
+
],
|
| 41 |
+
"run_at": "document_idle",
|
| 42 |
+
"all_frames": false
|
| 43 |
+
}
|
| 44 |
+
],
|
| 45 |
+
"icons": {
|
| 46 |
+
"16": "icons/icon16.png",
|
| 47 |
+
"32": "icons/icon32.png",
|
| 48 |
+
"48": "icons/icon48.png",
|
| 49 |
+
"128": "icons/icon128.png"
|
| 50 |
+
},
|
| 51 |
+
"content_security_policy": {
|
| 52 |
+
"extension_pages": "script-src 'self'; object-src 'self'"
|
| 53 |
+
}
|
| 54 |
+
}
|
popup/popup.css
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
|
| 2 |
+
* { box-sizing: border-box; margin: 0; padding: 0; }
|
| 3 |
+
body { width: 350px; min-height: 200px; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; background: #fff; color: #1a1a1a; }
|
| 4 |
+
header { background: #2d5be3; color: #fff; padding: 12px 16px; }
|
| 5 |
+
header h1 { font-size: 14px; font-weight: 600; }
|
| 6 |
+
.content { padding: 16px; }
|
| 7 |
+
.btn { display: inline-block; background: #2d5be3; color: #fff; border: none; border-radius: 6px; padding: 8px 16px; font-size: 13px; cursor: pointer; width: 100%; text-align: center; }
|
| 8 |
+
.btn:hover { background: #1a3fa8; }
|
| 9 |
+
.result { margin-top: 12px; padding: 10px; background: #f5f7ff; border-radius: 6px; font-size: 12px; }
|
| 10 |
+
.upgrade { display: block; text-align: center; margin-top: 10px; font-size: 11px; color: #888; text-decoration: none; }
|
| 11 |
+
.upgrade:hover { color: #2d5be3; }
|
popup/popup.html
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<!DOCTYPE html>
|
| 2 |
+
<html>
|
| 3 |
+
<head>
|
| 4 |
+
<meta charset="utf-8">
|
| 5 |
+
<link rel="stylesheet" href="popup.css">
|
| 6 |
+
</head>
|
| 7 |
+
<body>
|
| 8 |
+
<header><h1>AI SQL Query Builder and Optimizer Extension</h1></header>
|
| 9 |
+
<div class="content">
|
| 10 |
+
<button class="btn" id="analyze">Analyze Page</button>
|
| 11 |
+
<div class="result" id="result"></div>
|
| 12 |
+
<a class="upgrade" href="#">Upgrade to Pro</a>
|
| 13 |
+
</div>
|
| 14 |
+
<script src="popup.js"></script>
|
| 15 |
+
</body>
|
| 16 |
+
</html>
|
popup/popup.js
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
document.addEventListener('DOMContentLoaded', () => {
|
| 2 |
+
const btn = document.getElementById('analyze');
|
| 3 |
+
const result = document.getElementById('result');
|
| 4 |
+
if (btn) {
|
| 5 |
+
btn.addEventListener('click', () => {
|
| 6 |
+
chrome.tabs.query({ active: true, currentWindow: true }, (tabs) => {
|
| 7 |
+
if (tabs[0]) {
|
| 8 |
+
chrome.tabs.sendMessage(tabs[0].id, { action: 'analyze' }, (response) => {
|
| 9 |
+
if (chrome.runtime.lastError) {
|
| 10 |
+
result.textContent = 'Could not connect to page. Try refreshing.';
|
| 11 |
+
return;
|
| 12 |
+
}
|
| 13 |
+
result.textContent = response ? JSON.stringify(response, null, 2) : 'No data';
|
| 14 |
+
});
|
| 15 |
+
}
|
| 16 |
+
});
|
| 17 |
+
});
|
| 18 |
+
}
|
| 19 |
+
});
|