bunny-sql-assistant 0.0.1

🐰 Bunny SQL Assistant is a CLI tool that converts natural language into SQL using local LLMs like Ollama.
bunny-sql-assistant-0.0.1 is not a library.

🐰 Bunny SQL Assistant

Bunny SQL Assistant is an open-source CLI tool built with Rust that enables non-technical users to write and execute SQL queries using natural language. It leverages local LLMs like DeepSeek-Coder via Ollama to generate SQL queries from prompts in Indonesian or English.


✨ Features

  • 🔌 Database configuration (currently supports SQLite)
  • 💬 Natural language input (Indonesian or English)
  • 📜 Generate and execute SQL directly in the terminal
  • 🧠 Uses local LLM via Ollama (offline & private)
  • 📊 Neatly formatted table output

📦 Installation

Prerequisites

  • Rust >= 1.73
  • SQLite (as example database)
  • Ollama with a local model such as deepseek-coder installed

Clone & Build

git clone https://github.com/yourname/bunny-sql-assistant.git
cd bunny-sql-assistant
cargo build --release

Global Install (Optional)

cargo install --path .

🚀 Usage

1. Configure the database connection (e.g. SQLite)

bunny config sqlite://test.db

2. Run a query using natural language

bunny query "Show top 3 products by sales"

Sample Output:

📜 Generated SQL:
SELECT * FROM produk ORDER BY penjualan DESC LIMIT 3;

+----+------------+-----------+
| id | name       | sales     |
+----+------------+-----------+
| 2  | Smartphone | 300       |
| 8  | Flashdisk  | 250       |
| 3  | Mouse      | 200       |
+----+------------+-----------+

🐳 Run with Docker

1. Build the Docker image

docker build -t bunny .

2. Run a query

docker run --rm -v $(pwd)/test.db:/app/test.db bunny query "Show all products"

⚙️ .env Configuration

Create a .env file to store default settings:

OLLAMA_URL=http://localhost:11434
OLLAMA_MODEL=deepseek-coder

🛠 Technology Stack

  • Language: Rust
  • Async Runtime: tokio
  • CLI Parser: clap
  • Database Layer: sqlx
  • Table Renderer: tabled
  • HTTP Client: reqwest
  • Local LLM API: Ollama

🌱 Roadmap

  • Support for PostgreSQL & MySQL
  • SQL validation before execution
  • Query logging
  • Editable query results
  • Plugin system

🤝 Contributing

Pull requests are welcome! Feel free to fork the repo, add features or improvements, and open a PR.


📄 License

MIT License © 2025 - Albany Siswanto