store

package
v0.1.9 Latest Latest
Warning

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

Go to latest
Published: May 25, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const SchemaSQL = `` /* 2105-byte string literal not displayed */

Variables

This section is empty.

Functions

func ReadSectionContent

func ReadSectionContent(filePath string, startLine, endLine int, projectRoot string, maxBytes int) (string, error)

ReadSectionContent reads the content of a section from its source file. filePath is relative to projectRoot. startLine and endLine are 1-based. If the result exceeds maxBytes, it is truncated with a marker.

Types

type Edge

type Edge struct {
	Source   string
	Target   string
	Kind     string
	Metadata string
	Line     int
}

type FileInfo

type FileInfo struct {
	Path           string
	ContentHash    string
	Size           int64
	ModifiedAt     int64
	IndexedAt      int64
	NodeCount      int
	HasFrontmatter bool
	Errors         string
}

type Node

type Node struct {
	ID            string
	Kind          string
	Name          string
	QualifiedName string
	FilePath      string
	StartLine     int
	EndLine       int
	Level         int
	Metadata      string
	BodyExcerpt   string
	UpdatedAt     int64
}

type SearchResult

type SearchResult struct {
	Node Node
	Rank float64
}

type Stats

type Stats struct {
	FileCount       int
	NodeCount       int
	EdgeCount       int
	UnresolvedCount int
	DBSizeBytes     int64
	NodesByKind     map[string]int
	EdgesByKind     map[string]int
}

type Store

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

func Open

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

func (*Store) Close

func (s *Store) Close() error

func (*Store) DeleteAllUnresolvedRefs

func (s *Store) DeleteAllUnresolvedRefs() error

func (*Store) DeleteEdgesByKind

func (s *Store) DeleteEdgesByKind(kind string) error

func (*Store) DeleteFileData

func (s *Store) DeleteFileData(filePath string) error

func (*Store) FindNodeByName

func (s *Store) FindNodeByName(name string) (*Node, error)

func (*Store) FindNodeByPath

func (s *Store) FindNodeByPath(path string) (*Node, error)

func (*Store) GetAllDocumentIDs

func (s *Store) GetAllDocumentIDs() ([]string, error)

func (*Store) GetAllDocumentNodes

func (s *Store) GetAllDocumentNodes() ([]Node, error)

func (*Store) GetChildHeadings

func (s *Store) GetChildHeadings(docFilePath string) ([]Node, error)

func (*Store) GetEdgesBySource

func (s *Store) GetEdgesBySource(sourceID string) ([]Edge, error)

func (*Store) GetEdgesByTarget

func (s *Store) GetEdgesByTarget(targetID string) ([]Edge, error)

func (*Store) GetFileHash

func (s *Store) GetFileHash(path string) (string, error)

func (*Store) GetFiles

func (s *Store) GetFiles(pathFilter string) ([]FileInfo, error)

func (*Store) GetIncomingEdges

func (s *Store) GetIncomingEdges(nodeID string) ([]Edge, error)

func (*Store) GetNodeByID

func (s *Store) GetNodeByID(id string) (*Node, error)

func (*Store) GetNodesByFile

func (s *Store) GetNodesByFile(filePath string) ([]Node, error)

func (*Store) GetOutgoingEdges

func (s *Store) GetOutgoingEdges(nodeID string) ([]Edge, error)

func (*Store) GetStats

func (s *Store) GetStats() (Stats, error)

func (*Store) GetUnresolvedRefs

func (s *Store) GetUnresolvedRefs() ([]UnresolvedRef, error)

func (*Store) InsertEdges

func (s *Store) InsertEdges(edges []Edge) error

func (*Store) InsertNodes

func (s *Store) InsertNodes(nodes []Node) error

func (*Store) InsertUnresolvedRefs

func (s *Store) InsertUnresolvedRefs(refs []UnresolvedRef) error

func (*Store) Search

func (s *Store) Search(query string, kind string, limit int) ([]SearchResult, error)

func (*Store) UpsertFile

func (s *Store) UpsertFile(f FileInfo) error

type UnresolvedRef

type UnresolvedRef struct {
	FromNodeID    string
	ReferenceText string
	ReferenceKind string
	Line          int
	Col           int
	FilePath      string
}

Jump to

Keyboard shortcuts

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