aboutsummaryrefslogtreecommitdiffstats
path: root/pkg/data/db.go
diff options
context:
space:
mode:
authorJP Appel <jeanpierre.appel01@gmail.com>2025-08-02 14:04:45 -0400
committerJP Appel <jeanpierre.appel01@gmail.com>2025-08-02 14:04:45 -0400
commitf14c466d5d5d1f1a68153162349a74a154bcb535 (patch)
tree1b2c9723f4c1f73a92b6ce544c96bae35ebcc9fe /pkg/data/db.go
parent6a65be22a5e3434e8ca925ec40162c560e1dd612 (diff)
Add initial todos for new heading category
The heading category is planned to be backed by a single db text column. The column will be a concatenation of all ATX style heading matches, with a newline delimiter.
Diffstat (limited to 'pkg/data/db.go')
-rw-r--r--pkg/data/db.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/pkg/data/db.go b/pkg/data/db.go
index 6837da1..2d9e6c0 100644
--- a/pkg/data/db.go
+++ b/pkg/data/db.go
@@ -104,6 +104,7 @@ func createSchema(db *sql.DB, version string) error {
CREATE TABLE IF NOT EXISTS Documents(
id INTEGER PRIMARY KEY,
path TEXT UNIQUE NOT NULL,
+ headings TEXT,
title TEXT,
date INT,
fileTime INT,
@@ -257,6 +258,7 @@ func createSchema(db *sql.DB, version string) error {
SELECT
d.id AS docId,
d.path,
+ d.headings,
d.title,
d.date,
d.fileTime,
@@ -394,7 +396,7 @@ func (q Query) Execute(ctx context.Context, artifact query.CompilationArtifact)
}
compiledQuery := fmt.Sprintf(`
- SELECT DISTINCT docId, path, title, date, fileTime, meta
+ SELECT DISTINCT docId, path, headings, title, date, fileTime, meta
FROM Search
WHERE %s`, artifact.Query)