Skip to content

Node.js Promise-based interface for accessing Snowflake databases

License

Notifications You must be signed in to change notification settings

natesilva/snowflake-promise

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Mar 12, 2021
23db485 · Mar 12, 2021
Sep 13, 2019
Sep 12, 2017
Mar 12, 2021
Sep 11, 2017
Sep 13, 2019
Sep 13, 2019
Sep 13, 2019
Sep 11, 2017
Sep 23, 2019
Mar 12, 2021
Mar 12, 2021
Sep 13, 2019
Jul 11, 2019

Repository files navigation

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

About

Node.js Promise-based interface for accessing Snowflake databases

Resources

License

Stars

Watchers

Forks

Packages

No packages published