1.2.3 • Published 6 months ago

@peaka/client v1.2.3

Weekly downloads
-
License
Apache-2.0
Repository
-
Last release
6 months ago

Peaka Client

Client for Peaka, a Zero-ETL data integration platform.

Requirements

  • Node 12 or newer.

Install

npm install @peaka/client or yarn add @peaka/client

Usage

Create a Peaka connection

import { Peaka, connectToPeaka } from "@peaka/client";

const connection: Peaka = connectToPeaka("<YOUR_API_KEY>", options)

NOTE: options object and included items are optional.

Options Example

{
  "options": {
    "zone": "eu"
  }
}

Options

optiondefault valuepossible valuesrequired
zone"us""us" or "eu"false

Submit a query

import type { QueryResult } from "@peaka/client";

const iter: Iterator<QueryResult> = await connection.query(
  'select * from <CATALOG_NAME>.<SCHEMA_NAME>.<TABLE_NAME> limit 100'
);

Iterate through the query results

for await (const queryResult of iter) {
  console.log(queryResult.data);
}

Alternative: map and aggregate the data

import type { QueryData } from "@peaka/client";

const data: QueryData[] = await iter
  .map(r => r.data ?? [])
  .fold<QueryData[]>([], (row, acc) => [...acc, ...row]);
1.2.3

6 months ago

1.2.2

10 months ago

1.2.1

12 months ago

1.2.0

1 year ago

1.1.0

1 year ago

1.0.0

2 years ago

1.0.0-rc1

2 years ago