Quickstart
Version scope: Page text reviewed against Python 0.0.17 / JavaScript 0.5.10 release source; examples were not re-run for this review. Read-only SQL is included from Python 0.0.14 / npm 0.5.6; entity keys, progressive geometry and structured ragged/CSR from 0.0.11 / 0.5.3. See feature examples and limits for the supported boundaries; older packages may not expose these methods.
Reading takes three lines and no credentials. Writing takes a backend that can PUT. Both are below. Earlier versions of these examples were run against an earlier published package; the current examples were reviewed against the 0.5.8 release source and type declarations and were not re-run.
Read and query
Point Space.fromUri at a ref. Passing null for the backend uses plain fetch against the URI's base, which is all a readable bucket needs:
A vector query takes the field name, a Float32Array, and options:
Scalar columns come back as a Map keyed by exact anchor strings. In 0.5.8, queryVector returns anchors as plain numbers that can lose nanosecond precision, so String(hit.anchor) is not a reliable key into that Map. Anchors from queryScalar are exact (nanosecond anchors come back as bigint):
Don't have a dataset yet? The Quick Start writes one to a local directory with Python in about twenty lines, then serves it over HTTP — which is exactly the http://localhost:8791 above.
Write
Writing needs a backend object with put. The bundled S3Backend is read-only, and the write entry points say so rather than failing later:
For a server-side script, a fetch wrapper is enough. This one talks to MinIO:
Then create a dataset and append to it. Fields are declared as plain objects, and each sample names its field types:
Nothing is visible to a reader until commit(). That call is what advances the ref, with a compare-and-swap against its current ETag.
To append to a dataset that already exists, skip Authoring entirely:
Writer is in the browser build too. Authoring is not — see Overview.
Next
- API reference — every method, with what it returns
- Browser usage — rendering stored images, and writing without shipping credentials
- Storage backends — MinIO, S3, R2, and the CORS rules