diff deita/d_sqlite.c @ 260:1f9877b637e9

Add Copilot-powered cyberpunk JRPG chat Integrate the production JRPG chat with Seobeo streaming, Deita persistence, and a Bazel-managed Copilot SDK and LiteLLM inference stack. Co-authored-by: Copilot <[email protected]>
author MrJuneJune <mrjunejune@users.noreply.github.com>
date Wed, 05 Aug 2026 09:19:41 -0700
parents ae6a88e6e484
children
line wrap: on
line diff
--- a/deita/d_sqlite.c	Wed Aug 05 09:19:41 2026 -0700
+++ b/deita/d_sqlite.c	Wed Aug 05 09:19:41 2026 -0700
@@ -26,6 +26,17 @@
     free(p_connection);
     return NULL;
   }
+  result = sqlite3_busy_timeout(p_db, 5000);
+  if (result != SQLITE_OK)
+  {
+    fprintf(
+        stderr,
+        "deita__sqlite_connection_create: Failed to set busy timeout: %s\n",
+        sqlite3_errmsg(p_db));
+    sqlite3_close(p_db);
+    free(p_connection);
+    return NULL;
+  }
 
   p_connection->native_handle = p_db;
   p_connection->is_open = TRUE;
@@ -88,6 +99,7 @@
   p_result_set->column_count = sqlite3_column_count(p_stmt);
   p_result_set->has_data = FALSE;
   p_result_set->is_done = FALSE;
+  p_result_set->has_error = FALSE;
 
   return p_result_set;
 }
@@ -136,6 +148,7 @@
   p_result_set->column_count = sqlite3_column_count(p_stmt);
   p_result_set->has_data = FALSE;
   p_result_set->is_done = FALSE;
+  p_result_set->has_error = FALSE;
 
   return p_result_set;
 }
@@ -229,6 +242,7 @@
     fprintf(stderr, "deita__sqlite_result_set_next: Error stepping through results\n");
     p_result_set->has_data = FALSE;
     p_result_set->is_done = TRUE;
+    p_result_set->has_error = TRUE;
     return FALSE;
   }
 }