Skip to content
This repository was archived by the owner on Dec 1, 2024. It is now read-only.
/ leveldown Public archive
This repository was archived by the owner on Dec 1, 2024. It is now read-only.

Support more than 32bit ApproximateSize bindings #776

@larskuhtz

Description

@larskuhtz

Currently the binding for approximateSize stores the result as uint32 (

napi_create_uint32(env_, (uint32_t)size_, &argv[1]);
). This supports only databases of up to 4GB and returns wrong results for larger DBs.

It would be nice if approximateSize could either

  1. support all of Number.isSafeInteger(),
  2. support larger numbers by representing them as nearest float (it's "approximate" after all),
  3. return BitInt, or
  4. at least return an error if an invalid result is returned.

Not sure, which of the options would be best.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingsemver-patchBug fixes that are backward compatible

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions