store

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CanonicalRepoPath

func CanonicalRepoPath(path string) (string, error)

func DBFileNameForRepo

func DBFileNameForRepo(repoRoot string) string

Types

type FileRecord

type FileRecord struct {
	ID          int64
	Path        string
	Language    string
	SizeBytes   int64
	MtimeUnixNS int64
	ContentHash string
	IsDeleted   bool
}

type RelatedTest

type RelatedTest struct {
	File   string  `json:"file"`
	Symbol string  `json:"symbol"`
	Reason string  `json:"reason"`
	Score  float64 `json:"score"`
}

type ScanSummary

type ScanSummary struct {
	RepoID       int64 `json:"repo_id"`
	ScanID       int64 `json:"scan_id"`
	FilesSeen    int   `json:"files_seen"`
	FilesIndexed int   `json:"files_indexed"`
	FilesSkipped int   `json:"files_skipped"`
	FilesChanged int   `json:"files_changed"`
	FilesDeleted int   `json:"files_deleted"`
	DurationMS   int64 `json:"duration_ms"`
}

type Store

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

func Open

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

func (*Store) BeginScan

func (s *Store) BeginScan(ctx context.Context, repoID int64, kind string) (int64, time.Time, error)

func (*Store) Close

func (s *Store) Close() error

func (*Store) CompleteScan

func (s *Store) CompleteScan(ctx context.Context, scanID int64, summary ScanSummary, started time.Time, status string, errText string) error

func (*Store) DrainDirtyFiles

func (s *Store) DrainDirtyFiles(ctx context.Context, repoID int64) ([]string, error)

func (*Store) ExistingFiles

func (s *Store) ExistingFiles(ctx context.Context, repoID int64) (map[string]FileRecord, error)

func (*Store) FindCallees

func (s *Store) FindCallees(ctx context.Context, repoID int64, symbol string, symbolID int64, limit int) ([]graph.Symbol, error)

func (*Store) FindCallers

func (s *Store) FindCallers(ctx context.Context, repoID int64, symbol string, symbolID int64, limit int) ([]graph.Symbol, error)

func (*Store) FindSymbol

func (s *Store) FindSymbol(ctx context.Context, repoID int64, query string, limit int) ([]graph.Symbol, error)

func (*Store) ImpactRadius

func (s *Store) ImpactRadius(ctx context.Context, repoID int64, symbols []string, files []string, depth int) (map[string]any, error)

func (*Store) MarkMissingDeleted

func (s *Store) MarkMissingDeleted(ctx context.Context, repoID, scanID int64, seen map[string]struct{}) (int, error)

func (*Store) Migrate

func (s *Store) Migrate() error

func (*Store) QueueDirtyFile

func (s *Store) QueueDirtyFile(ctx context.Context, repoID int64, path, reason string) error

func (*Store) RelatedTests

func (s *Store) RelatedTests(ctx context.Context, repoID int64, symbol, file string, limit int) ([]RelatedTest, error)

func (*Store) ReplaceFileGraph

func (s *Store) ReplaceFileGraph(ctx context.Context, repoID, scanID int64, path, language string, sizeBytes, mtimeUnixNS int64, contentHash string, parsed graph.ParsedFile) error

func (*Store) ResolveEdges

func (s *Store) ResolveEdges(ctx context.Context, repoID int64) error

func (*Store) SearchSymbols

func (s *Store) SearchSymbols(ctx context.Context, repoID int64, query string, limit int) ([]graph.Symbol, error)

func (*Store) SemanticSearch

func (s *Store) SemanticSearch(ctx context.Context, repoID int64, query string, limit int) ([]map[string]any, error)

func (*Store) Stats

func (s *Store) Stats(ctx context.Context, repoID int64) (graph.Stats, error)

func (*Store) TouchFileMetadata

func (s *Store) TouchFileMetadata(ctx context.Context, repoID, scanID int64, path, language string, sizeBytes, mtimeUnixNS int64, contentHash string) error

func (*Store) UpsertRepo

func (s *Store) UpsertRepo(ctx context.Context, rootPath string) (graph.Repo, error)

Jump to

Keyboard shortcuts

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