labeltagging_create.go 33 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098
  1. // Code generated by ent, DO NOT EDIT.
  2. package ent
  3. import (
  4. "context"
  5. "errors"
  6. "fmt"
  7. "time"
  8. "wechat-api/ent/labeltagging"
  9. "entgo.io/ent/dialect/sql"
  10. "entgo.io/ent/dialect/sql/sqlgraph"
  11. "entgo.io/ent/schema/field"
  12. )
  13. // LabelTaggingCreate is the builder for creating a LabelTagging entity.
  14. type LabelTaggingCreate struct {
  15. config
  16. mutation *LabelTaggingMutation
  17. hooks []Hook
  18. conflict []sql.ConflictOption
  19. }
  20. // SetCreatedAt sets the "created_at" field.
  21. func (ltc *LabelTaggingCreate) SetCreatedAt(t time.Time) *LabelTaggingCreate {
  22. ltc.mutation.SetCreatedAt(t)
  23. return ltc
  24. }
  25. // SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
  26. func (ltc *LabelTaggingCreate) SetNillableCreatedAt(t *time.Time) *LabelTaggingCreate {
  27. if t != nil {
  28. ltc.SetCreatedAt(*t)
  29. }
  30. return ltc
  31. }
  32. // SetUpdatedAt sets the "updated_at" field.
  33. func (ltc *LabelTaggingCreate) SetUpdatedAt(t time.Time) *LabelTaggingCreate {
  34. ltc.mutation.SetUpdatedAt(t)
  35. return ltc
  36. }
  37. // SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.
  38. func (ltc *LabelTaggingCreate) SetNillableUpdatedAt(t *time.Time) *LabelTaggingCreate {
  39. if t != nil {
  40. ltc.SetUpdatedAt(*t)
  41. }
  42. return ltc
  43. }
  44. // SetStatus sets the "status" field.
  45. func (ltc *LabelTaggingCreate) SetStatus(u uint8) *LabelTaggingCreate {
  46. ltc.mutation.SetStatus(u)
  47. return ltc
  48. }
  49. // SetNillableStatus sets the "status" field if the given value is not nil.
  50. func (ltc *LabelTaggingCreate) SetNillableStatus(u *uint8) *LabelTaggingCreate {
  51. if u != nil {
  52. ltc.SetStatus(*u)
  53. }
  54. return ltc
  55. }
  56. // SetDeletedAt sets the "deleted_at" field.
  57. func (ltc *LabelTaggingCreate) SetDeletedAt(t time.Time) *LabelTaggingCreate {
  58. ltc.mutation.SetDeletedAt(t)
  59. return ltc
  60. }
  61. // SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.
  62. func (ltc *LabelTaggingCreate) SetNillableDeletedAt(t *time.Time) *LabelTaggingCreate {
  63. if t != nil {
  64. ltc.SetDeletedAt(*t)
  65. }
  66. return ltc
  67. }
  68. // SetOrganizationID sets the "organization_id" field.
  69. func (ltc *LabelTaggingCreate) SetOrganizationID(u uint64) *LabelTaggingCreate {
  70. ltc.mutation.SetOrganizationID(u)
  71. return ltc
  72. }
  73. // SetNillableOrganizationID sets the "organization_id" field if the given value is not nil.
  74. func (ltc *LabelTaggingCreate) SetNillableOrganizationID(u *uint64) *LabelTaggingCreate {
  75. if u != nil {
  76. ltc.SetOrganizationID(*u)
  77. }
  78. return ltc
  79. }
  80. // SetType sets the "type" field.
  81. func (ltc *LabelTaggingCreate) SetType(i int) *LabelTaggingCreate {
  82. ltc.mutation.SetType(i)
  83. return ltc
  84. }
  85. // SetNillableType sets the "type" field if the given value is not nil.
  86. func (ltc *LabelTaggingCreate) SetNillableType(i *int) *LabelTaggingCreate {
  87. if i != nil {
  88. ltc.SetType(*i)
  89. }
  90. return ltc
  91. }
  92. // SetConditions sets the "conditions" field.
  93. func (ltc *LabelTaggingCreate) SetConditions(s string) *LabelTaggingCreate {
  94. ltc.mutation.SetConditions(s)
  95. return ltc
  96. }
  97. // SetNillableConditions sets the "conditions" field if the given value is not nil.
  98. func (ltc *LabelTaggingCreate) SetNillableConditions(s *string) *LabelTaggingCreate {
  99. if s != nil {
  100. ltc.SetConditions(*s)
  101. }
  102. return ltc
  103. }
  104. // SetActionLabelAdd sets the "action_label_add" field.
  105. func (ltc *LabelTaggingCreate) SetActionLabelAdd(u []uint64) *LabelTaggingCreate {
  106. ltc.mutation.SetActionLabelAdd(u)
  107. return ltc
  108. }
  109. // SetActionLabelDel sets the "action_label_del" field.
  110. func (ltc *LabelTaggingCreate) SetActionLabelDel(u []uint64) *LabelTaggingCreate {
  111. ltc.mutation.SetActionLabelDel(u)
  112. return ltc
  113. }
  114. // SetID sets the "id" field.
  115. func (ltc *LabelTaggingCreate) SetID(u uint64) *LabelTaggingCreate {
  116. ltc.mutation.SetID(u)
  117. return ltc
  118. }
  119. // Mutation returns the LabelTaggingMutation object of the builder.
  120. func (ltc *LabelTaggingCreate) Mutation() *LabelTaggingMutation {
  121. return ltc.mutation
  122. }
  123. // Save creates the LabelTagging in the database.
  124. func (ltc *LabelTaggingCreate) Save(ctx context.Context) (*LabelTagging, error) {
  125. if err := ltc.defaults(); err != nil {
  126. return nil, err
  127. }
  128. return withHooks(ctx, ltc.sqlSave, ltc.mutation, ltc.hooks)
  129. }
  130. // SaveX calls Save and panics if Save returns an error.
  131. func (ltc *LabelTaggingCreate) SaveX(ctx context.Context) *LabelTagging {
  132. v, err := ltc.Save(ctx)
  133. if err != nil {
  134. panic(err)
  135. }
  136. return v
  137. }
  138. // Exec executes the query.
  139. func (ltc *LabelTaggingCreate) Exec(ctx context.Context) error {
  140. _, err := ltc.Save(ctx)
  141. return err
  142. }
  143. // ExecX is like Exec, but panics if an error occurs.
  144. func (ltc *LabelTaggingCreate) ExecX(ctx context.Context) {
  145. if err := ltc.Exec(ctx); err != nil {
  146. panic(err)
  147. }
  148. }
  149. // defaults sets the default values of the builder before save.
  150. func (ltc *LabelTaggingCreate) defaults() error {
  151. if _, ok := ltc.mutation.CreatedAt(); !ok {
  152. if labeltagging.DefaultCreatedAt == nil {
  153. return fmt.Errorf("ent: uninitialized labeltagging.DefaultCreatedAt (forgotten import ent/runtime?)")
  154. }
  155. v := labeltagging.DefaultCreatedAt()
  156. ltc.mutation.SetCreatedAt(v)
  157. }
  158. if _, ok := ltc.mutation.UpdatedAt(); !ok {
  159. if labeltagging.DefaultUpdatedAt == nil {
  160. return fmt.Errorf("ent: uninitialized labeltagging.DefaultUpdatedAt (forgotten import ent/runtime?)")
  161. }
  162. v := labeltagging.DefaultUpdatedAt()
  163. ltc.mutation.SetUpdatedAt(v)
  164. }
  165. if _, ok := ltc.mutation.Status(); !ok {
  166. v := labeltagging.DefaultStatus
  167. ltc.mutation.SetStatus(v)
  168. }
  169. if _, ok := ltc.mutation.OrganizationID(); !ok {
  170. v := labeltagging.DefaultOrganizationID
  171. ltc.mutation.SetOrganizationID(v)
  172. }
  173. if _, ok := ltc.mutation.GetType(); !ok {
  174. v := labeltagging.DefaultType
  175. ltc.mutation.SetType(v)
  176. }
  177. if _, ok := ltc.mutation.Conditions(); !ok {
  178. v := labeltagging.DefaultConditions
  179. ltc.mutation.SetConditions(v)
  180. }
  181. return nil
  182. }
  183. // check runs all checks and user-defined validators on the builder.
  184. func (ltc *LabelTaggingCreate) check() error {
  185. if _, ok := ltc.mutation.CreatedAt(); !ok {
  186. return &ValidationError{Name: "created_at", err: errors.New(`ent: missing required field "LabelTagging.created_at"`)}
  187. }
  188. if _, ok := ltc.mutation.UpdatedAt(); !ok {
  189. return &ValidationError{Name: "updated_at", err: errors.New(`ent: missing required field "LabelTagging.updated_at"`)}
  190. }
  191. if _, ok := ltc.mutation.OrganizationID(); !ok {
  192. return &ValidationError{Name: "organization_id", err: errors.New(`ent: missing required field "LabelTagging.organization_id"`)}
  193. }
  194. if _, ok := ltc.mutation.GetType(); !ok {
  195. return &ValidationError{Name: "type", err: errors.New(`ent: missing required field "LabelTagging.type"`)}
  196. }
  197. if _, ok := ltc.mutation.Conditions(); !ok {
  198. return &ValidationError{Name: "conditions", err: errors.New(`ent: missing required field "LabelTagging.conditions"`)}
  199. }
  200. return nil
  201. }
  202. func (ltc *LabelTaggingCreate) sqlSave(ctx context.Context) (*LabelTagging, error) {
  203. if err := ltc.check(); err != nil {
  204. return nil, err
  205. }
  206. _node, _spec := ltc.createSpec()
  207. if err := sqlgraph.CreateNode(ctx, ltc.driver, _spec); err != nil {
  208. if sqlgraph.IsConstraintError(err) {
  209. err = &ConstraintError{msg: err.Error(), wrap: err}
  210. }
  211. return nil, err
  212. }
  213. if _spec.ID.Value != _node.ID {
  214. id := _spec.ID.Value.(int64)
  215. _node.ID = uint64(id)
  216. }
  217. ltc.mutation.id = &_node.ID
  218. ltc.mutation.done = true
  219. return _node, nil
  220. }
  221. func (ltc *LabelTaggingCreate) createSpec() (*LabelTagging, *sqlgraph.CreateSpec) {
  222. var (
  223. _node = &LabelTagging{config: ltc.config}
  224. _spec = sqlgraph.NewCreateSpec(labeltagging.Table, sqlgraph.NewFieldSpec(labeltagging.FieldID, field.TypeUint64))
  225. )
  226. _spec.OnConflict = ltc.conflict
  227. if id, ok := ltc.mutation.ID(); ok {
  228. _node.ID = id
  229. _spec.ID.Value = id
  230. }
  231. if value, ok := ltc.mutation.CreatedAt(); ok {
  232. _spec.SetField(labeltagging.FieldCreatedAt, field.TypeTime, value)
  233. _node.CreatedAt = value
  234. }
  235. if value, ok := ltc.mutation.UpdatedAt(); ok {
  236. _spec.SetField(labeltagging.FieldUpdatedAt, field.TypeTime, value)
  237. _node.UpdatedAt = value
  238. }
  239. if value, ok := ltc.mutation.Status(); ok {
  240. _spec.SetField(labeltagging.FieldStatus, field.TypeUint8, value)
  241. _node.Status = value
  242. }
  243. if value, ok := ltc.mutation.DeletedAt(); ok {
  244. _spec.SetField(labeltagging.FieldDeletedAt, field.TypeTime, value)
  245. _node.DeletedAt = value
  246. }
  247. if value, ok := ltc.mutation.OrganizationID(); ok {
  248. _spec.SetField(labeltagging.FieldOrganizationID, field.TypeUint64, value)
  249. _node.OrganizationID = value
  250. }
  251. if value, ok := ltc.mutation.GetType(); ok {
  252. _spec.SetField(labeltagging.FieldType, field.TypeInt, value)
  253. _node.Type = value
  254. }
  255. if value, ok := ltc.mutation.Conditions(); ok {
  256. _spec.SetField(labeltagging.FieldConditions, field.TypeString, value)
  257. _node.Conditions = value
  258. }
  259. if value, ok := ltc.mutation.ActionLabelAdd(); ok {
  260. _spec.SetField(labeltagging.FieldActionLabelAdd, field.TypeJSON, value)
  261. _node.ActionLabelAdd = value
  262. }
  263. if value, ok := ltc.mutation.ActionLabelDel(); ok {
  264. _spec.SetField(labeltagging.FieldActionLabelDel, field.TypeJSON, value)
  265. _node.ActionLabelDel = value
  266. }
  267. return _node, _spec
  268. }
  269. // OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause
  270. // of the `INSERT` statement. For example:
  271. //
  272. // client.LabelTagging.Create().
  273. // SetCreatedAt(v).
  274. // OnConflict(
  275. // // Update the row with the new values
  276. // // the was proposed for insertion.
  277. // sql.ResolveWithNewValues(),
  278. // ).
  279. // // Override some of the fields with custom
  280. // // update values.
  281. // Update(func(u *ent.LabelTaggingUpsert) {
  282. // SetCreatedAt(v+v).
  283. // }).
  284. // Exec(ctx)
  285. func (ltc *LabelTaggingCreate) OnConflict(opts ...sql.ConflictOption) *LabelTaggingUpsertOne {
  286. ltc.conflict = opts
  287. return &LabelTaggingUpsertOne{
  288. create: ltc,
  289. }
  290. }
  291. // OnConflictColumns calls `OnConflict` and configures the columns
  292. // as conflict target. Using this option is equivalent to using:
  293. //
  294. // client.LabelTagging.Create().
  295. // OnConflict(sql.ConflictColumns(columns...)).
  296. // Exec(ctx)
  297. func (ltc *LabelTaggingCreate) OnConflictColumns(columns ...string) *LabelTaggingUpsertOne {
  298. ltc.conflict = append(ltc.conflict, sql.ConflictColumns(columns...))
  299. return &LabelTaggingUpsertOne{
  300. create: ltc,
  301. }
  302. }
  303. type (
  304. // LabelTaggingUpsertOne is the builder for "upsert"-ing
  305. // one LabelTagging node.
  306. LabelTaggingUpsertOne struct {
  307. create *LabelTaggingCreate
  308. }
  309. // LabelTaggingUpsert is the "OnConflict" setter.
  310. LabelTaggingUpsert struct {
  311. *sql.UpdateSet
  312. }
  313. )
  314. // SetUpdatedAt sets the "updated_at" field.
  315. func (u *LabelTaggingUpsert) SetUpdatedAt(v time.Time) *LabelTaggingUpsert {
  316. u.Set(labeltagging.FieldUpdatedAt, v)
  317. return u
  318. }
  319. // UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.
  320. func (u *LabelTaggingUpsert) UpdateUpdatedAt() *LabelTaggingUpsert {
  321. u.SetExcluded(labeltagging.FieldUpdatedAt)
  322. return u
  323. }
  324. // SetStatus sets the "status" field.
  325. func (u *LabelTaggingUpsert) SetStatus(v uint8) *LabelTaggingUpsert {
  326. u.Set(labeltagging.FieldStatus, v)
  327. return u
  328. }
  329. // UpdateStatus sets the "status" field to the value that was provided on create.
  330. func (u *LabelTaggingUpsert) UpdateStatus() *LabelTaggingUpsert {
  331. u.SetExcluded(labeltagging.FieldStatus)
  332. return u
  333. }
  334. // AddStatus adds v to the "status" field.
  335. func (u *LabelTaggingUpsert) AddStatus(v uint8) *LabelTaggingUpsert {
  336. u.Add(labeltagging.FieldStatus, v)
  337. return u
  338. }
  339. // ClearStatus clears the value of the "status" field.
  340. func (u *LabelTaggingUpsert) ClearStatus() *LabelTaggingUpsert {
  341. u.SetNull(labeltagging.FieldStatus)
  342. return u
  343. }
  344. // SetDeletedAt sets the "deleted_at" field.
  345. func (u *LabelTaggingUpsert) SetDeletedAt(v time.Time) *LabelTaggingUpsert {
  346. u.Set(labeltagging.FieldDeletedAt, v)
  347. return u
  348. }
  349. // UpdateDeletedAt sets the "deleted_at" field to the value that was provided on create.
  350. func (u *LabelTaggingUpsert) UpdateDeletedAt() *LabelTaggingUpsert {
  351. u.SetExcluded(labeltagging.FieldDeletedAt)
  352. return u
  353. }
  354. // ClearDeletedAt clears the value of the "deleted_at" field.
  355. func (u *LabelTaggingUpsert) ClearDeletedAt() *LabelTaggingUpsert {
  356. u.SetNull(labeltagging.FieldDeletedAt)
  357. return u
  358. }
  359. // SetOrganizationID sets the "organization_id" field.
  360. func (u *LabelTaggingUpsert) SetOrganizationID(v uint64) *LabelTaggingUpsert {
  361. u.Set(labeltagging.FieldOrganizationID, v)
  362. return u
  363. }
  364. // UpdateOrganizationID sets the "organization_id" field to the value that was provided on create.
  365. func (u *LabelTaggingUpsert) UpdateOrganizationID() *LabelTaggingUpsert {
  366. u.SetExcluded(labeltagging.FieldOrganizationID)
  367. return u
  368. }
  369. // AddOrganizationID adds v to the "organization_id" field.
  370. func (u *LabelTaggingUpsert) AddOrganizationID(v uint64) *LabelTaggingUpsert {
  371. u.Add(labeltagging.FieldOrganizationID, v)
  372. return u
  373. }
  374. // SetType sets the "type" field.
  375. func (u *LabelTaggingUpsert) SetType(v int) *LabelTaggingUpsert {
  376. u.Set(labeltagging.FieldType, v)
  377. return u
  378. }
  379. // UpdateType sets the "type" field to the value that was provided on create.
  380. func (u *LabelTaggingUpsert) UpdateType() *LabelTaggingUpsert {
  381. u.SetExcluded(labeltagging.FieldType)
  382. return u
  383. }
  384. // AddType adds v to the "type" field.
  385. func (u *LabelTaggingUpsert) AddType(v int) *LabelTaggingUpsert {
  386. u.Add(labeltagging.FieldType, v)
  387. return u
  388. }
  389. // SetConditions sets the "conditions" field.
  390. func (u *LabelTaggingUpsert) SetConditions(v string) *LabelTaggingUpsert {
  391. u.Set(labeltagging.FieldConditions, v)
  392. return u
  393. }
  394. // UpdateConditions sets the "conditions" field to the value that was provided on create.
  395. func (u *LabelTaggingUpsert) UpdateConditions() *LabelTaggingUpsert {
  396. u.SetExcluded(labeltagging.FieldConditions)
  397. return u
  398. }
  399. // SetActionLabelAdd sets the "action_label_add" field.
  400. func (u *LabelTaggingUpsert) SetActionLabelAdd(v []uint64) *LabelTaggingUpsert {
  401. u.Set(labeltagging.FieldActionLabelAdd, v)
  402. return u
  403. }
  404. // UpdateActionLabelAdd sets the "action_label_add" field to the value that was provided on create.
  405. func (u *LabelTaggingUpsert) UpdateActionLabelAdd() *LabelTaggingUpsert {
  406. u.SetExcluded(labeltagging.FieldActionLabelAdd)
  407. return u
  408. }
  409. // ClearActionLabelAdd clears the value of the "action_label_add" field.
  410. func (u *LabelTaggingUpsert) ClearActionLabelAdd() *LabelTaggingUpsert {
  411. u.SetNull(labeltagging.FieldActionLabelAdd)
  412. return u
  413. }
  414. // SetActionLabelDel sets the "action_label_del" field.
  415. func (u *LabelTaggingUpsert) SetActionLabelDel(v []uint64) *LabelTaggingUpsert {
  416. u.Set(labeltagging.FieldActionLabelDel, v)
  417. return u
  418. }
  419. // UpdateActionLabelDel sets the "action_label_del" field to the value that was provided on create.
  420. func (u *LabelTaggingUpsert) UpdateActionLabelDel() *LabelTaggingUpsert {
  421. u.SetExcluded(labeltagging.FieldActionLabelDel)
  422. return u
  423. }
  424. // ClearActionLabelDel clears the value of the "action_label_del" field.
  425. func (u *LabelTaggingUpsert) ClearActionLabelDel() *LabelTaggingUpsert {
  426. u.SetNull(labeltagging.FieldActionLabelDel)
  427. return u
  428. }
  429. // UpdateNewValues updates the mutable fields using the new values that were set on create except the ID field.
  430. // Using this option is equivalent to using:
  431. //
  432. // client.LabelTagging.Create().
  433. // OnConflict(
  434. // sql.ResolveWithNewValues(),
  435. // sql.ResolveWith(func(u *sql.UpdateSet) {
  436. // u.SetIgnore(labeltagging.FieldID)
  437. // }),
  438. // ).
  439. // Exec(ctx)
  440. func (u *LabelTaggingUpsertOne) UpdateNewValues() *LabelTaggingUpsertOne {
  441. u.create.conflict = append(u.create.conflict, sql.ResolveWithNewValues())
  442. u.create.conflict = append(u.create.conflict, sql.ResolveWith(func(s *sql.UpdateSet) {
  443. if _, exists := u.create.mutation.ID(); exists {
  444. s.SetIgnore(labeltagging.FieldID)
  445. }
  446. if _, exists := u.create.mutation.CreatedAt(); exists {
  447. s.SetIgnore(labeltagging.FieldCreatedAt)
  448. }
  449. }))
  450. return u
  451. }
  452. // Ignore sets each column to itself in case of conflict.
  453. // Using this option is equivalent to using:
  454. //
  455. // client.LabelTagging.Create().
  456. // OnConflict(sql.ResolveWithIgnore()).
  457. // Exec(ctx)
  458. func (u *LabelTaggingUpsertOne) Ignore() *LabelTaggingUpsertOne {
  459. u.create.conflict = append(u.create.conflict, sql.ResolveWithIgnore())
  460. return u
  461. }
  462. // DoNothing configures the conflict_action to `DO NOTHING`.
  463. // Supported only by SQLite and PostgreSQL.
  464. func (u *LabelTaggingUpsertOne) DoNothing() *LabelTaggingUpsertOne {
  465. u.create.conflict = append(u.create.conflict, sql.DoNothing())
  466. return u
  467. }
  468. // Update allows overriding fields `UPDATE` values. See the LabelTaggingCreate.OnConflict
  469. // documentation for more info.
  470. func (u *LabelTaggingUpsertOne) Update(set func(*LabelTaggingUpsert)) *LabelTaggingUpsertOne {
  471. u.create.conflict = append(u.create.conflict, sql.ResolveWith(func(update *sql.UpdateSet) {
  472. set(&LabelTaggingUpsert{UpdateSet: update})
  473. }))
  474. return u
  475. }
  476. // SetUpdatedAt sets the "updated_at" field.
  477. func (u *LabelTaggingUpsertOne) SetUpdatedAt(v time.Time) *LabelTaggingUpsertOne {
  478. return u.Update(func(s *LabelTaggingUpsert) {
  479. s.SetUpdatedAt(v)
  480. })
  481. }
  482. // UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.
  483. func (u *LabelTaggingUpsertOne) UpdateUpdatedAt() *LabelTaggingUpsertOne {
  484. return u.Update(func(s *LabelTaggingUpsert) {
  485. s.UpdateUpdatedAt()
  486. })
  487. }
  488. // SetStatus sets the "status" field.
  489. func (u *LabelTaggingUpsertOne) SetStatus(v uint8) *LabelTaggingUpsertOne {
  490. return u.Update(func(s *LabelTaggingUpsert) {
  491. s.SetStatus(v)
  492. })
  493. }
  494. // AddStatus adds v to the "status" field.
  495. func (u *LabelTaggingUpsertOne) AddStatus(v uint8) *LabelTaggingUpsertOne {
  496. return u.Update(func(s *LabelTaggingUpsert) {
  497. s.AddStatus(v)
  498. })
  499. }
  500. // UpdateStatus sets the "status" field to the value that was provided on create.
  501. func (u *LabelTaggingUpsertOne) UpdateStatus() *LabelTaggingUpsertOne {
  502. return u.Update(func(s *LabelTaggingUpsert) {
  503. s.UpdateStatus()
  504. })
  505. }
  506. // ClearStatus clears the value of the "status" field.
  507. func (u *LabelTaggingUpsertOne) ClearStatus() *LabelTaggingUpsertOne {
  508. return u.Update(func(s *LabelTaggingUpsert) {
  509. s.ClearStatus()
  510. })
  511. }
  512. // SetDeletedAt sets the "deleted_at" field.
  513. func (u *LabelTaggingUpsertOne) SetDeletedAt(v time.Time) *LabelTaggingUpsertOne {
  514. return u.Update(func(s *LabelTaggingUpsert) {
  515. s.SetDeletedAt(v)
  516. })
  517. }
  518. // UpdateDeletedAt sets the "deleted_at" field to the value that was provided on create.
  519. func (u *LabelTaggingUpsertOne) UpdateDeletedAt() *LabelTaggingUpsertOne {
  520. return u.Update(func(s *LabelTaggingUpsert) {
  521. s.UpdateDeletedAt()
  522. })
  523. }
  524. // ClearDeletedAt clears the value of the "deleted_at" field.
  525. func (u *LabelTaggingUpsertOne) ClearDeletedAt() *LabelTaggingUpsertOne {
  526. return u.Update(func(s *LabelTaggingUpsert) {
  527. s.ClearDeletedAt()
  528. })
  529. }
  530. // SetOrganizationID sets the "organization_id" field.
  531. func (u *LabelTaggingUpsertOne) SetOrganizationID(v uint64) *LabelTaggingUpsertOne {
  532. return u.Update(func(s *LabelTaggingUpsert) {
  533. s.SetOrganizationID(v)
  534. })
  535. }
  536. // AddOrganizationID adds v to the "organization_id" field.
  537. func (u *LabelTaggingUpsertOne) AddOrganizationID(v uint64) *LabelTaggingUpsertOne {
  538. return u.Update(func(s *LabelTaggingUpsert) {
  539. s.AddOrganizationID(v)
  540. })
  541. }
  542. // UpdateOrganizationID sets the "organization_id" field to the value that was provided on create.
  543. func (u *LabelTaggingUpsertOne) UpdateOrganizationID() *LabelTaggingUpsertOne {
  544. return u.Update(func(s *LabelTaggingUpsert) {
  545. s.UpdateOrganizationID()
  546. })
  547. }
  548. // SetType sets the "type" field.
  549. func (u *LabelTaggingUpsertOne) SetType(v int) *LabelTaggingUpsertOne {
  550. return u.Update(func(s *LabelTaggingUpsert) {
  551. s.SetType(v)
  552. })
  553. }
  554. // AddType adds v to the "type" field.
  555. func (u *LabelTaggingUpsertOne) AddType(v int) *LabelTaggingUpsertOne {
  556. return u.Update(func(s *LabelTaggingUpsert) {
  557. s.AddType(v)
  558. })
  559. }
  560. // UpdateType sets the "type" field to the value that was provided on create.
  561. func (u *LabelTaggingUpsertOne) UpdateType() *LabelTaggingUpsertOne {
  562. return u.Update(func(s *LabelTaggingUpsert) {
  563. s.UpdateType()
  564. })
  565. }
  566. // SetConditions sets the "conditions" field.
  567. func (u *LabelTaggingUpsertOne) SetConditions(v string) *LabelTaggingUpsertOne {
  568. return u.Update(func(s *LabelTaggingUpsert) {
  569. s.SetConditions(v)
  570. })
  571. }
  572. // UpdateConditions sets the "conditions" field to the value that was provided on create.
  573. func (u *LabelTaggingUpsertOne) UpdateConditions() *LabelTaggingUpsertOne {
  574. return u.Update(func(s *LabelTaggingUpsert) {
  575. s.UpdateConditions()
  576. })
  577. }
  578. // SetActionLabelAdd sets the "action_label_add" field.
  579. func (u *LabelTaggingUpsertOne) SetActionLabelAdd(v []uint64) *LabelTaggingUpsertOne {
  580. return u.Update(func(s *LabelTaggingUpsert) {
  581. s.SetActionLabelAdd(v)
  582. })
  583. }
  584. // UpdateActionLabelAdd sets the "action_label_add" field to the value that was provided on create.
  585. func (u *LabelTaggingUpsertOne) UpdateActionLabelAdd() *LabelTaggingUpsertOne {
  586. return u.Update(func(s *LabelTaggingUpsert) {
  587. s.UpdateActionLabelAdd()
  588. })
  589. }
  590. // ClearActionLabelAdd clears the value of the "action_label_add" field.
  591. func (u *LabelTaggingUpsertOne) ClearActionLabelAdd() *LabelTaggingUpsertOne {
  592. return u.Update(func(s *LabelTaggingUpsert) {
  593. s.ClearActionLabelAdd()
  594. })
  595. }
  596. // SetActionLabelDel sets the "action_label_del" field.
  597. func (u *LabelTaggingUpsertOne) SetActionLabelDel(v []uint64) *LabelTaggingUpsertOne {
  598. return u.Update(func(s *LabelTaggingUpsert) {
  599. s.SetActionLabelDel(v)
  600. })
  601. }
  602. // UpdateActionLabelDel sets the "action_label_del" field to the value that was provided on create.
  603. func (u *LabelTaggingUpsertOne) UpdateActionLabelDel() *LabelTaggingUpsertOne {
  604. return u.Update(func(s *LabelTaggingUpsert) {
  605. s.UpdateActionLabelDel()
  606. })
  607. }
  608. // ClearActionLabelDel clears the value of the "action_label_del" field.
  609. func (u *LabelTaggingUpsertOne) ClearActionLabelDel() *LabelTaggingUpsertOne {
  610. return u.Update(func(s *LabelTaggingUpsert) {
  611. s.ClearActionLabelDel()
  612. })
  613. }
  614. // Exec executes the query.
  615. func (u *LabelTaggingUpsertOne) Exec(ctx context.Context) error {
  616. if len(u.create.conflict) == 0 {
  617. return errors.New("ent: missing options for LabelTaggingCreate.OnConflict")
  618. }
  619. return u.create.Exec(ctx)
  620. }
  621. // ExecX is like Exec, but panics if an error occurs.
  622. func (u *LabelTaggingUpsertOne) ExecX(ctx context.Context) {
  623. if err := u.create.Exec(ctx); err != nil {
  624. panic(err)
  625. }
  626. }
  627. // Exec executes the UPSERT query and returns the inserted/updated ID.
  628. func (u *LabelTaggingUpsertOne) ID(ctx context.Context) (id uint64, err error) {
  629. node, err := u.create.Save(ctx)
  630. if err != nil {
  631. return id, err
  632. }
  633. return node.ID, nil
  634. }
  635. // IDX is like ID, but panics if an error occurs.
  636. func (u *LabelTaggingUpsertOne) IDX(ctx context.Context) uint64 {
  637. id, err := u.ID(ctx)
  638. if err != nil {
  639. panic(err)
  640. }
  641. return id
  642. }
  643. // LabelTaggingCreateBulk is the builder for creating many LabelTagging entities in bulk.
  644. type LabelTaggingCreateBulk struct {
  645. config
  646. err error
  647. builders []*LabelTaggingCreate
  648. conflict []sql.ConflictOption
  649. }
  650. // Save creates the LabelTagging entities in the database.
  651. func (ltcb *LabelTaggingCreateBulk) Save(ctx context.Context) ([]*LabelTagging, error) {
  652. if ltcb.err != nil {
  653. return nil, ltcb.err
  654. }
  655. specs := make([]*sqlgraph.CreateSpec, len(ltcb.builders))
  656. nodes := make([]*LabelTagging, len(ltcb.builders))
  657. mutators := make([]Mutator, len(ltcb.builders))
  658. for i := range ltcb.builders {
  659. func(i int, root context.Context) {
  660. builder := ltcb.builders[i]
  661. builder.defaults()
  662. var mut Mutator = MutateFunc(func(ctx context.Context, m Mutation) (Value, error) {
  663. mutation, ok := m.(*LabelTaggingMutation)
  664. if !ok {
  665. return nil, fmt.Errorf("unexpected mutation type %T", m)
  666. }
  667. if err := builder.check(); err != nil {
  668. return nil, err
  669. }
  670. builder.mutation = mutation
  671. var err error
  672. nodes[i], specs[i] = builder.createSpec()
  673. if i < len(mutators)-1 {
  674. _, err = mutators[i+1].Mutate(root, ltcb.builders[i+1].mutation)
  675. } else {
  676. spec := &sqlgraph.BatchCreateSpec{Nodes: specs}
  677. spec.OnConflict = ltcb.conflict
  678. // Invoke the actual operation on the latest mutation in the chain.
  679. if err = sqlgraph.BatchCreate(ctx, ltcb.driver, spec); err != nil {
  680. if sqlgraph.IsConstraintError(err) {
  681. err = &ConstraintError{msg: err.Error(), wrap: err}
  682. }
  683. }
  684. }
  685. if err != nil {
  686. return nil, err
  687. }
  688. mutation.id = &nodes[i].ID
  689. if specs[i].ID.Value != nil && nodes[i].ID == 0 {
  690. id := specs[i].ID.Value.(int64)
  691. nodes[i].ID = uint64(id)
  692. }
  693. mutation.done = true
  694. return nodes[i], nil
  695. })
  696. for i := len(builder.hooks) - 1; i >= 0; i-- {
  697. mut = builder.hooks[i](mut)
  698. }
  699. mutators[i] = mut
  700. }(i, ctx)
  701. }
  702. if len(mutators) > 0 {
  703. if _, err := mutators[0].Mutate(ctx, ltcb.builders[0].mutation); err != nil {
  704. return nil, err
  705. }
  706. }
  707. return nodes, nil
  708. }
  709. // SaveX is like Save, but panics if an error occurs.
  710. func (ltcb *LabelTaggingCreateBulk) SaveX(ctx context.Context) []*LabelTagging {
  711. v, err := ltcb.Save(ctx)
  712. if err != nil {
  713. panic(err)
  714. }
  715. return v
  716. }
  717. // Exec executes the query.
  718. func (ltcb *LabelTaggingCreateBulk) Exec(ctx context.Context) error {
  719. _, err := ltcb.Save(ctx)
  720. return err
  721. }
  722. // ExecX is like Exec, but panics if an error occurs.
  723. func (ltcb *LabelTaggingCreateBulk) ExecX(ctx context.Context) {
  724. if err := ltcb.Exec(ctx); err != nil {
  725. panic(err)
  726. }
  727. }
  728. // OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause
  729. // of the `INSERT` statement. For example:
  730. //
  731. // client.LabelTagging.CreateBulk(builders...).
  732. // OnConflict(
  733. // // Update the row with the new values
  734. // // the was proposed for insertion.
  735. // sql.ResolveWithNewValues(),
  736. // ).
  737. // // Override some of the fields with custom
  738. // // update values.
  739. // Update(func(u *ent.LabelTaggingUpsert) {
  740. // SetCreatedAt(v+v).
  741. // }).
  742. // Exec(ctx)
  743. func (ltcb *LabelTaggingCreateBulk) OnConflict(opts ...sql.ConflictOption) *LabelTaggingUpsertBulk {
  744. ltcb.conflict = opts
  745. return &LabelTaggingUpsertBulk{
  746. create: ltcb,
  747. }
  748. }
  749. // OnConflictColumns calls `OnConflict` and configures the columns
  750. // as conflict target. Using this option is equivalent to using:
  751. //
  752. // client.LabelTagging.Create().
  753. // OnConflict(sql.ConflictColumns(columns...)).
  754. // Exec(ctx)
  755. func (ltcb *LabelTaggingCreateBulk) OnConflictColumns(columns ...string) *LabelTaggingUpsertBulk {
  756. ltcb.conflict = append(ltcb.conflict, sql.ConflictColumns(columns...))
  757. return &LabelTaggingUpsertBulk{
  758. create: ltcb,
  759. }
  760. }
  761. // LabelTaggingUpsertBulk is the builder for "upsert"-ing
  762. // a bulk of LabelTagging nodes.
  763. type LabelTaggingUpsertBulk struct {
  764. create *LabelTaggingCreateBulk
  765. }
  766. // UpdateNewValues updates the mutable fields using the new values that
  767. // were set on create. Using this option is equivalent to using:
  768. //
  769. // client.LabelTagging.Create().
  770. // OnConflict(
  771. // sql.ResolveWithNewValues(),
  772. // sql.ResolveWith(func(u *sql.UpdateSet) {
  773. // u.SetIgnore(labeltagging.FieldID)
  774. // }),
  775. // ).
  776. // Exec(ctx)
  777. func (u *LabelTaggingUpsertBulk) UpdateNewValues() *LabelTaggingUpsertBulk {
  778. u.create.conflict = append(u.create.conflict, sql.ResolveWithNewValues())
  779. u.create.conflict = append(u.create.conflict, sql.ResolveWith(func(s *sql.UpdateSet) {
  780. for _, b := range u.create.builders {
  781. if _, exists := b.mutation.ID(); exists {
  782. s.SetIgnore(labeltagging.FieldID)
  783. }
  784. if _, exists := b.mutation.CreatedAt(); exists {
  785. s.SetIgnore(labeltagging.FieldCreatedAt)
  786. }
  787. }
  788. }))
  789. return u
  790. }
  791. // Ignore sets each column to itself in case of conflict.
  792. // Using this option is equivalent to using:
  793. //
  794. // client.LabelTagging.Create().
  795. // OnConflict(sql.ResolveWithIgnore()).
  796. // Exec(ctx)
  797. func (u *LabelTaggingUpsertBulk) Ignore() *LabelTaggingUpsertBulk {
  798. u.create.conflict = append(u.create.conflict, sql.ResolveWithIgnore())
  799. return u
  800. }
  801. // DoNothing configures the conflict_action to `DO NOTHING`.
  802. // Supported only by SQLite and PostgreSQL.
  803. func (u *LabelTaggingUpsertBulk) DoNothing() *LabelTaggingUpsertBulk {
  804. u.create.conflict = append(u.create.conflict, sql.DoNothing())
  805. return u
  806. }
  807. // Update allows overriding fields `UPDATE` values. See the LabelTaggingCreateBulk.OnConflict
  808. // documentation for more info.
  809. func (u *LabelTaggingUpsertBulk) Update(set func(*LabelTaggingUpsert)) *LabelTaggingUpsertBulk {
  810. u.create.conflict = append(u.create.conflict, sql.ResolveWith(func(update *sql.UpdateSet) {
  811. set(&LabelTaggingUpsert{UpdateSet: update})
  812. }))
  813. return u
  814. }
  815. // SetUpdatedAt sets the "updated_at" field.
  816. func (u *LabelTaggingUpsertBulk) SetUpdatedAt(v time.Time) *LabelTaggingUpsertBulk {
  817. return u.Update(func(s *LabelTaggingUpsert) {
  818. s.SetUpdatedAt(v)
  819. })
  820. }
  821. // UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.
  822. func (u *LabelTaggingUpsertBulk) UpdateUpdatedAt() *LabelTaggingUpsertBulk {
  823. return u.Update(func(s *LabelTaggingUpsert) {
  824. s.UpdateUpdatedAt()
  825. })
  826. }
  827. // SetStatus sets the "status" field.
  828. func (u *LabelTaggingUpsertBulk) SetStatus(v uint8) *LabelTaggingUpsertBulk {
  829. return u.Update(func(s *LabelTaggingUpsert) {
  830. s.SetStatus(v)
  831. })
  832. }
  833. // AddStatus adds v to the "status" field.
  834. func (u *LabelTaggingUpsertBulk) AddStatus(v uint8) *LabelTaggingUpsertBulk {
  835. return u.Update(func(s *LabelTaggingUpsert) {
  836. s.AddStatus(v)
  837. })
  838. }
  839. // UpdateStatus sets the "status" field to the value that was provided on create.
  840. func (u *LabelTaggingUpsertBulk) UpdateStatus() *LabelTaggingUpsertBulk {
  841. return u.Update(func(s *LabelTaggingUpsert) {
  842. s.UpdateStatus()
  843. })
  844. }
  845. // ClearStatus clears the value of the "status" field.
  846. func (u *LabelTaggingUpsertBulk) ClearStatus() *LabelTaggingUpsertBulk {
  847. return u.Update(func(s *LabelTaggingUpsert) {
  848. s.ClearStatus()
  849. })
  850. }
  851. // SetDeletedAt sets the "deleted_at" field.
  852. func (u *LabelTaggingUpsertBulk) SetDeletedAt(v time.Time) *LabelTaggingUpsertBulk {
  853. return u.Update(func(s *LabelTaggingUpsert) {
  854. s.SetDeletedAt(v)
  855. })
  856. }
  857. // UpdateDeletedAt sets the "deleted_at" field to the value that was provided on create.
  858. func (u *LabelTaggingUpsertBulk) UpdateDeletedAt() *LabelTaggingUpsertBulk {
  859. return u.Update(func(s *LabelTaggingUpsert) {
  860. s.UpdateDeletedAt()
  861. })
  862. }
  863. // ClearDeletedAt clears the value of the "deleted_at" field.
  864. func (u *LabelTaggingUpsertBulk) ClearDeletedAt() *LabelTaggingUpsertBulk {
  865. return u.Update(func(s *LabelTaggingUpsert) {
  866. s.ClearDeletedAt()
  867. })
  868. }
  869. // SetOrganizationID sets the "organization_id" field.
  870. func (u *LabelTaggingUpsertBulk) SetOrganizationID(v uint64) *LabelTaggingUpsertBulk {
  871. return u.Update(func(s *LabelTaggingUpsert) {
  872. s.SetOrganizationID(v)
  873. })
  874. }
  875. // AddOrganizationID adds v to the "organization_id" field.
  876. func (u *LabelTaggingUpsertBulk) AddOrganizationID(v uint64) *LabelTaggingUpsertBulk {
  877. return u.Update(func(s *LabelTaggingUpsert) {
  878. s.AddOrganizationID(v)
  879. })
  880. }
  881. // UpdateOrganizationID sets the "organization_id" field to the value that was provided on create.
  882. func (u *LabelTaggingUpsertBulk) UpdateOrganizationID() *LabelTaggingUpsertBulk {
  883. return u.Update(func(s *LabelTaggingUpsert) {
  884. s.UpdateOrganizationID()
  885. })
  886. }
  887. // SetType sets the "type" field.
  888. func (u *LabelTaggingUpsertBulk) SetType(v int) *LabelTaggingUpsertBulk {
  889. return u.Update(func(s *LabelTaggingUpsert) {
  890. s.SetType(v)
  891. })
  892. }
  893. // AddType adds v to the "type" field.
  894. func (u *LabelTaggingUpsertBulk) AddType(v int) *LabelTaggingUpsertBulk {
  895. return u.Update(func(s *LabelTaggingUpsert) {
  896. s.AddType(v)
  897. })
  898. }
  899. // UpdateType sets the "type" field to the value that was provided on create.
  900. func (u *LabelTaggingUpsertBulk) UpdateType() *LabelTaggingUpsertBulk {
  901. return u.Update(func(s *LabelTaggingUpsert) {
  902. s.UpdateType()
  903. })
  904. }
  905. // SetConditions sets the "conditions" field.
  906. func (u *LabelTaggingUpsertBulk) SetConditions(v string) *LabelTaggingUpsertBulk {
  907. return u.Update(func(s *LabelTaggingUpsert) {
  908. s.SetConditions(v)
  909. })
  910. }
  911. // UpdateConditions sets the "conditions" field to the value that was provided on create.
  912. func (u *LabelTaggingUpsertBulk) UpdateConditions() *LabelTaggingUpsertBulk {
  913. return u.Update(func(s *LabelTaggingUpsert) {
  914. s.UpdateConditions()
  915. })
  916. }
  917. // SetActionLabelAdd sets the "action_label_add" field.
  918. func (u *LabelTaggingUpsertBulk) SetActionLabelAdd(v []uint64) *LabelTaggingUpsertBulk {
  919. return u.Update(func(s *LabelTaggingUpsert) {
  920. s.SetActionLabelAdd(v)
  921. })
  922. }
  923. // UpdateActionLabelAdd sets the "action_label_add" field to the value that was provided on create.
  924. func (u *LabelTaggingUpsertBulk) UpdateActionLabelAdd() *LabelTaggingUpsertBulk {
  925. return u.Update(func(s *LabelTaggingUpsert) {
  926. s.UpdateActionLabelAdd()
  927. })
  928. }
  929. // ClearActionLabelAdd clears the value of the "action_label_add" field.
  930. func (u *LabelTaggingUpsertBulk) ClearActionLabelAdd() *LabelTaggingUpsertBulk {
  931. return u.Update(func(s *LabelTaggingUpsert) {
  932. s.ClearActionLabelAdd()
  933. })
  934. }
  935. // SetActionLabelDel sets the "action_label_del" field.
  936. func (u *LabelTaggingUpsertBulk) SetActionLabelDel(v []uint64) *LabelTaggingUpsertBulk {
  937. return u.Update(func(s *LabelTaggingUpsert) {
  938. s.SetActionLabelDel(v)
  939. })
  940. }
  941. // UpdateActionLabelDel sets the "action_label_del" field to the value that was provided on create.
  942. func (u *LabelTaggingUpsertBulk) UpdateActionLabelDel() *LabelTaggingUpsertBulk {
  943. return u.Update(func(s *LabelTaggingUpsert) {
  944. s.UpdateActionLabelDel()
  945. })
  946. }
  947. // ClearActionLabelDel clears the value of the "action_label_del" field.
  948. func (u *LabelTaggingUpsertBulk) ClearActionLabelDel() *LabelTaggingUpsertBulk {
  949. return u.Update(func(s *LabelTaggingUpsert) {
  950. s.ClearActionLabelDel()
  951. })
  952. }
  953. // Exec executes the query.
  954. func (u *LabelTaggingUpsertBulk) Exec(ctx context.Context) error {
  955. if u.create.err != nil {
  956. return u.create.err
  957. }
  958. for i, b := range u.create.builders {
  959. if len(b.conflict) != 0 {
  960. return fmt.Errorf("ent: OnConflict was set for builder %d. Set it on the LabelTaggingCreateBulk instead", i)
  961. }
  962. }
  963. if len(u.create.conflict) == 0 {
  964. return errors.New("ent: missing options for LabelTaggingCreateBulk.OnConflict")
  965. }
  966. return u.create.Exec(ctx)
  967. }
  968. // ExecX is like Exec, but panics if an error occurs.
  969. func (u *LabelTaggingUpsertBulk) ExecX(ctx context.Context) {
  970. if err := u.create.Exec(ctx); err != nil {
  971. panic(err)
  972. }
  973. }