Build SQL queries without the syntax headaches! QueryCraft generates clean, correct SQL from simple commands.
The Problem: SQL syntax is annoying
- Easy to make mistakes
- Hard to remember exact syntax
- WHERE vs HAVING? JOIN vs LEFT JOIN?
- Forgetting semicolons, quotes, commas
The Solution: Build queries visually
- No syntax errors
- Clear, readable output
- Learn SQL by seeing examples
- Templates for common patterns
curl -sSL https://raw.githubusercontent.com/strabo231/querycraft/main/install.sh | bash# SELECT query
querycraft select users --where "age > 25" --order-by name
# INSERT query
querycraft insert users --columns "name,email" --values "'John','j@example.com'"
# UPDATE query
querycraft update users --set "status='active'" --where "id=5"
# Show templates
querycraft templatesselect <table> Build SELECT query
insert <table> Build INSERT query
update <table> Build UPDATE query
delete <table> Build DELETE query
templates Show common patterns
explain <query> Understand a query
validate <query> Check for errors
save <name> <query> Save for later
🎯 No syntax errors - Generated SQL is always valid
📝 Templates - Common patterns ready to use
✅ Validation - Catch dangerous queries
🎨 Pretty printing - Formatted, readable output
💡 Explanations - Understand what queries do
💾 Save queries - Reuse complex queries
Basic SELECT:
querycraft select usersSELECT *
FROM users;SELECT with conditions:
querycraft select users --columns "name,email" --where "age > 18" --order-by name --limit 10SELECT name,email
FROM users
WHERE age > 18
ORDER BY name
LIMIT 10;INSERT:
querycraft insert products --columns "name,price,stock" --values "'Laptop',999.99,50"INSERT INTO products (name,price,stock) VALUES ('Laptop',999.99,50);UPDATE (safe):
querycraft update users --set "last_login=NOW()" --where "id=123"UPDATE users SET last_login=NOW() WHERE id=123;DELETE (with warning):
querycraft delete logs --where "created_at < '2024-01-01'"DELETE FROM logs WHERE created_at < '2024-01-01';Dangerous query detection:
querycraft delete users⚠ This query will:
• DELETE FROM table: users
✗ No WHERE clause - will delete ALL rows!
Validation:
querycraft validate "UPDATE users SET status='active'"✗ UPDATE without WHERE will update ALL rows!
✗ Found 1 potential issues
querycraft templatesShows patterns for:
- Basic SELECT
- SELECT with WHERE
- SELECT with JOIN
- INSERT single/multiple rows
- UPDATE with WHERE
- DELETE with WHERE
- COUNT and aggregations
- GROUP BY
- LEFT JOIN
Learning SQL:
# See how queries are structured
querycraft select orders --join "customers ON orders.customer_id = customers.id"Quick queries:
# Build queries faster than typing
querycraft select products --where "price < 100" --order-by priceAvoid mistakes:
# Validation catches errors
querycraft validate "DELETE FROM important_table"
# ✗ No WHERE clause!- Bash 4.0+
MIT License
Sean - @strabo231
Build SQL. Without the pain. 🎯