Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show Full Minutes and Seconds on Query Execute #241

Merged
merged 8 commits into from
May 27, 2024
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,14 @@ This option must be disabled (set to 0) for Redshift.
let g:db_ui_use_postgres_views = 0
```

## Disable builtin progress bar
If you want to utilize *DBExecutePre or *DBExecutePost to make your own progress bar
or if you want to disable the progress entirely set to 1.

```vimL
let g:db_ui_disable_progress_bar = 1
```

## TODO

* [ ] Test with more db types
16 changes: 9 additions & 7 deletions autoload/db_ui/dbout.vim
Original file line number Diff line number Diff line change
Expand Up @@ -332,11 +332,13 @@ endfunction


if exists('*nvim_open_win') || exists('*popup_create')
augroup dbui_async_queries_dbout
autocmd!
autocmd User DBQueryPre call s:progress_show()
autocmd User DBQueryPost call s:progress_hide()
autocmd User *DBExecutePre call s:progress_show(expand('<amatch>:h'))
autocmd User *DBExecutePost call s:progress_hide(expand('<amatch>:h'))
augroup END
if empty(g:db_ui_disable_progress_bar)
augroup dbui_async_queries_dbout
autocmd!
autocmd User DBQueryPre call s:progress_show()
autocmd User DBQueryPost call s:progress_hide()
autocmd User *DBExecutePre call s:progress_show(expand('<amatch>:h'))
autocmd User *DBExecutePost call s:progress_hide(expand('<amatch>:h'))
augroup END
endif
endif
8 changes: 8 additions & 0 deletions doc/dadbod-ui.txt
Original file line number Diff line number Diff line change
Expand Up @@ -721,6 +721,14 @@ g:db_ui_use_postgres_views

Default value: 1

*g:db_ui_disable_progress_bar*
g:db_ui_disable_progress_bar
Toggle query execution progress bar.
This option is available to prevent conflict with a custom progress bar
or if you want to disable the progress entirely set to 1.

Default value: 0

*g:db_ui_use_nvim_notify*
g:db_ui_use_nvim_notify
Use Neovim's `vim.notify` API for notifications.
Expand Down
1 change: 1 addition & 0 deletions plugin/db_ui.vim
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ if exists('g:loaded_dbui')
endif
let g:loaded_dbui = 1

let g:db_ui_disable_progress_bar = get(g:, 'db_ui_disable_progress_bar', 0)
let g:db_ui_use_postgres_views = get(g:, 'db_ui_use_postgres_views', 1)
let g:db_ui_notification_width = get(g:, 'db_ui_notification_width', 40)
let g:db_ui_winwidth = get(g:, 'db_ui_winwidth', 40)
Expand Down
Loading