aboutsummaryrefslogtreecommitdiff
path: root/miniDB/main.c
diff options
context:
space:
mode:
authorHyder Hadi <hyder@hyderhadi.xyz>2026-06-09 16:33:38 +0300
committerHyder Hadi <hyder@hyderhadi.xyz>2026-06-09 16:33:38 +0300
commitd6b915a043f868611d49e814730ffc2f7c82a048 (patch)
treee7d6e687de0b40b30a5cadfc1bd35aa1b0c70a1f /miniDB/main.c
parent5a6a3dd7c8f535721467248cf5f93f8e0ef1e633 (diff)
Made a simple miniDB during the governmental job XD
simple miniDB that has couple of commands, that uses my hashMap implementation to store (key,value) pairs.
Diffstat (limited to 'miniDB/main.c')
-rw-r--r--miniDB/main.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/miniDB/main.c b/miniDB/main.c
new file mode 100644
index 0000000..f6ce5d0
--- /dev/null
+++ b/miniDB/main.c
@@ -0,0 +1,28 @@
+#include "HashMap.h"
+#include "db_commands.h"
+#include <stdio.h>
+
+
+
+
+int main() {
+
+ struct hashTable *t1 = createTable();
+ FILE *fh = NULL;
+ printf("Enter a filename for the database, otherwise press ENTER: ");
+ char *fileName = read_line();
+ if(!fileName) {
+ fileName = "db.txt";
+ printf("Default name picked up: %s\n", fileName);
+ }
+
+
+ int exitState = -1;
+ while (db_commands(t1, fh, fileName) != exitState) {
+ printf("");
+ }
+
+ t1->destructor(t1);
+
+ return 0;
+}