Level DB storage for @trust0/ridb.
npm install @trust0/ridb-level
bash
npm install @trust0/ridb @trust0/ridb-level -S
`
Using yarn:
`bash
yarn add @trust0/ridb @trust0/ridb-level
`Usage
The following example demonstrates how to create a database with a leveldb storage engine and a simple schema with ID primary key as string.
`typescript
import { RIDB, SchemaFieldType, Doc } from '@trust0/ridb';
import { LevelDB } from '@trust0/ridb-level';
const db = new RIDB(
{
dbName: "test",
schemas: {
demo: {
version: 0,
primaryKey: 'id',
type: SchemaFieldType.object,
properties: {
id: {
type: SchemaFieldType.string,
maxLength: 60
}
}
}
} as const
}
)
await db.start({
storageType: LevelDB,
password: "test"
});
``