The Adminer SQL Ollama Plugin integrates local AI models via Ollama directly into the SQL command interface of Adminer.
This allows you to generate, complete, and assist with SQL queries using a local AI model --- without sending your database structure or data to any external server.
It works similarly to the sql-gemini plugin, but everything runs
100% locally, ensuring maximum privacy and security.
- AI-powered SQL generation using Ollama
- Fully local execution --- no external API required
- Integrated with Adminer's native autocomplete system
- Access to your database schema for accurate query generation
- Lightweight and easy to install
- Privacy-friendly: your schema never leaves your machine
In my tests, the small model:
qwen2.5-coder:3b
produced excellent results, with fast responses. If you go for larger models, you may get high-quality SQL generation.
- Adminer
- Ollama installed and running
Example:
ollama pull qwen2.5-coder:3b
Place the plugin file into:
adminer-plugins/
Example:
adminer/
├── adminer.php
├── adminer-plugins.php
└── adminer-plugins/
└── sql-ollama.php
Edit:
adminer-plugins.php
Example:
<?php
return array(
new AdminerSqlOllama('http://127.0.0.1:11434', 'qwen2.5-coder:3b')
);AI-generated SQL queries based on natural language prompts, with access to the database schema for accurate results.
Autocomplete suggestions, providing relevant SQL keywords, table names, and column names as you type.
Everything runs locally. Your schema is never sent externally.
Distributed under the MIT license. See the LICENSE file for more details.
MIT License — Copyright (c) 2026 Guilherme Saldanha
Standalone desktop application that runs Adminer locally with an embedded PHP server and a native PyWebView interface.
https://github.com/guisaldanha/adminer-launcher
Adminer plugin that integrates Ollama to generate SQL queries using local AI models.
https://github.com/guisaldanha/sql-ollama
Custom dark theme for Adminer inspired by the Obsidian interface with amber accents.
https://github.com/guisaldanha/adminer-obsidian-amber
Developed by Guilherme Saldanha
- GitHub: https://github.com/guisaldanha
- Site: https://guisaldanha.com
If this project saves you time or helps your workflow, consider supporting its development.
Ways to help:
- ⭐ Star the repository
- 🔁 Share with other developers
- ☕ Buy me a coffee by clicking here (PayPal)
Made with ☕ by Guilherme Saldanha

