where.go 36 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216
  1. // Code generated by entc, DO NOT EDIT.
  2. package machine
  3. import (
  4. "time"
  5. "entgo.io/ent/dialect/sql"
  6. "entgo.io/ent/dialect/sql/sqlgraph"
  7. "github.com/crowdsecurity/crowdsec/pkg/database/ent/predicate"
  8. )
  9. // ID filters vertices based on their ID field.
  10. func ID(id int) predicate.Machine {
  11. return predicate.Machine(func(s *sql.Selector) {
  12. s.Where(sql.EQ(s.C(FieldID), id))
  13. })
  14. }
  15. // IDEQ applies the EQ predicate on the ID field.
  16. func IDEQ(id int) predicate.Machine {
  17. return predicate.Machine(func(s *sql.Selector) {
  18. s.Where(sql.EQ(s.C(FieldID), id))
  19. })
  20. }
  21. // IDNEQ applies the NEQ predicate on the ID field.
  22. func IDNEQ(id int) predicate.Machine {
  23. return predicate.Machine(func(s *sql.Selector) {
  24. s.Where(sql.NEQ(s.C(FieldID), id))
  25. })
  26. }
  27. // IDIn applies the In predicate on the ID field.
  28. func IDIn(ids ...int) predicate.Machine {
  29. return predicate.Machine(func(s *sql.Selector) {
  30. // if not arguments were provided, append the FALSE constants,
  31. // since we can't apply "IN ()". This will make this predicate falsy.
  32. if len(ids) == 0 {
  33. s.Where(sql.False())
  34. return
  35. }
  36. v := make([]interface{}, len(ids))
  37. for i := range v {
  38. v[i] = ids[i]
  39. }
  40. s.Where(sql.In(s.C(FieldID), v...))
  41. })
  42. }
  43. // IDNotIn applies the NotIn predicate on the ID field.
  44. func IDNotIn(ids ...int) predicate.Machine {
  45. return predicate.Machine(func(s *sql.Selector) {
  46. // if not arguments were provided, append the FALSE constants,
  47. // since we can't apply "IN ()". This will make this predicate falsy.
  48. if len(ids) == 0 {
  49. s.Where(sql.False())
  50. return
  51. }
  52. v := make([]interface{}, len(ids))
  53. for i := range v {
  54. v[i] = ids[i]
  55. }
  56. s.Where(sql.NotIn(s.C(FieldID), v...))
  57. })
  58. }
  59. // IDGT applies the GT predicate on the ID field.
  60. func IDGT(id int) predicate.Machine {
  61. return predicate.Machine(func(s *sql.Selector) {
  62. s.Where(sql.GT(s.C(FieldID), id))
  63. })
  64. }
  65. // IDGTE applies the GTE predicate on the ID field.
  66. func IDGTE(id int) predicate.Machine {
  67. return predicate.Machine(func(s *sql.Selector) {
  68. s.Where(sql.GTE(s.C(FieldID), id))
  69. })
  70. }
  71. // IDLT applies the LT predicate on the ID field.
  72. func IDLT(id int) predicate.Machine {
  73. return predicate.Machine(func(s *sql.Selector) {
  74. s.Where(sql.LT(s.C(FieldID), id))
  75. })
  76. }
  77. // IDLTE applies the LTE predicate on the ID field.
  78. func IDLTE(id int) predicate.Machine {
  79. return predicate.Machine(func(s *sql.Selector) {
  80. s.Where(sql.LTE(s.C(FieldID), id))
  81. })
  82. }
  83. // CreatedAt applies equality check predicate on the "created_at" field. It's identical to CreatedAtEQ.
  84. func CreatedAt(v time.Time) predicate.Machine {
  85. return predicate.Machine(func(s *sql.Selector) {
  86. s.Where(sql.EQ(s.C(FieldCreatedAt), v))
  87. })
  88. }
  89. // UpdatedAt applies equality check predicate on the "updated_at" field. It's identical to UpdatedAtEQ.
  90. func UpdatedAt(v time.Time) predicate.Machine {
  91. return predicate.Machine(func(s *sql.Selector) {
  92. s.Where(sql.EQ(s.C(FieldUpdatedAt), v))
  93. })
  94. }
  95. // LastPush applies equality check predicate on the "last_push" field. It's identical to LastPushEQ.
  96. func LastPush(v time.Time) predicate.Machine {
  97. return predicate.Machine(func(s *sql.Selector) {
  98. s.Where(sql.EQ(s.C(FieldLastPush), v))
  99. })
  100. }
  101. // MachineId applies equality check predicate on the "machineId" field. It's identical to MachineIdEQ.
  102. func MachineId(v string) predicate.Machine {
  103. return predicate.Machine(func(s *sql.Selector) {
  104. s.Where(sql.EQ(s.C(FieldMachineId), v))
  105. })
  106. }
  107. // Password applies equality check predicate on the "password" field. It's identical to PasswordEQ.
  108. func Password(v string) predicate.Machine {
  109. return predicate.Machine(func(s *sql.Selector) {
  110. s.Where(sql.EQ(s.C(FieldPassword), v))
  111. })
  112. }
  113. // IpAddress applies equality check predicate on the "ipAddress" field. It's identical to IpAddressEQ.
  114. func IpAddress(v string) predicate.Machine {
  115. return predicate.Machine(func(s *sql.Selector) {
  116. s.Where(sql.EQ(s.C(FieldIpAddress), v))
  117. })
  118. }
  119. // Scenarios applies equality check predicate on the "scenarios" field. It's identical to ScenariosEQ.
  120. func Scenarios(v string) predicate.Machine {
  121. return predicate.Machine(func(s *sql.Selector) {
  122. s.Where(sql.EQ(s.C(FieldScenarios), v))
  123. })
  124. }
  125. // Version applies equality check predicate on the "version" field. It's identical to VersionEQ.
  126. func Version(v string) predicate.Machine {
  127. return predicate.Machine(func(s *sql.Selector) {
  128. s.Where(sql.EQ(s.C(FieldVersion), v))
  129. })
  130. }
  131. // IsValidated applies equality check predicate on the "isValidated" field. It's identical to IsValidatedEQ.
  132. func IsValidated(v bool) predicate.Machine {
  133. return predicate.Machine(func(s *sql.Selector) {
  134. s.Where(sql.EQ(s.C(FieldIsValidated), v))
  135. })
  136. }
  137. // Status applies equality check predicate on the "status" field. It's identical to StatusEQ.
  138. func Status(v string) predicate.Machine {
  139. return predicate.Machine(func(s *sql.Selector) {
  140. s.Where(sql.EQ(s.C(FieldStatus), v))
  141. })
  142. }
  143. // CreatedAtEQ applies the EQ predicate on the "created_at" field.
  144. func CreatedAtEQ(v time.Time) predicate.Machine {
  145. return predicate.Machine(func(s *sql.Selector) {
  146. s.Where(sql.EQ(s.C(FieldCreatedAt), v))
  147. })
  148. }
  149. // CreatedAtNEQ applies the NEQ predicate on the "created_at" field.
  150. func CreatedAtNEQ(v time.Time) predicate.Machine {
  151. return predicate.Machine(func(s *sql.Selector) {
  152. s.Where(sql.NEQ(s.C(FieldCreatedAt), v))
  153. })
  154. }
  155. // CreatedAtIn applies the In predicate on the "created_at" field.
  156. func CreatedAtIn(vs ...time.Time) predicate.Machine {
  157. v := make([]interface{}, len(vs))
  158. for i := range v {
  159. v[i] = vs[i]
  160. }
  161. return predicate.Machine(func(s *sql.Selector) {
  162. // if not arguments were provided, append the FALSE constants,
  163. // since we can't apply "IN ()". This will make this predicate falsy.
  164. if len(v) == 0 {
  165. s.Where(sql.False())
  166. return
  167. }
  168. s.Where(sql.In(s.C(FieldCreatedAt), v...))
  169. })
  170. }
  171. // CreatedAtNotIn applies the NotIn predicate on the "created_at" field.
  172. func CreatedAtNotIn(vs ...time.Time) predicate.Machine {
  173. v := make([]interface{}, len(vs))
  174. for i := range v {
  175. v[i] = vs[i]
  176. }
  177. return predicate.Machine(func(s *sql.Selector) {
  178. // if not arguments were provided, append the FALSE constants,
  179. // since we can't apply "IN ()". This will make this predicate falsy.
  180. if len(v) == 0 {
  181. s.Where(sql.False())
  182. return
  183. }
  184. s.Where(sql.NotIn(s.C(FieldCreatedAt), v...))
  185. })
  186. }
  187. // CreatedAtGT applies the GT predicate on the "created_at" field.
  188. func CreatedAtGT(v time.Time) predicate.Machine {
  189. return predicate.Machine(func(s *sql.Selector) {
  190. s.Where(sql.GT(s.C(FieldCreatedAt), v))
  191. })
  192. }
  193. // CreatedAtGTE applies the GTE predicate on the "created_at" field.
  194. func CreatedAtGTE(v time.Time) predicate.Machine {
  195. return predicate.Machine(func(s *sql.Selector) {
  196. s.Where(sql.GTE(s.C(FieldCreatedAt), v))
  197. })
  198. }
  199. // CreatedAtLT applies the LT predicate on the "created_at" field.
  200. func CreatedAtLT(v time.Time) predicate.Machine {
  201. return predicate.Machine(func(s *sql.Selector) {
  202. s.Where(sql.LT(s.C(FieldCreatedAt), v))
  203. })
  204. }
  205. // CreatedAtLTE applies the LTE predicate on the "created_at" field.
  206. func CreatedAtLTE(v time.Time) predicate.Machine {
  207. return predicate.Machine(func(s *sql.Selector) {
  208. s.Where(sql.LTE(s.C(FieldCreatedAt), v))
  209. })
  210. }
  211. // CreatedAtIsNil applies the IsNil predicate on the "created_at" field.
  212. func CreatedAtIsNil() predicate.Machine {
  213. return predicate.Machine(func(s *sql.Selector) {
  214. s.Where(sql.IsNull(s.C(FieldCreatedAt)))
  215. })
  216. }
  217. // CreatedAtNotNil applies the NotNil predicate on the "created_at" field.
  218. func CreatedAtNotNil() predicate.Machine {
  219. return predicate.Machine(func(s *sql.Selector) {
  220. s.Where(sql.NotNull(s.C(FieldCreatedAt)))
  221. })
  222. }
  223. // UpdatedAtEQ applies the EQ predicate on the "updated_at" field.
  224. func UpdatedAtEQ(v time.Time) predicate.Machine {
  225. return predicate.Machine(func(s *sql.Selector) {
  226. s.Where(sql.EQ(s.C(FieldUpdatedAt), v))
  227. })
  228. }
  229. // UpdatedAtNEQ applies the NEQ predicate on the "updated_at" field.
  230. func UpdatedAtNEQ(v time.Time) predicate.Machine {
  231. return predicate.Machine(func(s *sql.Selector) {
  232. s.Where(sql.NEQ(s.C(FieldUpdatedAt), v))
  233. })
  234. }
  235. // UpdatedAtIn applies the In predicate on the "updated_at" field.
  236. func UpdatedAtIn(vs ...time.Time) predicate.Machine {
  237. v := make([]interface{}, len(vs))
  238. for i := range v {
  239. v[i] = vs[i]
  240. }
  241. return predicate.Machine(func(s *sql.Selector) {
  242. // if not arguments were provided, append the FALSE constants,
  243. // since we can't apply "IN ()". This will make this predicate falsy.
  244. if len(v) == 0 {
  245. s.Where(sql.False())
  246. return
  247. }
  248. s.Where(sql.In(s.C(FieldUpdatedAt), v...))
  249. })
  250. }
  251. // UpdatedAtNotIn applies the NotIn predicate on the "updated_at" field.
  252. func UpdatedAtNotIn(vs ...time.Time) predicate.Machine {
  253. v := make([]interface{}, len(vs))
  254. for i := range v {
  255. v[i] = vs[i]
  256. }
  257. return predicate.Machine(func(s *sql.Selector) {
  258. // if not arguments were provided, append the FALSE constants,
  259. // since we can't apply "IN ()". This will make this predicate falsy.
  260. if len(v) == 0 {
  261. s.Where(sql.False())
  262. return
  263. }
  264. s.Where(sql.NotIn(s.C(FieldUpdatedAt), v...))
  265. })
  266. }
  267. // UpdatedAtGT applies the GT predicate on the "updated_at" field.
  268. func UpdatedAtGT(v time.Time) predicate.Machine {
  269. return predicate.Machine(func(s *sql.Selector) {
  270. s.Where(sql.GT(s.C(FieldUpdatedAt), v))
  271. })
  272. }
  273. // UpdatedAtGTE applies the GTE predicate on the "updated_at" field.
  274. func UpdatedAtGTE(v time.Time) predicate.Machine {
  275. return predicate.Machine(func(s *sql.Selector) {
  276. s.Where(sql.GTE(s.C(FieldUpdatedAt), v))
  277. })
  278. }
  279. // UpdatedAtLT applies the LT predicate on the "updated_at" field.
  280. func UpdatedAtLT(v time.Time) predicate.Machine {
  281. return predicate.Machine(func(s *sql.Selector) {
  282. s.Where(sql.LT(s.C(FieldUpdatedAt), v))
  283. })
  284. }
  285. // UpdatedAtLTE applies the LTE predicate on the "updated_at" field.
  286. func UpdatedAtLTE(v time.Time) predicate.Machine {
  287. return predicate.Machine(func(s *sql.Selector) {
  288. s.Where(sql.LTE(s.C(FieldUpdatedAt), v))
  289. })
  290. }
  291. // UpdatedAtIsNil applies the IsNil predicate on the "updated_at" field.
  292. func UpdatedAtIsNil() predicate.Machine {
  293. return predicate.Machine(func(s *sql.Selector) {
  294. s.Where(sql.IsNull(s.C(FieldUpdatedAt)))
  295. })
  296. }
  297. // UpdatedAtNotNil applies the NotNil predicate on the "updated_at" field.
  298. func UpdatedAtNotNil() predicate.Machine {
  299. return predicate.Machine(func(s *sql.Selector) {
  300. s.Where(sql.NotNull(s.C(FieldUpdatedAt)))
  301. })
  302. }
  303. // LastPushEQ applies the EQ predicate on the "last_push" field.
  304. func LastPushEQ(v time.Time) predicate.Machine {
  305. return predicate.Machine(func(s *sql.Selector) {
  306. s.Where(sql.EQ(s.C(FieldLastPush), v))
  307. })
  308. }
  309. // LastPushNEQ applies the NEQ predicate on the "last_push" field.
  310. func LastPushNEQ(v time.Time) predicate.Machine {
  311. return predicate.Machine(func(s *sql.Selector) {
  312. s.Where(sql.NEQ(s.C(FieldLastPush), v))
  313. })
  314. }
  315. // LastPushIn applies the In predicate on the "last_push" field.
  316. func LastPushIn(vs ...time.Time) predicate.Machine {
  317. v := make([]interface{}, len(vs))
  318. for i := range v {
  319. v[i] = vs[i]
  320. }
  321. return predicate.Machine(func(s *sql.Selector) {
  322. // if not arguments were provided, append the FALSE constants,
  323. // since we can't apply "IN ()". This will make this predicate falsy.
  324. if len(v) == 0 {
  325. s.Where(sql.False())
  326. return
  327. }
  328. s.Where(sql.In(s.C(FieldLastPush), v...))
  329. })
  330. }
  331. // LastPushNotIn applies the NotIn predicate on the "last_push" field.
  332. func LastPushNotIn(vs ...time.Time) predicate.Machine {
  333. v := make([]interface{}, len(vs))
  334. for i := range v {
  335. v[i] = vs[i]
  336. }
  337. return predicate.Machine(func(s *sql.Selector) {
  338. // if not arguments were provided, append the FALSE constants,
  339. // since we can't apply "IN ()". This will make this predicate falsy.
  340. if len(v) == 0 {
  341. s.Where(sql.False())
  342. return
  343. }
  344. s.Where(sql.NotIn(s.C(FieldLastPush), v...))
  345. })
  346. }
  347. // LastPushGT applies the GT predicate on the "last_push" field.
  348. func LastPushGT(v time.Time) predicate.Machine {
  349. return predicate.Machine(func(s *sql.Selector) {
  350. s.Where(sql.GT(s.C(FieldLastPush), v))
  351. })
  352. }
  353. // LastPushGTE applies the GTE predicate on the "last_push" field.
  354. func LastPushGTE(v time.Time) predicate.Machine {
  355. return predicate.Machine(func(s *sql.Selector) {
  356. s.Where(sql.GTE(s.C(FieldLastPush), v))
  357. })
  358. }
  359. // LastPushLT applies the LT predicate on the "last_push" field.
  360. func LastPushLT(v time.Time) predicate.Machine {
  361. return predicate.Machine(func(s *sql.Selector) {
  362. s.Where(sql.LT(s.C(FieldLastPush), v))
  363. })
  364. }
  365. // LastPushLTE applies the LTE predicate on the "last_push" field.
  366. func LastPushLTE(v time.Time) predicate.Machine {
  367. return predicate.Machine(func(s *sql.Selector) {
  368. s.Where(sql.LTE(s.C(FieldLastPush), v))
  369. })
  370. }
  371. // LastPushIsNil applies the IsNil predicate on the "last_push" field.
  372. func LastPushIsNil() predicate.Machine {
  373. return predicate.Machine(func(s *sql.Selector) {
  374. s.Where(sql.IsNull(s.C(FieldLastPush)))
  375. })
  376. }
  377. // LastPushNotNil applies the NotNil predicate on the "last_push" field.
  378. func LastPushNotNil() predicate.Machine {
  379. return predicate.Machine(func(s *sql.Selector) {
  380. s.Where(sql.NotNull(s.C(FieldLastPush)))
  381. })
  382. }
  383. // MachineIdEQ applies the EQ predicate on the "machineId" field.
  384. func MachineIdEQ(v string) predicate.Machine {
  385. return predicate.Machine(func(s *sql.Selector) {
  386. s.Where(sql.EQ(s.C(FieldMachineId), v))
  387. })
  388. }
  389. // MachineIdNEQ applies the NEQ predicate on the "machineId" field.
  390. func MachineIdNEQ(v string) predicate.Machine {
  391. return predicate.Machine(func(s *sql.Selector) {
  392. s.Where(sql.NEQ(s.C(FieldMachineId), v))
  393. })
  394. }
  395. // MachineIdIn applies the In predicate on the "machineId" field.
  396. func MachineIdIn(vs ...string) predicate.Machine {
  397. v := make([]interface{}, len(vs))
  398. for i := range v {
  399. v[i] = vs[i]
  400. }
  401. return predicate.Machine(func(s *sql.Selector) {
  402. // if not arguments were provided, append the FALSE constants,
  403. // since we can't apply "IN ()". This will make this predicate falsy.
  404. if len(v) == 0 {
  405. s.Where(sql.False())
  406. return
  407. }
  408. s.Where(sql.In(s.C(FieldMachineId), v...))
  409. })
  410. }
  411. // MachineIdNotIn applies the NotIn predicate on the "machineId" field.
  412. func MachineIdNotIn(vs ...string) predicate.Machine {
  413. v := make([]interface{}, len(vs))
  414. for i := range v {
  415. v[i] = vs[i]
  416. }
  417. return predicate.Machine(func(s *sql.Selector) {
  418. // if not arguments were provided, append the FALSE constants,
  419. // since we can't apply "IN ()". This will make this predicate falsy.
  420. if len(v) == 0 {
  421. s.Where(sql.False())
  422. return
  423. }
  424. s.Where(sql.NotIn(s.C(FieldMachineId), v...))
  425. })
  426. }
  427. // MachineIdGT applies the GT predicate on the "machineId" field.
  428. func MachineIdGT(v string) predicate.Machine {
  429. return predicate.Machine(func(s *sql.Selector) {
  430. s.Where(sql.GT(s.C(FieldMachineId), v))
  431. })
  432. }
  433. // MachineIdGTE applies the GTE predicate on the "machineId" field.
  434. func MachineIdGTE(v string) predicate.Machine {
  435. return predicate.Machine(func(s *sql.Selector) {
  436. s.Where(sql.GTE(s.C(FieldMachineId), v))
  437. })
  438. }
  439. // MachineIdLT applies the LT predicate on the "machineId" field.
  440. func MachineIdLT(v string) predicate.Machine {
  441. return predicate.Machine(func(s *sql.Selector) {
  442. s.Where(sql.LT(s.C(FieldMachineId), v))
  443. })
  444. }
  445. // MachineIdLTE applies the LTE predicate on the "machineId" field.
  446. func MachineIdLTE(v string) predicate.Machine {
  447. return predicate.Machine(func(s *sql.Selector) {
  448. s.Where(sql.LTE(s.C(FieldMachineId), v))
  449. })
  450. }
  451. // MachineIdContains applies the Contains predicate on the "machineId" field.
  452. func MachineIdContains(v string) predicate.Machine {
  453. return predicate.Machine(func(s *sql.Selector) {
  454. s.Where(sql.Contains(s.C(FieldMachineId), v))
  455. })
  456. }
  457. // MachineIdHasPrefix applies the HasPrefix predicate on the "machineId" field.
  458. func MachineIdHasPrefix(v string) predicate.Machine {
  459. return predicate.Machine(func(s *sql.Selector) {
  460. s.Where(sql.HasPrefix(s.C(FieldMachineId), v))
  461. })
  462. }
  463. // MachineIdHasSuffix applies the HasSuffix predicate on the "machineId" field.
  464. func MachineIdHasSuffix(v string) predicate.Machine {
  465. return predicate.Machine(func(s *sql.Selector) {
  466. s.Where(sql.HasSuffix(s.C(FieldMachineId), v))
  467. })
  468. }
  469. // MachineIdEqualFold applies the EqualFold predicate on the "machineId" field.
  470. func MachineIdEqualFold(v string) predicate.Machine {
  471. return predicate.Machine(func(s *sql.Selector) {
  472. s.Where(sql.EqualFold(s.C(FieldMachineId), v))
  473. })
  474. }
  475. // MachineIdContainsFold applies the ContainsFold predicate on the "machineId" field.
  476. func MachineIdContainsFold(v string) predicate.Machine {
  477. return predicate.Machine(func(s *sql.Selector) {
  478. s.Where(sql.ContainsFold(s.C(FieldMachineId), v))
  479. })
  480. }
  481. // PasswordEQ applies the EQ predicate on the "password" field.
  482. func PasswordEQ(v string) predicate.Machine {
  483. return predicate.Machine(func(s *sql.Selector) {
  484. s.Where(sql.EQ(s.C(FieldPassword), v))
  485. })
  486. }
  487. // PasswordNEQ applies the NEQ predicate on the "password" field.
  488. func PasswordNEQ(v string) predicate.Machine {
  489. return predicate.Machine(func(s *sql.Selector) {
  490. s.Where(sql.NEQ(s.C(FieldPassword), v))
  491. })
  492. }
  493. // PasswordIn applies the In predicate on the "password" field.
  494. func PasswordIn(vs ...string) predicate.Machine {
  495. v := make([]interface{}, len(vs))
  496. for i := range v {
  497. v[i] = vs[i]
  498. }
  499. return predicate.Machine(func(s *sql.Selector) {
  500. // if not arguments were provided, append the FALSE constants,
  501. // since we can't apply "IN ()". This will make this predicate falsy.
  502. if len(v) == 0 {
  503. s.Where(sql.False())
  504. return
  505. }
  506. s.Where(sql.In(s.C(FieldPassword), v...))
  507. })
  508. }
  509. // PasswordNotIn applies the NotIn predicate on the "password" field.
  510. func PasswordNotIn(vs ...string) predicate.Machine {
  511. v := make([]interface{}, len(vs))
  512. for i := range v {
  513. v[i] = vs[i]
  514. }
  515. return predicate.Machine(func(s *sql.Selector) {
  516. // if not arguments were provided, append the FALSE constants,
  517. // since we can't apply "IN ()". This will make this predicate falsy.
  518. if len(v) == 0 {
  519. s.Where(sql.False())
  520. return
  521. }
  522. s.Where(sql.NotIn(s.C(FieldPassword), v...))
  523. })
  524. }
  525. // PasswordGT applies the GT predicate on the "password" field.
  526. func PasswordGT(v string) predicate.Machine {
  527. return predicate.Machine(func(s *sql.Selector) {
  528. s.Where(sql.GT(s.C(FieldPassword), v))
  529. })
  530. }
  531. // PasswordGTE applies the GTE predicate on the "password" field.
  532. func PasswordGTE(v string) predicate.Machine {
  533. return predicate.Machine(func(s *sql.Selector) {
  534. s.Where(sql.GTE(s.C(FieldPassword), v))
  535. })
  536. }
  537. // PasswordLT applies the LT predicate on the "password" field.
  538. func PasswordLT(v string) predicate.Machine {
  539. return predicate.Machine(func(s *sql.Selector) {
  540. s.Where(sql.LT(s.C(FieldPassword), v))
  541. })
  542. }
  543. // PasswordLTE applies the LTE predicate on the "password" field.
  544. func PasswordLTE(v string) predicate.Machine {
  545. return predicate.Machine(func(s *sql.Selector) {
  546. s.Where(sql.LTE(s.C(FieldPassword), v))
  547. })
  548. }
  549. // PasswordContains applies the Contains predicate on the "password" field.
  550. func PasswordContains(v string) predicate.Machine {
  551. return predicate.Machine(func(s *sql.Selector) {
  552. s.Where(sql.Contains(s.C(FieldPassword), v))
  553. })
  554. }
  555. // PasswordHasPrefix applies the HasPrefix predicate on the "password" field.
  556. func PasswordHasPrefix(v string) predicate.Machine {
  557. return predicate.Machine(func(s *sql.Selector) {
  558. s.Where(sql.HasPrefix(s.C(FieldPassword), v))
  559. })
  560. }
  561. // PasswordHasSuffix applies the HasSuffix predicate on the "password" field.
  562. func PasswordHasSuffix(v string) predicate.Machine {
  563. return predicate.Machine(func(s *sql.Selector) {
  564. s.Where(sql.HasSuffix(s.C(FieldPassword), v))
  565. })
  566. }
  567. // PasswordEqualFold applies the EqualFold predicate on the "password" field.
  568. func PasswordEqualFold(v string) predicate.Machine {
  569. return predicate.Machine(func(s *sql.Selector) {
  570. s.Where(sql.EqualFold(s.C(FieldPassword), v))
  571. })
  572. }
  573. // PasswordContainsFold applies the ContainsFold predicate on the "password" field.
  574. func PasswordContainsFold(v string) predicate.Machine {
  575. return predicate.Machine(func(s *sql.Selector) {
  576. s.Where(sql.ContainsFold(s.C(FieldPassword), v))
  577. })
  578. }
  579. // IpAddressEQ applies the EQ predicate on the "ipAddress" field.
  580. func IpAddressEQ(v string) predicate.Machine {
  581. return predicate.Machine(func(s *sql.Selector) {
  582. s.Where(sql.EQ(s.C(FieldIpAddress), v))
  583. })
  584. }
  585. // IpAddressNEQ applies the NEQ predicate on the "ipAddress" field.
  586. func IpAddressNEQ(v string) predicate.Machine {
  587. return predicate.Machine(func(s *sql.Selector) {
  588. s.Where(sql.NEQ(s.C(FieldIpAddress), v))
  589. })
  590. }
  591. // IpAddressIn applies the In predicate on the "ipAddress" field.
  592. func IpAddressIn(vs ...string) predicate.Machine {
  593. v := make([]interface{}, len(vs))
  594. for i := range v {
  595. v[i] = vs[i]
  596. }
  597. return predicate.Machine(func(s *sql.Selector) {
  598. // if not arguments were provided, append the FALSE constants,
  599. // since we can't apply "IN ()". This will make this predicate falsy.
  600. if len(v) == 0 {
  601. s.Where(sql.False())
  602. return
  603. }
  604. s.Where(sql.In(s.C(FieldIpAddress), v...))
  605. })
  606. }
  607. // IpAddressNotIn applies the NotIn predicate on the "ipAddress" field.
  608. func IpAddressNotIn(vs ...string) predicate.Machine {
  609. v := make([]interface{}, len(vs))
  610. for i := range v {
  611. v[i] = vs[i]
  612. }
  613. return predicate.Machine(func(s *sql.Selector) {
  614. // if not arguments were provided, append the FALSE constants,
  615. // since we can't apply "IN ()". This will make this predicate falsy.
  616. if len(v) == 0 {
  617. s.Where(sql.False())
  618. return
  619. }
  620. s.Where(sql.NotIn(s.C(FieldIpAddress), v...))
  621. })
  622. }
  623. // IpAddressGT applies the GT predicate on the "ipAddress" field.
  624. func IpAddressGT(v string) predicate.Machine {
  625. return predicate.Machine(func(s *sql.Selector) {
  626. s.Where(sql.GT(s.C(FieldIpAddress), v))
  627. })
  628. }
  629. // IpAddressGTE applies the GTE predicate on the "ipAddress" field.
  630. func IpAddressGTE(v string) predicate.Machine {
  631. return predicate.Machine(func(s *sql.Selector) {
  632. s.Where(sql.GTE(s.C(FieldIpAddress), v))
  633. })
  634. }
  635. // IpAddressLT applies the LT predicate on the "ipAddress" field.
  636. func IpAddressLT(v string) predicate.Machine {
  637. return predicate.Machine(func(s *sql.Selector) {
  638. s.Where(sql.LT(s.C(FieldIpAddress), v))
  639. })
  640. }
  641. // IpAddressLTE applies the LTE predicate on the "ipAddress" field.
  642. func IpAddressLTE(v string) predicate.Machine {
  643. return predicate.Machine(func(s *sql.Selector) {
  644. s.Where(sql.LTE(s.C(FieldIpAddress), v))
  645. })
  646. }
  647. // IpAddressContains applies the Contains predicate on the "ipAddress" field.
  648. func IpAddressContains(v string) predicate.Machine {
  649. return predicate.Machine(func(s *sql.Selector) {
  650. s.Where(sql.Contains(s.C(FieldIpAddress), v))
  651. })
  652. }
  653. // IpAddressHasPrefix applies the HasPrefix predicate on the "ipAddress" field.
  654. func IpAddressHasPrefix(v string) predicate.Machine {
  655. return predicate.Machine(func(s *sql.Selector) {
  656. s.Where(sql.HasPrefix(s.C(FieldIpAddress), v))
  657. })
  658. }
  659. // IpAddressHasSuffix applies the HasSuffix predicate on the "ipAddress" field.
  660. func IpAddressHasSuffix(v string) predicate.Machine {
  661. return predicate.Machine(func(s *sql.Selector) {
  662. s.Where(sql.HasSuffix(s.C(FieldIpAddress), v))
  663. })
  664. }
  665. // IpAddressEqualFold applies the EqualFold predicate on the "ipAddress" field.
  666. func IpAddressEqualFold(v string) predicate.Machine {
  667. return predicate.Machine(func(s *sql.Selector) {
  668. s.Where(sql.EqualFold(s.C(FieldIpAddress), v))
  669. })
  670. }
  671. // IpAddressContainsFold applies the ContainsFold predicate on the "ipAddress" field.
  672. func IpAddressContainsFold(v string) predicate.Machine {
  673. return predicate.Machine(func(s *sql.Selector) {
  674. s.Where(sql.ContainsFold(s.C(FieldIpAddress), v))
  675. })
  676. }
  677. // ScenariosEQ applies the EQ predicate on the "scenarios" field.
  678. func ScenariosEQ(v string) predicate.Machine {
  679. return predicate.Machine(func(s *sql.Selector) {
  680. s.Where(sql.EQ(s.C(FieldScenarios), v))
  681. })
  682. }
  683. // ScenariosNEQ applies the NEQ predicate on the "scenarios" field.
  684. func ScenariosNEQ(v string) predicate.Machine {
  685. return predicate.Machine(func(s *sql.Selector) {
  686. s.Where(sql.NEQ(s.C(FieldScenarios), v))
  687. })
  688. }
  689. // ScenariosIn applies the In predicate on the "scenarios" field.
  690. func ScenariosIn(vs ...string) predicate.Machine {
  691. v := make([]interface{}, len(vs))
  692. for i := range v {
  693. v[i] = vs[i]
  694. }
  695. return predicate.Machine(func(s *sql.Selector) {
  696. // if not arguments were provided, append the FALSE constants,
  697. // since we can't apply "IN ()". This will make this predicate falsy.
  698. if len(v) == 0 {
  699. s.Where(sql.False())
  700. return
  701. }
  702. s.Where(sql.In(s.C(FieldScenarios), v...))
  703. })
  704. }
  705. // ScenariosNotIn applies the NotIn predicate on the "scenarios" field.
  706. func ScenariosNotIn(vs ...string) predicate.Machine {
  707. v := make([]interface{}, len(vs))
  708. for i := range v {
  709. v[i] = vs[i]
  710. }
  711. return predicate.Machine(func(s *sql.Selector) {
  712. // if not arguments were provided, append the FALSE constants,
  713. // since we can't apply "IN ()". This will make this predicate falsy.
  714. if len(v) == 0 {
  715. s.Where(sql.False())
  716. return
  717. }
  718. s.Where(sql.NotIn(s.C(FieldScenarios), v...))
  719. })
  720. }
  721. // ScenariosGT applies the GT predicate on the "scenarios" field.
  722. func ScenariosGT(v string) predicate.Machine {
  723. return predicate.Machine(func(s *sql.Selector) {
  724. s.Where(sql.GT(s.C(FieldScenarios), v))
  725. })
  726. }
  727. // ScenariosGTE applies the GTE predicate on the "scenarios" field.
  728. func ScenariosGTE(v string) predicate.Machine {
  729. return predicate.Machine(func(s *sql.Selector) {
  730. s.Where(sql.GTE(s.C(FieldScenarios), v))
  731. })
  732. }
  733. // ScenariosLT applies the LT predicate on the "scenarios" field.
  734. func ScenariosLT(v string) predicate.Machine {
  735. return predicate.Machine(func(s *sql.Selector) {
  736. s.Where(sql.LT(s.C(FieldScenarios), v))
  737. })
  738. }
  739. // ScenariosLTE applies the LTE predicate on the "scenarios" field.
  740. func ScenariosLTE(v string) predicate.Machine {
  741. return predicate.Machine(func(s *sql.Selector) {
  742. s.Where(sql.LTE(s.C(FieldScenarios), v))
  743. })
  744. }
  745. // ScenariosContains applies the Contains predicate on the "scenarios" field.
  746. func ScenariosContains(v string) predicate.Machine {
  747. return predicate.Machine(func(s *sql.Selector) {
  748. s.Where(sql.Contains(s.C(FieldScenarios), v))
  749. })
  750. }
  751. // ScenariosHasPrefix applies the HasPrefix predicate on the "scenarios" field.
  752. func ScenariosHasPrefix(v string) predicate.Machine {
  753. return predicate.Machine(func(s *sql.Selector) {
  754. s.Where(sql.HasPrefix(s.C(FieldScenarios), v))
  755. })
  756. }
  757. // ScenariosHasSuffix applies the HasSuffix predicate on the "scenarios" field.
  758. func ScenariosHasSuffix(v string) predicate.Machine {
  759. return predicate.Machine(func(s *sql.Selector) {
  760. s.Where(sql.HasSuffix(s.C(FieldScenarios), v))
  761. })
  762. }
  763. // ScenariosIsNil applies the IsNil predicate on the "scenarios" field.
  764. func ScenariosIsNil() predicate.Machine {
  765. return predicate.Machine(func(s *sql.Selector) {
  766. s.Where(sql.IsNull(s.C(FieldScenarios)))
  767. })
  768. }
  769. // ScenariosNotNil applies the NotNil predicate on the "scenarios" field.
  770. func ScenariosNotNil() predicate.Machine {
  771. return predicate.Machine(func(s *sql.Selector) {
  772. s.Where(sql.NotNull(s.C(FieldScenarios)))
  773. })
  774. }
  775. // ScenariosEqualFold applies the EqualFold predicate on the "scenarios" field.
  776. func ScenariosEqualFold(v string) predicate.Machine {
  777. return predicate.Machine(func(s *sql.Selector) {
  778. s.Where(sql.EqualFold(s.C(FieldScenarios), v))
  779. })
  780. }
  781. // ScenariosContainsFold applies the ContainsFold predicate on the "scenarios" field.
  782. func ScenariosContainsFold(v string) predicate.Machine {
  783. return predicate.Machine(func(s *sql.Selector) {
  784. s.Where(sql.ContainsFold(s.C(FieldScenarios), v))
  785. })
  786. }
  787. // VersionEQ applies the EQ predicate on the "version" field.
  788. func VersionEQ(v string) predicate.Machine {
  789. return predicate.Machine(func(s *sql.Selector) {
  790. s.Where(sql.EQ(s.C(FieldVersion), v))
  791. })
  792. }
  793. // VersionNEQ applies the NEQ predicate on the "version" field.
  794. func VersionNEQ(v string) predicate.Machine {
  795. return predicate.Machine(func(s *sql.Selector) {
  796. s.Where(sql.NEQ(s.C(FieldVersion), v))
  797. })
  798. }
  799. // VersionIn applies the In predicate on the "version" field.
  800. func VersionIn(vs ...string) predicate.Machine {
  801. v := make([]interface{}, len(vs))
  802. for i := range v {
  803. v[i] = vs[i]
  804. }
  805. return predicate.Machine(func(s *sql.Selector) {
  806. // if not arguments were provided, append the FALSE constants,
  807. // since we can't apply "IN ()". This will make this predicate falsy.
  808. if len(v) == 0 {
  809. s.Where(sql.False())
  810. return
  811. }
  812. s.Where(sql.In(s.C(FieldVersion), v...))
  813. })
  814. }
  815. // VersionNotIn applies the NotIn predicate on the "version" field.
  816. func VersionNotIn(vs ...string) predicate.Machine {
  817. v := make([]interface{}, len(vs))
  818. for i := range v {
  819. v[i] = vs[i]
  820. }
  821. return predicate.Machine(func(s *sql.Selector) {
  822. // if not arguments were provided, append the FALSE constants,
  823. // since we can't apply "IN ()". This will make this predicate falsy.
  824. if len(v) == 0 {
  825. s.Where(sql.False())
  826. return
  827. }
  828. s.Where(sql.NotIn(s.C(FieldVersion), v...))
  829. })
  830. }
  831. // VersionGT applies the GT predicate on the "version" field.
  832. func VersionGT(v string) predicate.Machine {
  833. return predicate.Machine(func(s *sql.Selector) {
  834. s.Where(sql.GT(s.C(FieldVersion), v))
  835. })
  836. }
  837. // VersionGTE applies the GTE predicate on the "version" field.
  838. func VersionGTE(v string) predicate.Machine {
  839. return predicate.Machine(func(s *sql.Selector) {
  840. s.Where(sql.GTE(s.C(FieldVersion), v))
  841. })
  842. }
  843. // VersionLT applies the LT predicate on the "version" field.
  844. func VersionLT(v string) predicate.Machine {
  845. return predicate.Machine(func(s *sql.Selector) {
  846. s.Where(sql.LT(s.C(FieldVersion), v))
  847. })
  848. }
  849. // VersionLTE applies the LTE predicate on the "version" field.
  850. func VersionLTE(v string) predicate.Machine {
  851. return predicate.Machine(func(s *sql.Selector) {
  852. s.Where(sql.LTE(s.C(FieldVersion), v))
  853. })
  854. }
  855. // VersionContains applies the Contains predicate on the "version" field.
  856. func VersionContains(v string) predicate.Machine {
  857. return predicate.Machine(func(s *sql.Selector) {
  858. s.Where(sql.Contains(s.C(FieldVersion), v))
  859. })
  860. }
  861. // VersionHasPrefix applies the HasPrefix predicate on the "version" field.
  862. func VersionHasPrefix(v string) predicate.Machine {
  863. return predicate.Machine(func(s *sql.Selector) {
  864. s.Where(sql.HasPrefix(s.C(FieldVersion), v))
  865. })
  866. }
  867. // VersionHasSuffix applies the HasSuffix predicate on the "version" field.
  868. func VersionHasSuffix(v string) predicate.Machine {
  869. return predicate.Machine(func(s *sql.Selector) {
  870. s.Where(sql.HasSuffix(s.C(FieldVersion), v))
  871. })
  872. }
  873. // VersionIsNil applies the IsNil predicate on the "version" field.
  874. func VersionIsNil() predicate.Machine {
  875. return predicate.Machine(func(s *sql.Selector) {
  876. s.Where(sql.IsNull(s.C(FieldVersion)))
  877. })
  878. }
  879. // VersionNotNil applies the NotNil predicate on the "version" field.
  880. func VersionNotNil() predicate.Machine {
  881. return predicate.Machine(func(s *sql.Selector) {
  882. s.Where(sql.NotNull(s.C(FieldVersion)))
  883. })
  884. }
  885. // VersionEqualFold applies the EqualFold predicate on the "version" field.
  886. func VersionEqualFold(v string) predicate.Machine {
  887. return predicate.Machine(func(s *sql.Selector) {
  888. s.Where(sql.EqualFold(s.C(FieldVersion), v))
  889. })
  890. }
  891. // VersionContainsFold applies the ContainsFold predicate on the "version" field.
  892. func VersionContainsFold(v string) predicate.Machine {
  893. return predicate.Machine(func(s *sql.Selector) {
  894. s.Where(sql.ContainsFold(s.C(FieldVersion), v))
  895. })
  896. }
  897. // IsValidatedEQ applies the EQ predicate on the "isValidated" field.
  898. func IsValidatedEQ(v bool) predicate.Machine {
  899. return predicate.Machine(func(s *sql.Selector) {
  900. s.Where(sql.EQ(s.C(FieldIsValidated), v))
  901. })
  902. }
  903. // IsValidatedNEQ applies the NEQ predicate on the "isValidated" field.
  904. func IsValidatedNEQ(v bool) predicate.Machine {
  905. return predicate.Machine(func(s *sql.Selector) {
  906. s.Where(sql.NEQ(s.C(FieldIsValidated), v))
  907. })
  908. }
  909. // StatusEQ applies the EQ predicate on the "status" field.
  910. func StatusEQ(v string) predicate.Machine {
  911. return predicate.Machine(func(s *sql.Selector) {
  912. s.Where(sql.EQ(s.C(FieldStatus), v))
  913. })
  914. }
  915. // StatusNEQ applies the NEQ predicate on the "status" field.
  916. func StatusNEQ(v string) predicate.Machine {
  917. return predicate.Machine(func(s *sql.Selector) {
  918. s.Where(sql.NEQ(s.C(FieldStatus), v))
  919. })
  920. }
  921. // StatusIn applies the In predicate on the "status" field.
  922. func StatusIn(vs ...string) predicate.Machine {
  923. v := make([]interface{}, len(vs))
  924. for i := range v {
  925. v[i] = vs[i]
  926. }
  927. return predicate.Machine(func(s *sql.Selector) {
  928. // if not arguments were provided, append the FALSE constants,
  929. // since we can't apply "IN ()". This will make this predicate falsy.
  930. if len(v) == 0 {
  931. s.Where(sql.False())
  932. return
  933. }
  934. s.Where(sql.In(s.C(FieldStatus), v...))
  935. })
  936. }
  937. // StatusNotIn applies the NotIn predicate on the "status" field.
  938. func StatusNotIn(vs ...string) predicate.Machine {
  939. v := make([]interface{}, len(vs))
  940. for i := range v {
  941. v[i] = vs[i]
  942. }
  943. return predicate.Machine(func(s *sql.Selector) {
  944. // if not arguments were provided, append the FALSE constants,
  945. // since we can't apply "IN ()". This will make this predicate falsy.
  946. if len(v) == 0 {
  947. s.Where(sql.False())
  948. return
  949. }
  950. s.Where(sql.NotIn(s.C(FieldStatus), v...))
  951. })
  952. }
  953. // StatusGT applies the GT predicate on the "status" field.
  954. func StatusGT(v string) predicate.Machine {
  955. return predicate.Machine(func(s *sql.Selector) {
  956. s.Where(sql.GT(s.C(FieldStatus), v))
  957. })
  958. }
  959. // StatusGTE applies the GTE predicate on the "status" field.
  960. func StatusGTE(v string) predicate.Machine {
  961. return predicate.Machine(func(s *sql.Selector) {
  962. s.Where(sql.GTE(s.C(FieldStatus), v))
  963. })
  964. }
  965. // StatusLT applies the LT predicate on the "status" field.
  966. func StatusLT(v string) predicate.Machine {
  967. return predicate.Machine(func(s *sql.Selector) {
  968. s.Where(sql.LT(s.C(FieldStatus), v))
  969. })
  970. }
  971. // StatusLTE applies the LTE predicate on the "status" field.
  972. func StatusLTE(v string) predicate.Machine {
  973. return predicate.Machine(func(s *sql.Selector) {
  974. s.Where(sql.LTE(s.C(FieldStatus), v))
  975. })
  976. }
  977. // StatusContains applies the Contains predicate on the "status" field.
  978. func StatusContains(v string) predicate.Machine {
  979. return predicate.Machine(func(s *sql.Selector) {
  980. s.Where(sql.Contains(s.C(FieldStatus), v))
  981. })
  982. }
  983. // StatusHasPrefix applies the HasPrefix predicate on the "status" field.
  984. func StatusHasPrefix(v string) predicate.Machine {
  985. return predicate.Machine(func(s *sql.Selector) {
  986. s.Where(sql.HasPrefix(s.C(FieldStatus), v))
  987. })
  988. }
  989. // StatusHasSuffix applies the HasSuffix predicate on the "status" field.
  990. func StatusHasSuffix(v string) predicate.Machine {
  991. return predicate.Machine(func(s *sql.Selector) {
  992. s.Where(sql.HasSuffix(s.C(FieldStatus), v))
  993. })
  994. }
  995. // StatusIsNil applies the IsNil predicate on the "status" field.
  996. func StatusIsNil() predicate.Machine {
  997. return predicate.Machine(func(s *sql.Selector) {
  998. s.Where(sql.IsNull(s.C(FieldStatus)))
  999. })
  1000. }
  1001. // StatusNotNil applies the NotNil predicate on the "status" field.
  1002. func StatusNotNil() predicate.Machine {
  1003. return predicate.Machine(func(s *sql.Selector) {
  1004. s.Where(sql.NotNull(s.C(FieldStatus)))
  1005. })
  1006. }
  1007. // StatusEqualFold applies the EqualFold predicate on the "status" field.
  1008. func StatusEqualFold(v string) predicate.Machine {
  1009. return predicate.Machine(func(s *sql.Selector) {
  1010. s.Where(sql.EqualFold(s.C(FieldStatus), v))
  1011. })
  1012. }
  1013. // StatusContainsFold applies the ContainsFold predicate on the "status" field.
  1014. func StatusContainsFold(v string) predicate.Machine {
  1015. return predicate.Machine(func(s *sql.Selector) {
  1016. s.Where(sql.ContainsFold(s.C(FieldStatus), v))
  1017. })
  1018. }
  1019. // HasAlerts applies the HasEdge predicate on the "alerts" edge.
  1020. func HasAlerts() predicate.Machine {
  1021. return predicate.Machine(func(s *sql.Selector) {
  1022. step := sqlgraph.NewStep(
  1023. sqlgraph.From(Table, FieldID),
  1024. sqlgraph.To(AlertsTable, FieldID),
  1025. sqlgraph.Edge(sqlgraph.O2M, false, AlertsTable, AlertsColumn),
  1026. )
  1027. sqlgraph.HasNeighbors(s, step)
  1028. })
  1029. }
  1030. // HasAlertsWith applies the HasEdge predicate on the "alerts" edge with a given conditions (other predicates).
  1031. func HasAlertsWith(preds ...predicate.Alert) predicate.Machine {
  1032. return predicate.Machine(func(s *sql.Selector) {
  1033. step := sqlgraph.NewStep(
  1034. sqlgraph.From(Table, FieldID),
  1035. sqlgraph.To(AlertsInverseTable, FieldID),
  1036. sqlgraph.Edge(sqlgraph.O2M, false, AlertsTable, AlertsColumn),
  1037. )
  1038. sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) {
  1039. for _, p := range preds {
  1040. p(s)
  1041. }
  1042. })
  1043. })
  1044. }
  1045. // And groups predicates with the AND operator between them.
  1046. func And(predicates ...predicate.Machine) predicate.Machine {
  1047. return predicate.Machine(func(s *sql.Selector) {
  1048. s1 := s.Clone().SetP(nil)
  1049. for _, p := range predicates {
  1050. p(s1)
  1051. }
  1052. s.Where(s1.P())
  1053. })
  1054. }
  1055. // Or groups predicates with the OR operator between them.
  1056. func Or(predicates ...predicate.Machine) predicate.Machine {
  1057. return predicate.Machine(func(s *sql.Selector) {
  1058. s1 := s.Clone().SetP(nil)
  1059. for i, p := range predicates {
  1060. if i > 0 {
  1061. s1.Or()
  1062. }
  1063. p(s1)
  1064. }
  1065. s.Where(s1.P())
  1066. })
  1067. }
  1068. // Not applies the not operator on the given predicate.
  1069. func Not(p predicate.Machine) predicate.Machine {
  1070. return predicate.Machine(func(s *sql.Selector) {
  1071. p(s.Not())
  1072. })
  1073. }