Go to file
Nate Silva 23db485d5d 4.5.0
2021-03-12 12:19:16 -08:00
.vscode clean up configuration files 2019-09-13 10:44:58 -07:00
examples add logging 2017-09-11 17:12:28 -07:00
src docs: formatting 2021-03-12 12:17:59 -08:00
.editorconfig initial commit 2017-09-10 19:53:33 -07:00
.gitignore clean up configuration files 2019-09-13 10:44:58 -07:00
.npmignore clean up configuration files 2019-09-13 10:44:58 -07:00
CHANGELOG.md release notes are now on the GitHub releases tab 2019-09-13 11:08:29 -07:00
LICENSE.txt initial commit 2017-09-10 19:53:33 -07:00
package-lock.json 4.5.0 2021-03-12 12:19:16 -08:00
package.json 4.5.0 2021-03-12 12:19:16 -08:00
README.md update README.md 2019-09-23 08:47:17 -07:00
tsconfig.json clean up configuration files 2019-09-13 10:44:58 -07:00
tslint.json updated dependencies 2019-07-11 11:57:48 -07:00

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