You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Dec 1, 2024. It is now read-only.
I'm wondering what the exact purpose of the asBuffer option is (and it's cousins keyAsBuffer and valueAsBuffer). To me it feels redundant since one can use keyEncoding binary and/or valueEncoding binary.
I wonder what to do when using IndexedDB as a backend which has support for native JS types as values and supports some different types for keys (Level/level-js#48). I know in level.js they even have a raw option. I can't really tell the difference between encoding, asBuffer and raw.
I'm wondering what the exact purpose of the asBuffer option is (and it's cousins keyAsBuffer and valueAsBuffer).
The asBuffer option tells the store to fetch data as a Buffer, and avoid unnecessary conversion. Stores like leveldown have the ability to return either a Buffer or string, both sourced from the same byte array. See encoding format for more.
To me it feels redundant since one can use keyEncoding binary and/or valueEncoding binary.
The binary encoding is just one of the encodings (which is user-specified) that result in asBuffer: true (which is derived from the encoding).
I wonder what to do when using IndexedDB as a backend which has support for native JS types as values and supports some different types for keys (Level/level-js#48)
TBD, to be discussed elsewhere.
I know in level.js they even have a raw option.
IMO the non-standard raw option should be removed from level.js. And if asBuffer is false, level.js should return the value as-is. Then, by using the identity encoding, one can achieve the same effect as raw: true.
I'm wondering what the exact purpose of the asBuffer option is (and it's cousins keyAsBuffer and valueAsBuffer). To me it feels redundant since one can use keyEncoding
binary
and/or valueEncodingbinary
.I wonder what to do when using IndexedDB as a backend which has support for native JS types as values and supports some different types for keys (Level/level-js#48). I know in level.js they even have a
raw
option. I can't really tell the difference between encoding, asBuffer and raw./cc @nolanlawson
The text was updated successfully, but these errors were encountered: