index

package
v0.107.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 30, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package index manages the SQLite cache of note metadata. The index is derived from the Markdown files and can be fully rebuilt at any time.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Index

type Index struct {
	// contains filtered or unexported fields
}

Index wraps an open SQLite database.

func Open

func Open(dbPath string) (*Index, error)

Open opens (or creates) the index database at dbPath and ensures the schema exists.

func (*Index) Close

func (idx *Index) Close() error

Close releases the database connection.

func (idx *Index) CountLinks() (int, error)

CountLinks returns the number of rows in the links table.

func (*Index) CountNotes

func (idx *Index) CountNotes() (int, error)

CountNotes returns the number of rows in the notes table.

func (*Index) IsStale

func (idx *Index) IsStale(id, path string) (bool, error)

IsStale returns true if the file at path has changed since it was indexed. Stale detection uses content hash (sha256) of the file.

func (*Index) Rebuild

func (idx *Index) Rebuild(dir string) error

Rebuild clears the index and repopulates it by scanning all .md files in dir.

func (*Index) TableExists

func (idx *Index) TableExists(name string) error

TableExists returns nil if the named table exists, or an error otherwise.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL