📈 GH Trending Explorer 🎲 Surprise me

← all repos

kristijanhusak / vim-dadbod-completion

git clone https://github.com/kristijanhusak/vim-dadbod-completion.git 🔥 on GitHub Trending today

Database autocompletion powered by https://github.com/tpope/vim-dadbod

+0
stars, 24h · #23,655
+~0
stars, 7 days · #32,244
+3
stars, 30 days · #35,782
801
★ total
41
forks · 14 open issues

Star history (as recorded here)

2026-10-20 · 801 ★ 2026-10-23 · 801 ★
LanguageVim Script
LicenseMIT
Created2020-04-09 (6y ago)
Last push1y ago
Watchers7
OwnerUser

Seen on GitHub Trending

  • 2026-10-23 — #13 monthly in vim-script · +3 ★
  • 2026-10-22 — #14 monthly in vim-script · +3 ★
  • 2026-10-21 — #13 monthly in vim-script · +3 ★
  • 2026-10-20 — #13 monthly in vim-script · +3 ★

GitHub topics

Links

README excerpt
# vim-dadbod-completion
Database auto completion powered by vim-dadbod.
Supports:
* coc.nvim
* deoplete.nvim
* nvim-compe
* nvim-cmp
* ddc.vim
* blink.cmp
* Built in `omnifunc`
Video presentation by TJ:
## Install
**Dependencies**:
* vim-dadbod
For coc.nvim
 [code] 
For `deoplete`, `completion-nvim`, `nvim-compe`, `ddc` and `omnifunc`, install it with your favorite plugin manager.
 [code] 
Configuration using lazy.nvim with vim-dadbod-ui
 [code] 
## Features
* Autocomplete table names, with automatic quoting where needed. Works for all schemes that vim-dadbod supports.
* Autocomplete table columns, context aware. Also knows to read aliases (`select * from mytable tbl where tbl.id = 1`). Currently works for `PostgreSQL`, `MySQL`, `Oracle`, `SQLite` (requires version `3.37.0 (2021-11-27)`) and `SQLserver/MSSQL`.
* Out of the box integration with vim-dadbod-ui
## How it works
* If an sql buffer is created by vim-dadbod-ui, it reads all the configuration from there. It should work out of the box.
* If `vim-dadbod-ui` is not used, there are multiple ways to define the connection string, prioritized by this order:
 * Window variable - example: `let w:db = 'postgresql://user:pass@localhost:5432/db_name'`
 * Tab variable - example: `let t:db = 'postgresql://user:pass@localhost:5432/db_name'`
 * Buffer variable - example: `let b:db = 'postgresql://user:pass@localhost:5432/db_name'`. You can also add `let b:db_table = 'table_name'` to limit column completions only to this table
 * Global variable - example: `let g:db = 'postgresql://user:pass@localhost:5432/db_name'`
 * `$DATABASE_URL` env variable, defined outside of Vim, or inside with `let $DATABASE_URL = 'postgresql://user:pass@localhost:5432/db_name'`
## Settings
Default mark for completion items is `[DB]`. To change it, add this to vimrc:
 [code] 
## Commands
This plugin caches the database tables and columns to leverage maximum performance. If you want to clear the cache at any point just run:
 [code] 
## Todo
* [ ] Integration for column autocompletion with more database types