Go to file
2017-09-10 20:42:10 -07:00
.vscode initial commit 2017-09-10 19:53:33 -07:00
examples editing oldSchool.js 2017-09-11 03:37:13 +00:00
src remove obsolete export 2017-09-10 20:42:10 -07:00
.editorconfig initial commit 2017-09-10 19:53:33 -07:00
.gitignore initial commit 2017-09-10 19:53:33 -07:00
.npmignore update .npmignore 2017-09-10 20:40:51 -07:00
LICENSE.txt initial commit 2017-09-10 19:53:33 -07:00
package-lock.json initial commit 2017-09-10 19:53:33 -07:00
package.json update package.json 2017-09-10 20:39:29 -07:00
README.md update README.md 2017-09-10 19:58:28 -07:00
tsconfig.json initial commit 2017-09-10 19:53:33 -07:00
tslint.json initial commit 2017-09-10 19:53:33 -07:00

snowflake-promise

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();

More examples