File tree Expand file tree Collapse file tree 1 file changed +11
-4
lines changed
Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Original file line number Diff line number Diff line change 11-- This script is used to enable MotherDuck support if
22-- the token is provided in the environment variables.
33
4- \getenv lc_token motherduck_token
5- \getenv uc_token MOTHERDUCK_TOKEN
4+ -- Once we stop supporting PG14 we can use \getenv again
5+ -- For grepability: PG_VERSION_NUM < 150000
6+ \set lc_token ` echo $motherduck_token`
7+ \set uc_token ` echo $MOTHERDUCK_TOKEN`
68
7- \if :{?lc_token}
9+ SELECT
10+ LENGTH(:' lc_token' ) > 0 as lc_token_set,
11+ LENGTH(:' uc_token' ) > 0 as uc_token_set
12+ \gset
13+
14+ \if :lc_token_set
815 CALL duckdb .enable_motherduck (:' lc_token' ::TEXT );
9- \elif :{?uc_token}
16+ \elif :uc_token_set
1017 CALL duckdb .enable_motherduck (:' uc_token' ::TEXT );
1118\else
1219 -- MotherDuck was not enabled, so we can skip the rest of the script
You can’t perform that action at this time.
0 commit comments