A lightweight Neovim plugin for executing SQL queries with minimal setup. Designed for quick and efficient database interactions directly from your workspace.
Note: This plugin is actively maintained and developed based on real-world needs. Breaking changes may occur as features are continuously improved.
- No need to leave your beloved neovim 🥰 to query!
- No external dependency (DB client)
- Flick your finger to run query, immediately
<leader>ss
-> select db (for once, in session)<leader>sq
-> run query
-
Database Connection Management
-
Query Execution
Using Lazy.nvim:
Note
When update the plugin and if there is some problem, recommend to run SQLFlickInstall
{
"nolleh/sqlflick.nvim",
config = function()
require("sqlflick").setup({
-- Configuration options (see below)
})
end,
-- recommended load plugin option
cmd = { "SQLFlickSelectDB", "SQLFlickExecute", "SQLFlickExecuteBuf", "SQLFlickInstall", "SQLFlickRestart" },
ft = { "sql" },
}
{
-- Database connections
databases = {
-- {
-- name = "local_mysql",
-- type = "mysql",
-- host = "localhost",
-- port = 3306,
-- database = "mydb",
-- username = "user",
-- password = "pass"
-- },
},
-- DBSelector window settings
selector = {
width = 60,
height = 15,
border = "rounded",
},
-- Display window settings
display = {
position = "bottom", -- "bottom" or "right"
size = {
height = 0.2, -- 20% of total height when position is "bottom"
width = 0.3, -- 30% of total width when position is "right"
},
size_absolute = {
height = nil, -- Absolute height in lines
width = nil, -- Absolute width in columns
},
},
-- Backend settings
backend = {
host = "localhost",
port = 8080,
},
}
The following mappings are available for SQL-related file types (e.g., .sql
, .pgsql
, .mysql
):
Command | Mode | Key Binding | Description |
---|---|---|---|
SQLFlickSelectDB |
n | <leader>ss |
Select database connection |
SQLFlickExecuteBuf |
n | <leader>sq |
Execute current line query |
SQLFlickExecute |
v | <leader>sq |
Execute selected query |
Database | Support | Planned | Remark |
---|---|---|---|
MySql | ✅ | ||
PostgreSQL | ✅ | ||
sqlite | ✅ | ||
Redis | ✅ | ||
Oracle DB | ✅ | ||
Mongo DB | ✅ | ||
Dynamo DB | ✅ |
Note
When update the plugin and if there is some problem, recommend to run SQLFlickInstall
If this is not sufficient to your situation and it occured after update the plugin, plz refer WIKI/Migration-Guide
We welcome and appreciate contributions from the community! Here's how you can help:
- Bug Reports: Found a bug? Please open an issue with detailed steps to reproduce.
- Feature Requests: Have an idea for a new feature? Open an issue to discuss it.
- Code Contributions: Submit a pull request with a clear description of your changes
- Documentation: Help improve our documentation by fixing typos, adding examples, or clarifying instructions.
Before contributing, please read our Contributing Guidelines (if available) and ensure your code follows our coding standards.
This project is licensed under the MIT License - see the LICENSE file for details.
Your feedback is valuable to us! Here are the ways you can contribute to the project's development:
Visit our GitHub repository to:
- Open an issue
- Submit a pull request
- Start a discussion
- Star the project to show your support