ent.go 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668
  1. // Code generated by ent, DO NOT EDIT.
  2. package ent
  3. import (
  4. "context"
  5. "errors"
  6. "fmt"
  7. "reflect"
  8. "sync"
  9. "wechat-api/ent/agent"
  10. "wechat-api/ent/agentbase"
  11. "wechat-api/ent/aliyunavatar"
  12. "wechat-api/ent/batchmsg"
  13. "wechat-api/ent/category"
  14. "wechat-api/ent/chatrecords"
  15. "wechat-api/ent/chatsession"
  16. "wechat-api/ent/contact"
  17. "wechat-api/ent/employee"
  18. "wechat-api/ent/employeeconfig"
  19. "wechat-api/ent/label"
  20. "wechat-api/ent/labelrelationship"
  21. "wechat-api/ent/labeltagging"
  22. "wechat-api/ent/message"
  23. "wechat-api/ent/messagerecords"
  24. "wechat-api/ent/msg"
  25. "wechat-api/ent/server"
  26. "wechat-api/ent/sopnode"
  27. "wechat-api/ent/sopstage"
  28. "wechat-api/ent/soptask"
  29. "wechat-api/ent/token"
  30. "wechat-api/ent/tutorial"
  31. "wechat-api/ent/usagedetail"
  32. "wechat-api/ent/usagetotal"
  33. "wechat-api/ent/workexperience"
  34. "wechat-api/ent/wpchatroom"
  35. "wechat-api/ent/wpchatroommember"
  36. "wechat-api/ent/wx"
  37. "wechat-api/ent/wxcard"
  38. "wechat-api/ent/wxcarduser"
  39. "wechat-api/ent/wxcardvisit"
  40. "entgo.io/ent"
  41. "entgo.io/ent/dialect/sql"
  42. "entgo.io/ent/dialect/sql/sqlgraph"
  43. )
  44. // ent aliases to avoid import conflicts in user's code.
  45. type (
  46. Op = ent.Op
  47. Hook = ent.Hook
  48. Value = ent.Value
  49. Query = ent.Query
  50. QueryContext = ent.QueryContext
  51. Querier = ent.Querier
  52. QuerierFunc = ent.QuerierFunc
  53. Interceptor = ent.Interceptor
  54. InterceptFunc = ent.InterceptFunc
  55. Traverser = ent.Traverser
  56. TraverseFunc = ent.TraverseFunc
  57. Policy = ent.Policy
  58. Mutator = ent.Mutator
  59. Mutation = ent.Mutation
  60. MutateFunc = ent.MutateFunc
  61. )
  62. type clientCtxKey struct{}
  63. // FromContext returns a Client stored inside a context, or nil if there isn't one.
  64. func FromContext(ctx context.Context) *Client {
  65. c, _ := ctx.Value(clientCtxKey{}).(*Client)
  66. return c
  67. }
  68. // NewContext returns a new context with the given Client attached.
  69. func NewContext(parent context.Context, c *Client) context.Context {
  70. return context.WithValue(parent, clientCtxKey{}, c)
  71. }
  72. type txCtxKey struct{}
  73. // TxFromContext returns a Tx stored inside a context, or nil if there isn't one.
  74. func TxFromContext(ctx context.Context) *Tx {
  75. tx, _ := ctx.Value(txCtxKey{}).(*Tx)
  76. return tx
  77. }
  78. // NewTxContext returns a new context with the given Tx attached.
  79. func NewTxContext(parent context.Context, tx *Tx) context.Context {
  80. return context.WithValue(parent, txCtxKey{}, tx)
  81. }
  82. // OrderFunc applies an ordering on the sql selector.
  83. // Deprecated: Use Asc/Desc functions or the package builders instead.
  84. type OrderFunc func(*sql.Selector)
  85. var (
  86. initCheck sync.Once
  87. columnCheck sql.ColumnCheck
  88. )
  89. // columnChecker checks if the column exists in the given table.
  90. func checkColumn(table, column string) error {
  91. initCheck.Do(func() {
  92. columnCheck = sql.NewColumnCheck(map[string]func(string) bool{
  93. agent.Table: agent.ValidColumn,
  94. agentbase.Table: agentbase.ValidColumn,
  95. aliyunavatar.Table: aliyunavatar.ValidColumn,
  96. batchmsg.Table: batchmsg.ValidColumn,
  97. category.Table: category.ValidColumn,
  98. chatrecords.Table: chatrecords.ValidColumn,
  99. chatsession.Table: chatsession.ValidColumn,
  100. contact.Table: contact.ValidColumn,
  101. employee.Table: employee.ValidColumn,
  102. employeeconfig.Table: employeeconfig.ValidColumn,
  103. label.Table: label.ValidColumn,
  104. labelrelationship.Table: labelrelationship.ValidColumn,
  105. labeltagging.Table: labeltagging.ValidColumn,
  106. message.Table: message.ValidColumn,
  107. messagerecords.Table: messagerecords.ValidColumn,
  108. msg.Table: msg.ValidColumn,
  109. server.Table: server.ValidColumn,
  110. sopnode.Table: sopnode.ValidColumn,
  111. sopstage.Table: sopstage.ValidColumn,
  112. soptask.Table: soptask.ValidColumn,
  113. token.Table: token.ValidColumn,
  114. tutorial.Table: tutorial.ValidColumn,
  115. usagedetail.Table: usagedetail.ValidColumn,
  116. usagetotal.Table: usagetotal.ValidColumn,
  117. workexperience.Table: workexperience.ValidColumn,
  118. wpchatroom.Table: wpchatroom.ValidColumn,
  119. wpchatroommember.Table: wpchatroommember.ValidColumn,
  120. wx.Table: wx.ValidColumn,
  121. wxcard.Table: wxcard.ValidColumn,
  122. wxcarduser.Table: wxcarduser.ValidColumn,
  123. wxcardvisit.Table: wxcardvisit.ValidColumn,
  124. })
  125. })
  126. return columnCheck(table, column)
  127. }
  128. // Asc applies the given fields in ASC order.
  129. func Asc(fields ...string) func(*sql.Selector) {
  130. return func(s *sql.Selector) {
  131. for _, f := range fields {
  132. if err := checkColumn(s.TableName(), f); err != nil {
  133. s.AddError(&ValidationError{Name: f, err: fmt.Errorf("ent: %w", err)})
  134. }
  135. s.OrderBy(sql.Asc(s.C(f)))
  136. }
  137. }
  138. }
  139. // Desc applies the given fields in DESC order.
  140. func Desc(fields ...string) func(*sql.Selector) {
  141. return func(s *sql.Selector) {
  142. for _, f := range fields {
  143. if err := checkColumn(s.TableName(), f); err != nil {
  144. s.AddError(&ValidationError{Name: f, err: fmt.Errorf("ent: %w", err)})
  145. }
  146. s.OrderBy(sql.Desc(s.C(f)))
  147. }
  148. }
  149. }
  150. // AggregateFunc applies an aggregation step on the group-by traversal/selector.
  151. type AggregateFunc func(*sql.Selector) string
  152. // As is a pseudo aggregation function for renaming another other functions with custom names. For example:
  153. //
  154. // GroupBy(field1, field2).
  155. // Aggregate(ent.As(ent.Sum(field1), "sum_field1"), (ent.As(ent.Sum(field2), "sum_field2")).
  156. // Scan(ctx, &v)
  157. func As(fn AggregateFunc, end string) AggregateFunc {
  158. return func(s *sql.Selector) string {
  159. return sql.As(fn(s), end)
  160. }
  161. }
  162. // Count applies the "count" aggregation function on each group.
  163. func Count() AggregateFunc {
  164. return func(s *sql.Selector) string {
  165. return sql.Count("*")
  166. }
  167. }
  168. // Max applies the "max" aggregation function on the given field of each group.
  169. func Max(field string) AggregateFunc {
  170. return func(s *sql.Selector) string {
  171. if err := checkColumn(s.TableName(), field); err != nil {
  172. s.AddError(&ValidationError{Name: field, err: fmt.Errorf("ent: %w", err)})
  173. return ""
  174. }
  175. return sql.Max(s.C(field))
  176. }
  177. }
  178. // Mean applies the "mean" aggregation function on the given field of each group.
  179. func Mean(field string) AggregateFunc {
  180. return func(s *sql.Selector) string {
  181. if err := checkColumn(s.TableName(), field); err != nil {
  182. s.AddError(&ValidationError{Name: field, err: fmt.Errorf("ent: %w", err)})
  183. return ""
  184. }
  185. return sql.Avg(s.C(field))
  186. }
  187. }
  188. // Min applies the "min" aggregation function on the given field of each group.
  189. func Min(field string) AggregateFunc {
  190. return func(s *sql.Selector) string {
  191. if err := checkColumn(s.TableName(), field); err != nil {
  192. s.AddError(&ValidationError{Name: field, err: fmt.Errorf("ent: %w", err)})
  193. return ""
  194. }
  195. return sql.Min(s.C(field))
  196. }
  197. }
  198. // Sum applies the "sum" aggregation function on the given field of each group.
  199. func Sum(field string) AggregateFunc {
  200. return func(s *sql.Selector) string {
  201. if err := checkColumn(s.TableName(), field); err != nil {
  202. s.AddError(&ValidationError{Name: field, err: fmt.Errorf("ent: %w", err)})
  203. return ""
  204. }
  205. return sql.Sum(s.C(field))
  206. }
  207. }
  208. // ValidationError returns when validating a field or edge fails.
  209. type ValidationError struct {
  210. Name string // Field or edge name.
  211. err error
  212. }
  213. // Error implements the error interface.
  214. func (e *ValidationError) Error() string {
  215. return e.err.Error()
  216. }
  217. // Unwrap implements the errors.Wrapper interface.
  218. func (e *ValidationError) Unwrap() error {
  219. return e.err
  220. }
  221. // IsValidationError returns a boolean indicating whether the error is a validation error.
  222. func IsValidationError(err error) bool {
  223. if err == nil {
  224. return false
  225. }
  226. var e *ValidationError
  227. return errors.As(err, &e)
  228. }
  229. // NotFoundError returns when trying to fetch a specific entity and it was not found in the database.
  230. type NotFoundError struct {
  231. label string
  232. }
  233. // Error implements the error interface.
  234. func (e *NotFoundError) Error() string {
  235. return "ent: " + e.label + " not found"
  236. }
  237. // IsNotFound returns a boolean indicating whether the error is a not found error.
  238. func IsNotFound(err error) bool {
  239. if err == nil {
  240. return false
  241. }
  242. var e *NotFoundError
  243. return errors.As(err, &e)
  244. }
  245. // MaskNotFound masks not found error.
  246. func MaskNotFound(err error) error {
  247. if IsNotFound(err) {
  248. return nil
  249. }
  250. return err
  251. }
  252. // NotSingularError returns when trying to fetch a singular entity and more then one was found in the database.
  253. type NotSingularError struct {
  254. label string
  255. }
  256. // Error implements the error interface.
  257. func (e *NotSingularError) Error() string {
  258. return "ent: " + e.label + " not singular"
  259. }
  260. // IsNotSingular returns a boolean indicating whether the error is a not singular error.
  261. func IsNotSingular(err error) bool {
  262. if err == nil {
  263. return false
  264. }
  265. var e *NotSingularError
  266. return errors.As(err, &e)
  267. }
  268. // NotLoadedError returns when trying to get a node that was not loaded by the query.
  269. type NotLoadedError struct {
  270. edge string
  271. }
  272. // Error implements the error interface.
  273. func (e *NotLoadedError) Error() string {
  274. return "ent: " + e.edge + " edge was not loaded"
  275. }
  276. // IsNotLoaded returns a boolean indicating whether the error is a not loaded error.
  277. func IsNotLoaded(err error) bool {
  278. if err == nil {
  279. return false
  280. }
  281. var e *NotLoadedError
  282. return errors.As(err, &e)
  283. }
  284. // ConstraintError returns when trying to create/update one or more entities and
  285. // one or more of their constraints failed. For example, violation of edge or
  286. // field uniqueness.
  287. type ConstraintError struct {
  288. msg string
  289. wrap error
  290. }
  291. // Error implements the error interface.
  292. func (e ConstraintError) Error() string {
  293. return "ent: constraint failed: " + e.msg
  294. }
  295. // Unwrap implements the errors.Wrapper interface.
  296. func (e *ConstraintError) Unwrap() error {
  297. return e.wrap
  298. }
  299. // IsConstraintError returns a boolean indicating whether the error is a constraint failure.
  300. func IsConstraintError(err error) bool {
  301. if err == nil {
  302. return false
  303. }
  304. var e *ConstraintError
  305. return errors.As(err, &e)
  306. }
  307. // selector embedded by the different Select/GroupBy builders.
  308. type selector struct {
  309. label string
  310. flds *[]string
  311. fns []AggregateFunc
  312. scan func(context.Context, any) error
  313. }
  314. // ScanX is like Scan, but panics if an error occurs.
  315. func (s *selector) ScanX(ctx context.Context, v any) {
  316. if err := s.scan(ctx, v); err != nil {
  317. panic(err)
  318. }
  319. }
  320. // Strings returns list of strings from a selector. It is only allowed when selecting one field.
  321. func (s *selector) Strings(ctx context.Context) ([]string, error) {
  322. if len(*s.flds) > 1 {
  323. return nil, errors.New("ent: Strings is not achievable when selecting more than 1 field")
  324. }
  325. var v []string
  326. if err := s.scan(ctx, &v); err != nil {
  327. return nil, err
  328. }
  329. return v, nil
  330. }
  331. // StringsX is like Strings, but panics if an error occurs.
  332. func (s *selector) StringsX(ctx context.Context) []string {
  333. v, err := s.Strings(ctx)
  334. if err != nil {
  335. panic(err)
  336. }
  337. return v
  338. }
  339. // String returns a single string from a selector. It is only allowed when selecting one field.
  340. func (s *selector) String(ctx context.Context) (_ string, err error) {
  341. var v []string
  342. if v, err = s.Strings(ctx); err != nil {
  343. return
  344. }
  345. switch len(v) {
  346. case 1:
  347. return v[0], nil
  348. case 0:
  349. err = &NotFoundError{s.label}
  350. default:
  351. err = fmt.Errorf("ent: Strings returned %d results when one was expected", len(v))
  352. }
  353. return
  354. }
  355. // StringX is like String, but panics if an error occurs.
  356. func (s *selector) StringX(ctx context.Context) string {
  357. v, err := s.String(ctx)
  358. if err != nil {
  359. panic(err)
  360. }
  361. return v
  362. }
  363. // Ints returns list of ints from a selector. It is only allowed when selecting one field.
  364. func (s *selector) Ints(ctx context.Context) ([]int, error) {
  365. if len(*s.flds) > 1 {
  366. return nil, errors.New("ent: Ints is not achievable when selecting more than 1 field")
  367. }
  368. var v []int
  369. if err := s.scan(ctx, &v); err != nil {
  370. return nil, err
  371. }
  372. return v, nil
  373. }
  374. // IntsX is like Ints, but panics if an error occurs.
  375. func (s *selector) IntsX(ctx context.Context) []int {
  376. v, err := s.Ints(ctx)
  377. if err != nil {
  378. panic(err)
  379. }
  380. return v
  381. }
  382. // Int returns a single int from a selector. It is only allowed when selecting one field.
  383. func (s *selector) Int(ctx context.Context) (_ int, err error) {
  384. var v []int
  385. if v, err = s.Ints(ctx); err != nil {
  386. return
  387. }
  388. switch len(v) {
  389. case 1:
  390. return v[0], nil
  391. case 0:
  392. err = &NotFoundError{s.label}
  393. default:
  394. err = fmt.Errorf("ent: Ints returned %d results when one was expected", len(v))
  395. }
  396. return
  397. }
  398. // IntX is like Int, but panics if an error occurs.
  399. func (s *selector) IntX(ctx context.Context) int {
  400. v, err := s.Int(ctx)
  401. if err != nil {
  402. panic(err)
  403. }
  404. return v
  405. }
  406. // Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
  407. func (s *selector) Float64s(ctx context.Context) ([]float64, error) {
  408. if len(*s.flds) > 1 {
  409. return nil, errors.New("ent: Float64s is not achievable when selecting more than 1 field")
  410. }
  411. var v []float64
  412. if err := s.scan(ctx, &v); err != nil {
  413. return nil, err
  414. }
  415. return v, nil
  416. }
  417. // Float64sX is like Float64s, but panics if an error occurs.
  418. func (s *selector) Float64sX(ctx context.Context) []float64 {
  419. v, err := s.Float64s(ctx)
  420. if err != nil {
  421. panic(err)
  422. }
  423. return v
  424. }
  425. // Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
  426. func (s *selector) Float64(ctx context.Context) (_ float64, err error) {
  427. var v []float64
  428. if v, err = s.Float64s(ctx); err != nil {
  429. return
  430. }
  431. switch len(v) {
  432. case 1:
  433. return v[0], nil
  434. case 0:
  435. err = &NotFoundError{s.label}
  436. default:
  437. err = fmt.Errorf("ent: Float64s returned %d results when one was expected", len(v))
  438. }
  439. return
  440. }
  441. // Float64X is like Float64, but panics if an error occurs.
  442. func (s *selector) Float64X(ctx context.Context) float64 {
  443. v, err := s.Float64(ctx)
  444. if err != nil {
  445. panic(err)
  446. }
  447. return v
  448. }
  449. // Bools returns list of bools from a selector. It is only allowed when selecting one field.
  450. func (s *selector) Bools(ctx context.Context) ([]bool, error) {
  451. if len(*s.flds) > 1 {
  452. return nil, errors.New("ent: Bools is not achievable when selecting more than 1 field")
  453. }
  454. var v []bool
  455. if err := s.scan(ctx, &v); err != nil {
  456. return nil, err
  457. }
  458. return v, nil
  459. }
  460. // BoolsX is like Bools, but panics if an error occurs.
  461. func (s *selector) BoolsX(ctx context.Context) []bool {
  462. v, err := s.Bools(ctx)
  463. if err != nil {
  464. panic(err)
  465. }
  466. return v
  467. }
  468. // Bool returns a single bool from a selector. It is only allowed when selecting one field.
  469. func (s *selector) Bool(ctx context.Context) (_ bool, err error) {
  470. var v []bool
  471. if v, err = s.Bools(ctx); err != nil {
  472. return
  473. }
  474. switch len(v) {
  475. case 1:
  476. return v[0], nil
  477. case 0:
  478. err = &NotFoundError{s.label}
  479. default:
  480. err = fmt.Errorf("ent: Bools returned %d results when one was expected", len(v))
  481. }
  482. return
  483. }
  484. // BoolX is like Bool, but panics if an error occurs.
  485. func (s *selector) BoolX(ctx context.Context) bool {
  486. v, err := s.Bool(ctx)
  487. if err != nil {
  488. panic(err)
  489. }
  490. return v
  491. }
  492. // withHooks invokes the builder operation with the given hooks, if any.
  493. func withHooks[V Value, M any, PM interface {
  494. *M
  495. Mutation
  496. }](ctx context.Context, exec func(context.Context) (V, error), mutation PM, hooks []Hook) (value V, err error) {
  497. if len(hooks) == 0 {
  498. return exec(ctx)
  499. }
  500. var mut Mutator = MutateFunc(func(ctx context.Context, m Mutation) (Value, error) {
  501. mutationT, ok := any(m).(PM)
  502. if !ok {
  503. return nil, fmt.Errorf("unexpected mutation type %T", m)
  504. }
  505. // Set the mutation to the builder.
  506. *mutation = *mutationT
  507. return exec(ctx)
  508. })
  509. for i := len(hooks) - 1; i >= 0; i-- {
  510. if hooks[i] == nil {
  511. return value, fmt.Errorf("ent: uninitialized hook (forgotten import ent/runtime?)")
  512. }
  513. mut = hooks[i](mut)
  514. }
  515. v, err := mut.Mutate(ctx, mutation)
  516. if err != nil {
  517. return value, err
  518. }
  519. nv, ok := v.(V)
  520. if !ok {
  521. return value, fmt.Errorf("unexpected node type %T returned from %T", v, mutation)
  522. }
  523. return nv, nil
  524. }
  525. // setContextOp returns a new context with the given QueryContext attached (including its op) in case it does not exist.
  526. func setContextOp(ctx context.Context, qc *QueryContext, op string) context.Context {
  527. if ent.QueryFromContext(ctx) == nil {
  528. qc.Op = op
  529. ctx = ent.NewQueryContext(ctx, qc)
  530. }
  531. return ctx
  532. }
  533. func querierAll[V Value, Q interface {
  534. sqlAll(context.Context, ...queryHook) (V, error)
  535. }]() Querier {
  536. return QuerierFunc(func(ctx context.Context, q Query) (Value, error) {
  537. query, ok := q.(Q)
  538. if !ok {
  539. return nil, fmt.Errorf("unexpected query type %T", q)
  540. }
  541. return query.sqlAll(ctx)
  542. })
  543. }
  544. func querierCount[Q interface {
  545. sqlCount(context.Context) (int, error)
  546. }]() Querier {
  547. return QuerierFunc(func(ctx context.Context, q Query) (Value, error) {
  548. query, ok := q.(Q)
  549. if !ok {
  550. return nil, fmt.Errorf("unexpected query type %T", q)
  551. }
  552. return query.sqlCount(ctx)
  553. })
  554. }
  555. func withInterceptors[V Value](ctx context.Context, q Query, qr Querier, inters []Interceptor) (v V, err error) {
  556. for i := len(inters) - 1; i >= 0; i-- {
  557. qr = inters[i].Intercept(qr)
  558. }
  559. rv, err := qr.Query(ctx, q)
  560. if err != nil {
  561. return v, err
  562. }
  563. vt, ok := rv.(V)
  564. if !ok {
  565. return v, fmt.Errorf("unexpected type %T returned from %T. expected type: %T", vt, q, v)
  566. }
  567. return vt, nil
  568. }
  569. func scanWithInterceptors[Q1 ent.Query, Q2 interface {
  570. sqlScan(context.Context, Q1, any) error
  571. }](ctx context.Context, rootQuery Q1, selectOrGroup Q2, inters []Interceptor, v any) error {
  572. rv := reflect.ValueOf(v)
  573. var qr Querier = QuerierFunc(func(ctx context.Context, q Query) (Value, error) {
  574. query, ok := q.(Q1)
  575. if !ok {
  576. return nil, fmt.Errorf("unexpected query type %T", q)
  577. }
  578. if err := selectOrGroup.sqlScan(ctx, query, v); err != nil {
  579. return nil, err
  580. }
  581. if k := rv.Kind(); k == reflect.Pointer && rv.Elem().CanInterface() {
  582. return rv.Elem().Interface(), nil
  583. }
  584. return v, nil
  585. })
  586. for i := len(inters) - 1; i >= 0; i-- {
  587. qr = inters[i].Intercept(qr)
  588. }
  589. vv, err := qr.Query(ctx, rootQuery)
  590. if err != nil {
  591. return err
  592. }
  593. switch rv2 := reflect.ValueOf(vv); {
  594. case rv.IsNil(), rv2.IsNil(), rv.Kind() != reflect.Pointer:
  595. case rv.Type() == rv2.Type():
  596. rv.Elem().Set(rv2.Elem())
  597. case rv.Elem().Type() == rv2.Type():
  598. rv.Elem().Set(rv2)
  599. }
  600. return nil
  601. }
  602. // queryHook describes an internal hook for the different sqlAll methods.
  603. type queryHook func(context.Context, *sqlgraph.QuerySpec)