A command-line tool for SQL AI queries
Project description
# SQLAI
SQLAI is a command-line tool that uses generative AI (Google Gemini, OpenAI, etc.) to help you interact with SQL queries. It can explain, validate, and (soon) improve SQL queries, leveraging the power of modern AI models.
—
## Features
Explain Explains in plain English what SQL query does.
Validate check for general correctness.
Improve (coming soon): Suggest improvements to your SQL queries.
Configurable: Choose your AI provider, API key, and model.
Simple CLI: Easy-to-use command-line interface.
—
## Local Development
To set up your development environment and use the CLI tool while working on the project:
### 1. Clone the repository
`bash git clone https://github.com/alexanderbrueck/sqlai.git cd sqlai `
### 2. Install in editable mode
From the project root, run:
`bash pip install -e . `
The -e . flag installs your package in “editable” mode, so changes to the code are immediately reflected without reinstalling.
All required dependencies will be installed automatically, as they are specified in setup.py (install_requires).
You do not need to run `pip install -r requirements.txt` separately.
—
## Quick Start
Configure your AI provider and credentials:
`bash sqlai set_config `
You’ll be prompted for: - AI provider (e.g., gemini, openai) - API key - Model name (e.g., gemini-1.5-flash)
Analyze a SQL file:
`bash sqlai run path/to/your_query.sql `
You will be shown several actions (explain, validate, …), and you can select one interactively.
Show your current configuration:
`bash sqlai show_config `
—
## Example Usage
`bash sqlai set_config sqlai run my_query.sql `
—
## Requirements
Python 3.7+
[google-generativeai](https://pypi.org/project/google-generativeai/)
[tomli](https://pypi.org/project/tomli/)
[tomli-w](https://pypi.org/project/tomli-w/)
Install all dependencies via:
`bash pip install -r requirements.txt `
—
## License
MIT License. See [LICENSE](LICENSE) for details.
—
## Notes
Only .sql files are supported for analysis.
The “improve” feature is coming soon.
Your credentials are stored in ~/.sqlai/config.toml.
—
## Contributing
Pull requests and feedback are welcome! Please open an issue or PR to discuss changes or suggestions.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file sqlai-0.1.0.tar.gz.
File metadata
- Download URL: sqlai-0.1.0.tar.gz
- Upload date:
- Size: 4.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
934f7de6c8b35f92d02e858001ebee8cbd41c3d212edea83dfe268cf848a613e
|
|
| MD5 |
36c97d46a1ef863c575ceb63af7eb9c0
|
|
| BLAKE2b-256 |
d890b172786e1afcec51f6b54f1d854c438c9a1d5bda6275ad235a7c0df8dc27
|
File details
Details for the file sqlai-0.1.0-py3-none-any.whl.
File metadata
- Download URL: sqlai-0.1.0-py3-none-any.whl
- Upload date:
- Size: 5.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
781a018d0610e20650ecc70ca85df0bd2e647b61d8409bec96885335115db38e
|
|
| MD5 |
5912ecf901f635df3667c87fc8776781
|
|
| BLAKE2b-256 |
97f2380cd822ea775d59462179fae4ed0c4e2f7613f7d08f3eaed5ea6f2d6f48
|