mirror of
https://github.com/ent/ent.git
synced 2026-04-28 13:40:56 +03:00
dialect/sql/sqlgraph: add deletion spec builder (#3291)
This commit is contained in:
@@ -518,6 +518,11 @@ type DeleteSpec struct {
|
||||
Predicate func(*sql.Selector)
|
||||
}
|
||||
|
||||
// NewDeleteSpec creates a new node deletion spec.
|
||||
func NewDeleteSpec(table string, id *FieldSpec) *DeleteSpec {
|
||||
return &DeleteSpec{Node: &NodeSpec{Table: table, ID: id}}
|
||||
}
|
||||
|
||||
// DeleteNodes applies the DeleteSpec on the graph.
|
||||
func DeleteNodes(ctx context.Context, drv dialect.Driver, spec *DeleteSpec) (int, error) {
|
||||
var (
|
||||
|
||||
Reference in New Issue
Block a user