Skip to content

Commit 9155543

Browse files
committed
feat(depot-client): wire sqlite optimization flags
1 parent 48cc3bb commit 9155543

6 files changed

Lines changed: 391 additions & 237 deletions

File tree

engine/packages/depot-client/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ depot-client-types.workspace = true
2323
depot.workspace = true
2424
moka = { version = "0.12", default-features = false, features = ["sync"] }
2525
parking_lot.workspace = true
26+
scc.workspace = true
2627

2728
[dev-dependencies]
2829
depot = { workspace = true, features = ["test-faults"] }
@@ -31,7 +32,6 @@ gas.workspace = true
3132
rivet-config.workspace = true
3233
rivet-pools.workspace = true
3334
rivet-test-deps.workspace = true
34-
scc.workspace = true
3535
sha2.workspace = true
3636
tempfile.workspace = true
3737
universaldb.workspace = true

engine/packages/depot-client/src/database.rs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use crate::{
99
vfs::{
1010
NativeVfsHandle, SqliteTransportHandle, SqliteVfs, SqliteVfsMetrics,
1111
SqliteVfsMetricsSnapshot, VfsConfig, VfsPreloadHintSnapshot,
12-
fetch_initial_main_page_for_registration,
12+
fetch_initial_pages_for_registration,
1313
},
1414
worker::SqliteWorkerHandle,
1515
};
@@ -32,17 +32,18 @@ pub async fn open_database_from_transport(
3232
metrics: Option<Arc<dyn SqliteVfsMetrics>>,
3333
) -> Result<NativeDatabaseHandle> {
3434
let vfs_name = vfs_name_for_actor_database(&actor_id, generation);
35-
let initial_main_page = fetch_initial_main_page_for_registration(transport.clone(), &actor_id)
35+
let config = VfsConfig::default();
36+
let initial_pages = fetch_initial_pages_for_registration(transport.clone(), &actor_id, &config)
3637
.await
37-
.map_err(|e| anyhow!("failed to preload sqlite main page: {e}"))?;
38+
.map_err(|e| anyhow!("failed to preload sqlite pages: {e}"))?;
3839
let vfs = Arc::new(
39-
SqliteVfs::register_with_transport_and_initial_page(
40+
SqliteVfs::register_with_transport_and_initial_pages(
4041
&vfs_name,
4142
transport,
4243
actor_id.clone(),
4344
rt_handle,
44-
VfsConfig::default(),
45-
initial_main_page,
45+
config,
46+
initial_pages,
4647
metrics.clone(),
4748
)
4849
.map_err(|e| anyhow!("failed to register sqlite VFS: {e}"))?,

0 commit comments

Comments
 (0)