Switch to storing in sqlite

This commit is contained in:
2025-01-26 16:59:19 +01:00
parent 477af8b063
commit cb743d15d9
4 changed files with 63 additions and 41 deletions

View File

@@ -1,5 +1,15 @@
const char create_table[] = "CREATE TABLE IF NOT EXISTS prim_table ( ID INTEGER PRIMARY KEY, USER_ID INTEGER, GEN INTEGER, HASH INTEGER, POS INTEGER, LIKED INTEGER);";
const char create_index[] = "CREATE INDEX IF NOT EXISTS idx_usrer_id ON prim_table (USER_ID);";
const char insert_data[] = "INSERT INTO prim_table (USER_ID, GEN, HASH, POS, LIKED) VALUES(?, ?, ?, ?, ?);";
const char max_gen[] = "SELECT MAX(GEN) FROM prim_table WHERE USER_ID = ?;";
constexpr char DB_NAME[] = "data.db";
namespace sql
{
void init();