Documentation
¶
Index ¶
- type DB
- func (db *DB) AttachAllDirtyIndexes() int
- func (db *DB) AttachDirtyIndex(worktreePath string) error
- func (db *DB) AttachDirtyIndexByID(id, dirtyBlevePath string) error
- func (db *DB) AttachDirtyOverlay() error
- func (db *DB) BackfillSymbolEdges(ctx context.Context, progress func(string)) (index.BackfillStats, error)
- func (db *DB) BuildDirtyIndex(ctx context.Context, localPath string, opts index.IndexOptions) (int, error)
- func (db *DB) Close() error
- func (db *DB) DetachDirtyIndexByID(id string)
- func (db *DB) DetachDirtyOverlay()
- func (db *DB) DirtyOverlayCount() int
- func (db *DB) GCDirtyIndexes() (int, error)
- func (db *DB) IndexGitHubData(ctx context.Context, ledgerPath string, progress func(string)) (*index.GitHubIndexStats, error)
- func (db *DB) IndexLocalRepo(ctx context.Context, localPath string, opts index.IndexOptions) error
- func (db *DB) IndexRepo(ctx context.Context, url string, opts index.IndexOptions) error
- func (db *DB) ParseComments(ctx context.Context, progress func(string)) (index.CommentStats, error)
- func (db *DB) ParseSymbols(ctx context.Context, progress func(string)) (index.ParseStats, error)
- func (db *DB) RawSQL(query string) ([]string, [][]string, error)
- func (db *DB) Search(ctx context.Context, input string) ([]search.Result, error)
- func (db *DB) SearchRestrictedFiles(ctx context.Context, input string, patterns []string) ([]search.Result, error)
- func (db *DB) Store() *store.Store
- func (db *DB) TranslateQuery(input string) (*search.TranslatedQuery, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DB ¶
type DB struct {
// contains filtered or unexported fields
}
DB is the top-level CodeDB facade.
func OpenSQLOnly ¶ added in v0.9.0
OpenSQLOnly opens a CodeDB without touching its bleve sub-indexes. Use for read paths that only query SQL data (insights, status counters) so they keep working when bleve is mid-rebuild, locked by an active writer, or being self-healed after corruption.
IMPORTANT: callers MUST NOT use Search, IndexRepo, IndexLocalRepo, BuildDirtyIndex, or any dirty-overlay API on a SQL-only DB — those depend on bleve and will dereference nil. SQL convenience methods (Query, QueryRow, Exec, RawSQL) are safe.
func (*DB) AttachAllDirtyIndexes ¶ added in v0.6.1
AttachAllDirtyIndexes scans the dirty index directory for manifest files and attaches all valid dirty overlays by worktree ID. This gives CLI searches access to all active worktree overlays simultaneously.
func (*DB) AttachDirtyIndex ¶ added in v0.5.0
AttachDirtyIndex opens the daemon-built on-disk dirty overlay and aliases it with the shared CodeIndex for transparent search. Uses a default key; for multi-worktree support use AttachDirtyIndexByID.
func (*DB) AttachDirtyIndexByID ¶ added in v0.6.1
AttachDirtyIndexByID opens an on-disk dirty overlay by worktree ID and path. Multiple overlays can be attached simultaneously; all are merged at query time.
func (*DB) AttachDirtyOverlay ¶ added in v0.5.0
AttachDirtyOverlay creates an in-memory Bleve overlay for dirty worktree files. Primarily used in tests; production uses AttachDirtyIndex for on-disk overlays.
func (*DB) BackfillSymbolEdges ¶ added in v0.10.1
func (db *DB) BackfillSymbolEdges(ctx context.Context, progress func(string)) (index.BackfillStats, error)
BackfillSymbolEdges populates ADR-019 symbol_edges for blobs that were parsed before the resolver landed (or before a resolver version bump). Idempotent and cheap (pure SQL, no tree-sitter); daemons call it after every index pass so codedbs upgrade without operator action.
func (*DB) BuildDirtyIndex ¶ added in v0.5.0
func (db *DB) BuildDirtyIndex(ctx context.Context, localPath string, opts index.IndexOptions) (int, error)
BuildDirtyIndex builds an on-disk Bleve index of dirty (uncommitted) files. Called by the daemon after committed content indexing.
func (*DB) DetachDirtyIndexByID ¶ added in v0.6.1
DetachDirtyIndexByID removes a specific dirty overlay by ID.
func (*DB) DetachDirtyOverlay ¶ added in v0.5.0
func (db *DB) DetachDirtyOverlay()
DetachDirtyOverlay closes all attached dirty overlays.
func (*DB) DirtyOverlayCount ¶ added in v0.6.1
DirtyOverlayCount returns the number of currently attached dirty overlays.
func (*DB) GCDirtyIndexes ¶ added in v0.6.0
GCDirtyIndexes removes stale dirty overlay directories for worktrees that no longer exist on disk. Returns the number of overlays removed.
func (*DB) IndexGitHubData ¶ added in v0.5.0
func (db *DB) IndexGitHubData(ctx context.Context, ledgerPath string, progress func(string)) (*index.GitHubIndexStats, error)
IndexGitHubData reads PR/issue JSON files from the ledger and indexes them into CodeDB.
func (*DB) IndexLocalRepo ¶
IndexLocalRepo indexes a local git repository's committed content.
func (*DB) ParseComments ¶ added in v0.5.0
ParseComments extracts comments from all unparsed blobs with supported languages.
func (*DB) ParseSymbols ¶
ParseSymbols extracts symbols from all unparsed blobs with supported languages.
func (*DB) SearchRestrictedFiles ¶ added in v0.12.0
func (db *DB) SearchRestrictedFiles(ctx context.Context, input string, patterns []string) ([]search.Result, error)
SearchRestrictedFiles parses and executes a query with an additional internal file-path OR filter. The extra filter is applied inside the search plan, before result limits are enforced.
func (*DB) TranslateQuery ¶
func (db *DB) TranslateQuery(input string) (*search.TranslatedQuery, error)
TranslateQuery parses a query and returns the generated SQL without executing.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package comments extracts comments from source code using a character-level scanner configured by language-specific syntax families.
|
Package comments extracts comments from source code using a character-level scanner configured by language-specific syntax families. |
|
Package diffformat produces the simple "before vs after" diff text CodeDB indexes for diff search and re-derives at search-read time for snippets (ADR-018 phase 2 Option A).
|
Package diffformat produces the simple "before vs after" diff text CodeDB indexes for diff search and re-derives at search-read time for snippets (ADR-018 phase 2 Option A). |
|
Package symbols extracts symbol definitions and references from source code using tree-sitter via gotreesitter (pure Go, no CGO required).
|
Package symbols extracts symbol definitions and references from source code using tree-sitter via gotreesitter (pure Go, no CGO required). |