From e162f03be4edc71c87abb5ed2c7fe6245a8cc1a7 Mon Sep 17 00:00:00 2001 From: HongboLiu Date: Tue, 18 Apr 2023 18:45:38 +0800 Subject: [PATCH] support custom redis-cli arguments --- autoload/db/adapter/redis.vim | 3 ++- plugin/dadbod.vim | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/autoload/db/adapter/redis.vim b/autoload/db/adapter/redis.vim index 68e8a511..eae92233 100644 --- a/autoload/db/adapter/redis.vim +++ b/autoload/db/adapter/redis.vim @@ -7,7 +7,8 @@ function! db#adapter#redis#canonicalize(url) abort endfunction function! db#adapter#redis#interactive(url) abort - return ['redis-cli'] + db#url#as_argv(a:url, '-h ', '-p ', '', '', '-a ', '-n ') + return ['redis-cli'] + g:daddb_redis_args + + \ db#url#as_argv(a:url, '-h ', '-p ', '', '', '-a ', '-n ') endfunction function! db#adapter#redis#auth_input() abort diff --git a/plugin/dadbod.vim b/plugin/dadbod.vim index 1f45fd5f..f18c903d 100644 --- a/plugin/dadbod.vim +++ b/plugin/dadbod.vim @@ -8,6 +8,10 @@ if exists('g:loaded_dadbod') || &cp || v:version < 704 endif let g:loaded_dadbod = 1 +if !exists('g:daddb_redis_args') + let g:daddb_redis_args = [] +endif + call extend(g:, {'db_adapters': {}}, 'keep') call extend(g:db_adapters, {