IdbFactory Class

The entry point of IndexedDB of a window or a worker (https://w3c.github.io/IndexedDB/#idbfactory): opens and deletes the databases of its origin, stored by BrowsingContextOptions.IndexedDB.

public sealed class IdbFactory

Methods

NameDescription
Cmp(object?, object?)Compares two keys (https://w3c.github.io/IndexedDB/#dom-idbfactory-cmp): -1, 0 or 1.
Databases()Returns the names and the versions of the databases of the origin (https://w3c.github.io/IndexedDB/#dom-idbfactory-databases).
DeleteDatabase(string)Deletes a database (https://w3c.github.io/IndexedDB/#dom-idbfactory-deletedatabase).
Open(string, ulong?)Opens a connection to a database, creating or upgrading it (https://w3c.github.io/IndexedDB/#dom-idbfactory-open).

Cmp(object?, object?)

IdbFactory.cs

Compares two keys (https://w3c.github.io/IndexedDB/#dom-idbfactory-cmp): -1, 0 or 1.

public short Cmp(object? first, object? second)

Parameters

first object?
second object?

Returns

short

Exceptions

DomException
A DataError when a value is not a valid key.

See also

Databases()

IdbFactory.cs

Returns the names and the versions of the databases of the origin (https://w3c.github.io/IndexedDB/#dom-idbfactory-databases).

public Task<IReadOnlyList<IdbDatabaseInfo>> Databases()

DeleteDatabase(string)

IdbFactory.cs

Deletes a database (https://w3c.github.io/IndexedDB/#dom-idbfactory-deletedatabase).

public IdbOpenDBRequest DeleteDatabase(string name)

Parameters

name string
The name of the database.

Returns

IdbOpenDBRequest

Exceptions

DomException
A SecurityError when the origin is opaque.

See also

Open(string, ulong?)

IdbFactory.cs

Opens a connection to a database, creating or upgrading it (https://w3c.github.io/IndexedDB/#dom-idbfactory-open).

public IdbOpenDBRequest Open(string name, ulong? version = null)

Parameters

name string
The name of the database.
version ulong?
The version of the database, or null for the current version (1 for a new database).

Returns

IdbOpenDBRequest

Exceptions

TypeErrorException
The version is 0.
DomException
A SecurityError when the origin is opaque.

See also