Reference status
This page predates the current package split. Use the current package guides for checked installation, public imports, and onboarding examples. The detailed examples below have not all been revalidated.
DataStore API
The DataStore API provides the core storage layer for managing nodes, transactions, and schema validation.
DataStore Class
The main storage class that manages nodes with transactional overlay and lock support.
Constructor
new DataStore(rootNodeId?: string, schema?: Schema, sessionId?: number)
Parameters:
rootNodeId?: string- Optional root node IDschema?: Schema- Optional schema for validationsessionId?: number- Optional session ID (default: 0)
Example:
import { DataStore } from '@barocss/datastore';
import { createSchema } from '@barocss/schema';
const schema = createSchema('my-doc', { /* ... */ });
const dataStore = new DataStore(undefined, schema, 0);
Properties
core: CoreOperations
Core operations instance (read-only).
query: QueryOperations
Query operations instance (read-only).