1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270 |
- // Code generated by ent, DO NOT EDIT.
- package ent
- import (
- "context"
- "errors"
- "fmt"
- "time"
- "wechat-api/ent/custom_types"
- "wechat-api/ent/messagerecords"
- "wechat-api/ent/sopnode"
- "wechat-api/ent/sopstage"
- "entgo.io/ent/dialect/sql"
- "entgo.io/ent/dialect/sql/sqlgraph"
- "entgo.io/ent/schema/field"
- )
- // SopNodeCreate is the builder for creating a SopNode entity.
- type SopNodeCreate struct {
- config
- mutation *SopNodeMutation
- hooks []Hook
- conflict []sql.ConflictOption
- }
- // SetCreatedAt sets the "created_at" field.
- func (snc *SopNodeCreate) SetCreatedAt(t time.Time) *SopNodeCreate {
- snc.mutation.SetCreatedAt(t)
- return snc
- }
- // SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
- func (snc *SopNodeCreate) SetNillableCreatedAt(t *time.Time) *SopNodeCreate {
- if t != nil {
- snc.SetCreatedAt(*t)
- }
- return snc
- }
- // SetUpdatedAt sets the "updated_at" field.
- func (snc *SopNodeCreate) SetUpdatedAt(t time.Time) *SopNodeCreate {
- snc.mutation.SetUpdatedAt(t)
- return snc
- }
- // SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.
- func (snc *SopNodeCreate) SetNillableUpdatedAt(t *time.Time) *SopNodeCreate {
- if t != nil {
- snc.SetUpdatedAt(*t)
- }
- return snc
- }
- // SetStatus sets the "status" field.
- func (snc *SopNodeCreate) SetStatus(u uint8) *SopNodeCreate {
- snc.mutation.SetStatus(u)
- return snc
- }
- // SetNillableStatus sets the "status" field if the given value is not nil.
- func (snc *SopNodeCreate) SetNillableStatus(u *uint8) *SopNodeCreate {
- if u != nil {
- snc.SetStatus(*u)
- }
- return snc
- }
- // SetDeletedAt sets the "deleted_at" field.
- func (snc *SopNodeCreate) SetDeletedAt(t time.Time) *SopNodeCreate {
- snc.mutation.SetDeletedAt(t)
- return snc
- }
- // SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.
- func (snc *SopNodeCreate) SetNillableDeletedAt(t *time.Time) *SopNodeCreate {
- if t != nil {
- snc.SetDeletedAt(*t)
- }
- return snc
- }
- // SetStageID sets the "stage_id" field.
- func (snc *SopNodeCreate) SetStageID(u uint64) *SopNodeCreate {
- snc.mutation.SetStageID(u)
- return snc
- }
- // SetParentID sets the "parent_id" field.
- func (snc *SopNodeCreate) SetParentID(u uint64) *SopNodeCreate {
- snc.mutation.SetParentID(u)
- return snc
- }
- // SetName sets the "name" field.
- func (snc *SopNodeCreate) SetName(s string) *SopNodeCreate {
- snc.mutation.SetName(s)
- return snc
- }
- // SetNillableName sets the "name" field if the given value is not nil.
- func (snc *SopNodeCreate) SetNillableName(s *string) *SopNodeCreate {
- if s != nil {
- snc.SetName(*s)
- }
- return snc
- }
- // SetConditionType sets the "condition_type" field.
- func (snc *SopNodeCreate) SetConditionType(i int) *SopNodeCreate {
- snc.mutation.SetConditionType(i)
- return snc
- }
- // SetNillableConditionType sets the "condition_type" field if the given value is not nil.
- func (snc *SopNodeCreate) SetNillableConditionType(i *int) *SopNodeCreate {
- if i != nil {
- snc.SetConditionType(*i)
- }
- return snc
- }
- // SetConditionList sets the "condition_list" field.
- func (snc *SopNodeCreate) SetConditionList(s []string) *SopNodeCreate {
- snc.mutation.SetConditionList(s)
- return snc
- }
- // SetActionMessage sets the "action_message" field.
- func (snc *SopNodeCreate) SetActionMessage(ct []custom_types.Action) *SopNodeCreate {
- snc.mutation.SetActionMessage(ct)
- return snc
- }
- // SetActionLabel sets the "action_label" field.
- func (snc *SopNodeCreate) SetActionLabel(u []uint64) *SopNodeCreate {
- snc.mutation.SetActionLabel(u)
- return snc
- }
- // SetID sets the "id" field.
- func (snc *SopNodeCreate) SetID(u uint64) *SopNodeCreate {
- snc.mutation.SetID(u)
- return snc
- }
- // SetSopStageID sets the "sop_stage" edge to the SopStage entity by ID.
- func (snc *SopNodeCreate) SetSopStageID(id uint64) *SopNodeCreate {
- snc.mutation.SetSopStageID(id)
- return snc
- }
- // SetSopStage sets the "sop_stage" edge to the SopStage entity.
- func (snc *SopNodeCreate) SetSopStage(s *SopStage) *SopNodeCreate {
- return snc.SetSopStageID(s.ID)
- }
- // AddNodeMessageIDs adds the "node_messages" edge to the MessageRecords entity by IDs.
- func (snc *SopNodeCreate) AddNodeMessageIDs(ids ...uint64) *SopNodeCreate {
- snc.mutation.AddNodeMessageIDs(ids...)
- return snc
- }
- // AddNodeMessages adds the "node_messages" edges to the MessageRecords entity.
- func (snc *SopNodeCreate) AddNodeMessages(m ...*MessageRecords) *SopNodeCreate {
- ids := make([]uint64, len(m))
- for i := range m {
- ids[i] = m[i].ID
- }
- return snc.AddNodeMessageIDs(ids...)
- }
- // Mutation returns the SopNodeMutation object of the builder.
- func (snc *SopNodeCreate) Mutation() *SopNodeMutation {
- return snc.mutation
- }
- // Save creates the SopNode in the database.
- func (snc *SopNodeCreate) Save(ctx context.Context) (*SopNode, error) {
- if err := snc.defaults(); err != nil {
- return nil, err
- }
- return withHooks(ctx, snc.sqlSave, snc.mutation, snc.hooks)
- }
- // SaveX calls Save and panics if Save returns an error.
- func (snc *SopNodeCreate) SaveX(ctx context.Context) *SopNode {
- v, err := snc.Save(ctx)
- if err != nil {
- panic(err)
- }
- return v
- }
- // Exec executes the query.
- func (snc *SopNodeCreate) Exec(ctx context.Context) error {
- _, err := snc.Save(ctx)
- return err
- }
- // ExecX is like Exec, but panics if an error occurs.
- func (snc *SopNodeCreate) ExecX(ctx context.Context) {
- if err := snc.Exec(ctx); err != nil {
- panic(err)
- }
- }
- // defaults sets the default values of the builder before save.
- func (snc *SopNodeCreate) defaults() error {
- if _, ok := snc.mutation.CreatedAt(); !ok {
- if sopnode.DefaultCreatedAt == nil {
- return fmt.Errorf("ent: uninitialized sopnode.DefaultCreatedAt (forgotten import ent/runtime?)")
- }
- v := sopnode.DefaultCreatedAt()
- snc.mutation.SetCreatedAt(v)
- }
- if _, ok := snc.mutation.UpdatedAt(); !ok {
- if sopnode.DefaultUpdatedAt == nil {
- return fmt.Errorf("ent: uninitialized sopnode.DefaultUpdatedAt (forgotten import ent/runtime?)")
- }
- v := sopnode.DefaultUpdatedAt()
- snc.mutation.SetUpdatedAt(v)
- }
- if _, ok := snc.mutation.Status(); !ok {
- v := sopnode.DefaultStatus
- snc.mutation.SetStatus(v)
- }
- if _, ok := snc.mutation.Name(); !ok {
- v := sopnode.DefaultName
- snc.mutation.SetName(v)
- }
- if _, ok := snc.mutation.ConditionType(); !ok {
- v := sopnode.DefaultConditionType
- snc.mutation.SetConditionType(v)
- }
- return nil
- }
- // check runs all checks and user-defined validators on the builder.
- func (snc *SopNodeCreate) check() error {
- if _, ok := snc.mutation.CreatedAt(); !ok {
- return &ValidationError{Name: "created_at", err: errors.New(`ent: missing required field "SopNode.created_at"`)}
- }
- if _, ok := snc.mutation.UpdatedAt(); !ok {
- return &ValidationError{Name: "updated_at", err: errors.New(`ent: missing required field "SopNode.updated_at"`)}
- }
- if _, ok := snc.mutation.StageID(); !ok {
- return &ValidationError{Name: "stage_id", err: errors.New(`ent: missing required field "SopNode.stage_id"`)}
- }
- if _, ok := snc.mutation.ParentID(); !ok {
- return &ValidationError{Name: "parent_id", err: errors.New(`ent: missing required field "SopNode.parent_id"`)}
- }
- if _, ok := snc.mutation.Name(); !ok {
- return &ValidationError{Name: "name", err: errors.New(`ent: missing required field "SopNode.name"`)}
- }
- if _, ok := snc.mutation.ConditionType(); !ok {
- return &ValidationError{Name: "condition_type", err: errors.New(`ent: missing required field "SopNode.condition_type"`)}
- }
- if _, ok := snc.mutation.SopStageID(); !ok {
- return &ValidationError{Name: "sop_stage", err: errors.New(`ent: missing required edge "SopNode.sop_stage"`)}
- }
- return nil
- }
- func (snc *SopNodeCreate) sqlSave(ctx context.Context) (*SopNode, error) {
- if err := snc.check(); err != nil {
- return nil, err
- }
- _node, _spec := snc.createSpec()
- if err := sqlgraph.CreateNode(ctx, snc.driver, _spec); err != nil {
- if sqlgraph.IsConstraintError(err) {
- err = &ConstraintError{msg: err.Error(), wrap: err}
- }
- return nil, err
- }
- if _spec.ID.Value != _node.ID {
- id := _spec.ID.Value.(int64)
- _node.ID = uint64(id)
- }
- snc.mutation.id = &_node.ID
- snc.mutation.done = true
- return _node, nil
- }
- func (snc *SopNodeCreate) createSpec() (*SopNode, *sqlgraph.CreateSpec) {
- var (
- _node = &SopNode{config: snc.config}
- _spec = sqlgraph.NewCreateSpec(sopnode.Table, sqlgraph.NewFieldSpec(sopnode.FieldID, field.TypeUint64))
- )
- _spec.OnConflict = snc.conflict
- if id, ok := snc.mutation.ID(); ok {
- _node.ID = id
- _spec.ID.Value = id
- }
- if value, ok := snc.mutation.CreatedAt(); ok {
- _spec.SetField(sopnode.FieldCreatedAt, field.TypeTime, value)
- _node.CreatedAt = value
- }
- if value, ok := snc.mutation.UpdatedAt(); ok {
- _spec.SetField(sopnode.FieldUpdatedAt, field.TypeTime, value)
- _node.UpdatedAt = value
- }
- if value, ok := snc.mutation.Status(); ok {
- _spec.SetField(sopnode.FieldStatus, field.TypeUint8, value)
- _node.Status = value
- }
- if value, ok := snc.mutation.DeletedAt(); ok {
- _spec.SetField(sopnode.FieldDeletedAt, field.TypeTime, value)
- _node.DeletedAt = value
- }
- if value, ok := snc.mutation.ParentID(); ok {
- _spec.SetField(sopnode.FieldParentID, field.TypeUint64, value)
- _node.ParentID = value
- }
- if value, ok := snc.mutation.Name(); ok {
- _spec.SetField(sopnode.FieldName, field.TypeString, value)
- _node.Name = value
- }
- if value, ok := snc.mutation.ConditionType(); ok {
- _spec.SetField(sopnode.FieldConditionType, field.TypeInt, value)
- _node.ConditionType = value
- }
- if value, ok := snc.mutation.ConditionList(); ok {
- _spec.SetField(sopnode.FieldConditionList, field.TypeJSON, value)
- _node.ConditionList = value
- }
- if value, ok := snc.mutation.ActionMessage(); ok {
- _spec.SetField(sopnode.FieldActionMessage, field.TypeJSON, value)
- _node.ActionMessage = value
- }
- if value, ok := snc.mutation.ActionLabel(); ok {
- _spec.SetField(sopnode.FieldActionLabel, field.TypeJSON, value)
- _node.ActionLabel = value
- }
- if nodes := snc.mutation.SopStageIDs(); len(nodes) > 0 {
- edge := &sqlgraph.EdgeSpec{
- Rel: sqlgraph.M2O,
- Inverse: true,
- Table: sopnode.SopStageTable,
- Columns: []string{sopnode.SopStageColumn},
- Bidi: false,
- Target: &sqlgraph.EdgeTarget{
- IDSpec: sqlgraph.NewFieldSpec(sopstage.FieldID, field.TypeUint64),
- },
- }
- for _, k := range nodes {
- edge.Target.Nodes = append(edge.Target.Nodes, k)
- }
- _node.StageID = nodes[0]
- _spec.Edges = append(_spec.Edges, edge)
- }
- if nodes := snc.mutation.NodeMessagesIDs(); len(nodes) > 0 {
- edge := &sqlgraph.EdgeSpec{
- Rel: sqlgraph.O2M,
- Inverse: false,
- Table: sopnode.NodeMessagesTable,
- Columns: []string{sopnode.NodeMessagesColumn},
- Bidi: false,
- Target: &sqlgraph.EdgeTarget{
- IDSpec: sqlgraph.NewFieldSpec(messagerecords.FieldID, field.TypeUint64),
- },
- }
- for _, k := range nodes {
- edge.Target.Nodes = append(edge.Target.Nodes, k)
- }
- _spec.Edges = append(_spec.Edges, edge)
- }
- return _node, _spec
- }
- // OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause
- // of the `INSERT` statement. For example:
- //
- // client.SopNode.Create().
- // SetCreatedAt(v).
- // OnConflict(
- // // Update the row with the new values
- // // the was proposed for insertion.
- // sql.ResolveWithNewValues(),
- // ).
- // // Override some of the fields with custom
- // // update values.
- // Update(func(u *ent.SopNodeUpsert) {
- // SetCreatedAt(v+v).
- // }).
- // Exec(ctx)
- func (snc *SopNodeCreate) OnConflict(opts ...sql.ConflictOption) *SopNodeUpsertOne {
- snc.conflict = opts
- return &SopNodeUpsertOne{
- create: snc,
- }
- }
- // OnConflictColumns calls `OnConflict` and configures the columns
- // as conflict target. Using this option is equivalent to using:
- //
- // client.SopNode.Create().
- // OnConflict(sql.ConflictColumns(columns...)).
- // Exec(ctx)
- func (snc *SopNodeCreate) OnConflictColumns(columns ...string) *SopNodeUpsertOne {
- snc.conflict = append(snc.conflict, sql.ConflictColumns(columns...))
- return &SopNodeUpsertOne{
- create: snc,
- }
- }
- type (
- // SopNodeUpsertOne is the builder for "upsert"-ing
- // one SopNode node.
- SopNodeUpsertOne struct {
- create *SopNodeCreate
- }
- // SopNodeUpsert is the "OnConflict" setter.
- SopNodeUpsert struct {
- *sql.UpdateSet
- }
- )
- // SetUpdatedAt sets the "updated_at" field.
- func (u *SopNodeUpsert) SetUpdatedAt(v time.Time) *SopNodeUpsert {
- u.Set(sopnode.FieldUpdatedAt, v)
- return u
- }
- // UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.
- func (u *SopNodeUpsert) UpdateUpdatedAt() *SopNodeUpsert {
- u.SetExcluded(sopnode.FieldUpdatedAt)
- return u
- }
- // SetStatus sets the "status" field.
- func (u *SopNodeUpsert) SetStatus(v uint8) *SopNodeUpsert {
- u.Set(sopnode.FieldStatus, v)
- return u
- }
- // UpdateStatus sets the "status" field to the value that was provided on create.
- func (u *SopNodeUpsert) UpdateStatus() *SopNodeUpsert {
- u.SetExcluded(sopnode.FieldStatus)
- return u
- }
- // AddStatus adds v to the "status" field.
- func (u *SopNodeUpsert) AddStatus(v uint8) *SopNodeUpsert {
- u.Add(sopnode.FieldStatus, v)
- return u
- }
- // ClearStatus clears the value of the "status" field.
- func (u *SopNodeUpsert) ClearStatus() *SopNodeUpsert {
- u.SetNull(sopnode.FieldStatus)
- return u
- }
- // SetDeletedAt sets the "deleted_at" field.
- func (u *SopNodeUpsert) SetDeletedAt(v time.Time) *SopNodeUpsert {
- u.Set(sopnode.FieldDeletedAt, v)
- return u
- }
- // UpdateDeletedAt sets the "deleted_at" field to the value that was provided on create.
- func (u *SopNodeUpsert) UpdateDeletedAt() *SopNodeUpsert {
- u.SetExcluded(sopnode.FieldDeletedAt)
- return u
- }
- // ClearDeletedAt clears the value of the "deleted_at" field.
- func (u *SopNodeUpsert) ClearDeletedAt() *SopNodeUpsert {
- u.SetNull(sopnode.FieldDeletedAt)
- return u
- }
- // SetStageID sets the "stage_id" field.
- func (u *SopNodeUpsert) SetStageID(v uint64) *SopNodeUpsert {
- u.Set(sopnode.FieldStageID, v)
- return u
- }
- // UpdateStageID sets the "stage_id" field to the value that was provided on create.
- func (u *SopNodeUpsert) UpdateStageID() *SopNodeUpsert {
- u.SetExcluded(sopnode.FieldStageID)
- return u
- }
- // SetParentID sets the "parent_id" field.
- func (u *SopNodeUpsert) SetParentID(v uint64) *SopNodeUpsert {
- u.Set(sopnode.FieldParentID, v)
- return u
- }
- // UpdateParentID sets the "parent_id" field to the value that was provided on create.
- func (u *SopNodeUpsert) UpdateParentID() *SopNodeUpsert {
- u.SetExcluded(sopnode.FieldParentID)
- return u
- }
- // AddParentID adds v to the "parent_id" field.
- func (u *SopNodeUpsert) AddParentID(v uint64) *SopNodeUpsert {
- u.Add(sopnode.FieldParentID, v)
- return u
- }
- // SetName sets the "name" field.
- func (u *SopNodeUpsert) SetName(v string) *SopNodeUpsert {
- u.Set(sopnode.FieldName, v)
- return u
- }
- // UpdateName sets the "name" field to the value that was provided on create.
- func (u *SopNodeUpsert) UpdateName() *SopNodeUpsert {
- u.SetExcluded(sopnode.FieldName)
- return u
- }
- // SetConditionType sets the "condition_type" field.
- func (u *SopNodeUpsert) SetConditionType(v int) *SopNodeUpsert {
- u.Set(sopnode.FieldConditionType, v)
- return u
- }
- // UpdateConditionType sets the "condition_type" field to the value that was provided on create.
- func (u *SopNodeUpsert) UpdateConditionType() *SopNodeUpsert {
- u.SetExcluded(sopnode.FieldConditionType)
- return u
- }
- // AddConditionType adds v to the "condition_type" field.
- func (u *SopNodeUpsert) AddConditionType(v int) *SopNodeUpsert {
- u.Add(sopnode.FieldConditionType, v)
- return u
- }
- // SetConditionList sets the "condition_list" field.
- func (u *SopNodeUpsert) SetConditionList(v []string) *SopNodeUpsert {
- u.Set(sopnode.FieldConditionList, v)
- return u
- }
- // UpdateConditionList sets the "condition_list" field to the value that was provided on create.
- func (u *SopNodeUpsert) UpdateConditionList() *SopNodeUpsert {
- u.SetExcluded(sopnode.FieldConditionList)
- return u
- }
- // ClearConditionList clears the value of the "condition_list" field.
- func (u *SopNodeUpsert) ClearConditionList() *SopNodeUpsert {
- u.SetNull(sopnode.FieldConditionList)
- return u
- }
- // SetActionMessage sets the "action_message" field.
- func (u *SopNodeUpsert) SetActionMessage(v []custom_types.Action) *SopNodeUpsert {
- u.Set(sopnode.FieldActionMessage, v)
- return u
- }
- // UpdateActionMessage sets the "action_message" field to the value that was provided on create.
- func (u *SopNodeUpsert) UpdateActionMessage() *SopNodeUpsert {
- u.SetExcluded(sopnode.FieldActionMessage)
- return u
- }
- // ClearActionMessage clears the value of the "action_message" field.
- func (u *SopNodeUpsert) ClearActionMessage() *SopNodeUpsert {
- u.SetNull(sopnode.FieldActionMessage)
- return u
- }
- // SetActionLabel sets the "action_label" field.
- func (u *SopNodeUpsert) SetActionLabel(v []uint64) *SopNodeUpsert {
- u.Set(sopnode.FieldActionLabel, v)
- return u
- }
- // UpdateActionLabel sets the "action_label" field to the value that was provided on create.
- func (u *SopNodeUpsert) UpdateActionLabel() *SopNodeUpsert {
- u.SetExcluded(sopnode.FieldActionLabel)
- return u
- }
- // ClearActionLabel clears the value of the "action_label" field.
- func (u *SopNodeUpsert) ClearActionLabel() *SopNodeUpsert {
- u.SetNull(sopnode.FieldActionLabel)
- return u
- }
- // UpdateNewValues updates the mutable fields using the new values that were set on create except the ID field.
- // Using this option is equivalent to using:
- //
- // client.SopNode.Create().
- // OnConflict(
- // sql.ResolveWithNewValues(),
- // sql.ResolveWith(func(u *sql.UpdateSet) {
- // u.SetIgnore(sopnode.FieldID)
- // }),
- // ).
- // Exec(ctx)
- func (u *SopNodeUpsertOne) UpdateNewValues() *SopNodeUpsertOne {
- u.create.conflict = append(u.create.conflict, sql.ResolveWithNewValues())
- u.create.conflict = append(u.create.conflict, sql.ResolveWith(func(s *sql.UpdateSet) {
- if _, exists := u.create.mutation.ID(); exists {
- s.SetIgnore(sopnode.FieldID)
- }
- if _, exists := u.create.mutation.CreatedAt(); exists {
- s.SetIgnore(sopnode.FieldCreatedAt)
- }
- }))
- return u
- }
- // Ignore sets each column to itself in case of conflict.
- // Using this option is equivalent to using:
- //
- // client.SopNode.Create().
- // OnConflict(sql.ResolveWithIgnore()).
- // Exec(ctx)
- func (u *SopNodeUpsertOne) Ignore() *SopNodeUpsertOne {
- u.create.conflict = append(u.create.conflict, sql.ResolveWithIgnore())
- return u
- }
- // DoNothing configures the conflict_action to `DO NOTHING`.
- // Supported only by SQLite and PostgreSQL.
- func (u *SopNodeUpsertOne) DoNothing() *SopNodeUpsertOne {
- u.create.conflict = append(u.create.conflict, sql.DoNothing())
- return u
- }
- // Update allows overriding fields `UPDATE` values. See the SopNodeCreate.OnConflict
- // documentation for more info.
- func (u *SopNodeUpsertOne) Update(set func(*SopNodeUpsert)) *SopNodeUpsertOne {
- u.create.conflict = append(u.create.conflict, sql.ResolveWith(func(update *sql.UpdateSet) {
- set(&SopNodeUpsert{UpdateSet: update})
- }))
- return u
- }
- // SetUpdatedAt sets the "updated_at" field.
- func (u *SopNodeUpsertOne) SetUpdatedAt(v time.Time) *SopNodeUpsertOne {
- return u.Update(func(s *SopNodeUpsert) {
- s.SetUpdatedAt(v)
- })
- }
- // UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.
- func (u *SopNodeUpsertOne) UpdateUpdatedAt() *SopNodeUpsertOne {
- return u.Update(func(s *SopNodeUpsert) {
- s.UpdateUpdatedAt()
- })
- }
- // SetStatus sets the "status" field.
- func (u *SopNodeUpsertOne) SetStatus(v uint8) *SopNodeUpsertOne {
- return u.Update(func(s *SopNodeUpsert) {
- s.SetStatus(v)
- })
- }
- // AddStatus adds v to the "status" field.
- func (u *SopNodeUpsertOne) AddStatus(v uint8) *SopNodeUpsertOne {
- return u.Update(func(s *SopNodeUpsert) {
- s.AddStatus(v)
- })
- }
- // UpdateStatus sets the "status" field to the value that was provided on create.
- func (u *SopNodeUpsertOne) UpdateStatus() *SopNodeUpsertOne {
- return u.Update(func(s *SopNodeUpsert) {
- s.UpdateStatus()
- })
- }
- // ClearStatus clears the value of the "status" field.
- func (u *SopNodeUpsertOne) ClearStatus() *SopNodeUpsertOne {
- return u.Update(func(s *SopNodeUpsert) {
- s.ClearStatus()
- })
- }
- // SetDeletedAt sets the "deleted_at" field.
- func (u *SopNodeUpsertOne) SetDeletedAt(v time.Time) *SopNodeUpsertOne {
- return u.Update(func(s *SopNodeUpsert) {
- s.SetDeletedAt(v)
- })
- }
- // UpdateDeletedAt sets the "deleted_at" field to the value that was provided on create.
- func (u *SopNodeUpsertOne) UpdateDeletedAt() *SopNodeUpsertOne {
- return u.Update(func(s *SopNodeUpsert) {
- s.UpdateDeletedAt()
- })
- }
- // ClearDeletedAt clears the value of the "deleted_at" field.
- func (u *SopNodeUpsertOne) ClearDeletedAt() *SopNodeUpsertOne {
- return u.Update(func(s *SopNodeUpsert) {
- s.ClearDeletedAt()
- })
- }
- // SetStageID sets the "stage_id" field.
- func (u *SopNodeUpsertOne) SetStageID(v uint64) *SopNodeUpsertOne {
- return u.Update(func(s *SopNodeUpsert) {
- s.SetStageID(v)
- })
- }
- // UpdateStageID sets the "stage_id" field to the value that was provided on create.
- func (u *SopNodeUpsertOne) UpdateStageID() *SopNodeUpsertOne {
- return u.Update(func(s *SopNodeUpsert) {
- s.UpdateStageID()
- })
- }
- // SetParentID sets the "parent_id" field.
- func (u *SopNodeUpsertOne) SetParentID(v uint64) *SopNodeUpsertOne {
- return u.Update(func(s *SopNodeUpsert) {
- s.SetParentID(v)
- })
- }
- // AddParentID adds v to the "parent_id" field.
- func (u *SopNodeUpsertOne) AddParentID(v uint64) *SopNodeUpsertOne {
- return u.Update(func(s *SopNodeUpsert) {
- s.AddParentID(v)
- })
- }
- // UpdateParentID sets the "parent_id" field to the value that was provided on create.
- func (u *SopNodeUpsertOne) UpdateParentID() *SopNodeUpsertOne {
- return u.Update(func(s *SopNodeUpsert) {
- s.UpdateParentID()
- })
- }
- // SetName sets the "name" field.
- func (u *SopNodeUpsertOne) SetName(v string) *SopNodeUpsertOne {
- return u.Update(func(s *SopNodeUpsert) {
- s.SetName(v)
- })
- }
- // UpdateName sets the "name" field to the value that was provided on create.
- func (u *SopNodeUpsertOne) UpdateName() *SopNodeUpsertOne {
- return u.Update(func(s *SopNodeUpsert) {
- s.UpdateName()
- })
- }
- // SetConditionType sets the "condition_type" field.
- func (u *SopNodeUpsertOne) SetConditionType(v int) *SopNodeUpsertOne {
- return u.Update(func(s *SopNodeUpsert) {
- s.SetConditionType(v)
- })
- }
- // AddConditionType adds v to the "condition_type" field.
- func (u *SopNodeUpsertOne) AddConditionType(v int) *SopNodeUpsertOne {
- return u.Update(func(s *SopNodeUpsert) {
- s.AddConditionType(v)
- })
- }
- // UpdateConditionType sets the "condition_type" field to the value that was provided on create.
- func (u *SopNodeUpsertOne) UpdateConditionType() *SopNodeUpsertOne {
- return u.Update(func(s *SopNodeUpsert) {
- s.UpdateConditionType()
- })
- }
- // SetConditionList sets the "condition_list" field.
- func (u *SopNodeUpsertOne) SetConditionList(v []string) *SopNodeUpsertOne {
- return u.Update(func(s *SopNodeUpsert) {
- s.SetConditionList(v)
- })
- }
- // UpdateConditionList sets the "condition_list" field to the value that was provided on create.
- func (u *SopNodeUpsertOne) UpdateConditionList() *SopNodeUpsertOne {
- return u.Update(func(s *SopNodeUpsert) {
- s.UpdateConditionList()
- })
- }
- // ClearConditionList clears the value of the "condition_list" field.
- func (u *SopNodeUpsertOne) ClearConditionList() *SopNodeUpsertOne {
- return u.Update(func(s *SopNodeUpsert) {
- s.ClearConditionList()
- })
- }
- // SetActionMessage sets the "action_message" field.
- func (u *SopNodeUpsertOne) SetActionMessage(v []custom_types.Action) *SopNodeUpsertOne {
- return u.Update(func(s *SopNodeUpsert) {
- s.SetActionMessage(v)
- })
- }
- // UpdateActionMessage sets the "action_message" field to the value that was provided on create.
- func (u *SopNodeUpsertOne) UpdateActionMessage() *SopNodeUpsertOne {
- return u.Update(func(s *SopNodeUpsert) {
- s.UpdateActionMessage()
- })
- }
- // ClearActionMessage clears the value of the "action_message" field.
- func (u *SopNodeUpsertOne) ClearActionMessage() *SopNodeUpsertOne {
- return u.Update(func(s *SopNodeUpsert) {
- s.ClearActionMessage()
- })
- }
- // SetActionLabel sets the "action_label" field.
- func (u *SopNodeUpsertOne) SetActionLabel(v []uint64) *SopNodeUpsertOne {
- return u.Update(func(s *SopNodeUpsert) {
- s.SetActionLabel(v)
- })
- }
- // UpdateActionLabel sets the "action_label" field to the value that was provided on create.
- func (u *SopNodeUpsertOne) UpdateActionLabel() *SopNodeUpsertOne {
- return u.Update(func(s *SopNodeUpsert) {
- s.UpdateActionLabel()
- })
- }
- // ClearActionLabel clears the value of the "action_label" field.
- func (u *SopNodeUpsertOne) ClearActionLabel() *SopNodeUpsertOne {
- return u.Update(func(s *SopNodeUpsert) {
- s.ClearActionLabel()
- })
- }
- // Exec executes the query.
- func (u *SopNodeUpsertOne) Exec(ctx context.Context) error {
- if len(u.create.conflict) == 0 {
- return errors.New("ent: missing options for SopNodeCreate.OnConflict")
- }
- return u.create.Exec(ctx)
- }
- // ExecX is like Exec, but panics if an error occurs.
- func (u *SopNodeUpsertOne) ExecX(ctx context.Context) {
- if err := u.create.Exec(ctx); err != nil {
- panic(err)
- }
- }
- // Exec executes the UPSERT query and returns the inserted/updated ID.
- func (u *SopNodeUpsertOne) ID(ctx context.Context) (id uint64, err error) {
- node, err := u.create.Save(ctx)
- if err != nil {
- return id, err
- }
- return node.ID, nil
- }
- // IDX is like ID, but panics if an error occurs.
- func (u *SopNodeUpsertOne) IDX(ctx context.Context) uint64 {
- id, err := u.ID(ctx)
- if err != nil {
- panic(err)
- }
- return id
- }
- // SopNodeCreateBulk is the builder for creating many SopNode entities in bulk.
- type SopNodeCreateBulk struct {
- config
- err error
- builders []*SopNodeCreate
- conflict []sql.ConflictOption
- }
- // Save creates the SopNode entities in the database.
- func (sncb *SopNodeCreateBulk) Save(ctx context.Context) ([]*SopNode, error) {
- if sncb.err != nil {
- return nil, sncb.err
- }
- specs := make([]*sqlgraph.CreateSpec, len(sncb.builders))
- nodes := make([]*SopNode, len(sncb.builders))
- mutators := make([]Mutator, len(sncb.builders))
- for i := range sncb.builders {
- func(i int, root context.Context) {
- builder := sncb.builders[i]
- builder.defaults()
- var mut Mutator = MutateFunc(func(ctx context.Context, m Mutation) (Value, error) {
- mutation, ok := m.(*SopNodeMutation)
- if !ok {
- return nil, fmt.Errorf("unexpected mutation type %T", m)
- }
- if err := builder.check(); err != nil {
- return nil, err
- }
- builder.mutation = mutation
- var err error
- nodes[i], specs[i] = builder.createSpec()
- if i < len(mutators)-1 {
- _, err = mutators[i+1].Mutate(root, sncb.builders[i+1].mutation)
- } else {
- spec := &sqlgraph.BatchCreateSpec{Nodes: specs}
- spec.OnConflict = sncb.conflict
- // Invoke the actual operation on the latest mutation in the chain.
- if err = sqlgraph.BatchCreate(ctx, sncb.driver, spec); err != nil {
- if sqlgraph.IsConstraintError(err) {
- err = &ConstraintError{msg: err.Error(), wrap: err}
- }
- }
- }
- if err != nil {
- return nil, err
- }
- mutation.id = &nodes[i].ID
- if specs[i].ID.Value != nil && nodes[i].ID == 0 {
- id := specs[i].ID.Value.(int64)
- nodes[i].ID = uint64(id)
- }
- mutation.done = true
- return nodes[i], nil
- })
- for i := len(builder.hooks) - 1; i >= 0; i-- {
- mut = builder.hooks[i](mut)
- }
- mutators[i] = mut
- }(i, ctx)
- }
- if len(mutators) > 0 {
- if _, err := mutators[0].Mutate(ctx, sncb.builders[0].mutation); err != nil {
- return nil, err
- }
- }
- return nodes, nil
- }
- // SaveX is like Save, but panics if an error occurs.
- func (sncb *SopNodeCreateBulk) SaveX(ctx context.Context) []*SopNode {
- v, err := sncb.Save(ctx)
- if err != nil {
- panic(err)
- }
- return v
- }
- // Exec executes the query.
- func (sncb *SopNodeCreateBulk) Exec(ctx context.Context) error {
- _, err := sncb.Save(ctx)
- return err
- }
- // ExecX is like Exec, but panics if an error occurs.
- func (sncb *SopNodeCreateBulk) ExecX(ctx context.Context) {
- if err := sncb.Exec(ctx); err != nil {
- panic(err)
- }
- }
- // OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause
- // of the `INSERT` statement. For example:
- //
- // client.SopNode.CreateBulk(builders...).
- // OnConflict(
- // // Update the row with the new values
- // // the was proposed for insertion.
- // sql.ResolveWithNewValues(),
- // ).
- // // Override some of the fields with custom
- // // update values.
- // Update(func(u *ent.SopNodeUpsert) {
- // SetCreatedAt(v+v).
- // }).
- // Exec(ctx)
- func (sncb *SopNodeCreateBulk) OnConflict(opts ...sql.ConflictOption) *SopNodeUpsertBulk {
- sncb.conflict = opts
- return &SopNodeUpsertBulk{
- create: sncb,
- }
- }
- // OnConflictColumns calls `OnConflict` and configures the columns
- // as conflict target. Using this option is equivalent to using:
- //
- // client.SopNode.Create().
- // OnConflict(sql.ConflictColumns(columns...)).
- // Exec(ctx)
- func (sncb *SopNodeCreateBulk) OnConflictColumns(columns ...string) *SopNodeUpsertBulk {
- sncb.conflict = append(sncb.conflict, sql.ConflictColumns(columns...))
- return &SopNodeUpsertBulk{
- create: sncb,
- }
- }
- // SopNodeUpsertBulk is the builder for "upsert"-ing
- // a bulk of SopNode nodes.
- type SopNodeUpsertBulk struct {
- create *SopNodeCreateBulk
- }
- // UpdateNewValues updates the mutable fields using the new values that
- // were set on create. Using this option is equivalent to using:
- //
- // client.SopNode.Create().
- // OnConflict(
- // sql.ResolveWithNewValues(),
- // sql.ResolveWith(func(u *sql.UpdateSet) {
- // u.SetIgnore(sopnode.FieldID)
- // }),
- // ).
- // Exec(ctx)
- func (u *SopNodeUpsertBulk) UpdateNewValues() *SopNodeUpsertBulk {
- u.create.conflict = append(u.create.conflict, sql.ResolveWithNewValues())
- u.create.conflict = append(u.create.conflict, sql.ResolveWith(func(s *sql.UpdateSet) {
- for _, b := range u.create.builders {
- if _, exists := b.mutation.ID(); exists {
- s.SetIgnore(sopnode.FieldID)
- }
- if _, exists := b.mutation.CreatedAt(); exists {
- s.SetIgnore(sopnode.FieldCreatedAt)
- }
- }
- }))
- return u
- }
- // Ignore sets each column to itself in case of conflict.
- // Using this option is equivalent to using:
- //
- // client.SopNode.Create().
- // OnConflict(sql.ResolveWithIgnore()).
- // Exec(ctx)
- func (u *SopNodeUpsertBulk) Ignore() *SopNodeUpsertBulk {
- u.create.conflict = append(u.create.conflict, sql.ResolveWithIgnore())
- return u
- }
- // DoNothing configures the conflict_action to `DO NOTHING`.
- // Supported only by SQLite and PostgreSQL.
- func (u *SopNodeUpsertBulk) DoNothing() *SopNodeUpsertBulk {
- u.create.conflict = append(u.create.conflict, sql.DoNothing())
- return u
- }
- // Update allows overriding fields `UPDATE` values. See the SopNodeCreateBulk.OnConflict
- // documentation for more info.
- func (u *SopNodeUpsertBulk) Update(set func(*SopNodeUpsert)) *SopNodeUpsertBulk {
- u.create.conflict = append(u.create.conflict, sql.ResolveWith(func(update *sql.UpdateSet) {
- set(&SopNodeUpsert{UpdateSet: update})
- }))
- return u
- }
- // SetUpdatedAt sets the "updated_at" field.
- func (u *SopNodeUpsertBulk) SetUpdatedAt(v time.Time) *SopNodeUpsertBulk {
- return u.Update(func(s *SopNodeUpsert) {
- s.SetUpdatedAt(v)
- })
- }
- // UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.
- func (u *SopNodeUpsertBulk) UpdateUpdatedAt() *SopNodeUpsertBulk {
- return u.Update(func(s *SopNodeUpsert) {
- s.UpdateUpdatedAt()
- })
- }
- // SetStatus sets the "status" field.
- func (u *SopNodeUpsertBulk) SetStatus(v uint8) *SopNodeUpsertBulk {
- return u.Update(func(s *SopNodeUpsert) {
- s.SetStatus(v)
- })
- }
- // AddStatus adds v to the "status" field.
- func (u *SopNodeUpsertBulk) AddStatus(v uint8) *SopNodeUpsertBulk {
- return u.Update(func(s *SopNodeUpsert) {
- s.AddStatus(v)
- })
- }
- // UpdateStatus sets the "status" field to the value that was provided on create.
- func (u *SopNodeUpsertBulk) UpdateStatus() *SopNodeUpsertBulk {
- return u.Update(func(s *SopNodeUpsert) {
- s.UpdateStatus()
- })
- }
- // ClearStatus clears the value of the "status" field.
- func (u *SopNodeUpsertBulk) ClearStatus() *SopNodeUpsertBulk {
- return u.Update(func(s *SopNodeUpsert) {
- s.ClearStatus()
- })
- }
- // SetDeletedAt sets the "deleted_at" field.
- func (u *SopNodeUpsertBulk) SetDeletedAt(v time.Time) *SopNodeUpsertBulk {
- return u.Update(func(s *SopNodeUpsert) {
- s.SetDeletedAt(v)
- })
- }
- // UpdateDeletedAt sets the "deleted_at" field to the value that was provided on create.
- func (u *SopNodeUpsertBulk) UpdateDeletedAt() *SopNodeUpsertBulk {
- return u.Update(func(s *SopNodeUpsert) {
- s.UpdateDeletedAt()
- })
- }
- // ClearDeletedAt clears the value of the "deleted_at" field.
- func (u *SopNodeUpsertBulk) ClearDeletedAt() *SopNodeUpsertBulk {
- return u.Update(func(s *SopNodeUpsert) {
- s.ClearDeletedAt()
- })
- }
- // SetStageID sets the "stage_id" field.
- func (u *SopNodeUpsertBulk) SetStageID(v uint64) *SopNodeUpsertBulk {
- return u.Update(func(s *SopNodeUpsert) {
- s.SetStageID(v)
- })
- }
- // UpdateStageID sets the "stage_id" field to the value that was provided on create.
- func (u *SopNodeUpsertBulk) UpdateStageID() *SopNodeUpsertBulk {
- return u.Update(func(s *SopNodeUpsert) {
- s.UpdateStageID()
- })
- }
- // SetParentID sets the "parent_id" field.
- func (u *SopNodeUpsertBulk) SetParentID(v uint64) *SopNodeUpsertBulk {
- return u.Update(func(s *SopNodeUpsert) {
- s.SetParentID(v)
- })
- }
- // AddParentID adds v to the "parent_id" field.
- func (u *SopNodeUpsertBulk) AddParentID(v uint64) *SopNodeUpsertBulk {
- return u.Update(func(s *SopNodeUpsert) {
- s.AddParentID(v)
- })
- }
- // UpdateParentID sets the "parent_id" field to the value that was provided on create.
- func (u *SopNodeUpsertBulk) UpdateParentID() *SopNodeUpsertBulk {
- return u.Update(func(s *SopNodeUpsert) {
- s.UpdateParentID()
- })
- }
- // SetName sets the "name" field.
- func (u *SopNodeUpsertBulk) SetName(v string) *SopNodeUpsertBulk {
- return u.Update(func(s *SopNodeUpsert) {
- s.SetName(v)
- })
- }
- // UpdateName sets the "name" field to the value that was provided on create.
- func (u *SopNodeUpsertBulk) UpdateName() *SopNodeUpsertBulk {
- return u.Update(func(s *SopNodeUpsert) {
- s.UpdateName()
- })
- }
- // SetConditionType sets the "condition_type" field.
- func (u *SopNodeUpsertBulk) SetConditionType(v int) *SopNodeUpsertBulk {
- return u.Update(func(s *SopNodeUpsert) {
- s.SetConditionType(v)
- })
- }
- // AddConditionType adds v to the "condition_type" field.
- func (u *SopNodeUpsertBulk) AddConditionType(v int) *SopNodeUpsertBulk {
- return u.Update(func(s *SopNodeUpsert) {
- s.AddConditionType(v)
- })
- }
- // UpdateConditionType sets the "condition_type" field to the value that was provided on create.
- func (u *SopNodeUpsertBulk) UpdateConditionType() *SopNodeUpsertBulk {
- return u.Update(func(s *SopNodeUpsert) {
- s.UpdateConditionType()
- })
- }
- // SetConditionList sets the "condition_list" field.
- func (u *SopNodeUpsertBulk) SetConditionList(v []string) *SopNodeUpsertBulk {
- return u.Update(func(s *SopNodeUpsert) {
- s.SetConditionList(v)
- })
- }
- // UpdateConditionList sets the "condition_list" field to the value that was provided on create.
- func (u *SopNodeUpsertBulk) UpdateConditionList() *SopNodeUpsertBulk {
- return u.Update(func(s *SopNodeUpsert) {
- s.UpdateConditionList()
- })
- }
- // ClearConditionList clears the value of the "condition_list" field.
- func (u *SopNodeUpsertBulk) ClearConditionList() *SopNodeUpsertBulk {
- return u.Update(func(s *SopNodeUpsert) {
- s.ClearConditionList()
- })
- }
- // SetActionMessage sets the "action_message" field.
- func (u *SopNodeUpsertBulk) SetActionMessage(v []custom_types.Action) *SopNodeUpsertBulk {
- return u.Update(func(s *SopNodeUpsert) {
- s.SetActionMessage(v)
- })
- }
- // UpdateActionMessage sets the "action_message" field to the value that was provided on create.
- func (u *SopNodeUpsertBulk) UpdateActionMessage() *SopNodeUpsertBulk {
- return u.Update(func(s *SopNodeUpsert) {
- s.UpdateActionMessage()
- })
- }
- // ClearActionMessage clears the value of the "action_message" field.
- func (u *SopNodeUpsertBulk) ClearActionMessage() *SopNodeUpsertBulk {
- return u.Update(func(s *SopNodeUpsert) {
- s.ClearActionMessage()
- })
- }
- // SetActionLabel sets the "action_label" field.
- func (u *SopNodeUpsertBulk) SetActionLabel(v []uint64) *SopNodeUpsertBulk {
- return u.Update(func(s *SopNodeUpsert) {
- s.SetActionLabel(v)
- })
- }
- // UpdateActionLabel sets the "action_label" field to the value that was provided on create.
- func (u *SopNodeUpsertBulk) UpdateActionLabel() *SopNodeUpsertBulk {
- return u.Update(func(s *SopNodeUpsert) {
- s.UpdateActionLabel()
- })
- }
- // ClearActionLabel clears the value of the "action_label" field.
- func (u *SopNodeUpsertBulk) ClearActionLabel() *SopNodeUpsertBulk {
- return u.Update(func(s *SopNodeUpsert) {
- s.ClearActionLabel()
- })
- }
- // Exec executes the query.
- func (u *SopNodeUpsertBulk) Exec(ctx context.Context) error {
- if u.create.err != nil {
- return u.create.err
- }
- for i, b := range u.create.builders {
- if len(b.conflict) != 0 {
- return fmt.Errorf("ent: OnConflict was set for builder %d. Set it on the SopNodeCreateBulk instead", i)
- }
- }
- if len(u.create.conflict) == 0 {
- return errors.New("ent: missing options for SopNodeCreateBulk.OnConflict")
- }
- return u.create.Exec(ctx)
- }
- // ExecX is like Exec, but panics if an error occurs.
- func (u *SopNodeUpsertBulk) ExecX(ctx context.Context) {
- if err := u.create.Exec(ctx); err != nil {
- panic(err)
- }
- }
|