MCPcopy Create free account
hub / github.com/clockworklabs/SpacetimeDB / build

Method build

crates/bench/src/sqlite.rs:31–49  ·  view source on GitHub ↗
(in_memory: bool)

Source from the content-addressed store, hash-verified

29 }
30
31 fn build(in_memory: bool) -> ResultBench<Self>
32 where
33 Self: Sized,
34 {
35 let temp_dir = TempDir::new("sqlite_test")?;
36 let db = if in_memory {
37 Connection::open_in_memory()?
38 } else {
39 Connection::open(temp_dir.path().join("test.db"))?
40 };
41 // For sqlite benchmarks we should set synchronous to off which more
42 // closely aligns with wal_fsync=false in stdb.
43 db.execute_batch("PRAGMA journal_mode = WAL; PRAGMA synchronous = off;")?;
44
45 Ok(SQLite {
46 db,
47 _temp_dir: temp_dir,
48 })
49 }
50
51 type TableId = TableName;
52

Callers

nothing calls this directly

Calls 5

joinMethod · 0.80
newFunction · 0.50
openFunction · 0.50
OkFunction · 0.50
pathMethod · 0.45

Tested by

no test coverage detected