-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Start to vendor lmdb-js-lite #18
Conversation
@@ -0,0 +1,453 @@ | |||
//! This crate implements a LMDB wrapper for Node.js using N-API. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Source code is here
@@ -0,0 +1,527 @@ | |||
use std::path::Path; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And here
{ | ||
current_size = current_size * 2; | ||
tracing::info!("Resizing database {current_size}"); | ||
unsafe { read.environment().resize(current_size).unwrap() } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did not implement resizing because resizing requires us to put a lock around all the transactions so that we only resize when there are no open transactions. Even in that case it's hard to validate & it'll be a bit of UB to resize.
This starts to add a Rust based wrapper for LMDB, as published in the
lmdb-js-lite
npm package. That package will be deprecated and vendored into the parcel repository.This pull-request will be changed to that the LMDB bindings are built into the main bundler rust native add-on, rather than a separate one.