updated file database added get_all_users get_user_by_id
Prepare Build and Testing executable binary / Prepare-Build-Testing-With-Make (push) Successful in 14s
Prepare Build and Testing executable binary / Prepare-Build-Testing-With-CMake (push) Failing after 9s
Prepare Build and Testing executable binary / Prepare-Build-Testing-With-Meson (push) Successful in 12s

get_user_by_username get_user_field_by_id
This commit is contained in:
wt committed 2025-10-22 16:46:36 +07:00
1 parent 73a73976fe
commit d14db43e9b
13 files changed
+158 -9

No files matched your search

+8 -1
View File
@@ -4,6 +4,10 @@
#include "sql.h"
#include "user.h"
#ifndef USE_SQLITE3
#include "file.h"
#endif
char *db_get_all_users() {
#ifdef USE_SQLITE3
pthread_mutex_lock(&db_mutex);
@@ -99,6 +103,9 @@ char *db_get_all_users() {
pthread_mutex_unlock(&db_mutex);
return result;
#else
return "";
pthread_mutex_lock(&users_file_mutex);
char *data = read_file("users_db.json");
pthread_mutex_unlock(&users_file_mutex);
return data;
#endif
}