nixos-config/nixos/homes/common/0001-make-atuin-on-zfs-fast-again.patch

45 lines
1.8 KiB
Diff
Raw Normal View History

2024-04-19 21:07:41 +02:00
From 4797a2f62ab3d2716d313aa4a3170ba9672a93b6 Mon Sep 17 00:00:00 2001
2023-12-23 00:11:26 +01:00
From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= <joerg@thalheim.io>
2024-04-19 21:07:41 +02:00
Date: Fri, 22 Mar 2024 08:46:07 +0100
2023-12-23 00:11:26 +01:00
Subject: [PATCH] make atuin on zfs fast again
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Signed-off-by: Jörg Thalheim <joerg@thalheim.io>
---
2024-04-19 21:07:41 +02:00
atuin-client/src/database.rs | 4 ++--
atuin-client/src/record/sqlite_store.rs | 2 ++
2023-12-23 00:11:26 +01:00
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/atuin-client/src/database.rs b/atuin-client/src/database.rs
2024-04-19 21:07:41 +02:00
index b0bcae31..d8db492b 100644
2023-12-23 00:11:26 +01:00
--- a/atuin-client/src/database.rs
+++ b/atuin-client/src/database.rs
2024-04-19 21:07:41 +02:00
@@ -137,9 +137,9 @@ pub async fn new(path: impl AsRef<Path>, timeout: f64) -> Result<Self> {
2023-12-23 00:11:26 +01:00
}
2024-04-19 21:07:41 +02:00
2023-12-23 00:11:26 +01:00
let opts = SqliteConnectOptions::from_str(path.as_os_str().to_str().unwrap())?
- .journal_mode(SqliteJournalMode::Wal)
+ .journal_mode(SqliteJournalMode::Memory)
2024-04-19 21:07:41 +02:00
.optimize_on_close(true, None)
- .synchronous(SqliteSynchronous::Normal)
2023-12-23 00:11:26 +01:00
+ .synchronous(sqlx::sqlite::SqliteSynchronous::Off)
2024-04-19 21:07:41 +02:00
.with_regexp()
2023-12-23 00:11:26 +01:00
.create_if_missing(true);
2024-04-19 21:07:41 +02:00
2023-12-23 00:11:26 +01:00
diff --git a/atuin-client/src/record/sqlite_store.rs b/atuin-client/src/record/sqlite_store.rs
2024-04-19 21:07:41 +02:00
index 6333bb27..1f25a55b 100644
2023-12-23 00:11:26 +01:00
--- a/atuin-client/src/record/sqlite_store.rs
+++ b/atuin-client/src/record/sqlite_store.rs
2024-04-19 21:07:41 +02:00
@@ -42,6 +42,8 @@ pub async fn new(path: impl AsRef<Path>, timeout: f64) -> Result<Self> {
2023-12-23 00:11:26 +01:00
let opts = SqliteConnectOptions::from_str(path.as_os_str().to_str().unwrap())?
2024-04-19 21:07:41 +02:00
.journal_mode(SqliteJournalMode::Wal)
2023-12-23 00:11:26 +01:00
+ .journal_mode(SqliteJournalMode::Memory)
+ .synchronous(sqlx::sqlite::SqliteSynchronous::Off)
2024-04-19 21:07:41 +02:00
.foreign_keys(true)
2023-12-23 00:11:26 +01:00
.create_if_missing(true);
2024-04-19 21:07:41 +02:00
--
2.43.1