- From: David Callanan <notifications@github.com>
- Date: Sun, 09 Apr 2023 09:45:25 -0700
- To: w3c/IndexedDB <IndexedDB@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
Received on Sunday, 9 April 2023 16:45:31 UTC
It's a disaster that we cannot use BigInt's as keys, however, we can use a left-padded string instead. This should maintain numerical ordering when using `IDBKeyRange` etc. ``` const NUM_DIGITS = 20; // increase if larger numbers are possible const key_str = `${key_bigint}`.padStart(NUM_DIGITS, "0"); ``` I'm not sure what the performance implications are with using strings here, but it's better than the alternative of not being able to use IndexedDB at all. -- Reply to this email directly or view it on GitHub: https://github.com/w3c/IndexedDB/issues/230#issuecomment-1501167836 You are receiving this because you are subscribed to this thread. Message ID: <w3c/IndexedDB/issues/230/1501167836@github.com>
Received on Sunday, 9 April 2023 16:45:31 UTC