Documentation
¶
Index ¶
- func SchemaStatements() []string
- type SQLiteStore
- func (s *SQLiteStore) Close() error
- func (s *SQLiteStore) CreateSchema() error
- func (s *SQLiteStore) DeleteDanglingEdgesByType(edgeType string) error
- func (s *SQLiteStore) DeleteEdgesByType(edgeType string) error
- func (s *SQLiteStore) DeleteEdgesForFile(path string) error
- func (s *SQLiteStore) DeleteElementsByFile(path string) error
- func (s *SQLiteStore) GetAllElements() ([]model.Element, error)
- func (s *SQLiteStore) GetCallees(fqName string) ([]model.Element, error)
- func (s *SQLiteStore) GetCallers(fqName string) ([]model.Element, error)
- func (s *SQLiteStore) GetContained(name string) ([]model.Element, error)
- func (s *SQLiteStore) GetDefinedIn(moduleID string) ([]model.Element, error)
- func (s *SQLiteStore) GetElement(fqName string) (*model.Element, error)
- func (s *SQLiteStore) GetElementByExactName(name string) ([]model.Element, error)
- func (s *SQLiteStore) GetElementsByName(name string) ([]model.Element, error)
- func (s *SQLiteStore) GetImportTargets(fromID string) ([]model.Element, error)
- func (s *SQLiteStore) GetModulesByPrefix(prefix string) ([]model.Element, error)
- func (s *SQLiteStore) Open(path string) error
- func (s *SQLiteStore) Reset() error
- func (s *SQLiteStore) RunSQL(query string) ([]map[string]any, error)
- func (s *SQLiteStore) Search(substring string) ([]model.Element, error)
- func (s *SQLiteStore) UpsertEdge(e model.Edge) error
- func (s *SQLiteStore) UpsertElement(el model.Element) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SchemaStatements ¶
func SchemaStatements() []string
SchemaStatements returns SQL DDL statements for the elements and edges tables.
Types ¶
type SQLiteStore ¶
type SQLiteStore struct {
// contains filtered or unexported fields
}
SQLiteStore provides SQLite-backed storage for elements and edges.
func NewSQLiteStore ¶
func NewSQLiteStore() *SQLiteStore
NewSQLiteStore creates a new uninitialized SQLiteStore.
func (*SQLiteStore) Close ¶
func (s *SQLiteStore) Close() error
Close closes the database connection.
func (*SQLiteStore) CreateSchema ¶
func (s *SQLiteStore) CreateSchema() error
CreateSchema creates the elements and edges tables if they don't exist.
func (*SQLiteStore) DeleteDanglingEdgesByType ¶
func (s *SQLiteStore) DeleteDanglingEdgesByType(edgeType string) error
DeleteDanglingEdgesByType removes edges whose endpoints no longer exist.
func (*SQLiteStore) DeleteEdgesByType ¶
func (s *SQLiteStore) DeleteEdgesByType(edgeType string) error
DeleteEdgesByType removes all edges of a given type.
func (*SQLiteStore) DeleteEdgesForFile ¶
func (s *SQLiteStore) DeleteEdgesForFile(path string) error
DeleteEdgesForFile removes all edges referencing elements in a file.
func (*SQLiteStore) DeleteElementsByFile ¶
func (s *SQLiteStore) DeleteElementsByFile(path string) error
DeleteElementsByFile removes all elements belonging to the given file path.
func (*SQLiteStore) GetAllElements ¶
func (s *SQLiteStore) GetAllElements() ([]model.Element, error)
GetAllElements returns all elements in the database.
func (*SQLiteStore) GetCallees ¶
func (s *SQLiteStore) GetCallees(fqName string) ([]model.Element, error)
GetCallees returns elements called by the given element.
func (*SQLiteStore) GetCallers ¶
func (s *SQLiteStore) GetCallers(fqName string) ([]model.Element, error)
GetCallers returns elements that call the given element.
func (*SQLiteStore) GetContained ¶
func (s *SQLiteStore) GetContained(name string) ([]model.Element, error)
GetContained returns elements contained by the named parent element.
func (*SQLiteStore) GetDefinedIn ¶
func (s *SQLiteStore) GetDefinedIn(moduleID string) ([]model.Element, error)
GetDefinedIn returns elements defined in the given module element ID.
func (*SQLiteStore) GetElement ¶
func (s *SQLiteStore) GetElement(fqName string) (*model.Element, error)
GetElement retrieves an element by its fully qualified name.
func (*SQLiteStore) GetElementByExactName ¶
func (s *SQLiteStore) GetElementByExactName(name string) ([]model.Element, error)
GetElementByExactName retrieves elements matching an exact short name.
func (*SQLiteStore) GetElementsByName ¶
func (s *SQLiteStore) GetElementsByName(name string) ([]model.Element, error)
GetElementsByName retrieves elements whose name contains a substring.
func (*SQLiteStore) GetImportTargets ¶
func (s *SQLiteStore) GetImportTargets(fromID string) ([]model.Element, error)
GetImportTargets returns elements imported by a source element.
func (*SQLiteStore) GetModulesByPrefix ¶
func (s *SQLiteStore) GetModulesByPrefix(prefix string) ([]model.Element, error)
GetModulesByPrefix retrieves module elements whose fq_name starts with prefix.
func (*SQLiteStore) Open ¶
func (s *SQLiteStore) Open(path string) error
Open opens a SQLite database at the given path.
func (*SQLiteStore) Reset ¶
func (s *SQLiteStore) Reset() error
Reset clears all graph data so a full index can rebuild an authoritative snapshot.
func (*SQLiteStore) RunSQL ¶
func (s *SQLiteStore) RunSQL(query string) ([]map[string]any, error)
RunSQL executes a raw SQL query and returns rows as maps.
func (*SQLiteStore) Search ¶
func (s *SQLiteStore) Search(substring string) ([]model.Element, error)
Search searches for elements by name or FQName substring.
func (*SQLiteStore) UpsertEdge ¶
func (s *SQLiteStore) UpsertEdge(e model.Edge) error
UpsertEdge inserts an edge or ignores it if it already exists.
func (*SQLiteStore) UpsertElement ¶
func (s *SQLiteStore) UpsertElement(el model.Element) error
UpsertElement inserts or updates an element in the database.