Database management for Neovim.
The supported databases at the moment:
Install pynvim
pip3 install pynvim
Install pyyaml
pip3 install pyyaml
Install Neovim plugin
Plug 'dinhhuy258/vim-database', {'branch': 'master', 'do': ':UpdateRemotePlugins'}
Install sqlite3 (Optional - skip if you don’t use sqlite)
brew install sqlite
Install postgres client (Optional - skip if you don’t use postgres)
brew install postgresql
Install msyql client (Optional - skip if you don’t use mysql)
brew install mysql
VDToggleDatabase
: Open or close database managementVDToggleQuery
: Open or close query terminalVimDatabaseListTablesFzf
: List all tables in fzfYou can map these commands to another keys:
nnoremap <silent> <F3> :VDToggleDatabase<CR>
nnoremap <silent> <F4> :VDToggleQuery<CR>
nmap <silent> <Leader>fd :VimDatabaseListTablesFzf<CR>
If you see an error Not and editor command: VDToggleDatabase
you need to run :UpdateRemotePlugins
. If the error still occurs, run the following command
pip install --user --upgrade pynvim
then restart nvim and re-run :UpdateRemotePlugins
and finally restart nvim, :VDToggleDatabase
will exist
Check the default key binding here
You can tweak the behavior of Database by setting a few variables in your vim setting file. For example:
let g:vim_database_rows_limit = 50
let g:vim_database_window_layout = "bottom"
...
The maximum number of rows to display in table results.
Default: 50
Set the layout for database window.
Possible values:
left
right
above
below
Default: left
Set size for database window.
Default: 100
Navigate between connection, database, table mode:
<Leader> c
: Go to connection mode<Leader> d
: Go to database mode<Leader> t
: Go to table modec
)dd
)s
)m
)s
)f
)F
)s
)dd
).
)o
)O
)f
)F
)a
)A
)dd
)m
)p
)C
)M
)P
).
)right-arrow
)left-arrow
)r
)