Skip to content

Commit 23ed6ed

Browse files
fix(url)!: Only resolve DB URL if it does not point to a filesystem
For DBs that point to a file we need to resolve the URL when adding. For other schemes we can let dadbod resolve the url when necessary.
1 parent b1675d1 commit 23ed6ed

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

autoload/db_ui.vim

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -416,19 +416,16 @@ function! s:dbui.populate_schema_info(db) abort
416416
let a:db.filetype = get(scheme_info, 'filetype', 'sql')
417417
endfunction
418418

419-
" This function is used to skip resolving the url
420-
" added for ssh connections (https://github.com/pbogut/vim-dadbod-ssh)
421-
" Because resolving those url gets the underlying connection, which
422-
" we don't want to do.
419+
" Resolve only urls for DBs that are files
423420
function db_ui#resolve(url) abort
424421
let parsed_url = db#url#parse(a:url)
425-
let ignored_resolve_schemes = ['ssh']
422+
let resolve_schemes = ['sqlite', 'jq', 'duckdb', 'osquery']
426423

427-
if index(ignored_resolve_schemes, get(parsed_url, 'scheme', '')) > -1
428-
return a:url
424+
if index(resolve_schemes, get(parsed_url, 'scheme', '')) > -1
425+
return db#resolve(a:url)
429426
endif
430427

431-
return db#resolve(a:url)
428+
return a:url
432429
endfunction
433430

434431
function! db_ui#reset_state() abort

0 commit comments

Comments
 (0)