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

Method IncrementTx

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

Source from the content-addressed store, hash-verified

32}
33
34func (d *DB) IncrementTx(ctx context.Context, id db.GraphID) (db.Tx, error) {
35 res, err := d.q.IncrementTx(ctx, string(id))
36 if errors.Is(err, sql.ErrNoRows) {
37 return 0, db.NotExists("graph", id)
38 } else if err != nil {
39 return 0, fmt.Errorf("failed to increment tx: %w", err)
40 }
41 return db.Tx(res), nil
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{

Callers

nothing calls this directly

Implementers 2

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

Calls 3

NotExistsFunction · 0.92
TxTypeAlias · 0.92
IncrementTxMethod · 0.65

Tested by

no test coverage detected