From faaf478c8ee4708cda80617d098ea2613a6ce7b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Mon, 16 Oct 2023 15:32:34 +0200 Subject: Experiment with different approach to storing components in sqlite. --- module/vcomponent/data-stores/sqlite-alt.scm | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 module/vcomponent/data-stores/sqlite-alt.scm diff --git a/module/vcomponent/data-stores/sqlite-alt.scm b/module/vcomponent/data-stores/sqlite-alt.scm new file mode 100644 index 00000000..bf4d5706 --- /dev/null +++ b/module/vcomponent/data-stores/sqlite-alt.scm @@ -0,0 +1,26 @@ +(define (initialize-database db) + ;; TODO on delete/update cascade + + (sqlite-exec db " +CREATE TABLE IF NOT EXISTS components +( id TEXT PRIMARY KEY NOT NULL +, type TEXT NOT NULL +, parent INTEGER REFERENCES components(id) +)") + + (sqlite-exec db " +CREATE TABLE IF NOT EXISTS component_properties +( id INTEGER PRIMARY KEY NOT NULL +, component TEXT NOT NULL REFERENCES components(id) +, key TEXT NOT NULL +, value TEXT NOT NULL +) +") + + ;; TODO index on component_properties.component + ;; TODO index on component_properties.key + + + ;; TODO manually build indexes for components start and end times? + + ) -- cgit v1.2.3