snowflake-promise
TypeScript icon, indicating that this package has built-in type declarations

4.5.0 • Public • Published

snowflake-promise npm node

A Promise-based interface to your Snowflake data warehouse.

This is a wrapper for the Snowflake SDK for Node.js. It provides a Promise-based API instead of the core callback-based API.

Installation

  • npm i snowflake-promise

Basic usage

const Snowflake = require('snowflake-promise').Snowflake;
// or, for TypeScript:
import { Snowflake } from 'snowflake-promise';

async function main() {
  const snowflake = new Snowflake({
    account: '<account name>',
    username: '<username>',
    password: '<password>',
    database: 'SNOWFLAKE_SAMPLE_DATA',
    schema: 'TPCH_SF1',
    warehouse: 'DEMO_WH'
  });

  await snowflake.connect();

  const rows = await snowflake.execute(
    'SELECT COUNT(*) FROM CUSTOMER WHERE C_MKTSEGMENT=:1',
    ['AUTOMOBILE']
  );

  console.log(rows);
}

main();

Connecting

The constructor takes up to three arguments:

new Snowflake(connectionOptions, [ loggingOptions, [ configureOptions ] ])

More examples

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 4.5.0
    23,886
    • latest

Version History

Package Sidebar

Install

npm i snowflake-promise

Weekly Downloads

26,147

Version

4.5.0

License

MIT

Unpacked Size

39 kB

Total Files

37

Last publish

Collaborators

  • natesilva