(ctx context.Context, id db.GraphID, tx db.Tx)
| 42 | } |
| 43 | |
| 44 | func (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 | |
| 56 | func (d *DB) Tx(ctx context.Context, id db.GraphID) (db.Tx, error) { |
| 57 | g, err := d.q.Graph(ctx, string(id)) |