cli + tui to publish to leaflet (wip) & manage tasks, notes & watch/read lists 馃崈
charm leaflet readability golang
at main 55 lines 3.1 kB view raw
1package repo 2 3const ( 4 noteColumns = "id, title, content, tags, archived, created, modified, file_path, leaflet_rkey, leaflet_cid, published_at, is_draft" 5 queryNoteByID = "SELECT " + noteColumns + " FROM notes WHERE id = ?" 6 queryNoteInsert = `INSERT INTO notes (title, content, tags, archived, created, modified, file_path, leaflet_rkey, leaflet_cid, published_at, is_draft) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)` 7 queryNoteUpdate = `UPDATE notes SET title = ?, content = ?, tags = ?, archived = ?, modified = ?, file_path = ?, leaflet_rkey = ?, leaflet_cid = ?, published_at = ?, is_draft = ? WHERE id = ?` 8 queryNoteDelete = "DELETE FROM notes WHERE id = ?" 9 queryNotesList = "SELECT " + noteColumns + " FROM notes" 10) 11const ( 12 articleColumns = "id, url, title, author, date, markdown_path, html_path, created, modified" 13 queryArticleByID = "SELECT " + articleColumns + " FROM articles WHERE id = ?" 14 queryArticleByURL = "SELECT " + articleColumns + " FROM articles WHERE url = ?" 15 queryArticleInsert = `INSERT INTO articles (url, title, author, date, markdown_path, html_path, created, modified) VALUES (?, ?, ?, ?, ?, ?, ?, ?)` 16 queryArticleUpdate = `UPDATE articles SET title = ?, author = ?, date = ?, markdown_path = ?, html_path = ?, modified = ? WHERE id = ?` 17 queryArticleDelete = "DELETE FROM articles WHERE id = ?" 18 queryArticlesList = "SELECT " + articleColumns + " FROM articles" 19 queryArticlesCount = "SELECT COUNT(*) FROM articles" 20) 21 22const ( 23 taskColumns = "id, uuid, description, status, priority, project, context, tags, due, wait, scheduled, entry, modified, end, start, annotations, recur, until, parent_uuid" 24 queryTaskByID = "SELECT " + taskColumns + " FROM tasks WHERE id = ?" 25 queryTaskByUUID = "SELECT " + taskColumns + " FROM tasks WHERE uuid = ?" 26 queryTaskInsert = ` 27 INSERT INTO tasks ( 28 uuid, description, status, priority, project, context, 29 tags, due, wait, scheduled, entry, modified, end, start, annotations, 30 recur, until, parent_uuid 31 ) 32 VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)` 33 queryTaskUpdate = ` 34 UPDATE tasks SET 35 uuid = ?, description = ?, status = ?, priority = ?, project = ?, context = ?, 36 tags = ?, due = ?, wait = ?, scheduled = ?, modified = ?, end = ?, start = ?, annotations = ?, 37 recur = ?, until = ?, parent_uuid = ? 38 WHERE id = ?` 39 queryTaskDelete = "DELETE FROM tasks WHERE id = ?" 40 queryTasksList = "SELECT " + taskColumns + " FROM tasks" 41) 42 43const ( 44 documentColumns = "id, title, body, created_at, doc_kind" 45 queryDocumentByID = "SELECT " + documentColumns + " FROM documents WHERE id = ?" 46 queryDocumentInsert = `INSERT INTO documents (title, body, created_at, doc_kind) VALUES (?, ?, ?, ?)` 47 queryDocumentDelete = "DELETE FROM documents WHERE id = ?" 48 queryDocumentsList = "SELECT " + documentColumns + " FROM documents ORDER BY created_at DESC" 49 queryDocumentsByKind = "SELECT " + documentColumns + " FROM documents WHERE doc_kind = ? ORDER BY created_at DESC" 50 queryDocumentsDeleteAll = "DELETE FROM documents" 51) 52 53type scanner interface { 54 Scan(dest ...any) error 55}