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

Method SetTx

db/sqlite/sqlite.go:44–54  ·  view source on GitHub ↗
(ctx context.Context, id db.GraphID, tx db.Tx)

Source from the content-addressed store, hash-verified

42}
43
44func (d *DB) SetTx(ctx context.Context, id db.GraphID, tx db.Tx) error {
45 if err := d.q.SetTx(ctx, sqlitedb.SetTxParams{
46 CurrentTx: int64(tx),
47 ID: string(id),
48 }); errors.Is(err, sql.ErrNoRows) {
49 return db.NotExists("graph", id)
50 } else if err != nil {
51 return fmt.Errorf("failed to set tx: %w", err)
52 }
53 return nil
54}
55
56func (d *DB) Tx(ctx context.Context, id db.GraphID) (db.Tx, error) {
57 g, err := d.q.Graph(ctx, string(id))

Callers

nothing calls this directly

Implementers 2

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

Calls 2

NotExistsFunction · 0.92
SetTxMethod · 0.65

Tested by

no test coverage detected