Skip to content

Commit

Permalink
chore: clean up comments/todos
Browse files Browse the repository at this point in the history
  • Loading branch information
dav1do committed Jan 19, 2024
1 parent a0167d6 commit d7f1902
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions core/src/sql.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,11 @@ impl SqlitePool {
/// Uses WAL journal mode.
pub async fn connect(path: impl AsRef<Path>) -> anyhow::Result<Self> {
let db_path = format!("sqlite:{}", path.as_ref().display());
// As we benchmark, we will likely adjust settings and make things configurable.
// A few ideas: number of RO connections, synchronize = NORMAL, mmap_size, temp_store = memory
let conn_opts = SqliteConnectOptions::from_str(&db_path)?
.journal_mode(SqliteJournalMode::Wal)
.create_if_missing(true)
// .synchronous(sqlx::sqlite::SqliteSynchronous::Normal) // normally enough in WAL mode?
.optimize_on_close(true, None);

let ro_opts = conn_opts.clone().read_only(true);
Expand All @@ -28,7 +29,7 @@ impl SqlitePool {
.connect_with(conn_opts)
.await?;
let reader = SqlitePoolOptions::new()
.max_connections(32) //TODO
.max_connections(8)
.connect_with(ro_opts)
.await?;

Expand Down

0 comments on commit d7f1902

Please sign in to comment.