Skip to content

Adds Sqlite to db options - #50

Merged
freesig merged 1 commit into
mainfrom
freesig/sqlite
Aug 6, 2025
Merged

Adds Sqlite to db options#50
freesig merged 1 commit into
mainfrom
freesig/sqlite

Conversation

@freesig

@freesig freesig commented Aug 4, 2025

Copy link
Copy Markdown
Collaborator

@freesig
freesig requested review from bengybade and nfurfaro August 4, 2025 00:00
@freesig
freesig force-pushed the freesig/sqlite branch 9 times, most recently from c53a28a to 6e796c1 Compare August 4, 2025 03:36
- Sqlite db implements all writes and queries
- tests
- closes #49

<!-- ps-id: 6d141b80-791e-4fa6-9cea-9efd24ea6d2a -->

@nfurfaro nfurfaro left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks clean! Just left one question.

let mut i = 0;
let parent_hash = loop {
match get_current_hash(&database).await {
match get_current_hash(&mut database).await {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

What is it about Sqlite that requires the database arg here to be mutable now?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

It's because the queries have to be executed in a spawn_blocking which requires a 'static type so you need to actually move out the Connection in order to move it into the other thread and then move it back again

@freesig
freesig merged commit 2f52b1e into main Aug 6, 2025
18 checks passed
@freesig
freesig deleted the freesig/sqlite branch August 6, 2025 00:08
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.

Add sqlite version of db

2 participants