mirror of
https://github.com/FlipsideCrypto/snowflake-promise.git
synced 2026-02-06 11:18:25 +00:00
| .vscode | ||
| examples | ||
| src | ||
| .editorconfig | ||
| .gitignore | ||
| .npmignore | ||
| CHANGELOG.md | ||
| LICENSE.txt | ||
| package-lock.json | ||
| package.json | ||
| README.md | ||
| tsconfig.json | ||
| tslint.json | ||
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
- Streaming result rows
- Using traditional Promise
thensyntax (and older versions of Node.js)- Node 4.0.0 is the oldest supported version
- Turn on logging