From f14c466d5d5d1f1a68153162349a74a154bcb535 Mon Sep 17 00:00:00 2001 From: JP Appel Date: Sat, 2 Aug 2025 14:04:45 -0400 Subject: 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. --- pkg/data/db.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'pkg/data') 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) -- cgit v1.2.3