- Added native support for apple silicon (arm64). This has been way too long coming. Thanks to everyone who contributed on the github issue. The library should automatically detect your computer's architecture and "just work". You will need to install a version of foundationdb which matches your computer's architecture.
- Fixed an issue where the directory layer would "reset" the transformers when a directory was created or opened. Thanks @NuckChorris for reporting this problem.
- Updated to support FoundationDB API version 720. This adds 2 new APIs:
txn.getEstimatedRangeSizeBytes
txn.getRangeSplitPoints
- Note this means node-foundationdb requires foundationdb-clients 7.2 or newer to build.
- Fixed a bug where
napi_string
values would have a nulled last value if 1024 length. (PR - thanks to @Max-Clark!)
- Fixed a bug creating directory prefixes when the database is under load (#63 - thanks @aikoven)
- Updated max api version to 630
- Moved CI to github actions (this should have no effect on downstream consumers)
- Regenerated options to add support for features added in API version 630 pr (thanks @ex3ndr!)
- Fixed small memory leak (we were leaking a few bytes with each transaction in native code). Thanks @aikoven!
- Fixed bug where node module was missing prebuilds for macos and linux
- Deprecated callback-oriented API, for the few methods for which I've added callback variant methods.
- Moved the tuple encoder out into its own module. Its still re-exported here via
fdb.tuple
.
- Changed
fdb.open()
to return a directory reference synchronously. This matches the semantics of the new client API. - Removed support for the older nan-based native module. The newer napi code works on all officially supported versions of nodejs, as well as node 8.16. If you're using a version of nodejs older than that, its past time to upgrade.
- Changed
db.get()
/txn.get()
to returnundefined
rather thannull
if the object doesn't exist. This is because null is a valid tuple value. - Changed
db.getKey()
/txn.getKey()
to returnundefined
if the requested key is not in the db / transaction's subspace - Deprecated
tn.scopedTo
. Usetn.at()
. - Deprecated callback-oriented API, for the few methods for which I've added callback variant methods.
- Bumped the default API version to 620, so you should use foundationdb 6.2 or greater to use this API.
- Pulled out database / transaction scope information (prefix and key value transformers) into a separate class 'subspace' to more closely match the other bindings. This is currently internal-only but it will be exposed when I'm more confident about the API.
- Added support in the tuple encoder for non-array values, which are functionally equivalent to their array-wrapped versions. Eg this will now work:
db.withKeyEncoding(fdb.tuple).at('index').set('hi', 'yo') // <-- 'index' and 'hi' no longer need to be wrapped in arrays
Note that db.at(['prefix']).set(['key'], 'value')
is equivalent to db.at(['prefix', 'key']).set([] (or undefined), 'value')
but not equivalent to db.at(['prefix', 'key']).set(null, 'value')
because null
is treated like [null]
which is not the same as []
.
(The mental model is that tuple.pack(arr1) + tuple.pack(arr2) is always equivalent to tuple.pack(arr1 + arr2), so []
encodes to an empty byte string, but [null]
encodes to [0]
).
- Updated API to support foundationdb 620
- Updated the binding tester to conform to version 620's changes
- Fixed a spec conformance bug in the tuple encoder's handling of extremely large negative integers
- Added the directory layer (!!)
- Added doc comments for a lot of methods in Transaction
- Backported an important fix to the tuple layer encoding logic for very large negative numbers from fdb 1.0.0
- Fixed another critical bug which can cause nodejs to hang (deadlock) under heavy load.
- Started moving some documentation into doc comment style, so hovering over methods can now show information.
- Updated transaction options and network options to match upstream foundationdb @ 6.2.19
- Fixed a really bad bug enabled by version 0.10.4 which can cause data corruption in some cases
- Improved the behaviour in
getRange
methods when fetching a range with a tuple key prefix. (getRangeAll
/getRangeStartsWith
/ etc all do the right thing by default now when using tuple keys).
- Fixed a bug involving range queries when a prefix wasn't applied to the database. Thanks @kristate!
- Removed compiled nan-based prebuilds for node 8 and node 11, since those versions have left the nodejs LTS window. Napi artifacts should still work on recent point releases.
- Added bigint support in tuple encoding
- Fixed behaviour when setAPIVersion is called multiple times. Thanks @ex3ndr! Issue / PR
- Added .modType to exported library artifact to help with debugging (its 'nan' or 'napi' depending on the build used).
- Fixed a bug causing node-gyp-build to stall when running
npm install
(Tweaked testing infrastructure, but made no user / package level changes)
- Moved to n-api, which should improve performance and fix the build on node 12. It should also work on all future nodejs versions without code change. This breaks compatibility between the bundled prebuilds and most older point releases of node 8, 10 and 11. The latest point releases of each version of nodejs (v8.16.0+, 10.15.3+, 11.14.0+ or node 12) all support napi v4. The fallback build process should still build correct & usable binaries using the old C code path, but at some point I'll remove this code entirely.
- Fixed issue using baked versionstamps in scoped transactions. Thanks @aikoven!
- Added an extra optional argument to
fdb.setAPIVerion(version, headerVersion?)
to work around issues where the#define FDB_API_VERSION
header version is newer than the installedlibfdb_c
library. Its a hack, but its a decent work around until we work out best practices.
- Fixed a bug where if you called
tn.getVersionstamp
inside a transaction which conflicted, it would crash your whole node process.
- Fixed type information on
tn.scopedTo
- Added support for explicit
cluster.close()
/db.close()
calls - Added support for
set/getVersionstampPrefixedValue
with no value
- Removed prebuild for node 9 and electron.
- Added prebuild for node 11
- Added proper versionstamp API
- Added versionstamp support to tuple
- Wrapped getVersionstamp in a {promise} object
- Added support for protocol versions 520 and 600, testing with fdb 6.0.15
- Added support for versionstamp values at an offset
- Added support for decoding tuple values with versionstamps. No support for encoding versionstamps yet
- Removed a bunch of unnecessary files from the bundle
- Added binding build for FreeBSD