sqlite

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: May 29, 2026 License: MIT Imports: 6 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) 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) 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) 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.

Jump to

Keyboard shortcuts

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