Releases: Dadiya-Harsh/sql_tool
v0.1.9
Release Notes - sql-agent v0.1.9
Overview
We are pleased to announce the release of sql-agent v0.1.9, introducing a fully implemented CLI interface and an updated licensing model. This version enhances usability and provides clearer legal terms for both open-source and commercial use.
Key Changes
-
CLI Implementation
- Description: The
sql-agent-toolcommand-line interface is now fully functional, supporting interactive database management with PostgreSQL. Key commands include:init: Initialize database schemas.query: Execute natural language queries.shell: Start an interactive SQL shell.update: Manage database updates (disabled in read-only mode by default).
- Configuration: Loads
config.yamlfrom the current working directory by default, with support for custom paths via the--configoption. - Impact: Offers a powerful alternative to script-based usage, improving accessibility for users.
- Description: The
-
New Licensing Model
- Description: Transitioned from the MIT license to Apache 2.0 for open-source use, complemented by a dual-licensing approach with a commercial license defined in
COMMERCIAL.md. - Details:
- Apache 2.0 provides enhanced patent protection and redistribution terms, suitable for community development.
- The commercial license (
COMMERCIAL.md) supports proprietary applications. - Deprecated
EULA.mdhas been removed to streamline licensing documentation.
- Impact: Ensures robust open-source terms while enabling commercial flexibility.
- Description: Transitioned from the MIT license to Apache 2.0 for open-source use, complemented by a dual-licensing approach with a commercial license defined in
Installation
To get started with v0.1.9:
pip install sql-agent-toolExplore available options:
sql-agent-tool --helpResources
- Source Code: https://github.com/Dadiya-Harsh/sql-agent
- Commercial License: https://github.com/Dadiya-Harsh/sql-tool/blob/main/COMMERCIAL.md
Feedback
We welcome your input on this release. Report issues or suggest improvements via the repository.
Full Changelog: v0.1.8...v0.1.9
v0.1.8
updated pyproject.toml file
v0.1.7
Ready for building conda library, now users can download it as conda library too.
Full Changelog: v0.1.6...v0.1.7
v0.1.6
updated required library in pyproject.toml file and added new test cases
v0.1.5
New release installation issue is resolved now..
Full Changelog: v0.1.4...v0.1.5
v0.1.4
📦 SQL Agent Tool v0.1.4
This release updates requiremnts.txt
Developed By - @Dadiya-Harsh, @Dadiya-Harsh-wappnet
Full Changelog: v0.1.3...v0.1.4
v0.1.3
📦 SQL Agent Tool v0.1.3
This release introduces an interactive chat interface and enhanced LLM flexibility, empowering users to select their preferred language model for natural language to SQL conversion.
🔧 Updates
- Chat Interface: Added an interactive chat mode for real-time query input and execution.
- LLM Selection: Users can now choose from multiple LLM providers (Groq, Gemini, OpenAI, DeepSeek) to generate SQL, tailored to their needs.
📊 Sample Code
# Launch chat interface and select LLM
#this are contents of test1.py for testing of tool
from sql_agent_tool.model import SQLAgentTool, DatabaseConfig, LLMConfig
config = DatabaseConfig(
drivername="postgresql",
username="postgres",
password="password",
host="localhost",
port=5433,
database="P2"
)
llm_config = LLMConfig(provider="gemini", api_key=LLM_API_KEY, model="models/gemini-1.5-flash", max_tokens=500)
sql_tool = SQLAgentTool(config, llm_config)
try:
print("\nQuery 1:")
q1_start = time.time()
result = agent_tool.process_natural_language_query("what are top courses purchased by maximum students?")
print(f"Query 1 total time: {time.time() - q1_start:.2f} seconds")
if result.success:
print(f"Query executed successfully, found {result.row_count} results:")
for row in result.data:
print(row)
print("\nQuery 2:")
q2_start = time.time()
result2 = agent_tool.process_natural_language_query("Are there any student named harsh?")
print(f"Query 2 total time: {time.time() - q2_start:.2f} seconds")
if result2.success:
print(f"Query executed successfully, found {result2.row_count} results:")
for row in result2.data:
print(row)
except Exception as e:
print(f"Error processing queries: {e}")
finally:
agent_tool.close()
print(f"Total time: {time.time() - start_time:.2f} seconds")📊 Sample Output
Selected LLM: Gemini
Enter your query: Show me all courses with the most purchases
Generated SQL:
SELECT c.id, c.title, COUNT(p.id) as purchase_count
FROM courses c
JOIN payments p ON c.id = p.course_id
GROUP BY c.id, c.title
ORDER BY purchase_count DESC
LIMIT 500;
Parameters: {}
Query executed successfully, found 14 results:
{'id': ..., 'title': 'Social Media Marketing (SMM)', 'purchase_count': 6}
...
Developed By - @Dadiya-Harsh, @Dadiya-Harsh-wappnet
Notes
- Version: Bumped to
v0.1.3since this is a significant feature update (chat interface + LLM choice) beyond the initialv0.1.2. - Sample Code: Assumed
test1.pynow supports--chatand--llmflags for the chat interface and LLM selection. If your implementation differs (e.g., no CLI flags), let me know, and I’ll adjust it! - Sample Output: Adapted from your latest Groq-based run, simplified for brevity.
Full Changelog: v0.1.2...v0.1.3
SQL Agent Tool v0.1.2
📦 SQL Agent Tool v0.1.2
This is the initial release of sql-agent-tool, now available on PyPI!
🔧 Features
- Safe SQL query execution using SQLAlchemy
- Natural language to SQL (via Groq LLM)
- Schema reflection & parameter extraction
- Custom exception handling
- Pytest-based test suite with temporary tables
📊 Sample Code
result = sql_tool.process_natural_language_query("Tell me about user named harsh")📊 Sample Output
Extracted parameters: {'search_pattern': 'harsh'}
SQL with parameters:
-- Find user by first name or last name
SELECT *
FROM users
WHERE first_name ILIKE :search_pattern
OR last_name ILIKE :search_pattern
LIMIT 500;
-- Parameter: search_pattern = '%harsh%'
Query executed successfully, found 1 results:
{'id': 1, 'first_name': 'Harsh', 'last_name': 'Dadiya', 'email': 'harshd.wappnet@outlook.com', ...}
Developed By - @Dadiya-Harsh, @Dadiya-Harsh-wappnet
SQL Agent Tool v0.1.1
📦 SQL Agent Tool v0.1.1
This is the initial release of sql-agent-tool, now available on PyPI!
🔧 Features
- Safe SQL query execution using SQLAlchemy
- Natural language to SQL (via Groq LLM)
- Schema reflection & parameter extraction
- Custom exception handling
- Pytest-based test suite with temporary tables
📊 Sample Output
result = sql_tool.process_natural_language_query("Tell me about user named harsh")
Extracted parameters: {'search_pattern': 'harsh'}
SQL with parameters:
-- Find user by first name or last name
SELECT *
FROM users
WHERE first_name ILIKE :search_pattern
OR last_name ILIKE :search_pattern
LIMIT 500;
-- Parameter: search_pattern = '%harsh%'
Query executed successfully, found 1 results:
{'id': 1, 'first_name': 'Harsh', 'last_name': 'Dadiya', 'email': 'harshd.wappnet@outlook.com', ...}Developed By - @Dadiya-Harsh
🔗 [View on PyPI]
Full Changelog: https://github.com/Dadiya-Harsh/sql-tool/commits/v0.1.1