From ea9bd0c28c25241ee9bca4b8a1f54576a9fa4577 Mon Sep 17 00:00:00 2001 From: Dan Arthur Date: Thu, 7 Mar 2024 10:14:51 +0000 Subject: [PATCH] Add support for AzureAD auth (#152) --- autoload/db/adapter/sqlserver.vim | 1 + doc/dadbod.txt | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/autoload/db/adapter/sqlserver.vim b/autoload/db/adapter/sqlserver.vim index c14091b..f4ad912 100644 --- a/autoload/db/adapter/sqlserver.vim +++ b/autoload/db/adapter/sqlserver.vim @@ -48,6 +48,7 @@ function! db#adapter#sqlserver#interactive(url) abort \ (empty(encrypt) ? [] : ['-N'] + (encrypt ==# '1' ? [] : [url.params.encrypt])) + \ s:boolean_param_flag(url, 'trustServerCertificate', '-C') + \ (has_key(url, 'user') ? [] : ['-E']) + + \ (has_key(url.params, 'authentication') ? ['--authentication-method', url.params.authentication] : []) + \ db#url#as_argv(url, '', '', '', '-U ', '', '-d ') endfunction diff --git a/doc/dadbod.txt b/doc/dadbod.txt index 997ba4b..a6f6acf 100644 --- a/doc/dadbod.txt +++ b/doc/dadbod.txt @@ -186,8 +186,9 @@ SQL Server ~ sqlserver://[[:]@][][:]/[] sqlserver://[[:]][;user=][;...] < -Supported query parameters are `secure` and `trustServerCertificate`, which -correspond to connection properties of the same name. +Supported query parameters are `authentication`, `secure` and `trustServerCertificate`, +which correspond to connection properties of the same name. The `authentication` +property is only supported when using `go-sqlcmd`. To set the `integratedSecurity` connection property and use a trusted connection, omit the user and password.