sqlite

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package sqlite provides a SQLite implementation of the Store interface.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Store

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

Store implements the contracts.Store interface using SQLite.

func NewStore

func NewStore(dsn string) (*Store, error)

NewStore creates a new SQLite store with the given DSN.

func (*Store) Close

func (s *Store) Close() error

Close closes the database connection.

func (*Store) DeleteByFile

func (s *Store) DeleteByFile(ctx context.Context, file string) error

DeleteByFile deletes all nodes associated with a file.

func (*Store) DeleteEdgesFrom

func (s *Store) DeleteEdgesFrom(ctx context.Context, id string) error

DeleteEdgesFrom deletes all outbound edges from a node.

func (*Store) DeleteNode

func (s *Store) DeleteNode(ctx context.Context, id string) error

DeleteNode deletes a node by its ID.

func (*Store) GetEdgesByType added in v0.2.2

func (s *Store) GetEdgesByType(ctx context.Context, edgeType graph.EdgeType) ([]*graph.Edge, error)

GetEdgesByType returns all edges of a specific edge type.

func (*Store) GetImpactRecursive added in v0.1.8

func (s *Store) GetImpactRecursive(ctx context.Context, id string) ([]*graph.Node, []*graph.Edge, error)

GetImpactRecursive retrieves all recursive inbound edges and their source nodes for a given node ID.

func (*Store) GetInboundEdges

func (s *Store) GetInboundEdges(ctx context.Context, id string) ([]*graph.Node, []*graph.Edge, error)

GetInboundEdges retrieves all inbound edges and their source nodes for a given node ID.

func (*Store) GetNeighbors

func (s *Store) GetNeighbors(ctx context.Context, id string) ([]*graph.Node, []*graph.Edge, error)

GetNeighbors retrieves all outbound edges and target nodes for a given node ID.

func (*Store) GetNode

func (s *Store) GetNode(ctx context.Context, id string) (*graph.Node, error)

GetNode retrieves a node by its ID.

func (*Store) GetStats added in v0.1.8

func (s *Store) GetStats(ctx context.Context) (*contracts.Stats, error)

GetStats returns repository statistics.

func (*Store) ListEdges

func (s *Store) ListEdges(ctx context.Context) ([]*graph.Edge, error)

ListEdges returns all edges in the store.

func (*Store) ListNodes

func (s *Store) ListNodes(ctx context.Context) ([]*graph.Node, error)

ListNodes returns all nodes in the store.

func (*Store) ListNodesByType added in v0.2.2

func (s *Store) ListNodesByType(ctx context.Context, nodeType graph.NodeType) ([]*graph.Node, error)

ListNodesByType returns all nodes of a specific node type.

func (*Store) SaveEdge

func (s *Store) SaveEdge(ctx context.Context, edge *graph.Edge) error

SaveEdge saves an edge to the store.

func (*Store) SaveGraph

func (s *Store) SaveGraph(ctx context.Context, nodes []*graph.Node, edges []*graph.Edge) error

SaveGraph saves a set of nodes and edges in a single transaction.

func (*Store) SaveNode

func (s *Store) SaveNode(ctx context.Context, node *graph.Node) error

SaveNode saves a node to the store.

func (*Store) SearchNodes added in v0.2.2

func (s *Store) SearchNodes(ctx context.Context, pattern string) ([]*graph.Node, error)

SearchNodes returns nodes whose ID matches the LIKE pattern.

Jump to

Keyboard shortcuts

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