Skip to content

Attempt to bootstrap the db on connect#2029

Merged
penberg merged 2 commits intotursodatabase:mainfrom
avinassh:bs-on-connect
Apr 11, 2025
Merged

Attempt to bootstrap the db on connect#2029
penberg merged 2 commits intotursodatabase:mainfrom
avinassh:bs-on-connect

Conversation

@avinassh
Copy link
Copy Markdown
Member

@avinassh avinassh commented Apr 11, 2025

Fixes #2024

Whenever db.connect is called, we will try to bootstrap the db if required

@avinassh avinassh changed the title Attempt to sync on connect Attempt to bootstrap on connect Apr 11, 2025
@avinassh avinassh changed the title Attempt to bootstrap on connect Attempt to bootstrap the db on connect Apr 11, 2025
@penberg penberg added this pull request to the merge queue Apr 11, 2025
Merged via the queue into tursodatabase:main with commit 10f5dd8 Apr 11, 2025
19 checks passed
@avinassh avinassh deleted the bs-on-connect branch April 11, 2025 18:19
Comment thread libsql/src/database.rs
};
use tokio::sync::Mutex;

let _ = tokio::task::block_in_place(move || {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This breaks Db initialization under Actix due to its blocking nature. It forces the user to separate the db initialization out of the actix main and create a custom main which initializes the db first in a multi-threaded Tokio runtime and then passes it to Actix.

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.

Bootstrap the db on connect

3 participants