Discover the Peaka NodeJS driver
npm install @peaka/client or yarn add @peaka/client
npm install @peaka/client
yarn add @peaka/client
import { Peaka, connectToPeaka } from "@peaka/client"; const connection: Peaka = connectToPeaka("<YOUR_API_KEY>")
import type { QueryResult } from "@peaka/client"; const iter: Iterator<QueryResult> = await connection.query( 'select * from <CATALOG_NAME>.<SCHEMA_NAME>.<TABLE_NAME> limit 100' );
for await (const queryResult of iter) { console.log(queryResult.data); }
import type { QueryData } from "@peaka/client"; const data: QueryData[] = await iter .map(r => r.data ?? []) .fold<QueryData[]>([], (row, acc) => [...acc, ...row]);