A has a name which identifies it within a specific origin. The name is a , and stays constant for the lifetime of the database.

    A database has a version. When a database is first created, its is 0 (zero).

    Each database has one version at a time; a can’t exist in multiple versions at once. The only way to change the version is using an upgrade transaction.

    A has at most one associated upgrade transaction, which is either null or an upgrade transaction, and is initially null.

    2.1.1. Database connection

    The act of opening a creates a connection. There may be multiple to a given database at any given time.

    A can only access databases associated with the of the global scope from which the connection is opened.

    This is not affected by changes to the ‘s .

    A has a version, which is set when the connection is created. It remains constant for the lifetime of the unless an upgrade is aborted, in which case it is set to the previous version of the . Once the connection is closed the does not change.

    When a connection is initially created it is in an opened state. The connection can be closed through several means. If the execution context where the was created is destroyed (for example due to the user navigating away from that page), the connection is closed. The connection can also be closed explicitly using the steps to close a database connection. When the connection is closed its is always set to true if it hasn’t already been.

    A connection may be closed by a user agent in exceptional circumstances, for example due to loss of access to the file system, a permission change, or clearing of the origin’s storage. If this occurs the user agent must run with the connection and with the forced flag set to true.

    A has an object store set, which is initialized to the set of object stores in the associated when the connection is created. The contents of the set will remain constant except when an is running.

    A connection‘s algorithm returns null.