Skip to content
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

Merged
merged 16 commits into from
Aug 27, 2024
Merged

Start to vendor lmdb-js-lite #18

merged 16 commits into from
Aug 27, 2024

Conversation

yamadapc
Copy link
Contributor

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.

@@ -0,0 +1,453 @@
//! This crate implements a LMDB wrapper for Node.js using N-API.
Copy link
Contributor Author

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;
Copy link
Contributor Author

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() }
Copy link
Contributor Author

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.

yarn.lock Outdated Show resolved Hide resolved
@yamadapc yamadapc marked this pull request as ready for review August 26, 2024 00:23
@yamadapc yamadapc changed the title WIP - Start to vendor lmdb-js-lite Start to vendor lmdb-js-lite Aug 26, 2024
@yamadapc yamadapc merged commit f50e680 into main Aug 27, 2024
17 checks passed
Nikola-3 pushed a commit that referenced this pull request Oct 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants