CreateNode applies the CreateSpec on the graph. The operation creates a new record in the database, and connects it to other nodes specified in spec.Edges.
(ctx context.Context, drv dialect.Driver, spec *CreateSpec)
| 748 | // CreateNode applies the CreateSpec on the graph. The operation creates a new |
| 749 | // record in the database, and connects it to other nodes specified in spec.Edges. |
| 750 | func CreateNode(ctx context.Context, drv dialect.Driver, spec *CreateSpec) error { |
| 751 | gr := graph{tx: drv, builder: sql.Dialect(drv.Dialect())} |
| 752 | cr := &creator{CreateSpec: spec, graph: gr} |
| 753 | return cr.node(ctx, drv) |
| 754 | } |
| 755 | |
| 756 | // BatchCreate applies the BatchCreateSpec on the graph. |
| 757 | func BatchCreate(ctx context.Context, drv dialect.Driver, spec *BatchCreateSpec) error { |
searching dependent graphs…