@polybase/client
v0.6.6
Published
Client (browser/node) for Polybase
Downloads
203
Readme
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