MCPcopy Index your code
hub / github.com/ent/ent / CreateNode

Function CreateNode

dialect/sql/sqlgraph/graph.go:750–754  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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.
750func 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.
757func BatchCreate(ctx context.Context, drv dialect.Driver, spec *BatchCreateSpec) error {

Callers 15

sqlSaveMethod · 0.92
sqlSaveMethod · 0.92
sqlSaveMethod · 0.92
sqlSaveMethod · 0.92
sqlSaveMethod · 0.92
sqlSaveMethod · 0.92
sqlSaveMethod · 0.92
sqlSaveMethod · 0.92
sqlSaveMethod · 0.92
sqlSaveMethod · 0.92
sqlSaveMethod · 0.92
sqlSaveMethod · 0.92

Calls 3

nodeMethod · 0.95
DialectFunction · 0.92
DialectMethod · 0.65

Tested by 1

TestCreateNodeFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…