summaryrefslogtreecommitdiff
path: root/src/lib/create_table
diff options
context:
space:
mode:
authorLouie S <louie@example.com>2023-09-14 16:21:14 -0400
committerLouie S <louie@example.com>2023-09-14 16:21:14 -0400
commitbd511f431b75f21e8290aa2527d6222467e56b20 (patch)
tree7b0c4ffae4f7e5eef51e5bf405a715341364b349 /src/lib/create_table
First commit
Diffstat (limited to 'src/lib/create_table')
-rw-r--r--src/lib/create_table7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/lib/create_table b/src/lib/create_table
new file mode 100644
index 0000000..a783c50
--- /dev/null
+++ b/src/lib/create_table
@@ -0,0 +1,7 @@
+create_table() {
+ DB_PATH="$1"
+
+ sqlite3 "$DB_PATH" "CREATE TABLE IF NOT EXISTS searchIndex(id INTEGER PRIMARY KEY, name TEXT, type TEXT, path TEXT);"
+ sqlite3 "$DB_PATH" "CREATE UNIQUE INDEX IF NOT EXISTS anchor ON searchIndex (name, type, path);"
+}
+