Zero-dependency TypeScript contracts for Itsa DBMS stores, queries, transactions, and buffer boundaries.
This package names the pieces a DBMS library shares: the kind of store, the events a store can send, the shape of a query or a transaction, and the byte frame wrapped around a payload.
You extend the classes. You do not write new DbmsStore(). DbmsStore is a starting point your own class builds on. The same is true for the other classes in src/base.
DbmsError is the exception. You construct that one with new DbmsError(...) when a buffer frame is rejected.
This package is not on npm until the first publish. After that, install it with:
npm install @itsaorg/dbms-base
Import names from @itsaorg/dbms-base. Do not import a file inside the package.
A document store starts from DbmsStore and records its kind with StoreType.Docstore.
import { DbmsStore, StoreType } from "@itsaorg/dbms-base";
class DocumentStore extends DbmsStore {
constructor() {
super(StoreType.Docstore, false);
}
}
const docs = new DocumentStore();
docs.storeType is "docstore". docs.opened is false until your subclass opens the store.
Each class, interface, and enum has a longer example in the API reference.
src/base holds the classes and the enumerations, including DbmsStore, DbmsError, StoreType, and DbmsErrorCode.src/types holds the interfaces, including DbmsEventMap.src/index.ts re-exports those names. That file is the public API.