Skip to content

Commit 685e75b

Browse files
fix(connections): validate db url when adding a connection
Fixes #313
1 parent a7ff54a commit 685e75b

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

autoload/db_ui/connections.vim

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ function! s:connections.add_full_url() abort
4747
try
4848
let url = db_ui#resolve(db_ui#utils#input('Enter connection url: ', url))
4949
call db#url#parse(url)
50+
" Attempt to resolve to check if it's valid url
51+
call db#resolve(url)
5052
catch /.*/
5153
return db_ui#notifications#error(v:exception)
5254
endtry
@@ -80,6 +82,8 @@ function! s:connections.rename(db) abort
8082
try
8183
let url = db_ui#resolve(db_ui#utils#input('Edit connection url for "'.entry.name.'": ', url))
8284
call db#url#parse(url)
85+
" Attempt to resolve to check if it's valid url
86+
call db#resolve(url)
8387
catch /.*/
8488
return db_ui#notifications#error(v:exception)
8589
endtry

0 commit comments

Comments
 (0)