summary refs log tree commit diff
path: root/database.h
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2020-01-14 18:25:52 -0500
committerJune McEnroe <june@causal.agency>2020-01-14 18:25:52 -0500
commit699a8c625cdf1f9a57bf4be326dc0c797c2d4d63 (patch)
tree590c05c0bd8dac0addf1c89974ad3dac2af37ab9 /database.h
parentAdd columnsize = 0 option to FTS index (diff)
downloadlitterbox-699a8c625cdf1f9a57bf4be326dc0c797c2d4d63.tar.gz
litterbox-699a8c625cdf1f9a57bf4be326dc0c797c2d4d63.zip
Add -b flag for live backup
Diffstat (limited to '')
-rw-r--r--database.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/database.h b/database.h
index 83be73c..d9b2718 100644
--- a/database.h
+++ b/database.h
@@ -335,3 +335,13 @@ static inline void dbMigrate(void) {
 		dbExec(MigrationSQL[version]);
 	}
 }
+
+static inline void dbBackup(const char *path) {
+	if (sqlite3_libversion_number() < 3027000) {
+		errx(EX_CONFIG, "SQLite version 3.27.0 or newer required");
+	}
+	sqlite3_stmt *stmt = dbPrepare(SQL(VACUUM INTO :path;));
+	dbBindText(stmt, ":path", path);
+	dbRun(stmt);
+	sqlite3_finalize(stmt);
+}
rateJune McEnroe 2021-02-07Bump font size to 12June McEnroe 11 is what I use on macOS, but I feel like my eyes are working harder here. 2021-02-07Fully configure and rebind cwmJune McEnroe This is sort of a mix of trying to emulate macOS somewhat for my muscle memory and just rebinding some of the cwm defaults to use 4- rather than M-. 2021-02-07Add BintiJune McEnroe 2021-02-07Finish configuring xtermJune McEnroe 2021-02-06Enable tapping, reverse scroll, set scaling in wsconsctlJune McEnroe 2021-02-06Set root window to black on purple snowJune McEnroe 2021-02-06Add xmodmap configurationJune McEnroe 2021-02-06Add initial OpenBSD X configurationJune McEnroe cwm still needs a lot more rebinding, and I need to actually look at its other options. xterm definitely still needs some configuration, but I at least managed to get it to use a decent looking font. Very happy that OpenBSD includes Luxi Mono, which is what my usual font, Go Mono, is based on anyway. Still missing is xmodmap and such. 2021-02-06Add xterm output to schemeJune McEnroe