Class: IndexDB<T>

Defined in: ridb_core.d.ts:328

Represents an IndexDB storage system extending the base storage functionality.

Extends

Type Parameters

T

T extends SchemaTypeRecord

The schema type.

Constructors

Constructor

typescript
1
new IndexDB<T>(dbName, schemas, options?): IndexDB<T>

Defined in: ridb_core.d.ts:360

Parameters

dbName

string

schemas

T

options?

BaseStorageOptions

Returns

IndexDB<T>

Inherited from

BaseStorage.constructor

Properties

core

typescript
1
readonly core: CoreStorage

Defined in: ridb_core.d.ts:368

Inherited from

BaseStorage.core


dbName

typescript
1
readonly dbName: string

Defined in: ridb_core.d.ts:365

Inherited from

BaseStorage.dbName


options

typescript
1
readonly options: BaseStorageOptions

Defined in: ridb_core.d.ts:367

Inherited from

BaseStorage.options


schemas

typescript
1
readonly schemas: Record<keyof Schemas, Schema<Schemas[keyof Schemas]>>

Defined in: ridb_core.d.ts:366

Inherited from

BaseStorage.schemas

Methods

addIndexSchemas()

typescript
1
addIndexSchemas(): null

Defined in: ridb_core.d.ts:378

Returns

null

Inherited from

BaseStorage.addIndexSchemas


close()

typescript
1
close(): Promise<void>

Defined in: ridb_core.d.ts:370

Returns

Promise<void>

Inherited from

BaseStorage.close


count()

typescript
1
count(colectionName, query, options?): Promise<number>

Defined in: ridb_core.d.ts:371

Parameters

colectionName

keyof T

query

QueryType<T[keyof T]>

options?

QueryOptions

Returns

Promise<number>

Inherited from

BaseStorage.count


find()

typescript
1
find(collectionName, query, options?): Promise<Doc<T[keyof T]>[]>

Defined in: ridb_core.d.ts:373

Parameters

collectionName

keyof T

query

QueryType<T[keyof T]>

options?

QueryOptions

Returns

Promise<Doc<T[keyof T]>[]>

Inherited from

BaseStorage.find


findDocumentById()

typescript
1
findDocumentById(collectionName, id): Promise<null | Doc<T[keyof T]>>

Defined in: ridb_core.d.ts:372

Parameters

collectionName

keyof T

id

string

Returns

Promise<null | Doc<T[keyof T]>>

Inherited from

BaseStorage.findDocumentById


free()

typescript
1
free(): void

Defined in: ridb_core.d.ts:332

Frees the resources used by the in-memory storage.

Returns

void


getOption()

typescript
1
getOption(name): undefined | string | number | boolean

Defined in: ridb_core.d.ts:375

Parameters

name

string

Returns

undefined | string | number | boolean

Inherited from

BaseStorage.getOption


getSchema()

typescript
1
getSchema(name): Schema<any>

Defined in: ridb_core.d.ts:376

Parameters

name

string

Returns

Schema<any>

Inherited from

BaseStorage.getSchema


start()

typescript
1
start(): Promise<void>

Defined in: ridb_core.d.ts:369

Returns

Promise<void>

Inherited from

BaseStorage.start


write()

typescript
1
write(op): Promise<Doc<T[keyof T]>>

Defined in: ridb_core.d.ts:374

Parameters

op

Operation<T[keyof T]>

Returns

Promise<Doc<T[keyof T]>>

Inherited from

BaseStorage.write


create()

typescript
1
static create<SchemasCreate>(dbName, schemas): Promise<IndexDB<SchemasCreate>>

Defined in: ridb_core.d.ts:334

Type Parameters

SchemasCreate

SchemasCreate extends SchemaTypeRecord

Parameters

dbName

string

schemas

SchemasCreate

Returns

Promise<IndexDB<SchemasCreate>>

Overrides

BaseStorage.create