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

Serialize and deserialize database #1341

Merged
merged 2 commits into from
Jul 21, 2023
Merged

Serialize and deserialize database #1341

merged 2 commits into from
Jul 21, 2023

Conversation

gwenn
Copy link
Collaborator

@gwenn gwenn commented Jun 5, 2023

Fix #880
Port of Tcl impl
Partial duplicate of #786

@gwenn gwenn requested a review from thomcc June 5, 2023 18:08
@codecov
Copy link

codecov bot commented Jun 5, 2023

Codecov Report

Patch coverage has no change and project coverage change: -0.01 ⚠️

Comparison is base (38bf316) 80.67% compared to head (67d1e34) 80.67%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1341      +/-   ##
==========================================
- Coverage   80.67%   80.67%   -0.01%     
==========================================
  Files          49       49              
  Lines       10085    10084       -1     
==========================================
- Hits         8136     8135       -1     
  Misses       1949     1949              
Impacted Files Coverage Δ
src/error.rs 26.85% <ø> (-0.42%) ⬇️
src/lib.rs 84.32% <ø> (ø)

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@gwenn
Copy link
Collaborator Author

gwenn commented Jul 18, 2023

@thomcc would you mind reviewing this minimum viable API ?
You should be able to serialize the data anywhere (disk / network) (with the Deref<[u8]> impl).
But to deserialize, users will need sqlite3_malloc / sqlite3_realloc...
(maybe we will be able to provide a nicer API when std::alloc:: Allocator is stable)

Copy link
Member

@thomcc thomcc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks basically reasonable to me, sorry for the delay, I missed this in my inbox until now.

@gwenn gwenn merged commit ce71e92 into rusqlite:master Jul 21, 2023
16 checks passed
@gwenn gwenn deleted the serialize branch July 21, 2023 17:01
@dimo414
Copy link

dimo414 commented Sep 25, 2023

Any plans for a 0.30 to pick up this PR? Would love to use it!

@gwenn gwenn mentioned this pull request Mar 24, 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.

Is there any way to open a database from an &[u8]?
3 participants