Skip to content

@ralphschuler.webgl shader factory.<internal>.IDBObjectStore

github-actions edited this page Nov 26, 2023 · 1 revision

Interface: IDBObjectStore

@ralphschuler/webgl-shader-factory.<internal>.IDBObjectStore

This example shows a variety of different uses of object stores, from updating the data structure with IDBObjectStore.createIndex inside an onupgradeneeded function, to adding a new item to our object store with IDBObjectStore.add. For a full working example, see our To-do Notifications app (view example live.)

MDN Reference

Table of contents

Properties

Methods

Properties

autoIncrement

Readonly autoIncrement: boolean

Returns true if the store has a key generator, and false otherwise.

MDN Reference

Defined in

node_modules/typescript/lib/lib.dom.d.ts:13861


indexNames

Readonly indexNames: DOMStringList

Returns a list of the names of indexes in the store.

MDN Reference

Defined in

node_modules/typescript/lib/lib.dom.d.ts:13867


keyPath

Readonly keyPath: string | string[]

Returns the key path of the store, or null if none.

MDN Reference

Defined in

node_modules/typescript/lib/lib.dom.d.ts:13873


name

name: string

Returns the name of the store.

MDN Reference

Defined in

node_modules/typescript/lib/lib.dom.d.ts:13879


transaction

Readonly transaction: IDBTransaction

Returns the associated transaction.

MDN Reference

Defined in

node_modules/typescript/lib/lib.dom.d.ts:13885

Methods

add

add(value, key?): IDBRequest<IDBValidKey>

Adds or updates a record in store with the given value and key.

If the store uses in-line keys and key is specified a "DataError" DOMException will be thrown.

If put() is used, any existing record with the key will be replaced. If add() is used, and if a record with the key already exists the request will fail, with request's error set to a "ConstraintError" DOMException.

If successful, request's result will be the record's key.

MDN Reference

Parameters

Name Type
value any
key? IDBValidKey

Returns

IDBRequest<IDBValidKey>

Defined in

node_modules/typescript/lib/lib.dom.d.ts:13897


clear

clear(): IDBRequest<undefined>

Deletes all records in store.

If successful, request's result will be undefined.

MDN Reference

Returns

IDBRequest<undefined>

Defined in

node_modules/typescript/lib/lib.dom.d.ts:13905


count

count(query?): IDBRequest<number>

Retrieves the number of records matching the given key or key range in query.

If successful, request's result will be the count.

MDN Reference

Parameters

Name Type
query? IDBValidKey | IDBKeyRange

Returns

IDBRequest<number>

Defined in

node_modules/typescript/lib/lib.dom.d.ts:13913


createIndex

createIndex(name, keyPath, options?): IDBIndex

Creates a new index in store with the given name, keyPath and options and returns a new IDBIndex. If the keyPath and options define constraints that cannot be satisfied with the data already in store the upgrade transaction will abort with a "ConstraintError" DOMException.

Throws an "InvalidStateError" DOMException if not called within an upgrade transaction.

MDN Reference

Parameters

Name Type
name string
keyPath string | string[]
options? IDBIndexParameters

Returns

IDBIndex

Defined in

node_modules/typescript/lib/lib.dom.d.ts:13921


delete

delete(query): IDBRequest<undefined>

Deletes records in store with the given key or in the given key range in query.

If successful, request's result will be undefined.

MDN Reference

Parameters

Name Type
query IDBValidKey | IDBKeyRange

Returns

IDBRequest<undefined>

Defined in

node_modules/typescript/lib/lib.dom.d.ts:13929


deleteIndex

deleteIndex(name): void

Deletes the index in store with the given name.

Throws an "InvalidStateError" DOMException if not called within an upgrade transaction.

MDN Reference

Parameters

Name Type
name string

Returns

void

Defined in

node_modules/typescript/lib/lib.dom.d.ts:13937


get

get(query): IDBRequest<any>

Retrieves the value of the first record matching the given key or key range in query.

If successful, request's result will be the value, or undefined if there was no matching record.

MDN Reference

Parameters

Name Type
query IDBValidKey | IDBKeyRange

Returns

IDBRequest<any>

Defined in

node_modules/typescript/lib/lib.dom.d.ts:13945


getAll

getAll(query?, count?): IDBRequest<any[]>

Retrieves the values of the records matching the given key or key range in query (up to count if given).

If successful, request's result will be an Array of the values.

MDN Reference

Parameters

Name Type
query? null | IDBValidKey | IDBKeyRange
count? number

Returns

IDBRequest<any[]>

Defined in

node_modules/typescript/lib/lib.dom.d.ts:13953


getAllKeys

getAllKeys(query?, count?): IDBRequest<IDBValidKey[]>

Retrieves the keys of records matching the given key or key range in query (up to count if given).

If successful, request's result will be an Array of the keys.

MDN Reference

Parameters

Name Type
query? null | IDBValidKey | IDBKeyRange
count? number

Returns

IDBRequest<IDBValidKey[]>

Defined in

node_modules/typescript/lib/lib.dom.d.ts:13961


getKey

getKey(query): IDBRequest<undefined | IDBValidKey>

Retrieves the key of the first record matching the given key or key range in query.

If successful, request's result will be the key, or undefined if there was no matching record.

MDN Reference

Parameters

Name Type
query IDBValidKey | IDBKeyRange

Returns

IDBRequest<undefined | IDBValidKey>

Defined in

node_modules/typescript/lib/lib.dom.d.ts:13969


index

index(name): IDBIndex

MDN Reference

Parameters

Name Type
name string

Returns

IDBIndex

Defined in

node_modules/typescript/lib/lib.dom.d.ts:13971


openCursor

openCursor(query?, direction?): IDBRequest<null | IDBCursorWithValue>

Opens a cursor over the records matching query, ordered by direction. If query is null, all records in store are matched.

If successful, request's result will be an IDBCursorWithValue pointing at the first matching record, or null if there were no matching records.

MDN Reference

Parameters

Name Type
query? null | IDBValidKey | IDBKeyRange
direction? IDBCursorDirection

Returns

IDBRequest<null | IDBCursorWithValue>

Defined in

node_modules/typescript/lib/lib.dom.d.ts:13979


openKeyCursor

openKeyCursor(query?, direction?): IDBRequest<null | IDBCursor>

Opens a cursor with key only flag set over the records matching query, ordered by direction. If query is null, all records in store are matched.

If successful, request's result will be an IDBCursor pointing at the first matching record, or null if there were no matching records.

MDN Reference

Parameters

Name Type
query? null | IDBValidKey | IDBKeyRange
direction? IDBCursorDirection

Returns

IDBRequest<null | IDBCursor>

Defined in

node_modules/typescript/lib/lib.dom.d.ts:13987


put

put(value, key?): IDBRequest<IDBValidKey>

Adds or updates a record in store with the given value and key.

If the store uses in-line keys and key is specified a "DataError" DOMException will be thrown.

If put() is used, any existing record with the key will be replaced. If add() is used, and if a record with the key already exists the request will fail, with request's error set to a "ConstraintError" DOMException.

If successful, request's result will be the record's key.

MDN Reference

Parameters

Name Type
value any
key? IDBValidKey

Returns

IDBRequest<IDBValidKey>

Defined in

node_modules/typescript/lib/lib.dom.d.ts:13999

Typescript Libraries

Modules

Namespaces

Clone this wiki locally