@barqdb/barq
v21.3.0
Published
Barq is an offline-first database for JavaScript with optional sync powered by barq-core. A modified fork of Realm JS.
Maintainers
Readme
@barqdb/barq
The core Barq database SDK for JavaScript and TypeScript — an offline-first object database for Node.js, Electron and React Native, with optional synchronization powered by barq-core.
@barqdb/barq is a modified fork of the barq package from the Barq JavaScript
SDK. See the top-level NOTICE for fork attribution.
Install
npm install @barqdb/barqUsage
import { Barq } from "@barqdb/barq";
class Task extends Barq.Object<Task> {
_id!: Barq.Types.ObjectId;
description!: string;
static schema: Barq.ObjectSchema = {
name: "Task",
primaryKey: "_id",
properties: { _id: "objectId", description: "string" },
};
}
const barq = await Barq.open({ schema: [Task] });- Value types (
ObjectId,UUID,Decimal128,Binary) live underBarq.Types.
