Constructors
constructor
new IndexedCache(databaseName: string, version?: number): IndexedCache Parameters
- databaseName: string
- version: number = 1
Methods
cursor
cursor(table: string, callback: (record: any) => void): Promise<void> Parameters
- table: string
- callback: (record: any) => void
Returns Promise<void>
cursorIndex
cursorIndex( table: string, index: string, value: string, callback: (record: any) => void, direction?: IDBCursorDirection,): Promise<void> Parameters
- table: string
- index: string
- value: string
- callback: (record: any) => void
- direction: IDBCursorDirection = 'next'
Returns Promise<void>
cursorIndexByPage
cursorIndexByPage( table: string, index: string, value: string, page: number, pageSize: number, direction?: IDBCursorDirection,): Promise<unknown> Parameters
- table: string
- index: string
- value: string
- page: number
- pageSize: number
- direction: IDBCursorDirection = 'next'
Returns Promise<unknown>
deleteAllByIndex
deleteAllByIndex(table: string, index: string, value: any): Promise<unknown> Parameters
- table: string
- index: string
- value: any
Returns Promise<unknown>
deleteByCursorIndex
deleteByCursorIndex( table: string, index: string, value: any, callback: (record: any) => void,): Promise<void> Parameters
- table: string
- index: string
- value: any
- callback: (record: any) => void
Returns Promise<void>
deleteByIndex
deleteByIndex(table: string, index: string, value: string): Promise<unknown> Parameters
- table: string
- index: string
- value: string
Returns Promise<unknown>
deleteByKey
deleteByKey(table: string, value: any): Promise<unknown>
deleteDatabase
deleteDatabase(): Promise<unknown>
getByKey
getByKey(table: string, key: string): Promise<unknown>
index
index(table: string, index: string, value: string): Promise<unknown> Parameters
- table: string
- index: string
- value: string
Returns Promise<unknown>
indexAll
indexAll(table: string, index: string, value: string): Promise<unknown> Parameters
- table: string
- index: string
- value: string
Returns Promise<unknown>
insert
insert(table: string, record: any): Promise<unknown>
open
open(tables: Table[]): Promise<unknown>
updateByIndex
updateByIndex(table: string, index: string, record: any): Promise<unknown> Parameters
- table: string
- index: string
- record: any
Returns Promise<unknown>
updateByKey
updateByKey(table: string, record: any): Promise<unknown>
关闭数据库