0.3.39 • Published 1 year ago
maxmaxship2 v0.3.39
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
0.3.39
1 year ago