summaryrefslogtreecommitdiff
path: root/src/backend
diff options
context:
space:
mode:
authorLouie S <louie@example.com>2024-02-19 15:58:23 -0500
committerLouie S <louie@example.com>2024-02-19 15:58:23 -0500
commita276acd4e0c8031fdef41f11a4fa2285b671207d (patch)
treee28ba115c97257184e67f9a6787a81671e2aa437 /src/backend
parent8145f61fc830c8a3eaf7a9455756b861efb17683 (diff)
Set config creation
Diffstat (limited to 'src/backend')
-rw-r--r--src/backend/db_sqlite.h53
1 files changed, 53 insertions, 0 deletions
diff --git a/src/backend/db_sqlite.h b/src/backend/db_sqlite.h
new file mode 100644
index 0000000..5c55fef
--- /dev/null
+++ b/src/backend/db_sqlite.h
@@ -0,0 +1,53 @@
+#ifndef BACKEND_DB_SQLITE_H
+#define BACKEND_DB_SQLITE_H
+
+#include <QStringList>
+
+class BackendDB {
+ public:
+ void init();
+ void load();
+ void insertGroup(int new_group); // param datatype TBD
+ void insertEntry(int new_entry); // param datatype TBD
+ void insertRule(int new_rule); // param datatype TBD
+ void updateGroup(int group); // param datatype TBD
+ void updateEntry(int entry); // param datatype TBD
+ void updateRule(int rule); // param datatype TBD
+ void removeGroup(int group); // param datatype TBD
+ void removeEntry(int entry); // param datatype TBD
+ void removeRule(int rule); // param datatype TBD
+ void cleanHidden();
+
+ private:
+ const QStringList create_table_queries = {
+ "CREATE TABLE groups ("
+ "id INTEGER PRIMARY KEY AUTOINCREMENT UNIQUE NOT NULL,"
+ "name VARCHAR(255) NOT NULL,"
+ "column TINYINT(1) DEFAULT FALSE,"
+ "link VARCHAR(255) NOT NULL,"
+ "hidden TINYINT(1) DEFAULT FALSE"
+ ")",
+ "CREATE TABLE entries ("
+ "id INTEGER PRIMARY KEY AUTOINCREMENT UNIQUE NOT NULL,"
+ "parent_id REFERENCES groups (id),"
+ "description VARCHAR(255) NOT NULL,"
+ "due_date TEXT DEFAULT NULL,"
+ "alt_due_date VARCHAR(255) DEFAULT NULL,"
+ "link VARCHAR(255) DEFAULT NULL,"
+ "color VARCHAR(255) DEFAULT NULL,"
+ "highlight VARCHAR(255) DEFAULT NULL,"
+ "done TINYINT(1) DEFAULT FALSE,"
+ "hidden TINYINT(1) DEFAULT FALSE"
+ ")",
+ "CREATE TABLE rules ("
+ "id INTEGER PRIMARY KEY AUTOINCREMENT UNIQUE NOT NULL,"
+ "entry_id REFERENCES entries (id),"
+ "before_after TINYINT(1) DEFAULT TRUE,"
+ "date TEXT NOT NULL,"
+ "color VARCHAR(255) DEFAULT NULL,"
+ "highlight VARCHAR(255) DEFAULT NULL"
+ ")"
+ };
+};
+
+#endif