(ctx context.Context, id db.GraphID)
| 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)) |
| 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 | |
| 66 | func (d *DB) Graph(ctx context.Context, id db.GraphID) (*db.Graph, error) { |
| 67 | g, err := d.q.Graph(ctx, string(id)) |