IdbDatabase Class
A connection to a database (https://w3c.github.io/IndexedDB/#idbdatabase).
public sealed class IdbDatabase : EventTarget- Inheritance
EventTargetIdbDatabase
Properties
| Name | Description |
|---|---|
| Name | Gets the name of the database. |
| ObjectStoreNames | Gets the sorted names of the object stores of the connection. |
| OnAbort | The event handler of the abort events. |
| OnClose | The event handler of the close events. |
| OnError | The event handler of the error events. |
| OnVersionChange | The event handler of the versionchange events. |
| Version | Gets the version of the connection. |
Name
IdbDatabase.csGets the name of the database.
public string Name { get; }ObjectStoreNames
IdbDatabase.csGets the sorted names of the object stores of the connection.
public DomStringList ObjectStoreNames { get; }Property value
See also
OnAbort
IdbDatabase.csThe event handler of the abort events.
OnClose
IdbDatabase.csThe event handler of the close events.
OnError
IdbDatabase.csThe event handler of the error events.
OnVersionChange
IdbDatabase.csThe event handler of the versionchange events.
Property value
See also
Version
IdbDatabase.csGets the version of the connection.
public ulong Version { get; }Methods
| Name | Description |
|---|---|
| Close() | Closes the connection once its transactions are finished (https://w3c.github.io/IndexedDB/#dom-idbdatabase-close). |
| CreateObjectStore(string, IdbObjectStoreParameters?) | Creates an object store in the upgrade transaction (https://w3c.github.io/IndexedDB/#dom-idbdatabase-createobjectstore). |
| DeleteObjectStore(string) | Deletes an object store in the upgrade transaction (https://w3c.github.io/IndexedDB/#dom-idbdatabase-deleteobjectstore). |
| Transaction(object?, IdbTransactionMode, IdbTransactionOptions?) | Creates a transaction (https://w3c.github.io/IndexedDB/#dom-idbdatabase-transaction). |
Close()
IdbDatabase.csCloses the connection once its transactions are finished (https://w3c.github.io/IndexedDB/#dom-idbdatabase-close).
public void Close()CreateObjectStore(string, IdbObjectStoreParameters?)
IdbDatabase.csCreates an object store in the upgrade transaction (https://w3c.github.io/IndexedDB/#dom-idbdatabase-createobjectstore).
public IdbObjectStore CreateObjectStore(string name, IdbObjectStoreParameters? options = null)DeleteObjectStore(string)
IdbDatabase.csDeletes an object store in the upgrade transaction (https://w3c.github.io/IndexedDB/#dom-idbdatabase-deleteobjectstore).
Transaction(object?, IdbTransactionMode, IdbTransactionOptions?)
IdbDatabase.csCreates a transaction (https://w3c.github.io/IndexedDB/#dom-idbdatabase-transaction).
public IdbTransaction Transaction(object? storeNames, IdbTransactionMode mode = IdbTransactionMode.ReadOnly, IdbTransactionOptions? options = null)Parameters
storeNamesobject?- The name of an object store, or a list of names.
modeIdbTransactionMode- The mode of the transaction:
IdbTransactionMode.ReadOnlyorIdbTransactionMode.ReadWrite. optionsIdbTransactionOptions?- The options of the transaction.