Skip to content

New plugin: SnowSQL - #161

Merged
SimonBarendse merged 18 commits into
1Password:mainfrom
williamhpark:wpark/154-snowsql-plugin-env-vars
Feb 13, 2023
Merged

SimonBarendse merged 18 commits into
1Password:mainfrom
williamhpark:wpark/154-snowsql-plugin-env-vars

Conversation

@williamhpark

@williamhpark williamhpark commented Jan 23, 2023 •

Copy link
Copy Markdown
Contributor

Summary

Add support for a new plugin for the Snowflake CLI, SnowSQL.

Addresses: #154

Testing

Setup

  1. Create a Snowflake account following the guide here.
  2. Build and test the SnowSQL plugin locally according to these instructions. E.g. make snowflake/build

Importer

  1. After installing and setting up SnowSQL, a config file should have been created at ~/.snowsql/config. Add your Snowflake credentials to this file under [connections]. Initialize the SnowSQL plugin and test the importer using this config file. The credentials should be saved in 1Password successfully. Note: By default, the ~/.snowsql/config file has a [connections] section where the actual credentials are stored, as well as an uncommented [connections.example] section where example credentials are displayed. No matter where [connections.example] is located and even if the example credentials are uncommented, only the true credentials under [connections] should ever be saved by the importer.
  2. Initialize the SnowSQL plugin again but this time, import credentials by entering the credentials manually in the terminal. The credentials should, again, be saved in 1Password successfully.

Provisioner

  1. After initializing the SnowSQL plugin and having your Snowflake credentials saved in 1Password, run a snowsql command (just snowsql should suffice, but if you want to add connection parameters the available ones are listed here). You should be taken through the authentication flow with the SnowFlake Credentials that were saved in 1Password, and you shouldn't have to enter the credentials manually. Once authenticated, you should enter the SnowSQL shell, from which you can interact with your Snowflake warehouses/databases.

image

  1. Try running a snowsql command with each of the following arguments (descriptions can be found here):
-a
--accountname
-u
--username
--authenticator
--config
-P
--prompt
-v
--version
--help

You should not be prompted to authenticate through the 1Password CLI.

Note: While testing the provisioner, ensure that your credentials are not currently stored in ~/.snowsql/config nor environment variables.

Additional Information

  • Be aware that the plugin name is snowflake and the executable name is snowsql.
@williamhpark williamhpark changed the title #154: New Plugin: SnowSQL Jan 23, 2023
@williamhpark williamhpark changed the title New Plugin: SnowSQL Jan 23, 2023

@arunsathiya arunsathiya left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a great start! I left some comments to improve the importing flow for your consideration.

Comment thread plugins/snowflake/snowsql.go Resolved
Comment thread plugins/snowflake/credentials.go Resolved
Comment thread plugins/snowflake/credentials.go Resolved
SimonBarendse
SimonBarendse previously approved these changes Jan 24, 2023

@SimonBarendse SimonBarendse left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent! Snowflake will make for a great addition to the ecosystem!

Arun made some great suggestions in his review. I don't have much to add to that.

@williamhpark

Copy link
Copy Markdown
Contributor Author

Updated the testing instructions based on recent feedback on the PR.

@hculea hculea left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Only one comment, otherwise this is good to go, code-wise.

Thank you for this addition, @williamhpark ! ❤️

Comment thread plugins/snowflake/snowsql.go Resolved
SimonBarendse
SimonBarendse previously approved these changes Jan 25, 2023
@SimonBarendse
SimonBarendse requested a review from hculea January 25, 2023 12:07
@AndyTitu
AndyTitu requested a review from DCKcode January 25, 2023 16:25
Comment thread plugins/snowflake/credentials.go Resolved
DCKcode
DCKcode previously approved these changes Jan 26, 2023
@williamhpark
williamhpark dismissed stale reviews from DCKcode and SimonBarendse via fc02c19 January 26, 2023 22:50
hculea
hculea previously approved these changes Jan 27, 2023
DCKcode
DCKcode previously approved these changes Jan 27, 2023
@hculea
hculea requested a review from SimonBarendse January 27, 2023 10:11
@williamhpark
williamhpark dismissed stale reviews from DCKcode and hculea via 78d3821 February 9, 2023 18:19
@hculea
hculea requested review from DCKcode and removed request for DCKcode February 13, 2023 15:13
Comment thread sdk/schema/credname/names.go Resolved
@SimonBarendse
SimonBarendse merged commit bf33b30 into 1Password:main Feb 13, 2023
@williamhpark
williamhpark deleted the wpark/154-snowsql-plugin-env-vars branch February 13, 2023 18:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

7 participants