Connecting Node JS with Snowflake
- Establish a connection with Snowflake
- Execute statements, e.g. queries and DDL/DML commands
- Consume the results
- Terminate the connection
Refer to the following steps to establish the connection:
Step 1: Install Node.js
Node.js must already be installed in the environment where you require installing the driver. You can verify this after the installation, by checking the version using the following command:
Click here to know more about installation.
Step 2: Install the Snowflake-sdk
After Node installation, you can now use the Node Package Manager (npm) to download and install the snowflake driver. The command downloads and installs the Snowflake Node.js driver.
If things have been successful thus far, we are now ready to connect to the Snowflake cloud data warehouse instance via Node.js. Create a directory with the following commands:
In this directory, create a file (app.js) by copy- pasting the following text. Remember to use your credentials for account, username, password, and region.
Open the terminal window and run the file(app.js) with the following command to create the connection:
The node js Snowflake connection is successfully created.
To know more about our cloud expertise, write to us at email@example.com.