0.3.39 • Published 1 year ago

polybase_client v0.3.39

Weekly downloads
-
License
MIT
Repository
-
Last release
1 year ago

Polybase Client (Browser/Node)

A client to connect to the Polybase decentralized database.

Install Polybase

npm install @polybase/client
yarn add @polybase/client

Initialize the SDK

import Polybase from '@polybase/client'

const db = new Polybase({
  ...config
})

Get a single record

You can read data once, by calling the .record(id: string).get() method on a collection.

const colRef = db.collection("org/places")
const record = await colRef.record("id").get()

const { id, ...data } = record

Write data

const colRef = db.collection("org/places")
const record = await colRef.record("london").call("setName", ["Name"])

Tests

To run E2E tests, ensure that Polybase is running, and then run:

yarn test:e2e