From 5a3bd7eadb70d38ba4502773638ad7249ff44b80 Mon Sep 17 00:00:00 2001 From: Sundog Date: Mon, 6 May 2024 10:22:10 -0400 Subject: [PATCH] initial db config --- src/webserver/config/db.php | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 src/webserver/config/db.php diff --git a/src/webserver/config/db.php b/src/webserver/config/db.php new file mode 100644 index 0000000..b9557d3 --- /dev/null +++ b/src/webserver/config/db.php @@ -0,0 +1,35 @@ +lastErrorMsg()); +} + +$conn->exec('PRAGMA journal_mode = wal;'); +$conn->exec('PRAGMA synchronous = NORMAL;'); + +if ($populate) { + // load the initial schema + $schema_file = realpath(dirname(__FILE__) . '/../../../db/sqlite/20240506-initialize-db.sql'); + $sql = file_get_contents($schema_file) or die("cannot get file contents for " . $schema_file); + + $conn->exec($sql); +} + +?>