Compare commits

..

1 Commits

Author SHA1 Message Date
6f543e124d feat: add /history switch for runtime database backend switching
All checks were successful
CI Code / Check spelling (pull_request) Successful in 18s
CI Code / Check coding style (pull_request) Successful in 1m10s
CI Code / Linux (debian) (pull_request) Successful in 6m20s
CI Code / Linux (ubuntu) (pull_request) Successful in 6m27s
CI Code / Code Coverage (pull_request) Successful in 9m5s
CI Code / Linux (arch) (pull_request) Successful in 11m22s
Add log_database_switch_backend() that closes the current backend,
updates PREF_DBLOG preference, and reinitializes with the new backend
without requiring a reconnect or restart.

New command: /history switch sqlite|flatfile
- Validates connection state and backend name
- Skips if already using the requested backend
- Autocomplete support for the subcommand
2026-02-26 14:17:44 +03:00

View File

@@ -25,9 +25,14 @@
#include "config.h"
#include "database.h"
#include "database_flatfile.h"
db_backend_t* active_db_backend = NULL;
// The flatfile parser needs this global for path construction.
// In tests we keep it NULL since no real file I/O happens via the backend.
char* g_flatfile_account_jid = NULL;
gboolean
log_database_init(ProfAccount* account)
{
@@ -53,6 +58,11 @@ void
log_database_close(void)
{
}
gboolean
log_database_switch_backend(const char* new_backend)
{
return TRUE;
}
GSList*
log_database_verify_integrity(const gchar* const contact_barejid)
{