Typescript SDK
Load, query, and transform data using TypeScript or JavaScript.
Installation
npm install @birkini/js-sdk
# or
yarn add @birkini/js-sdk
import { Birkini } from '@birkini/js-sdk';
async function main() {
const client = new Birkini('ACCESSKEY:SECRET:USERNAME');
await client.login();
const originalStudents = [
{ id: 1, name: 'Alice', active: true },
{ id: 2, name: 'Bob', active: false }
];
// Push records and create table if missing
await client.push('school.class.students', originalStudents, {
createIfMissing: true,
dedupeOnAppend: true,
primaryKeyColumns: ['id']
});
// Push same data again — no changes applied
await client.push('school.class.students', originalStudents, {
dedupeOnAppend: true,
primaryKeyColumns: ['id']
});
const updatedStudents = [
{ id: 1, name: 'Alice', active: false },
{ id: 2, name: 'Bob', active: false },
{ id: 3, name: 'Charles', active: false }
];
// Update existing records, append new ones
await client.push('school.class.students', updatedStudents, {
dedupeOnAppend: true,
primaryKeyColumns: ['id']
});
// Overwrite table with original data
await client.push('school.class.students', originalStudents, {
createIfMissing: true,
replaceIfExists: true
});
const rows = await client.execute(
'SELECT * FROM school.class.students WHERE active = $1',
[true]
);
console.table(rows);
}
main().catch(console.error);
CommonJS Usage
Last updated