MCPcopy Create free account
hub / github.com/bcspragu/logseq-sync / Graph

Method Graph

db/sqlite/sqlite.go:66–74  ·  view source on GitHub ↗
(ctx context.Context, id db.GraphID)

Source from the content-addressed store, hash-verified

64}
65
66func (d *DB) Graph(ctx context.Context, id db.GraphID) (*db.Graph, error) {
67 g, err := d.q.Graph(ctx, string(id))
68 if errors.Is(err, sql.ErrNoRows) {
69 return nil, db.NotExists("graph", id)
70 } else if err != nil {
71 return nil, fmt.Errorf("failed to load graph: %w", err)
72 }
73 return toGraph(g), nil
74}
75
76func toGraph(g sqlitedb.Graph) *db.Graph {
77 return &db.Graph{

Callers

nothing calls this directly

Implementers 2

DBdb/mem/mem.go
DBdb/sqlite/sqlite.go

Calls 3

NotExistsFunction · 0.92
toGraphFunction · 0.85
GraphMethod · 0.65

Tested by

no test coverage detected