Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/praczet/sql-command.nvim
Simple plugin to run sql command (for mariadb). It allows to run command from selection or for current line.
https://github.com/praczet/sql-command.nvim
mariadb query sql
Last synced: 24 days ago
JSON representation
Simple plugin to run sql command (for mariadb). It allows to run command from selection or for current line.
- Host: GitHub
- URL: https://github.com/praczet/sql-command.nvim
- Owner: Praczet
- License: mit
- Created: 2024-09-11T08:23:27.000Z (about 2 months ago)
- Default Branch: main
- Last Pushed: 2024-09-19T07:48:33.000Z (about 2 months ago)
- Last Synced: 2024-10-12T22:20:55.419Z (24 days ago)
- Topics: mariadb, query, sql
- Language: Lua
- Homepage:
- Size: 7.81 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# sql-command.nvim
Simple plugin to run SQL command (for MariaDB).
It allows to run command from a selection or for the current line.It uses MariaDB command (so it works only if the MariaDB client is installed).
> [!WARNING]
> This is very WIP project. I did it for myself, but it might be useful for
> others. And use it with caution## Usage
Basic usage:
1. Select SQL command
2. Go to command mode `:`
3. You should see: `:'<,'>`
4. Type `SQL` and hit `` you should have in command something like this:
`:'<,'>SQL`In this scenario SQL Command will be passed to mariadb client for the database
declared in the config file. (`/.db.json`)If you want to run a query from different database use: `:SQL `
This will open a "floated" window with query result. This window will also contain
executed query. You can adjust query and run it again.So the `.db.json` example:
```json
{
"database": "mydb"
}
```## Known restrictions
- For now it connects to local MariaDB server using `user's name` declared
in `~/.my.cnf` I do have plan to make this more configurable.
- Password is now also stored in `~/.my.cnf`. This also is planned to be added
in the nearest future.As I said I made this to be able simply run query directly from nvim in nvim
from selection.## TODO
- [ ] Add to config - user, password
- [ ] Add to config and command parameters style: markdown | simple
- [ ] Add some screenshots