Documentation
¶
Index ¶
- type FileMeta
- type Store
- func (s *Store) AcquireLocks(ctx context.Context, intentID string, lockKeys []string, ttl time.Duration) ([]core.LockRecord, error)
- func (s *Store) AllEdges(ctx context.Context) ([]core.Edge, error)
- func (s *Store) AllFileMeta(ctx context.Context) (map[string]FileMeta, error)
- func (s *Store) AllSymbols(ctx context.Context) ([]core.SymbolRecord, error)
- func (s *Store) Close() error
- func (s *Store) DeleteFilesNotIn(ctx context.Context, current map[string]bool) (int, error)
- func (s *Store) EdgeCount(ctx context.Context) (int, error)
- func (s *Store) EdgesBySource(ctx context.Context, source string) ([]core.Edge, error)
- func (s *Store) FileBlobSHA(ctx context.Context, filePath string) (string, bool, error)
- func (s *Store) FilesNotIn(ctx context.Context, current map[string]bool) ([]string, error)
- func (s *Store) Migrate(ctx context.Context) error
- func (s *Store) ReleaseLocks(ctx context.Context, intentID string) (int64, error)
- func (s *Store) ReplaceEdges(ctx context.Context, edges []core.Edge) error
- func (s *Store) SpliceEdges(ctx context.Context, deleteOwners []string, nativeFiles []string, ...) error
- func (s *Store) Status(ctx context.Context) (core.Status, error)
- func (s *Store) UpdateFileStats(ctx context.Context, stats map[string][2]int64) error
- func (s *Store) UpsertFile(ctx context.Context, filePath, blobSHA, language string, size, mtime int64, ...) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FileMeta ¶ added in v0.17.1
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 (*Store) AcquireLocks ¶
func (*Store) AllFileMeta ¶ added in v0.17.1
AllFileMeta returns the stat cache for every indexed file in one query.
func (*Store) AllSymbols ¶
func (*Store) DeleteFilesNotIn ¶
func (*Store) EdgeCount ¶ added in v0.24.0
EdgeCount returns COUNT(*) of the edges table — the cheap post-splice invariant check.
func (*Store) EdgesBySource ¶ added in v0.23.0
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 (*Store) FilesNotIn ¶ added in v0.6.2
FilesNotIn returns the indexed file paths absent from current — the files a delete pass would prune — without deleting anything.
func (*Store) ReleaseLocks ¶
func (*Store) ReplaceEdges ¶
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) UpdateFileStats ¶ added in v0.17.1
UpdateFileStats refreshes size+mtime for files whose content was verified unchanged (touched files: stat differs, blob identical).