Snowflake in terminal
Install snowsql - command line client for Snowflake
Install pspg - postgresql pager for viewing tables
Configure snowsql in
~/.snowsql/config
:[connections.MySnowflake] accountname= username= password= database= role= warehouse= ... output_format = psql output_file = ~/.snowsql.output editor = nvim wrap = False prompt_format = '''[#FFFF00]+--------------------------------------------------------------------------------------------------------+ [#FFFF00]| [#FFFFFF]user: [#FFFF00][user] |[#FFFFFF] role: [#FFFF00][role] |[#FFFFFF] warehouse: [#FFFF00][warehouse] |[#FFFFFF] database: [#FFFF00][database] [#FFFF00]+--------------------------------------------------------------------------------------------------------+ [#00FF00]❄❯ ''' ...
Optionally configure pspg in
~/.config/pspg/config
:... theme = 13 ...
Create a
snowview
alias andPSPG_CONF
env var in your~/.zshrc
or similar:export PSPG_CONF=~/.config/pspg/config alias snowvew="truncate -s 0 ~/.snowsql.output && pspg ~/.snowsql.output --stream"
In the top terminal window run
snowsql
:snowsql -c MySnowflake
In the bottom terminal run
snowview
:snowview
Enjoy editing queries in vim using
!edit
snowsql command in the top terminal and displaying results nicely in the bottom terminal: