@xtdb/xtdb
v0.0.0-2024.3.20.1
Published
A JavaScript client library for XTDB
Downloads
6
Readme
XTDB JavaScript/TypeScript SDK
This is very early days as yet. Particularly, it's currently missing tests and user documentation.
Get started
It's published to NPM as
@xtdb/xtdb
- to add it to a project:npm install '@xtdb/xtdb'
yarn add '@xtdb/xtdb'
import Xtdb, { q, tx, ex } from '@xtdb/xtdb'
const xtdb = new Xtdb('http://localhost:3000')
Transactions:
const txKey = await xtdb.submitTx([ tx.putDocs('myTable', {"xt/id": 1, ...}, {"xt/id": 2, ...}), ... ])
Queries:
const res = await node.query([ q.from('myTable'), q.aggregate({rc: ex.call("rowCount")}) ])
Publishing
- Get yourself an account on https://www.npmjs.com/
- Ask @jarohen for an invite to the
@xtdb
org. yarn publish --no-git-tag-version
. We're currently using version0.0.0-YYYY.M.D.n
(closest approximation to a Maven snapshot).