store

package
v0.24.0 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FileMeta added in v0.17.1

type FileMeta struct {
	BlobSHA string
	Size    int64
	Mtime   int64
}

FileMeta is the per-file identity the walk uses to decide whether a file needs re-hashing (stat match) or re-parsing (blob mismatch).

type Store

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

func Open

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

func (*Store) AcquireLocks

func (s *Store) AcquireLocks(ctx context.Context, intentID string, lockKeys []string, ttl time.Duration) ([]core.LockRecord, error)

func (*Store) AllEdges added in v0.5.0

func (s *Store) AllEdges(ctx context.Context) ([]core.Edge, error)

func (*Store) AllFileMeta added in v0.17.1

func (s *Store) AllFileMeta(ctx context.Context) (map[string]FileMeta, error)

AllFileMeta returns the stat cache for every indexed file in one query.

func (*Store) AllSymbols

func (s *Store) AllSymbols(ctx context.Context) ([]core.SymbolRecord, error)

func (*Store) Close

func (s *Store) Close() error

func (*Store) DeleteFilesNotIn

func (s *Store) DeleteFilesNotIn(ctx context.Context, current map[string]bool) (int, error)

func (*Store) EdgeCount added in v0.24.0

func (s *Store) EdgeCount(ctx context.Context) (int, error)

EdgeCount returns COUNT(*) of the edges table — the cheap post-splice invariant check.

func (*Store) EdgesBySource added in v0.23.0

func (s *Store) EdgesBySource(ctx context.Context, source string) ([]core.Edge, error)

EdgesBySource returns stored edges whose evidence source equals source, in the same (from_node, edge_type, to_node) order AllEdges uses, so callers that previously filtered AllEdges see an identical sequence. On monorepos this avoids materializing millions of rows the caller would discard (the delta carry path keeps only native edges — ~1/6 of the table).

func (*Store) FileBlobSHA

func (s *Store) FileBlobSHA(ctx context.Context, filePath string) (string, bool, error)

func (*Store) FilesNotIn added in v0.6.2

func (s *Store) FilesNotIn(ctx context.Context, current map[string]bool) ([]string, error)

FilesNotIn returns the indexed file paths absent from current — the files a delete pass would prune — without deleting anything.

func (*Store) Migrate

func (s *Store) Migrate(ctx context.Context) error

func (*Store) ReleaseLocks

func (s *Store) ReleaseLocks(ctx context.Context, intentID string) (int64, error)

func (*Store) ReplaceEdges

func (s *Store) ReplaceEdges(ctx context.Context, edges []core.Edge) error

ReplaceEdges makes the edges table equal to the given set. It diffs against what is stored and writes only the difference: a one-file change on a million-edge repo touches hundreds of rows, and the previous delete-everything-reinsert paid the full million-row write every index (21s on a 19k-file monorepo). Inserts are batched multi-row.

func (*Store) SpliceEdges added in v0.24.0

func (s *Store) SpliceEdges(ctx context.Context, deleteOwners []string, nativeFiles []string, inserts []core.Edge) error

SpliceEdges applies an incremental write-set instead of ReplaceEdges' full 6.3M-row diff: point-delete the out-rows of recomputed owners, range-delete the native-source rows of natively re-analyzed files, then upsert the insert rows with merge semantics (higher confidence wins, first-wins on ties — the same resolution mergeEdges applies in memory). The caller verifies the result with a COUNT(*) equality check and falls back to ReplaceEdges on any mismatch, so a write-set miss self-heals in-run.

func (*Store) Status

func (s *Store) Status(ctx context.Context) (core.Status, error)

func (*Store) UpdateFileStats added in v0.17.1

func (s *Store) UpdateFileStats(ctx context.Context, stats map[string][2]int64) error

UpdateFileStats refreshes size+mtime for files whose content was verified unchanged (touched files: stat differs, blob identical).

func (*Store) UpsertFile

func (s *Store) UpsertFile(ctx context.Context, filePath, blobSHA, language string, size, mtime int64, symbols []core.SymbolRecord) error

Jump to

Keyboard shortcuts

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