如何使用 sqitch 部署雪花数据库?
Posted
技术标签:
【中文标题】如何使用 sqitch 部署雪花数据库?【英文标题】:How to deploy snowflake DB with sqitch? 【发布时间】:2021-04-26 15:45:17 【问题描述】:我是新来的。 我正在尝试创建一个 Jenkins 管道来使用 sqitch 部署雪花。 因此,我在 Azure 中的 Ubuntu 18.04 LTS 中安装了 sqitch 和 snowsql。 我只是:
-
克隆现有的 sqitch 存储库
.git
.gitignore
sqitch
snowflake
deploy
revert
sqitch
sqitch.conf
sqitch.plan
-
修改以下配置:$WORKSPACE/.snowsql/config
[connections]
accountname = acc_name
region = east-us-2.azure
username = user_name
private_key_path = "/path/rsa_key.p8"
authenticator = SNOWFLAKE_JWT
-
创建 sqitch 配置:$WORKSPACE/sqitch/snowflake/sqitch.conf
[core]
engine = snowflake
[engine "snowflake"]
target = dev
client = snowsql
[target "dev"]
uri = "db:snowflake://client.east-us-2.azure/DEV_DB?Driver=SnowflakeDSIIDriver;warehouse=DEV_WH;authenticator=SNOWFLAKE_JWT;UID=DEV;PRIV_KEY_FILE=/path/rsa_key.p8;PRIV_KEY_FILE_PWD=password;"
然后我尝试运行“sqitch verify”并得到以下输出:
Trace begun at /usr/share/perl5/App/Sqitch/Engine.pm line 116
App::Sqitch::Engine::load('App::Sqitch::Engine', 'HASH(0x55ba14ad8ce0)') called at /usr/share/perl5/App/Sqitch/Target.pm line 55
App::Sqitch::Target::__ANON__('App::Sqitch::Target=HASH(0x55ba14ad8470)') called at (eval 278) line 22
App::Sqitch::Target::engine('App::Sqitch::Target=HASH(0x55ba14ad8470)') called at /usr/share/perl5/App/Sqitch/Command/status.pm line 113
App::Sqitch::Command::status::execute(undef) called at /usr/share/perl5/App/Sqitch.pm line 205
App::Sqitch::try ... at /usr/share/perl5/Try/Tiny.pm line 100
eval ... at /usr/share/perl5/Try/Tiny.pm line 93
Try::Tiny::try('CODE(0x55ba14acfb70)', 'Try::Tiny::Catch=REF(0x55ba15e7f2b0)') called at /usr/share/perl5/App/Sqitch.pm line 225
App::Sqitch::go('App::Sqitch') called at /usr/bin/sqitch line 14
我做错了什么? 对我来说,看起来系统缺少一些软件包。 Sqitch 安装如下:
sudo apt-get install sqitch libdbd-pg-perl libdbd-odbc-perl
【问题讨论】:
【参考方案1】:看来我需要执行以下操作:
sudo apt install cpanminus && cpanm App::Sqitch
【讨论】:
以上是关于如何使用 sqitch 部署雪花数据库?的主要内容,如果未能解决你的问题,请参考以下文章
在代码中使用 & 符号的存储过程的 Sqitch 部署导致失败