Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

snowflake-sdk

Package Overview
Dependencies
Maintainers
2
Versions
64
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

snowflake-sdk

Node.js driver for Snowflake

  • 1.13.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
463K
decreased by-22.48%
Maintainers
2
Weekly downloads
 
Created

What is snowflake-sdk?

The snowflake-sdk npm package is a Node.js driver for connecting to Snowflake, a cloud-based data warehousing service. It allows you to execute SQL queries, manage transactions, and handle various database operations programmatically.

What are snowflake-sdk's main functionalities?

Connecting to Snowflake

This feature allows you to establish a connection to a Snowflake database using the provided account credentials and connection details.

const snowflake = require('snowflake-sdk');
const connection = snowflake.createConnection({
  account: 'your_account',
  username: 'your_username',
  password: 'your_password',
  warehouse: 'your_warehouse',
  database: 'your_database',
  schema: 'your_schema'
});
connection.connect((err, conn) => {
  if (err) {
    console.error('Unable to connect: ' + err.message);
  } else {
    console.log('Successfully connected to Snowflake.');
  }
});

Executing SQL Queries

This feature allows you to execute SQL queries against the connected Snowflake database and handle the results.

connection.execute({
  sqlText: 'SELECT * FROM your_table',
  complete: (err, stmt, rows) => {
    if (err) {
      console.error('Failed to execute statement due to the following error: ' + err.message);
    } else {
      console.log('Number of rows produced: ' + rows.length);
      console.log(rows);
    }
  }
});

Managing Transactions

This feature allows you to manage transactions by beginning, committing, and rolling back transactions within the Snowflake database.

connection.execute({
  sqlText: 'BEGIN TRANSACTION',
  complete: (err, stmt, rows) => {
    if (err) {
      console.error('Failed to begin transaction: ' + err.message);
    } else {
      console.log('Transaction started.');
      // Perform other operations within the transaction
      connection.execute({
        sqlText: 'COMMIT',
        complete: (err, stmt, rows) => {
          if (err) {
            console.error('Failed to commit transaction: ' + err.message);
          } else {
            console.log('Transaction committed.');
          }
        }
      });
    }
  }
});

Other packages similar to snowflake-sdk

FAQs

Package last updated on 04 Sep 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc