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

Method Tx

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

Source from the content-addressed store, hash-verified

54}
55
56func (d *DB) Tx(ctx context.Context, id db.GraphID) (db.Tx, error) {
57 g, err := d.q.Graph(ctx, string(id))
58 if errors.Is(err, sql.ErrNoRows) {
59 return 0, db.NotExists("graph", id)
60 } else if err != nil {
61 return 0, fmt.Errorf("failed to load graph: %w", err)
62 }
63 return db.Tx(g.CurrentTx), nil
64}
65
66func (d *DB) Graph(ctx context.Context, id db.GraphID) (*db.Graph, error) {
67 g, err := d.q.Graph(ctx, string(id))

Callers

nothing calls this directly

Implementers 2

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

Calls 3

NotExistsFunction · 0.92
TxTypeAlias · 0.92
GraphMethod · 0.65

Tested by

no test coverage detected