(ctx context.Context, name string)
| 96 | return convSlice(gs, toGraph), nil |
| 97 | } |
| 98 | func (d *DB) CreateGraph(ctx context.Context, name string) (db.GraphID, db.Tx, error) { |
| 99 | id := uuid.NewString() |
| 100 | tx, err := d.q.CreateGraph(ctx, sqlitedb.CreateGraphParams{ |
| 101 | ID: id, |
| 102 | Name: name, |
| 103 | }) |
| 104 | if err != nil { |
| 105 | return "", 0, fmt.Errorf("failed to create graph: %w", err) |
| 106 | } |
| 107 | return db.GraphID(id), db.Tx(tx), nil |
| 108 | } |
| 109 | |
| 110 | func (d *DB) DeleteGraph(ctx context.Context, id db.GraphID) error { |
| 111 | if err := d.q.DeleteGraph(ctx, string(id)); errors.Is(err, sql.ErrNoRows) { |
nothing calls this directly
no test coverage detected