BoilingData JS/TS SDK
yarn add @boilingdata/node-boilingdata
import { BoilingData, isDataResponse } from "../boilingdata/boilingdata";
async function main() {
const bdInstance = new BoilingData({ process.env["BD_USERNAME"], process.env["BD_PASSWORD"] });
await bdInstance.connect();
const rows = await new Promise<any[]>((resolve, reject) => {
let r: any[] = [];
bdInstance.execQuery({
sql: `SELECT 's3://KEY' AS key, COUNT(*) AS count FROM parquet_scan('s3://KEY');`,
keys: ["s3://boilingdata-demo/demo.parquet", "s3://boilingdata-demo/demo2.parquet"],
callbacks: {
onData: (data: IBDDataResponse | unknown) => {
if (isDataResponse(data)) data.data.map(row => r.push(row));
},
onQueryFinished: () => resolve(r),
onLogError: (data: any) => reject(data),
},
});
});
console.log(rows);
await bdInstance.close();
}
This repository contains JS/TS BoilingData SDK. Please see the integration tests on tests/query.test.ts
for for more examples.