# ----- App Configuration ----- [app_config] StrictMode = true DBType = "sqlite3" DBPath = "dev.db" Lang = "en" ListStyle = "tree" DisplayTimeZone = "utc+8" Start_as_LLM_server = false # ----- DB Configuration ----- # Just a better reference for dev.db, no functional use(yet) # ↓ DB name("dev".db) # ↓ Table name [dev.compact_main] c1_pk = "id INTEGER PRIMARY KEY ASC" c2 = "type" c3 = "name" c4 = "dscrp" # .style = {position : [(x1,y1), (x2, y2), z], bgcolor, radius, border, } c5 = "creator" c6 = "createdTime" c7 = "relatedBoard" c8 = "relatedClass" c9 = "state" createSqls = ''' CREATE TABLE "compact_main" ( "id" INTEGER NOT NULL, "type" INTEGER NOT NULL, "name" TEXT NOT NULL, "dscrp" TEXT NOT NULL, "creator" TEXT NOT NULL, "createdTime" TEXT NOT NULL, "relatedBoard" TEXT NOT NULL, "relatedClass" TEXT NOT NULL, "state" INTEGER NOT NULL, PRIMARY KEY("id" AUTOINCREMENT) ); ''' [dev.log_action] c1_pk = "id INTEGER PRIMARY KEY ASC" c2 = "uid" # UNIQUE c3 = "commitTime" c4 = "type" c5 = "commitedAction" c6 = "operator" c7 = "status" createSqls = ''' CREATE TABLE "log_action" ( "id" INTEGER NOT NULL, "uid" TEXT NOT NULL, "commitTime" TEXT NOT NULL, "type" TEXT NOT NULL, "action" TEXT NOT NULL, "operator" TEXT NOT NULL, "status" TEXT NOT NULL, PRIMARY KEY("id" AUTOINCREMENT) ); ''' # ----- Some Notes ----- [notes] compact_main.type = ''' 0 = Board 1 = Class 2 = Event ''' compact_main.state = ''' -10 = deleted 10 = alive ''' log_action.status = ''' ''' # ----- used sqls ----- # Set integer prime key: INTEGER PRIMARY KEY ASC # INSERT INTO compact_main VALUES(null, 'class', 'CL1', 'dscrp', 'n.HE', datetime('now'), 'KB1, KB2', '', 'alive'); # SELECT name FROM compact_main WHERE belongBoard like '%KB1%' # SELECT name, dscrp FROM compact_main WHERE dscrp like '%KB1%' # SELECT name, dscrp FROM compact_main WHERE dscrp like '%_%KB1%' # INSERT INTO compact_main VALUES(null, 'class', 'CL2', '_usingBoard:KB1, KB2', 'n.HE', datetime('now'), '', '', 'alive'); # UPDATE main SET relatedBoard='KB1, KB2' WHERE type='class' AND name='CL2' # SELECT name FROM main WHERE type='class' AND relatedBoard like '%KB2%' # delete class 3 combo: # UPDATE compact_main SET relatedBoard = replace(relatedBoard, 'KB2, ', '') WHERE type='class' AND relatedBoard like '%KB2, %'; # UPDATE compact_main SET relatedBoard = replace(relatedBoard, ', KB2', '') WHERE type='class' AND relatedBoard like '%, KB2%'; # UPDATE compact_main SET relatedBoard = replace(relatedBoard, 'KB2', '') WHERE type='class' AND relatedBoard like '%KB2%';