Skip to content

IDBRecord's key/primaryKey aliasing #496

@ArnaudBienner

Description

@ArnaudBienner

Follow up of #494.

This could be an opportunity for optimization.

The spec mandates that IDBRecord's key and primarKey shall be the same value when being retrieved from an IDBObjectStore:

For cases where the key is not a primitive type (arrays, ...) it could be nice to state in the spec that the IDBRecord getters shall return the same JS object. i.e. be aliased.

Our the implementation side, even if data can be optimized to share underlying data in some cases, it would be even more efficient to not create a different JS object at all: this would save processing time and memory.

The observable effect is:
record.key === record.primaryKey would return true, while it returns false currently.

This could apply to IDBCursor too.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions