Documentation ¶
Index ¶
- Constants
- Variables
- func Asc(fields ...string) func(*sql.Selector)
- func Desc(fields ...string) func(*sql.Selector)
- func IsConstraintError(err error) bool
- func IsNotFound(err error) bool
- func IsNotLoaded(err error) bool
- func IsNotSingular(err error) bool
- func IsValidationError(err error) bool
- func MaskNotFound(err error) error
- func NewContext(parent context.Context, c *Client) context.Context
- func NewTxContext(parent context.Context, tx *Tx) context.Context
- func OpenTxFromContext(ctx context.Context) (context.Context, driver.Tx, error)
- type AggregateFunc
- type Cabinet
- func (c *Cabinet) Game(ctx context.Context) (*Game, error)
- func (*Cabinet) IsNode()
- func (c *Cabinet) Location(ctx context.Context) (*Location, error)
- func (c *Cabinet) QueryGame() *GameQuery
- func (c *Cabinet) QueryLocation() *LocationQuery
- func (c *Cabinet) String() string
- func (c *Cabinet) ToEdge(order *CabinetOrder) *CabinetEdge
- func (c *Cabinet) Unwrap() *Cabinet
- func (c *Cabinet) Update() *CabinetUpdateOne
- func (c *Cabinet) Value(name string) (ent.Value, error)
- type CabinetClient
- func (c *CabinetClient) Create() *CabinetCreate
- func (c *CabinetClient) CreateBulk(builders ...*CabinetCreate) *CabinetCreateBulk
- func (c *CabinetClient) Delete() *CabinetDelete
- func (c *CabinetClient) DeleteOne(ca *Cabinet) *CabinetDeleteOne
- func (c *CabinetClient) DeleteOneID(id string) *CabinetDeleteOne
- func (c *CabinetClient) Get(ctx context.Context, id string) (*Cabinet, error)
- func (c *CabinetClient) GetX(ctx context.Context, id string) *Cabinet
- func (c *CabinetClient) Hooks() []Hook
- func (c *CabinetClient) Intercept(interceptors ...Interceptor)
- func (c *CabinetClient) Interceptors() []Interceptor
- func (c *CabinetClient) MapCreateBulk(slice any, setFunc func(*CabinetCreate, int)) *CabinetCreateBulk
- func (c *CabinetClient) Query() *CabinetQuery
- func (c *CabinetClient) QueryGame(ca *Cabinet) *GameQuery
- func (c *CabinetClient) QueryLocation(ca *Cabinet) *LocationQuery
- func (c *CabinetClient) Update() *CabinetUpdate
- func (c *CabinetClient) UpdateOne(ca *Cabinet) *CabinetUpdateOne
- func (c *CabinetClient) UpdateOneID(id string) *CabinetUpdateOne
- func (c *CabinetClient) Use(hooks ...Hook)
- type CabinetConnection
- type CabinetCreate
- func (cc *CabinetCreate) Exec(ctx context.Context) error
- func (cc *CabinetCreate) ExecX(ctx context.Context)
- func (cc *CabinetCreate) Mutation() *CabinetMutation
- func (cc *CabinetCreate) Save(ctx context.Context) (*Cabinet, error)
- func (cc *CabinetCreate) SaveX(ctx context.Context) *Cabinet
- func (cc *CabinetCreate) SetCount(i int) *CabinetCreate
- func (cc *CabinetCreate) SetGame(g *Game) *CabinetCreate
- func (cc *CabinetCreate) SetGameID(s string) *CabinetCreate
- func (cc *CabinetCreate) SetID(s string) *CabinetCreate
- func (cc *CabinetCreate) SetLocation(l *Location) *CabinetCreate
- func (cc *CabinetCreate) SetLocationID(s string) *CabinetCreate
- func (cc *CabinetCreate) SetNillableCount(i *int) *CabinetCreate
- func (cc *CabinetCreate) SetNillableID(s *string) *CabinetCreate
- type CabinetCreateBulk
- type CabinetDelete
- type CabinetDeleteOne
- type CabinetEdge
- type CabinetEdges
- type CabinetGroupBy
- func (cgb *CabinetGroupBy) Aggregate(fns ...AggregateFunc) *CabinetGroupBy
- func (s *CabinetGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *CabinetGroupBy) BoolX(ctx context.Context) bool
- func (s *CabinetGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *CabinetGroupBy) BoolsX(ctx context.Context) []bool
- func (s *CabinetGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *CabinetGroupBy) Float64X(ctx context.Context) float64
- func (s *CabinetGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *CabinetGroupBy) Float64sX(ctx context.Context) []float64
- func (s *CabinetGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *CabinetGroupBy) IntX(ctx context.Context) int
- func (s *CabinetGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *CabinetGroupBy) IntsX(ctx context.Context) []int
- func (cgb *CabinetGroupBy) Scan(ctx context.Context, v any) error
- func (s *CabinetGroupBy) ScanX(ctx context.Context, v any)
- func (s *CabinetGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *CabinetGroupBy) StringX(ctx context.Context) string
- func (s *CabinetGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *CabinetGroupBy) StringsX(ctx context.Context) []string
- type CabinetMutation
- func (m *CabinetMutation) AddCount(i int)
- func (m *CabinetMutation) AddField(name string, value ent.Value) error
- func (m *CabinetMutation) AddedCount() (r int, exists bool)
- func (m *CabinetMutation) AddedEdges() []string
- func (m *CabinetMutation) AddedField(name string) (ent.Value, bool)
- func (m *CabinetMutation) AddedFields() []string
- func (m *CabinetMutation) AddedIDs(name string) []ent.Value
- func (m *CabinetMutation) ClearCount()
- func (m *CabinetMutation) ClearEdge(name string) error
- func (m *CabinetMutation) ClearField(name string) error
- func (m *CabinetMutation) ClearGame()
- func (m *CabinetMutation) ClearLocation()
- func (m *CabinetMutation) ClearedEdges() []string
- func (m *CabinetMutation) ClearedFields() []string
- func (m CabinetMutation) Client() *Client
- func (m *CabinetMutation) Count() (r int, exists bool)
- func (m *CabinetMutation) CountCleared() bool
- func (m *CabinetMutation) EdgeCleared(name string) bool
- func (m *CabinetMutation) Field(name string) (ent.Value, bool)
- func (m *CabinetMutation) FieldCleared(name string) bool
- func (m *CabinetMutation) Fields() []string
- func (m *CabinetMutation) GameCleared() bool
- func (m *CabinetMutation) GameID() (r string, exists bool)
- func (m *CabinetMutation) GameIDs() (ids []string)
- func (m *CabinetMutation) ID() (id string, exists bool)
- func (m *CabinetMutation) IDs(ctx context.Context) ([]string, error)
- func (m *CabinetMutation) LocationCleared() bool
- func (m *CabinetMutation) LocationID() (r string, exists bool)
- func (m *CabinetMutation) LocationIDs() (ids []string)
- func (m *CabinetMutation) OldCount(ctx context.Context) (v *int, err error)
- func (m *CabinetMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *CabinetMutation) OldGameID(ctx context.Context) (v string, err error)
- func (m *CabinetMutation) OldLocationID(ctx context.Context) (v string, err error)
- func (m *CabinetMutation) Op() Op
- func (m *CabinetMutation) RemovedEdges() []string
- func (m *CabinetMutation) RemovedIDs(name string) []ent.Value
- func (m *CabinetMutation) ResetCount()
- func (m *CabinetMutation) ResetEdge(name string) error
- func (m *CabinetMutation) ResetField(name string) error
- func (m *CabinetMutation) ResetGame()
- func (m *CabinetMutation) ResetGameID()
- func (m *CabinetMutation) ResetLocation()
- func (m *CabinetMutation) ResetLocationID()
- func (m *CabinetMutation) SetCount(i int)
- func (m *CabinetMutation) SetField(name string, value ent.Value) error
- func (m *CabinetMutation) SetGameID(s string)
- func (m *CabinetMutation) SetID(id string)
- func (m *CabinetMutation) SetLocationID(s string)
- func (m *CabinetMutation) SetOp(op Op)
- func (m CabinetMutation) Tx() (*Tx, error)
- func (m *CabinetMutation) Type() string
- func (m *CabinetMutation) Where(ps ...predicate.Cabinet)
- func (m *CabinetMutation) WhereP(ps ...func(*sql.Selector))
- type CabinetOrder
- type CabinetOrderField
- type CabinetPaginateOption
- type CabinetQuery
- func (cq *CabinetQuery) Aggregate(fns ...AggregateFunc) *CabinetSelect
- func (cq *CabinetQuery) All(ctx context.Context) ([]*Cabinet, error)
- func (cq *CabinetQuery) AllX(ctx context.Context) []*Cabinet
- func (cq *CabinetQuery) Clone() *CabinetQuery
- func (c *CabinetQuery) CollectFields(ctx context.Context, satisfies ...string) (*CabinetQuery, error)
- func (cq *CabinetQuery) Count(ctx context.Context) (int, error)
- func (cq *CabinetQuery) CountX(ctx context.Context) int
- func (cq *CabinetQuery) Exist(ctx context.Context) (bool, error)
- func (cq *CabinetQuery) ExistX(ctx context.Context) bool
- func (cq *CabinetQuery) First(ctx context.Context) (*Cabinet, error)
- func (cq *CabinetQuery) FirstID(ctx context.Context) (id string, err error)
- func (cq *CabinetQuery) FirstIDX(ctx context.Context) string
- func (cq *CabinetQuery) FirstX(ctx context.Context) *Cabinet
- func (cq *CabinetQuery) GroupBy(field string, fields ...string) *CabinetGroupBy
- func (cq *CabinetQuery) IDs(ctx context.Context) (ids []string, err error)
- func (cq *CabinetQuery) IDsX(ctx context.Context) []string
- func (cq *CabinetQuery) Limit(limit int) *CabinetQuery
- func (cq *CabinetQuery) Offset(offset int) *CabinetQuery
- func (cq *CabinetQuery) Only(ctx context.Context) (*Cabinet, error)
- func (cq *CabinetQuery) OnlyID(ctx context.Context) (id string, err error)
- func (cq *CabinetQuery) OnlyIDX(ctx context.Context) string
- func (cq *CabinetQuery) OnlyX(ctx context.Context) *Cabinet
- func (cq *CabinetQuery) Order(o ...cabinet.OrderOption) *CabinetQuery
- func (c *CabinetQuery) Paginate(ctx context.Context, after *Cursor, first *int, before *Cursor, last *int, ...) (*CabinetConnection, error)
- func (cq *CabinetQuery) QueryGame() *GameQuery
- func (cq *CabinetQuery) QueryLocation() *LocationQuery
- func (cq *CabinetQuery) Select(fields ...string) *CabinetSelect
- func (cq *CabinetQuery) Unique(unique bool) *CabinetQuery
- func (cq *CabinetQuery) Where(ps ...predicate.Cabinet) *CabinetQuery
- func (cq *CabinetQuery) WithGame(opts ...func(*GameQuery)) *CabinetQuery
- func (cq *CabinetQuery) WithLocation(opts ...func(*LocationQuery)) *CabinetQuery
- type CabinetSelect
- func (cs *CabinetSelect) Aggregate(fns ...AggregateFunc) *CabinetSelect
- func (s *CabinetSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *CabinetSelect) BoolX(ctx context.Context) bool
- func (s *CabinetSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *CabinetSelect) BoolsX(ctx context.Context) []bool
- func (s *CabinetSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *CabinetSelect) Float64X(ctx context.Context) float64
- func (s *CabinetSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *CabinetSelect) Float64sX(ctx context.Context) []float64
- func (s *CabinetSelect) Int(ctx context.Context) (_ int, err error)
- func (s *CabinetSelect) IntX(ctx context.Context) int
- func (s *CabinetSelect) Ints(ctx context.Context) ([]int, error)
- func (s *CabinetSelect) IntsX(ctx context.Context) []int
- func (cs *CabinetSelect) Scan(ctx context.Context, v any) error
- func (s *CabinetSelect) ScanX(ctx context.Context, v any)
- func (s *CabinetSelect) String(ctx context.Context) (_ string, err error)
- func (s *CabinetSelect) StringX(ctx context.Context) string
- func (s *CabinetSelect) Strings(ctx context.Context) ([]string, error)
- func (s *CabinetSelect) StringsX(ctx context.Context) []string
- type CabinetUpdate
- func (cu *CabinetUpdate) AddCount(i int) *CabinetUpdate
- func (cu *CabinetUpdate) ClearCount() *CabinetUpdate
- func (cu *CabinetUpdate) ClearGame() *CabinetUpdate
- func (cu *CabinetUpdate) ClearLocation() *CabinetUpdate
- func (cu *CabinetUpdate) Exec(ctx context.Context) error
- func (cu *CabinetUpdate) ExecX(ctx context.Context)
- func (cu *CabinetUpdate) Mutation() *CabinetMutation
- func (cu *CabinetUpdate) Save(ctx context.Context) (int, error)
- func (cu *CabinetUpdate) SaveX(ctx context.Context) int
- func (cu *CabinetUpdate) SetCount(i int) *CabinetUpdate
- func (cu *CabinetUpdate) SetGame(g *Game) *CabinetUpdate
- func (cu *CabinetUpdate) SetGameID(s string) *CabinetUpdate
- func (cu *CabinetUpdate) SetLocation(l *Location) *CabinetUpdate
- func (cu *CabinetUpdate) SetLocationID(s string) *CabinetUpdate
- func (cu *CabinetUpdate) SetNillableCount(i *int) *CabinetUpdate
- func (cu *CabinetUpdate) SetNillableGameID(s *string) *CabinetUpdate
- func (cu *CabinetUpdate) SetNillableLocationID(s *string) *CabinetUpdate
- func (cu *CabinetUpdate) Where(ps ...predicate.Cabinet) *CabinetUpdate
- type CabinetUpdateOne
- func (cuo *CabinetUpdateOne) AddCount(i int) *CabinetUpdateOne
- func (cuo *CabinetUpdateOne) ClearCount() *CabinetUpdateOne
- func (cuo *CabinetUpdateOne) ClearGame() *CabinetUpdateOne
- func (cuo *CabinetUpdateOne) ClearLocation() *CabinetUpdateOne
- func (cuo *CabinetUpdateOne) Exec(ctx context.Context) error
- func (cuo *CabinetUpdateOne) ExecX(ctx context.Context)
- func (cuo *CabinetUpdateOne) Mutation() *CabinetMutation
- func (cuo *CabinetUpdateOne) Save(ctx context.Context) (*Cabinet, error)
- func (cuo *CabinetUpdateOne) SaveX(ctx context.Context) *Cabinet
- func (cuo *CabinetUpdateOne) Select(field string, fields ...string) *CabinetUpdateOne
- func (cuo *CabinetUpdateOne) SetCount(i int) *CabinetUpdateOne
- func (cuo *CabinetUpdateOne) SetGame(g *Game) *CabinetUpdateOne
- func (cuo *CabinetUpdateOne) SetGameID(s string) *CabinetUpdateOne
- func (cuo *CabinetUpdateOne) SetLocation(l *Location) *CabinetUpdateOne
- func (cuo *CabinetUpdateOne) SetLocationID(s string) *CabinetUpdateOne
- func (cuo *CabinetUpdateOne) SetNillableCount(i *int) *CabinetUpdateOne
- func (cuo *CabinetUpdateOne) SetNillableGameID(s *string) *CabinetUpdateOne
- func (cuo *CabinetUpdateOne) SetNillableLocationID(s *string) *CabinetUpdateOne
- func (cuo *CabinetUpdateOne) Where(ps ...predicate.Cabinet) *CabinetUpdateOne
- type CabinetWhereInput
- type Cabinets
- type Client
- func (c *Client) BeginTx(ctx context.Context, opts *sql.TxOptions) (*Tx, error)
- func (c *Client) Close() error
- func (c *Client) Debug() *Client
- func (c *Client) Intercept(interceptors ...Interceptor)
- func (c *Client) Mutate(ctx context.Context, m Mutation) (Value, error)
- func (c *Client) Noder(ctx context.Context, id string, opts ...NodeOption) (_ Noder, err error)
- func (c *Client) Noders(ctx context.Context, ids []string, opts ...NodeOption) ([]Noder, error)
- func (c *Client) OpenTx(ctx context.Context) (context.Context, driver.Tx, error)
- func (c *Client) Tx(ctx context.Context) (*Tx, error)
- func (c *Client) Use(hooks ...Hook)
- type CommitFunc
- type CommitHook
- type Committer
- type ConstraintError
- type CreateLocationInput
- type Cursor
- type Game
- type GameClient
- func (c *GameClient) Create() *GameCreate
- func (c *GameClient) CreateBulk(builders ...*GameCreate) *GameCreateBulk
- func (c *GameClient) Delete() *GameDelete
- func (c *GameClient) DeleteOne(ga *Game) *GameDeleteOne
- func (c *GameClient) DeleteOneID(id string) *GameDeleteOne
- func (c *GameClient) Get(ctx context.Context, id string) (*Game, error)
- func (c *GameClient) GetX(ctx context.Context, id string) *Game
- func (c *GameClient) Hooks() []Hook
- func (c *GameClient) Intercept(interceptors ...Interceptor)
- func (c *GameClient) Interceptors() []Interceptor
- func (c *GameClient) MapCreateBulk(slice any, setFunc func(*GameCreate, int)) *GameCreateBulk
- func (c *GameClient) Query() *GameQuery
- func (c *GameClient) Update() *GameUpdate
- func (c *GameClient) UpdateOne(ga *Game) *GameUpdateOne
- func (c *GameClient) UpdateOneID(id string) *GameUpdateOne
- func (c *GameClient) Use(hooks ...Hook)
- type GameConnection
- type GameCreate
- func (gc *GameCreate) Exec(ctx context.Context) error
- func (gc *GameCreate) ExecX(ctx context.Context)
- func (gc *GameCreate) Mutation() *GameMutation
- func (gc *GameCreate) Save(ctx context.Context) (*Game, error)
- func (gc *GameCreate) SaveX(ctx context.Context) *Game
- func (gc *GameCreate) SetID(s string) *GameCreate
- func (gc *GameCreate) SetName(s string) *GameCreate
- func (gc *GameCreate) SetNillableID(s *string) *GameCreate
- type GameCreateBulk
- type GameDelete
- type GameDeleteOne
- type GameEdge
- type GameGroupBy
- func (ggb *GameGroupBy) Aggregate(fns ...AggregateFunc) *GameGroupBy
- func (s *GameGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *GameGroupBy) BoolX(ctx context.Context) bool
- func (s *GameGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *GameGroupBy) BoolsX(ctx context.Context) []bool
- func (s *GameGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *GameGroupBy) Float64X(ctx context.Context) float64
- func (s *GameGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *GameGroupBy) Float64sX(ctx context.Context) []float64
- func (s *GameGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *GameGroupBy) IntX(ctx context.Context) int
- func (s *GameGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *GameGroupBy) IntsX(ctx context.Context) []int
- func (ggb *GameGroupBy) Scan(ctx context.Context, v any) error
- func (s *GameGroupBy) ScanX(ctx context.Context, v any)
- func (s *GameGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *GameGroupBy) StringX(ctx context.Context) string
- func (s *GameGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *GameGroupBy) StringsX(ctx context.Context) []string
- type GameMutation
- func (m *GameMutation) AddField(name string, value ent.Value) error
- func (m *GameMutation) AddedEdges() []string
- func (m *GameMutation) AddedField(name string) (ent.Value, bool)
- func (m *GameMutation) AddedFields() []string
- func (m *GameMutation) AddedIDs(name string) []ent.Value
- func (m *GameMutation) ClearEdge(name string) error
- func (m *GameMutation) ClearField(name string) error
- func (m *GameMutation) ClearedEdges() []string
- func (m *GameMutation) ClearedFields() []string
- func (m GameMutation) Client() *Client
- func (m *GameMutation) EdgeCleared(name string) bool
- func (m *GameMutation) Field(name string) (ent.Value, bool)
- func (m *GameMutation) FieldCleared(name string) bool
- func (m *GameMutation) Fields() []string
- func (m *GameMutation) ID() (id string, exists bool)
- func (m *GameMutation) IDs(ctx context.Context) ([]string, error)
- func (m *GameMutation) Name() (r string, exists bool)
- func (m *GameMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *GameMutation) OldName(ctx context.Context) (v string, err error)
- func (m *GameMutation) Op() Op
- func (m *GameMutation) RemovedEdges() []string
- func (m *GameMutation) RemovedIDs(name string) []ent.Value
- func (m *GameMutation) ResetEdge(name string) error
- func (m *GameMutation) ResetField(name string) error
- func (m *GameMutation) ResetName()
- func (m *GameMutation) SetField(name string, value ent.Value) error
- func (m *GameMutation) SetID(id string)
- func (m *GameMutation) SetName(s string)
- func (m *GameMutation) SetOp(op Op)
- func (m GameMutation) Tx() (*Tx, error)
- func (m *GameMutation) Type() string
- func (m *GameMutation) Where(ps ...predicate.Game)
- func (m *GameMutation) WhereP(ps ...func(*sql.Selector))
- type GameOrder
- type GameOrderField
- type GamePaginateOption
- type GameQuery
- func (gq *GameQuery) Aggregate(fns ...AggregateFunc) *GameSelect
- func (gq *GameQuery) All(ctx context.Context) ([]*Game, error)
- func (gq *GameQuery) AllX(ctx context.Context) []*Game
- func (gq *GameQuery) Clone() *GameQuery
- func (ga *GameQuery) CollectFields(ctx context.Context, satisfies ...string) (*GameQuery, error)
- func (gq *GameQuery) Count(ctx context.Context) (int, error)
- func (gq *GameQuery) CountX(ctx context.Context) int
- func (gq *GameQuery) Exist(ctx context.Context) (bool, error)
- func (gq *GameQuery) ExistX(ctx context.Context) bool
- func (gq *GameQuery) First(ctx context.Context) (*Game, error)
- func (gq *GameQuery) FirstID(ctx context.Context) (id string, err error)
- func (gq *GameQuery) FirstIDX(ctx context.Context) string
- func (gq *GameQuery) FirstX(ctx context.Context) *Game
- func (gq *GameQuery) GroupBy(field string, fields ...string) *GameGroupBy
- func (gq *GameQuery) IDs(ctx context.Context) (ids []string, err error)
- func (gq *GameQuery) IDsX(ctx context.Context) []string
- func (gq *GameQuery) Limit(limit int) *GameQuery
- func (gq *GameQuery) Offset(offset int) *GameQuery
- func (gq *GameQuery) Only(ctx context.Context) (*Game, error)
- func (gq *GameQuery) OnlyID(ctx context.Context) (id string, err error)
- func (gq *GameQuery) OnlyIDX(ctx context.Context) string
- func (gq *GameQuery) OnlyX(ctx context.Context) *Game
- func (gq *GameQuery) Order(o ...game.OrderOption) *GameQuery
- func (ga *GameQuery) Paginate(ctx context.Context, after *Cursor, first *int, before *Cursor, last *int, ...) (*GameConnection, error)
- func (gq *GameQuery) Select(fields ...string) *GameSelect
- func (gq *GameQuery) Unique(unique bool) *GameQuery
- func (gq *GameQuery) Where(ps ...predicate.Game) *GameQuery
- type GameSelect
- func (gs *GameSelect) Aggregate(fns ...AggregateFunc) *GameSelect
- func (s *GameSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *GameSelect) BoolX(ctx context.Context) bool
- func (s *GameSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *GameSelect) BoolsX(ctx context.Context) []bool
- func (s *GameSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *GameSelect) Float64X(ctx context.Context) float64
- func (s *GameSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *GameSelect) Float64sX(ctx context.Context) []float64
- func (s *GameSelect) Int(ctx context.Context) (_ int, err error)
- func (s *GameSelect) IntX(ctx context.Context) int
- func (s *GameSelect) Ints(ctx context.Context) ([]int, error)
- func (s *GameSelect) IntsX(ctx context.Context) []int
- func (gs *GameSelect) Scan(ctx context.Context, v any) error
- func (s *GameSelect) ScanX(ctx context.Context, v any)
- func (s *GameSelect) String(ctx context.Context) (_ string, err error)
- func (s *GameSelect) StringX(ctx context.Context) string
- func (s *GameSelect) Strings(ctx context.Context) ([]string, error)
- func (s *GameSelect) StringsX(ctx context.Context) []string
- type GameUpdate
- func (gu *GameUpdate) Exec(ctx context.Context) error
- func (gu *GameUpdate) ExecX(ctx context.Context)
- func (gu *GameUpdate) Mutation() *GameMutation
- func (gu *GameUpdate) Save(ctx context.Context) (int, error)
- func (gu *GameUpdate) SaveX(ctx context.Context) int
- func (gu *GameUpdate) SetName(s string) *GameUpdate
- func (gu *GameUpdate) SetNillableName(s *string) *GameUpdate
- func (gu *GameUpdate) Where(ps ...predicate.Game) *GameUpdate
- type GameUpdateOne
- func (guo *GameUpdateOne) Exec(ctx context.Context) error
- func (guo *GameUpdateOne) ExecX(ctx context.Context)
- func (guo *GameUpdateOne) Mutation() *GameMutation
- func (guo *GameUpdateOne) Save(ctx context.Context) (*Game, error)
- func (guo *GameUpdateOne) SaveX(ctx context.Context) *Game
- func (guo *GameUpdateOne) Select(field string, fields ...string) *GameUpdateOne
- func (guo *GameUpdateOne) SetName(s string) *GameUpdateOne
- func (guo *GameUpdateOne) SetNillableName(s *string) *GameUpdateOne
- func (guo *GameUpdateOne) Where(ps ...predicate.Game) *GameUpdateOne
- type GameWhereInput
- type Games
- type Hook
- type InterceptFunc
- type Interceptor
- type Location
- func (l *Location) Cabinets(ctx context.Context) (result []*Cabinet, err error)
- func (*Location) IsNode()
- func (l *Location) NamedCabinets(name string) ([]*Cabinet, error)
- func (l *Location) QueryCabinets() *CabinetQuery
- func (l *Location) String() string
- func (l *Location) ToEdge(order *LocationOrder) *LocationEdge
- func (l *Location) Unwrap() *Location
- func (l *Location) Update() *LocationUpdateOne
- func (l *Location) Value(name string) (ent.Value, error)
- type LocationClient
- func (c *LocationClient) Create() *LocationCreate
- func (c *LocationClient) CreateBulk(builders ...*LocationCreate) *LocationCreateBulk
- func (c *LocationClient) Delete() *LocationDelete
- func (c *LocationClient) DeleteOne(l *Location) *LocationDeleteOne
- func (c *LocationClient) DeleteOneID(id string) *LocationDeleteOne
- func (c *LocationClient) Get(ctx context.Context, id string) (*Location, error)
- func (c *LocationClient) GetX(ctx context.Context, id string) *Location
- func (c *LocationClient) Hooks() []Hook
- func (c *LocationClient) Intercept(interceptors ...Interceptor)
- func (c *LocationClient) Interceptors() []Interceptor
- func (c *LocationClient) MapCreateBulk(slice any, setFunc func(*LocationCreate, int)) *LocationCreateBulk
- func (c *LocationClient) Query() *LocationQuery
- func (c *LocationClient) QueryCabinets(l *Location) *CabinetQuery
- func (c *LocationClient) Update() *LocationUpdate
- func (c *LocationClient) UpdateOne(l *Location) *LocationUpdateOne
- func (c *LocationClient) UpdateOneID(id string) *LocationUpdateOne
- func (c *LocationClient) Use(hooks ...Hook)
- type LocationConnection
- type LocationCreate
- func (lc *LocationCreate) AddCabinetIDs(ids ...string) *LocationCreate
- func (lc *LocationCreate) AddCabinets(c ...*Cabinet) *LocationCreate
- func (lc *LocationCreate) Exec(ctx context.Context) error
- func (lc *LocationCreate) ExecX(ctx context.Context)
- func (lc *LocationCreate) Mutation() *LocationMutation
- func (lc *LocationCreate) Save(ctx context.Context) (*Location, error)
- func (lc *LocationCreate) SaveX(ctx context.Context) *Location
- func (lc *LocationCreate) SetCoordinate(po *postgis.PointS) *LocationCreate
- func (lc *LocationCreate) SetDeduplicationKey(s string) *LocationCreate
- func (lc *LocationCreate) SetID(s string) *LocationCreate
- func (c *LocationCreate) SetInput(i CreateLocationInput) *LocationCreate
- func (lc *LocationCreate) SetName(s string) *LocationCreate
- func (lc *LocationCreate) SetNillableID(s *string) *LocationCreate
- func (lc *LocationCreate) SetNillableRawAddress(s *string) *LocationCreate
- func (lc *LocationCreate) SetRawAddress(s string) *LocationCreate
- type LocationCreateBulk
- type LocationDelete
- type LocationDeleteOne
- type LocationEdge
- type LocationEdges
- type LocationGroupBy
- func (lgb *LocationGroupBy) Aggregate(fns ...AggregateFunc) *LocationGroupBy
- func (s *LocationGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *LocationGroupBy) BoolX(ctx context.Context) bool
- func (s *LocationGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *LocationGroupBy) BoolsX(ctx context.Context) []bool
- func (s *LocationGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *LocationGroupBy) Float64X(ctx context.Context) float64
- func (s *LocationGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *LocationGroupBy) Float64sX(ctx context.Context) []float64
- func (s *LocationGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *LocationGroupBy) IntX(ctx context.Context) int
- func (s *LocationGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *LocationGroupBy) IntsX(ctx context.Context) []int
- func (lgb *LocationGroupBy) Scan(ctx context.Context, v any) error
- func (s *LocationGroupBy) ScanX(ctx context.Context, v any)
- func (s *LocationGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *LocationGroupBy) StringX(ctx context.Context) string
- func (s *LocationGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *LocationGroupBy) StringsX(ctx context.Context) []string
- type LocationMutation
- func (m *LocationMutation) AddCabinetIDs(ids ...string)
- func (m *LocationMutation) AddField(name string, value ent.Value) error
- func (m *LocationMutation) AddedEdges() []string
- func (m *LocationMutation) AddedField(name string) (ent.Value, bool)
- func (m *LocationMutation) AddedFields() []string
- func (m *LocationMutation) AddedIDs(name string) []ent.Value
- func (m *LocationMutation) CabinetsCleared() bool
- func (m *LocationMutation) CabinetsIDs() (ids []string)
- func (m *LocationMutation) ClearCabinets()
- func (m *LocationMutation) ClearCoordinate()
- func (m *LocationMutation) ClearEdge(name string) error
- func (m *LocationMutation) ClearField(name string) error
- func (m *LocationMutation) ClearRawAddress()
- func (m *LocationMutation) ClearedEdges() []string
- func (m *LocationMutation) ClearedFields() []string
- func (m LocationMutation) Client() *Client
- func (m *LocationMutation) Coordinate() (r *postgis.PointS, exists bool)
- func (m *LocationMutation) CoordinateCleared() bool
- func (m *LocationMutation) DeduplicationKey() (r string, exists bool)
- func (m *LocationMutation) EdgeCleared(name string) bool
- func (m *LocationMutation) Field(name string) (ent.Value, bool)
- func (m *LocationMutation) FieldCleared(name string) bool
- func (m *LocationMutation) Fields() []string
- func (m *LocationMutation) ID() (id string, exists bool)
- func (m *LocationMutation) IDs(ctx context.Context) ([]string, error)
- func (m *LocationMutation) Name() (r string, exists bool)
- func (m *LocationMutation) OldCoordinate(ctx context.Context) (v *postgis.PointS, err error)
- func (m *LocationMutation) OldDeduplicationKey(ctx context.Context) (v string, err error)
- func (m *LocationMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *LocationMutation) OldName(ctx context.Context) (v string, err error)
- func (m *LocationMutation) OldRawAddress(ctx context.Context) (v string, err error)
- func (m *LocationMutation) Op() Op
- func (m *LocationMutation) RawAddress() (r string, exists bool)
- func (m *LocationMutation) RawAddressCleared() bool
- func (m *LocationMutation) RemoveCabinetIDs(ids ...string)
- func (m *LocationMutation) RemovedCabinetsIDs() (ids []string)
- func (m *LocationMutation) RemovedEdges() []string
- func (m *LocationMutation) RemovedIDs(name string) []ent.Value
- func (m *LocationMutation) ResetCabinets()
- func (m *LocationMutation) ResetCoordinate()
- func (m *LocationMutation) ResetDeduplicationKey()
- func (m *LocationMutation) ResetEdge(name string) error
- func (m *LocationMutation) ResetField(name string) error
- func (m *LocationMutation) ResetName()
- func (m *LocationMutation) ResetRawAddress()
- func (m *LocationMutation) SetCoordinate(po *postgis.PointS)
- func (m *LocationMutation) SetDeduplicationKey(s string)
- func (m *LocationMutation) SetField(name string, value ent.Value) error
- func (m *LocationMutation) SetID(id string)
- func (m *LocationMutation) SetName(s string)
- func (m *LocationMutation) SetOp(op Op)
- func (m *LocationMutation) SetRawAddress(s string)
- func (m LocationMutation) Tx() (*Tx, error)
- func (m *LocationMutation) Type() string
- func (m *LocationMutation) Where(ps ...predicate.Location)
- func (m *LocationMutation) WhereP(ps ...func(*sql.Selector))
- type LocationOrder
- type LocationOrderField
- type LocationPaginateOption
- type LocationQuery
- func (lq *LocationQuery) Aggregate(fns ...AggregateFunc) *LocationSelect
- func (lq *LocationQuery) All(ctx context.Context) ([]*Location, error)
- func (lq *LocationQuery) AllX(ctx context.Context) []*Location
- func (lq *LocationQuery) Clone() *LocationQuery
- func (l *LocationQuery) CollectFields(ctx context.Context, satisfies ...string) (*LocationQuery, error)
- func (lq *LocationQuery) Count(ctx context.Context) (int, error)
- func (lq *LocationQuery) CountX(ctx context.Context) int
- func (lq *LocationQuery) Exist(ctx context.Context) (bool, error)
- func (lq *LocationQuery) ExistX(ctx context.Context) bool
- func (lq *LocationQuery) First(ctx context.Context) (*Location, error)
- func (lq *LocationQuery) FirstID(ctx context.Context) (id string, err error)
- func (lq *LocationQuery) FirstIDX(ctx context.Context) string
- func (lq *LocationQuery) FirstX(ctx context.Context) *Location
- func (lq *LocationQuery) GroupBy(field string, fields ...string) *LocationGroupBy
- func (lq *LocationQuery) IDs(ctx context.Context) (ids []string, err error)
- func (lq *LocationQuery) IDsX(ctx context.Context) []string
- func (lq *LocationQuery) Limit(limit int) *LocationQuery
- func (lq *LocationQuery) Offset(offset int) *LocationQuery
- func (lq *LocationQuery) Only(ctx context.Context) (*Location, error)
- func (lq *LocationQuery) OnlyID(ctx context.Context) (id string, err error)
- func (lq *LocationQuery) OnlyIDX(ctx context.Context) string
- func (lq *LocationQuery) OnlyX(ctx context.Context) *Location
- func (lq *LocationQuery) Order(o ...location.OrderOption) *LocationQuery
- func (l *LocationQuery) Paginate(ctx context.Context, after *Cursor, first *int, before *Cursor, last *int, ...) (*LocationConnection, error)
- func (lq *LocationQuery) QueryCabinets() *CabinetQuery
- func (lq *LocationQuery) Select(fields ...string) *LocationSelect
- func (lq *LocationQuery) Unique(unique bool) *LocationQuery
- func (lq *LocationQuery) Where(ps ...predicate.Location) *LocationQuery
- func (lq *LocationQuery) WithCabinets(opts ...func(*CabinetQuery)) *LocationQuery
- func (lq *LocationQuery) WithNamedCabinets(name string, opts ...func(*CabinetQuery)) *LocationQuery
- type LocationSelect
- func (ls *LocationSelect) Aggregate(fns ...AggregateFunc) *LocationSelect
- func (s *LocationSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *LocationSelect) BoolX(ctx context.Context) bool
- func (s *LocationSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *LocationSelect) BoolsX(ctx context.Context) []bool
- func (s *LocationSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *LocationSelect) Float64X(ctx context.Context) float64
- func (s *LocationSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *LocationSelect) Float64sX(ctx context.Context) []float64
- func (s *LocationSelect) Int(ctx context.Context) (_ int, err error)
- func (s *LocationSelect) IntX(ctx context.Context) int
- func (s *LocationSelect) Ints(ctx context.Context) ([]int, error)
- func (s *LocationSelect) IntsX(ctx context.Context) []int
- func (ls *LocationSelect) Scan(ctx context.Context, v any) error
- func (s *LocationSelect) ScanX(ctx context.Context, v any)
- func (s *LocationSelect) String(ctx context.Context) (_ string, err error)
- func (s *LocationSelect) StringX(ctx context.Context) string
- func (s *LocationSelect) Strings(ctx context.Context) ([]string, error)
- func (s *LocationSelect) StringsX(ctx context.Context) []string
- type LocationUpdate
- func (lu *LocationUpdate) AddCabinetIDs(ids ...string) *LocationUpdate
- func (lu *LocationUpdate) AddCabinets(c ...*Cabinet) *LocationUpdate
- func (lu *LocationUpdate) ClearCabinets() *LocationUpdate
- func (lu *LocationUpdate) ClearCoordinate() *LocationUpdate
- func (lu *LocationUpdate) ClearRawAddress() *LocationUpdate
- func (lu *LocationUpdate) Exec(ctx context.Context) error
- func (lu *LocationUpdate) ExecX(ctx context.Context)
- func (lu *LocationUpdate) Mutation() *LocationMutation
- func (lu *LocationUpdate) RemoveCabinetIDs(ids ...string) *LocationUpdate
- func (lu *LocationUpdate) RemoveCabinets(c ...*Cabinet) *LocationUpdate
- func (lu *LocationUpdate) Save(ctx context.Context) (int, error)
- func (lu *LocationUpdate) SaveX(ctx context.Context) int
- func (lu *LocationUpdate) SetCoordinate(po *postgis.PointS) *LocationUpdate
- func (lu *LocationUpdate) SetDeduplicationKey(s string) *LocationUpdate
- func (lu *LocationUpdate) SetName(s string) *LocationUpdate
- func (lu *LocationUpdate) SetNillableDeduplicationKey(s *string) *LocationUpdate
- func (lu *LocationUpdate) SetNillableName(s *string) *LocationUpdate
- func (lu *LocationUpdate) SetNillableRawAddress(s *string) *LocationUpdate
- func (lu *LocationUpdate) SetRawAddress(s string) *LocationUpdate
- func (lu *LocationUpdate) Where(ps ...predicate.Location) *LocationUpdate
- type LocationUpdateOne
- func (luo *LocationUpdateOne) AddCabinetIDs(ids ...string) *LocationUpdateOne
- func (luo *LocationUpdateOne) AddCabinets(c ...*Cabinet) *LocationUpdateOne
- func (luo *LocationUpdateOne) ClearCabinets() *LocationUpdateOne
- func (luo *LocationUpdateOne) ClearCoordinate() *LocationUpdateOne
- func (luo *LocationUpdateOne) ClearRawAddress() *LocationUpdateOne
- func (luo *LocationUpdateOne) Exec(ctx context.Context) error
- func (luo *LocationUpdateOne) ExecX(ctx context.Context)
- func (luo *LocationUpdateOne) Mutation() *LocationMutation
- func (luo *LocationUpdateOne) RemoveCabinetIDs(ids ...string) *LocationUpdateOne
- func (luo *LocationUpdateOne) RemoveCabinets(c ...*Cabinet) *LocationUpdateOne
- func (luo *LocationUpdateOne) Save(ctx context.Context) (*Location, error)
- func (luo *LocationUpdateOne) SaveX(ctx context.Context) *Location
- func (luo *LocationUpdateOne) Select(field string, fields ...string) *LocationUpdateOne
- func (luo *LocationUpdateOne) SetCoordinate(po *postgis.PointS) *LocationUpdateOne
- func (luo *LocationUpdateOne) SetDeduplicationKey(s string) *LocationUpdateOne
- func (luo *LocationUpdateOne) SetName(s string) *LocationUpdateOne
- func (luo *LocationUpdateOne) SetNillableDeduplicationKey(s *string) *LocationUpdateOne
- func (luo *LocationUpdateOne) SetNillableName(s *string) *LocationUpdateOne
- func (luo *LocationUpdateOne) SetNillableRawAddress(s *string) *LocationUpdateOne
- func (luo *LocationUpdateOne) SetRawAddress(s string) *LocationUpdateOne
- func (luo *LocationUpdateOne) Where(ps ...predicate.Location) *LocationUpdateOne
- type LocationWhereInput
- type Locations
- type MutateFunc
- type Mutation
- type Mutator
- type NodeOption
- type Noder
- type NotFoundError
- type NotLoadedError
- type NotSingularError
- type Op
- type Option
- type OrderDirection
- type OrderFunc
- type PageInfo
- type Policy
- type Querier
- type QuerierFunc
- type Query
- type QueryContext
- type RollbackFunc
- type RollbackHook
- type Rollbacker
- type TraverseFunc
- type Traverser
- type Tx
- type ValidationError
- type Value
Constants ¶
const ( // Operation types. OpCreate = ent.OpCreate OpDelete = ent.OpDelete OpDeleteOne = ent.OpDeleteOne OpUpdate = ent.OpUpdate OpUpdateOne = ent.OpUpdateOne // Node types. TypeCabinet = "Cabinet" TypeGame = "Game" TypeLocation = "Location" )
Variables ¶
var DefaultCabinetOrder = &CabinetOrder{ Direction: entgql.OrderDirectionAsc, Field: &CabinetOrderField{ Value: func(c *Cabinet) (ent.Value, error) { return c.ID, nil }, column: cabinet.FieldID, toTerm: cabinet.ByID, toCursor: func(c *Cabinet) Cursor { return Cursor{ID: c.ID} }, }, }
DefaultCabinetOrder is the default ordering of Cabinet.
var DefaultGameOrder = &GameOrder{ Direction: entgql.OrderDirectionAsc, Field: &GameOrderField{ Value: func(ga *Game) (ent.Value, error) { return ga.ID, nil }, column: game.FieldID, toTerm: game.ByID, toCursor: func(ga *Game) Cursor { return Cursor{ID: ga.ID} }, }, }
DefaultGameOrder is the default ordering of Game.
var DefaultLocationOrder = &LocationOrder{ Direction: entgql.OrderDirectionAsc, Field: &LocationOrderField{ Value: func(l *Location) (ent.Value, error) { return l.ID, nil }, column: location.FieldID, toTerm: location.ByID, toCursor: func(l *Location) Cursor { return Cursor{ID: l.ID} }, }, }
DefaultLocationOrder is the default ordering of Location.
var ErrEmptyCabinetWhereInput = errors.New("ent: empty predicate CabinetWhereInput")
ErrEmptyCabinetWhereInput is returned in case the CabinetWhereInput is empty.
var ErrEmptyGameWhereInput = errors.New("ent: empty predicate GameWhereInput")
ErrEmptyGameWhereInput is returned in case the GameWhereInput is empty.
var ErrEmptyLocationWhereInput = errors.New("ent: empty predicate LocationWhereInput")
ErrEmptyLocationWhereInput is returned in case the LocationWhereInput is empty.
var ErrTxStarted = errors.New("ent: cannot start a transaction within a transaction")
ErrTxStarted is returned when trying to start a new transaction from a transactional client.
Functions ¶
func IsConstraintError ¶
IsConstraintError returns a boolean indicating whether the error is a constraint failure.
func IsNotFound ¶
IsNotFound returns a boolean indicating whether the error is a not found error.
func IsNotLoaded ¶
IsNotLoaded returns a boolean indicating whether the error is a not loaded error.
func IsNotSingular ¶
IsNotSingular returns a boolean indicating whether the error is a not singular error.
func IsValidationError ¶
IsValidationError returns a boolean indicating whether the error is a validation error.
func NewContext ¶
NewContext returns a new context with the given Client attached.
func NewTxContext ¶
NewTxContext returns a new context with the given Tx attached.
Types ¶
type AggregateFunc ¶
AggregateFunc applies an aggregation step on the group-by traversal/selector.
func As ¶
func As(fn AggregateFunc, end string) AggregateFunc
As is a pseudo aggregation function for renaming another other functions with custom names. For example:
GroupBy(field1, field2). Aggregate(ent.As(ent.Sum(field1), "sum_field1"), (ent.As(ent.Sum(field2), "sum_field2")). Scan(ctx, &v)
func Count ¶
func Count() AggregateFunc
Count applies the "count" aggregation function on each group.
func Max ¶
func Max(field string) AggregateFunc
Max applies the "max" aggregation function on the given field of each group.
func Mean ¶
func Mean(field string) AggregateFunc
Mean applies the "mean" aggregation function on the given field of each group.
func Min ¶
func Min(field string) AggregateFunc
Min applies the "min" aggregation function on the given field of each group.
func Sum ¶
func Sum(field string) AggregateFunc
Sum applies the "sum" aggregation function on the given field of each group.
type Cabinet ¶
type Cabinet struct { // ID of the ent. ID string `json:"id,omitempty"` // Count holds the value of the "count" field. Count *int `json:"count,omitempty"` // LocationID holds the value of the "location_id" field. LocationID string `json:"location_id,omitempty"` // GameID holds the value of the "game_id" field. GameID string `json:"game_id,omitempty"` // Edges holds the relations/edges for other nodes in the graph. // The values are being populated by the CabinetQuery when eager-loading is set. Edges CabinetEdges `json:"edges"` // contains filtered or unexported fields }
Cabinet is the model entity for the Cabinet schema.
func (*Cabinet) IsNode ¶
func (*Cabinet) IsNode()
IsNode implements the Node interface check for GQLGen.
func (*Cabinet) QueryLocation ¶
func (c *Cabinet) QueryLocation() *LocationQuery
QueryLocation queries the "location" edge of the Cabinet entity.
func (*Cabinet) ToEdge ¶
func (c *Cabinet) ToEdge(order *CabinetOrder) *CabinetEdge
ToEdge converts Cabinet into CabinetEdge.
func (*Cabinet) Unwrap ¶
Unwrap unwraps the Cabinet entity that was returned from a transaction after it was closed, so that all future queries will be executed through the driver which created the transaction.
func (*Cabinet) Update ¶
func (c *Cabinet) Update() *CabinetUpdateOne
Update returns a builder for updating this Cabinet. Note that you need to call Cabinet.Unwrap() before calling this method if this Cabinet was returned from a transaction, and the transaction was committed or rolled back.
type CabinetClient ¶
type CabinetClient struct {
// contains filtered or unexported fields
}
CabinetClient is a client for the Cabinet schema.
func NewCabinetClient ¶
func NewCabinetClient(c config) *CabinetClient
NewCabinetClient returns a client for the Cabinet from the given config.
func (*CabinetClient) Create ¶
func (c *CabinetClient) Create() *CabinetCreate
Create returns a builder for creating a Cabinet entity.
func (*CabinetClient) CreateBulk ¶
func (c *CabinetClient) CreateBulk(builders ...*CabinetCreate) *CabinetCreateBulk
CreateBulk returns a builder for creating a bulk of Cabinet entities.
func (*CabinetClient) Delete ¶
func (c *CabinetClient) Delete() *CabinetDelete
Delete returns a delete builder for Cabinet.
func (*CabinetClient) DeleteOne ¶
func (c *CabinetClient) DeleteOne(ca *Cabinet) *CabinetDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*CabinetClient) DeleteOneID ¶
func (c *CabinetClient) DeleteOneID(id string) *CabinetDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*CabinetClient) GetX ¶
func (c *CabinetClient) GetX(ctx context.Context, id string) *Cabinet
GetX is like Get, but panics if an error occurs.
func (*CabinetClient) Hooks ¶
func (c *CabinetClient) Hooks() []Hook
Hooks returns the client hooks.
func (*CabinetClient) Intercept ¶
func (c *CabinetClient) Intercept(interceptors ...Interceptor)
Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `cabinet.Intercept(f(g(h())))`.
func (*CabinetClient) Interceptors ¶
func (c *CabinetClient) Interceptors() []Interceptor
Interceptors returns the client interceptors.
func (*CabinetClient) MapCreateBulk ¶
func (c *CabinetClient) MapCreateBulk(slice any, setFunc func(*CabinetCreate, int)) *CabinetCreateBulk
MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.
func (*CabinetClient) Query ¶
func (c *CabinetClient) Query() *CabinetQuery
Query returns a query builder for Cabinet.
func (*CabinetClient) QueryGame ¶
func (c *CabinetClient) QueryGame(ca *Cabinet) *GameQuery
QueryGame queries the game edge of a Cabinet.
func (*CabinetClient) QueryLocation ¶
func (c *CabinetClient) QueryLocation(ca *Cabinet) *LocationQuery
QueryLocation queries the location edge of a Cabinet.
func (*CabinetClient) Update ¶
func (c *CabinetClient) Update() *CabinetUpdate
Update returns an update builder for Cabinet.
func (*CabinetClient) UpdateOne ¶
func (c *CabinetClient) UpdateOne(ca *Cabinet) *CabinetUpdateOne
UpdateOne returns an update builder for the given entity.
func (*CabinetClient) UpdateOneID ¶
func (c *CabinetClient) UpdateOneID(id string) *CabinetUpdateOne
UpdateOneID returns an update builder for the given id.
func (*CabinetClient) Use ¶
func (c *CabinetClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `cabinet.Hooks(f(g(h())))`.
type CabinetConnection ¶
type CabinetConnection struct { Edges []*CabinetEdge `json:"edges"` PageInfo PageInfo `json:"pageInfo"` TotalCount int `json:"totalCount"` }
CabinetConnection is the connection containing edges to Cabinet.
type CabinetCreate ¶
type CabinetCreate struct {
// contains filtered or unexported fields
}
CabinetCreate is the builder for creating a Cabinet entity.
func (*CabinetCreate) Exec ¶
func (cc *CabinetCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*CabinetCreate) ExecX ¶
func (cc *CabinetCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*CabinetCreate) Mutation ¶
func (cc *CabinetCreate) Mutation() *CabinetMutation
Mutation returns the CabinetMutation object of the builder.
func (*CabinetCreate) Save ¶
func (cc *CabinetCreate) Save(ctx context.Context) (*Cabinet, error)
Save creates the Cabinet in the database.
func (*CabinetCreate) SaveX ¶
func (cc *CabinetCreate) SaveX(ctx context.Context) *Cabinet
SaveX calls Save and panics if Save returns an error.
func (*CabinetCreate) SetCount ¶
func (cc *CabinetCreate) SetCount(i int) *CabinetCreate
SetCount sets the "count" field.
func (*CabinetCreate) SetGame ¶
func (cc *CabinetCreate) SetGame(g *Game) *CabinetCreate
SetGame sets the "game" edge to the Game entity.
func (*CabinetCreate) SetGameID ¶
func (cc *CabinetCreate) SetGameID(s string) *CabinetCreate
SetGameID sets the "game_id" field.
func (*CabinetCreate) SetID ¶
func (cc *CabinetCreate) SetID(s string) *CabinetCreate
SetID sets the "id" field.
func (*CabinetCreate) SetLocation ¶
func (cc *CabinetCreate) SetLocation(l *Location) *CabinetCreate
SetLocation sets the "location" edge to the Location entity.
func (*CabinetCreate) SetLocationID ¶
func (cc *CabinetCreate) SetLocationID(s string) *CabinetCreate
SetLocationID sets the "location_id" field.
func (*CabinetCreate) SetNillableCount ¶
func (cc *CabinetCreate) SetNillableCount(i *int) *CabinetCreate
SetNillableCount sets the "count" field if the given value is not nil.
func (*CabinetCreate) SetNillableID ¶
func (cc *CabinetCreate) SetNillableID(s *string) *CabinetCreate
SetNillableID sets the "id" field if the given value is not nil.
type CabinetCreateBulk ¶
type CabinetCreateBulk struct {
// contains filtered or unexported fields
}
CabinetCreateBulk is the builder for creating many Cabinet entities in bulk.
func (*CabinetCreateBulk) Exec ¶
func (ccb *CabinetCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*CabinetCreateBulk) ExecX ¶
func (ccb *CabinetCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type CabinetDelete ¶
type CabinetDelete struct {
// contains filtered or unexported fields
}
CabinetDelete is the builder for deleting a Cabinet entity.
func (*CabinetDelete) Exec ¶
func (cd *CabinetDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*CabinetDelete) ExecX ¶
func (cd *CabinetDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*CabinetDelete) Where ¶
func (cd *CabinetDelete) Where(ps ...predicate.Cabinet) *CabinetDelete
Where appends a list predicates to the CabinetDelete builder.
type CabinetDeleteOne ¶
type CabinetDeleteOne struct {
// contains filtered or unexported fields
}
CabinetDeleteOne is the builder for deleting a single Cabinet entity.
func (*CabinetDeleteOne) Exec ¶
func (cdo *CabinetDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*CabinetDeleteOne) ExecX ¶
func (cdo *CabinetDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*CabinetDeleteOne) Where ¶
func (cdo *CabinetDeleteOne) Where(ps ...predicate.Cabinet) *CabinetDeleteOne
Where appends a list predicates to the CabinetDelete builder.
type CabinetEdge ¶
CabinetEdge is the edge representation of Cabinet.
type CabinetEdges ¶
type CabinetEdges struct { // Location holds the value of the location edge. Location *Location `json:"location,omitempty"` // Game holds the value of the game edge. Game *Game `json:"game,omitempty"` // contains filtered or unexported fields }
CabinetEdges holds the relations/edges for other nodes in the graph.
func (CabinetEdges) GameOrErr ¶
func (e CabinetEdges) GameOrErr() (*Game, error)
GameOrErr returns the Game value or an error if the edge was not loaded in eager-loading, or loaded but was not found.
func (CabinetEdges) LocationOrErr ¶
func (e CabinetEdges) LocationOrErr() (*Location, error)
LocationOrErr returns the Location value or an error if the edge was not loaded in eager-loading, or loaded but was not found.
type CabinetGroupBy ¶
type CabinetGroupBy struct {
// contains filtered or unexported fields
}
CabinetGroupBy is the group-by builder for Cabinet entities.
func (*CabinetGroupBy) Aggregate ¶
func (cgb *CabinetGroupBy) Aggregate(fns ...AggregateFunc) *CabinetGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*CabinetGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*CabinetGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*CabinetGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*CabinetGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*CabinetGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*CabinetGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*CabinetGroupBy) Scan ¶
func (cgb *CabinetGroupBy) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*CabinetGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type CabinetMutation ¶
type CabinetMutation struct {
// contains filtered or unexported fields
}
CabinetMutation represents an operation that mutates the Cabinet nodes in the graph.
func (*CabinetMutation) AddCount ¶
func (m *CabinetMutation) AddCount(i int)
AddCount adds i to the "count" field.
func (*CabinetMutation) AddField ¶
func (m *CabinetMutation) AddField(name string, value ent.Value) error
AddField adds the value to the field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.
func (*CabinetMutation) AddedCount ¶
func (m *CabinetMutation) AddedCount() (r int, exists bool)
AddedCount returns the value that was added to the "count" field in this mutation.
func (*CabinetMutation) AddedEdges ¶
func (m *CabinetMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*CabinetMutation) AddedField ¶
func (m *CabinetMutation) AddedField(name string) (ent.Value, bool)
AddedField returns the numeric value that was incremented/decremented on a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.
func (*CabinetMutation) AddedFields ¶
func (m *CabinetMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*CabinetMutation) AddedIDs ¶
func (m *CabinetMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*CabinetMutation) ClearCount ¶
func (m *CabinetMutation) ClearCount()
ClearCount clears the value of the "count" field.
func (*CabinetMutation) ClearEdge ¶
func (m *CabinetMutation) ClearEdge(name string) error
ClearEdge clears the value of the edge with the given name. It returns an error if that edge is not defined in the schema.
func (*CabinetMutation) ClearField ¶
func (m *CabinetMutation) ClearField(name string) error
ClearField clears the value of the field with the given name. It returns an error if the field is not defined in the schema.
func (*CabinetMutation) ClearGame ¶
func (m *CabinetMutation) ClearGame()
ClearGame clears the "game" edge to the Game entity.
func (*CabinetMutation) ClearLocation ¶
func (m *CabinetMutation) ClearLocation()
ClearLocation clears the "location" edge to the Location entity.
func (*CabinetMutation) ClearedEdges ¶
func (m *CabinetMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*CabinetMutation) ClearedFields ¶
func (m *CabinetMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (CabinetMutation) Client ¶
func (m CabinetMutation) Client() *Client
Client returns a new `ent.Client` from the mutation. If the mutation was executed in a transaction (ent.Tx), a transactional client is returned.
func (*CabinetMutation) Count ¶
func (m *CabinetMutation) Count() (r int, exists bool)
Count returns the value of the "count" field in the mutation.
func (*CabinetMutation) CountCleared ¶
func (m *CabinetMutation) CountCleared() bool
CountCleared returns if the "count" field was cleared in this mutation.
func (*CabinetMutation) EdgeCleared ¶
func (m *CabinetMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*CabinetMutation) Field ¶
func (m *CabinetMutation) Field(name string) (ent.Value, bool)
Field returns the value of a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.
func (*CabinetMutation) FieldCleared ¶
func (m *CabinetMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*CabinetMutation) Fields ¶
func (m *CabinetMutation) Fields() []string
Fields returns all fields that were changed during this mutation. Note that in order to get all numeric fields that were incremented/decremented, call AddedFields().
func (*CabinetMutation) GameCleared ¶
func (m *CabinetMutation) GameCleared() bool
GameCleared reports if the "game" edge to the Game entity was cleared.
func (*CabinetMutation) GameID ¶
func (m *CabinetMutation) GameID() (r string, exists bool)
GameID returns the value of the "game_id" field in the mutation.
func (*CabinetMutation) GameIDs ¶
func (m *CabinetMutation) GameIDs() (ids []string)
GameIDs returns the "game" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use GameID instead. It exists only for internal usage by the builders.
func (*CabinetMutation) ID ¶
func (m *CabinetMutation) ID() (id string, exists bool)
ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.
func (*CabinetMutation) IDs ¶
func (m *CabinetMutation) IDs(ctx context.Context) ([]string, error)
IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.
func (*CabinetMutation) LocationCleared ¶
func (m *CabinetMutation) LocationCleared() bool
LocationCleared reports if the "location" edge to the Location entity was cleared.
func (*CabinetMutation) LocationID ¶
func (m *CabinetMutation) LocationID() (r string, exists bool)
LocationID returns the value of the "location_id" field in the mutation.
func (*CabinetMutation) LocationIDs ¶
func (m *CabinetMutation) LocationIDs() (ids []string)
LocationIDs returns the "location" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use LocationID instead. It exists only for internal usage by the builders.
func (*CabinetMutation) OldCount ¶
func (m *CabinetMutation) OldCount(ctx context.Context) (v *int, err error)
OldCount returns the old "count" field's value of the Cabinet entity. If the Cabinet object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*CabinetMutation) OldField ¶
OldField returns the old value of the field from the database. An error is returned if the mutation operation is not UpdateOne, or the query to the database failed.
func (*CabinetMutation) OldGameID ¶
func (m *CabinetMutation) OldGameID(ctx context.Context) (v string, err error)
OldGameID returns the old "game_id" field's value of the Cabinet entity. If the Cabinet object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*CabinetMutation) OldLocationID ¶
func (m *CabinetMutation) OldLocationID(ctx context.Context) (v string, err error)
OldLocationID returns the old "location_id" field's value of the Cabinet entity. If the Cabinet object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*CabinetMutation) RemovedEdges ¶
func (m *CabinetMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*CabinetMutation) RemovedIDs ¶
func (m *CabinetMutation) RemovedIDs(name string) []ent.Value
RemovedIDs returns all IDs (to other nodes) that were removed for the edge with the given name in this mutation.
func (*CabinetMutation) ResetCount ¶
func (m *CabinetMutation) ResetCount()
ResetCount resets all changes to the "count" field.
func (*CabinetMutation) ResetEdge ¶
func (m *CabinetMutation) ResetEdge(name string) error
ResetEdge resets all changes to the edge with the given name in this mutation. It returns an error if the edge is not defined in the schema.
func (*CabinetMutation) ResetField ¶
func (m *CabinetMutation) ResetField(name string) error
ResetField resets all changes in the mutation for the field with the given name. It returns an error if the field is not defined in the schema.
func (*CabinetMutation) ResetGame ¶
func (m *CabinetMutation) ResetGame()
ResetGame resets all changes to the "game" edge.
func (*CabinetMutation) ResetGameID ¶
func (m *CabinetMutation) ResetGameID()
ResetGameID resets all changes to the "game_id" field.
func (*CabinetMutation) ResetLocation ¶
func (m *CabinetMutation) ResetLocation()
ResetLocation resets all changes to the "location" edge.
func (*CabinetMutation) ResetLocationID ¶
func (m *CabinetMutation) ResetLocationID()
ResetLocationID resets all changes to the "location_id" field.
func (*CabinetMutation) SetCount ¶
func (m *CabinetMutation) SetCount(i int)
SetCount sets the "count" field.
func (*CabinetMutation) SetField ¶
func (m *CabinetMutation) SetField(name string, value ent.Value) error
SetField sets the value of a field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.
func (*CabinetMutation) SetGameID ¶
func (m *CabinetMutation) SetGameID(s string)
SetGameID sets the "game_id" field.
func (*CabinetMutation) SetID ¶
func (m *CabinetMutation) SetID(id string)
SetID sets the value of the id field. Note that this operation is only accepted on creation of Cabinet entities.
func (*CabinetMutation) SetLocationID ¶
func (m *CabinetMutation) SetLocationID(s string)
SetLocationID sets the "location_id" field.
func (*CabinetMutation) SetOp ¶
func (m *CabinetMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (CabinetMutation) Tx ¶
func (m CabinetMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*CabinetMutation) Type ¶
func (m *CabinetMutation) Type() string
Type returns the node type of this mutation (Cabinet).
func (*CabinetMutation) Where ¶
func (m *CabinetMutation) Where(ps ...predicate.Cabinet)
Where appends a list predicates to the CabinetMutation builder.
func (*CabinetMutation) WhereP ¶
func (m *CabinetMutation) WhereP(ps ...func(*sql.Selector))
WhereP appends storage-level predicates to the CabinetMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.
type CabinetOrder ¶
type CabinetOrder struct { Direction OrderDirection `json:"direction"` Field *CabinetOrderField `json:"field"` }
CabinetOrder defines the ordering of Cabinet.
type CabinetOrderField ¶
type CabinetOrderField struct { // Value extracts the ordering value from the given Cabinet. Value func(*Cabinet) (ent.Value, error) // contains filtered or unexported fields }
CabinetOrderField defines the ordering field of Cabinet.
type CabinetPaginateOption ¶
type CabinetPaginateOption func(*cabinetPager) error
CabinetPaginateOption enables pagination customization.
func WithCabinetFilter ¶
func WithCabinetFilter(filter func(*CabinetQuery) (*CabinetQuery, error)) CabinetPaginateOption
WithCabinetFilter configures pagination filter.
func WithCabinetOrder ¶
func WithCabinetOrder(order *CabinetOrder) CabinetPaginateOption
WithCabinetOrder configures pagination ordering.
type CabinetQuery ¶
type CabinetQuery struct {
// contains filtered or unexported fields
}
CabinetQuery is the builder for querying Cabinet entities.
func (*CabinetQuery) Aggregate ¶
func (cq *CabinetQuery) Aggregate(fns ...AggregateFunc) *CabinetSelect
Aggregate returns a CabinetSelect configured with the given aggregations.
func (*CabinetQuery) All ¶
func (cq *CabinetQuery) All(ctx context.Context) ([]*Cabinet, error)
All executes the query and returns a list of Cabinets.
func (*CabinetQuery) AllX ¶
func (cq *CabinetQuery) AllX(ctx context.Context) []*Cabinet
AllX is like All, but panics if an error occurs.
func (*CabinetQuery) Clone ¶
func (cq *CabinetQuery) Clone() *CabinetQuery
Clone returns a duplicate of the CabinetQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*CabinetQuery) CollectFields ¶
func (c *CabinetQuery) CollectFields(ctx context.Context, satisfies ...string) (*CabinetQuery, error)
CollectFields tells the query-builder to eagerly load connected nodes by resolver context.
func (*CabinetQuery) Count ¶
func (cq *CabinetQuery) Count(ctx context.Context) (int, error)
Count returns the count of the given query.
func (*CabinetQuery) CountX ¶
func (cq *CabinetQuery) CountX(ctx context.Context) int
CountX is like Count, but panics if an error occurs.
func (*CabinetQuery) Exist ¶
func (cq *CabinetQuery) Exist(ctx context.Context) (bool, error)
Exist returns true if the query has elements in the graph.
func (*CabinetQuery) ExistX ¶
func (cq *CabinetQuery) ExistX(ctx context.Context) bool
ExistX is like Exist, but panics if an error occurs.
func (*CabinetQuery) First ¶
func (cq *CabinetQuery) First(ctx context.Context) (*Cabinet, error)
First returns the first Cabinet entity from the query. Returns a *NotFoundError when no Cabinet was found.
func (*CabinetQuery) FirstID ¶
func (cq *CabinetQuery) FirstID(ctx context.Context) (id string, err error)
FirstID returns the first Cabinet ID from the query. Returns a *NotFoundError when no Cabinet ID was found.
func (*CabinetQuery) FirstIDX ¶
func (cq *CabinetQuery) FirstIDX(ctx context.Context) string
FirstIDX is like FirstID, but panics if an error occurs.
func (*CabinetQuery) FirstX ¶
func (cq *CabinetQuery) FirstX(ctx context.Context) *Cabinet
FirstX is like First, but panics if an error occurs.
func (*CabinetQuery) GroupBy ¶
func (cq *CabinetQuery) GroupBy(field string, fields ...string) *CabinetGroupBy
GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.
Example:
var v []struct { Count int `json:"count,omitempty"` Count int `json:"count,omitempty"` } client.Cabinet.Query(). GroupBy(cabinet.FieldCount). Aggregate(ent.Count()). Scan(ctx, &v)
func (*CabinetQuery) IDs ¶
func (cq *CabinetQuery) IDs(ctx context.Context) (ids []string, err error)
IDs executes the query and returns a list of Cabinet IDs.
func (*CabinetQuery) IDsX ¶
func (cq *CabinetQuery) IDsX(ctx context.Context) []string
IDsX is like IDs, but panics if an error occurs.
func (*CabinetQuery) Limit ¶
func (cq *CabinetQuery) Limit(limit int) *CabinetQuery
Limit the number of records to be returned by this query.
func (*CabinetQuery) Offset ¶
func (cq *CabinetQuery) Offset(offset int) *CabinetQuery
Offset to start from.
func (*CabinetQuery) Only ¶
func (cq *CabinetQuery) Only(ctx context.Context) (*Cabinet, error)
Only returns a single Cabinet entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Cabinet entity is found. Returns a *NotFoundError when no Cabinet entities are found.
func (*CabinetQuery) OnlyID ¶
func (cq *CabinetQuery) OnlyID(ctx context.Context) (id string, err error)
OnlyID is like Only, but returns the only Cabinet ID in the query. Returns a *NotSingularError when more than one Cabinet ID is found. Returns a *NotFoundError when no entities are found.
func (*CabinetQuery) OnlyIDX ¶
func (cq *CabinetQuery) OnlyIDX(ctx context.Context) string
OnlyIDX is like OnlyID, but panics if an error occurs.
func (*CabinetQuery) OnlyX ¶
func (cq *CabinetQuery) OnlyX(ctx context.Context) *Cabinet
OnlyX is like Only, but panics if an error occurs.
func (*CabinetQuery) Order ¶
func (cq *CabinetQuery) Order(o ...cabinet.OrderOption) *CabinetQuery
Order specifies how the records should be ordered.
func (*CabinetQuery) Paginate ¶
func (c *CabinetQuery) Paginate( ctx context.Context, after *Cursor, first *int, before *Cursor, last *int, opts ...CabinetPaginateOption, ) (*CabinetConnection, error)
Paginate executes the query and returns a relay based cursor connection to Cabinet.
func (*CabinetQuery) QueryGame ¶
func (cq *CabinetQuery) QueryGame() *GameQuery
QueryGame chains the current query on the "game" edge.
func (*CabinetQuery) QueryLocation ¶
func (cq *CabinetQuery) QueryLocation() *LocationQuery
QueryLocation chains the current query on the "location" edge.
func (*CabinetQuery) Select ¶
func (cq *CabinetQuery) Select(fields ...string) *CabinetSelect
Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.
Example:
var v []struct { Count int `json:"count,omitempty"` } client.Cabinet.Query(). Select(cabinet.FieldCount). Scan(ctx, &v)
func (*CabinetQuery) Unique ¶
func (cq *CabinetQuery) Unique(unique bool) *CabinetQuery
Unique configures the query builder to filter duplicate records on query. By default, unique is set to true, and can be disabled using this method.
func (*CabinetQuery) Where ¶
func (cq *CabinetQuery) Where(ps ...predicate.Cabinet) *CabinetQuery
Where adds a new predicate for the CabinetQuery builder.
func (*CabinetQuery) WithGame ¶
func (cq *CabinetQuery) WithGame(opts ...func(*GameQuery)) *CabinetQuery
WithGame tells the query-builder to eager-load the nodes that are connected to the "game" edge. The optional arguments are used to configure the query builder of the edge.
func (*CabinetQuery) WithLocation ¶
func (cq *CabinetQuery) WithLocation(opts ...func(*LocationQuery)) *CabinetQuery
WithLocation tells the query-builder to eager-load the nodes that are connected to the "location" edge. The optional arguments are used to configure the query builder of the edge.
type CabinetSelect ¶
type CabinetSelect struct { *CabinetQuery // contains filtered or unexported fields }
CabinetSelect is the builder for selecting fields of Cabinet entities.
func (*CabinetSelect) Aggregate ¶
func (cs *CabinetSelect) Aggregate(fns ...AggregateFunc) *CabinetSelect
Aggregate adds the given aggregation functions to the selector query.
func (*CabinetSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*CabinetSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*CabinetSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*CabinetSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*CabinetSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*CabinetSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*CabinetSelect) Scan ¶
func (cs *CabinetSelect) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*CabinetSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type CabinetUpdate ¶
type CabinetUpdate struct {
// contains filtered or unexported fields
}
CabinetUpdate is the builder for updating Cabinet entities.
func (*CabinetUpdate) AddCount ¶
func (cu *CabinetUpdate) AddCount(i int) *CabinetUpdate
AddCount adds i to the "count" field.
func (*CabinetUpdate) ClearCount ¶
func (cu *CabinetUpdate) ClearCount() *CabinetUpdate
ClearCount clears the value of the "count" field.
func (*CabinetUpdate) ClearGame ¶
func (cu *CabinetUpdate) ClearGame() *CabinetUpdate
ClearGame clears the "game" edge to the Game entity.
func (*CabinetUpdate) ClearLocation ¶
func (cu *CabinetUpdate) ClearLocation() *CabinetUpdate
ClearLocation clears the "location" edge to the Location entity.
func (*CabinetUpdate) Exec ¶
func (cu *CabinetUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*CabinetUpdate) ExecX ¶
func (cu *CabinetUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*CabinetUpdate) Mutation ¶
func (cu *CabinetUpdate) Mutation() *CabinetMutation
Mutation returns the CabinetMutation object of the builder.
func (*CabinetUpdate) Save ¶
func (cu *CabinetUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*CabinetUpdate) SaveX ¶
func (cu *CabinetUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*CabinetUpdate) SetCount ¶
func (cu *CabinetUpdate) SetCount(i int) *CabinetUpdate
SetCount sets the "count" field.
func (*CabinetUpdate) SetGame ¶
func (cu *CabinetUpdate) SetGame(g *Game) *CabinetUpdate
SetGame sets the "game" edge to the Game entity.
func (*CabinetUpdate) SetGameID ¶
func (cu *CabinetUpdate) SetGameID(s string) *CabinetUpdate
SetGameID sets the "game_id" field.
func (*CabinetUpdate) SetLocation ¶
func (cu *CabinetUpdate) SetLocation(l *Location) *CabinetUpdate
SetLocation sets the "location" edge to the Location entity.
func (*CabinetUpdate) SetLocationID ¶
func (cu *CabinetUpdate) SetLocationID(s string) *CabinetUpdate
SetLocationID sets the "location_id" field.
func (*CabinetUpdate) SetNillableCount ¶
func (cu *CabinetUpdate) SetNillableCount(i *int) *CabinetUpdate
SetNillableCount sets the "count" field if the given value is not nil.
func (*CabinetUpdate) SetNillableGameID ¶
func (cu *CabinetUpdate) SetNillableGameID(s *string) *CabinetUpdate
SetNillableGameID sets the "game_id" field if the given value is not nil.
func (*CabinetUpdate) SetNillableLocationID ¶
func (cu *CabinetUpdate) SetNillableLocationID(s *string) *CabinetUpdate
SetNillableLocationID sets the "location_id" field if the given value is not nil.
func (*CabinetUpdate) Where ¶
func (cu *CabinetUpdate) Where(ps ...predicate.Cabinet) *CabinetUpdate
Where appends a list predicates to the CabinetUpdate builder.
type CabinetUpdateOne ¶
type CabinetUpdateOne struct {
// contains filtered or unexported fields
}
CabinetUpdateOne is the builder for updating a single Cabinet entity.
func (*CabinetUpdateOne) AddCount ¶
func (cuo *CabinetUpdateOne) AddCount(i int) *CabinetUpdateOne
AddCount adds i to the "count" field.
func (*CabinetUpdateOne) ClearCount ¶
func (cuo *CabinetUpdateOne) ClearCount() *CabinetUpdateOne
ClearCount clears the value of the "count" field.
func (*CabinetUpdateOne) ClearGame ¶
func (cuo *CabinetUpdateOne) ClearGame() *CabinetUpdateOne
ClearGame clears the "game" edge to the Game entity.
func (*CabinetUpdateOne) ClearLocation ¶
func (cuo *CabinetUpdateOne) ClearLocation() *CabinetUpdateOne
ClearLocation clears the "location" edge to the Location entity.
func (*CabinetUpdateOne) Exec ¶
func (cuo *CabinetUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*CabinetUpdateOne) ExecX ¶
func (cuo *CabinetUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*CabinetUpdateOne) Mutation ¶
func (cuo *CabinetUpdateOne) Mutation() *CabinetMutation
Mutation returns the CabinetMutation object of the builder.
func (*CabinetUpdateOne) Save ¶
func (cuo *CabinetUpdateOne) Save(ctx context.Context) (*Cabinet, error)
Save executes the query and returns the updated Cabinet entity.
func (*CabinetUpdateOne) SaveX ¶
func (cuo *CabinetUpdateOne) SaveX(ctx context.Context) *Cabinet
SaveX is like Save, but panics if an error occurs.
func (*CabinetUpdateOne) Select ¶
func (cuo *CabinetUpdateOne) Select(field string, fields ...string) *CabinetUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*CabinetUpdateOne) SetCount ¶
func (cuo *CabinetUpdateOne) SetCount(i int) *CabinetUpdateOne
SetCount sets the "count" field.
func (*CabinetUpdateOne) SetGame ¶
func (cuo *CabinetUpdateOne) SetGame(g *Game) *CabinetUpdateOne
SetGame sets the "game" edge to the Game entity.
func (*CabinetUpdateOne) SetGameID ¶
func (cuo *CabinetUpdateOne) SetGameID(s string) *CabinetUpdateOne
SetGameID sets the "game_id" field.
func (*CabinetUpdateOne) SetLocation ¶
func (cuo *CabinetUpdateOne) SetLocation(l *Location) *CabinetUpdateOne
SetLocation sets the "location" edge to the Location entity.
func (*CabinetUpdateOne) SetLocationID ¶
func (cuo *CabinetUpdateOne) SetLocationID(s string) *CabinetUpdateOne
SetLocationID sets the "location_id" field.
func (*CabinetUpdateOne) SetNillableCount ¶
func (cuo *CabinetUpdateOne) SetNillableCount(i *int) *CabinetUpdateOne
SetNillableCount sets the "count" field if the given value is not nil.
func (*CabinetUpdateOne) SetNillableGameID ¶
func (cuo *CabinetUpdateOne) SetNillableGameID(s *string) *CabinetUpdateOne
SetNillableGameID sets the "game_id" field if the given value is not nil.
func (*CabinetUpdateOne) SetNillableLocationID ¶
func (cuo *CabinetUpdateOne) SetNillableLocationID(s *string) *CabinetUpdateOne
SetNillableLocationID sets the "location_id" field if the given value is not nil.
func (*CabinetUpdateOne) Where ¶
func (cuo *CabinetUpdateOne) Where(ps ...predicate.Cabinet) *CabinetUpdateOne
Where appends a list predicates to the CabinetUpdate builder.
type CabinetWhereInput ¶
type CabinetWhereInput struct { Predicates []predicate.Cabinet `json:"-"` Not *CabinetWhereInput `json:"not,omitempty"` Or []*CabinetWhereInput `json:"or,omitempty"` And []*CabinetWhereInput `json:"and,omitempty"` // "id" field predicates. ID *string `json:"id,omitempty"` IDNEQ *string `json:"idNEQ,omitempty"` IDIn []string `json:"idIn,omitempty"` IDNotIn []string `json:"idNotIn,omitempty"` IDGT *string `json:"idGT,omitempty"` IDGTE *string `json:"idGTE,omitempty"` IDLT *string `json:"idLT,omitempty"` IDLTE *string `json:"idLTE,omitempty"` IDEqualFold *string `json:"idEqualFold,omitempty"` IDContainsFold *string `json:"idContainsFold,omitempty"` // "count" field predicates. Count *int `json:"count,omitempty"` CountNEQ *int `json:"countNEQ,omitempty"` CountIn []int `json:"countIn,omitempty"` CountNotIn []int `json:"countNotIn,omitempty"` CountGT *int `json:"countGT,omitempty"` CountGTE *int `json:"countGTE,omitempty"` CountLT *int `json:"countLT,omitempty"` CountLTE *int `json:"countLTE,omitempty"` CountIsNil bool `json:"countIsNil,omitempty"` CountNotNil bool `json:"countNotNil,omitempty"` // "location" edge predicates. HasLocation *bool `json:"hasLocation,omitempty"` HasLocationWith []*LocationWhereInput `json:"hasLocationWith,omitempty"` // "game" edge predicates. HasGame *bool `json:"hasGame,omitempty"` HasGameWith []*GameWhereInput `json:"hasGameWith,omitempty"` }
CabinetWhereInput represents a where input for filtering Cabinet queries.
func (*CabinetWhereInput) AddPredicates ¶
func (i *CabinetWhereInput) AddPredicates(predicates ...predicate.Cabinet)
AddPredicates adds custom predicates to the where input to be used during the filtering phase.
func (*CabinetWhereInput) Filter ¶
func (i *CabinetWhereInput) Filter(q *CabinetQuery) (*CabinetQuery, error)
Filter applies the CabinetWhereInput filter on the CabinetQuery builder.
type Client ¶
type Client struct { // Schema is the client for creating, migrating and dropping schema. Schema *migrate.Schema // Cabinet is the client for interacting with the Cabinet builders. Cabinet *CabinetClient // Game is the client for interacting with the Game builders. Game *GameClient // Location is the client for interacting with the Location builders. Location *LocationClient // contains filtered or unexported fields }
Client is the client that holds all ent builders.
func FromContext ¶
FromContext returns a Client stored inside a context, or nil if there isn't one.
func Open ¶
Open opens a database/sql.DB specified by the driver name and the data source name, and returns a new client attached to it. Optional parameters can be added for configuring the client.
func (*Client) Debug ¶
Debug returns a new debug-client. It's used to get verbose logging on specific operations.
client.Debug(). Cabinet. Query(). Count(ctx)
func (*Client) Intercept ¶
func (c *Client) Intercept(interceptors ...Interceptor)
Intercept adds the query interceptors to all the entity clients. In order to add interceptors to a specific client, call: `client.Node.Intercept(...)`.
func (*Client) Noder ¶
Noder returns a Node by its id. If the NodeType was not provided, it will be derived from the id value according to the universal-id configuration.
c.Noder(ctx, id) c.Noder(ctx, id, ent.WithNodeType(typeResolver))
func (*Client) OpenTx ¶
OpenTx opens a transaction and returns a transactional context along with the created transaction.
type CommitFunc ¶
The CommitFunc type is an adapter to allow the use of ordinary function as a Committer. If f is a function with the appropriate signature, CommitFunc(f) is a Committer that calls f.
type CommitHook ¶
CommitHook defines the "commit middleware". A function that gets a Committer and returns a Committer. For example:
hook := func(next ent.Committer) ent.Committer { return ent.CommitFunc(func(ctx context.Context, tx *ent.Tx) error { // Do some stuff before. if err := next.Commit(ctx, tx); err != nil { return err } // Do some stuff after. return nil }) }
type ConstraintError ¶
type ConstraintError struct {
// contains filtered or unexported fields
}
ConstraintError returns when trying to create/update one or more entities and one or more of their constraints failed. For example, violation of edge or field uniqueness.
func (ConstraintError) Error ¶
func (e ConstraintError) Error() string
Error implements the error interface.
func (*ConstraintError) Unwrap ¶
func (e *ConstraintError) Unwrap() error
Unwrap implements the errors.Wrapper interface.
type CreateLocationInput ¶
type CreateLocationInput struct { Name string RawAddress *string Coordinate *postgis.PointS CabinetIDs []string }
CreateLocationInput represents a mutation input for creating locations.
func (*CreateLocationInput) Mutate ¶
func (i *CreateLocationInput) Mutate(m *LocationMutation)
Mutate applies the CreateLocationInput on the LocationMutation builder.
type Game ¶
type Game struct { // ID of the ent. ID string `json:"id,omitempty"` // Name holds the value of the "name" field. Name string `json:"name,omitempty"` // contains filtered or unexported fields }
Game is the model entity for the Game schema.
func (*Game) Unwrap ¶
Unwrap unwraps the Game entity that was returned from a transaction after it was closed, so that all future queries will be executed through the driver which created the transaction.
func (*Game) Update ¶
func (ga *Game) Update() *GameUpdateOne
Update returns a builder for updating this Game. Note that you need to call Game.Unwrap() before calling this method if this Game was returned from a transaction, and the transaction was committed or rolled back.
type GameClient ¶
type GameClient struct {
// contains filtered or unexported fields
}
GameClient is a client for the Game schema.
func NewGameClient ¶
func NewGameClient(c config) *GameClient
NewGameClient returns a client for the Game from the given config.
func (*GameClient) Create ¶
func (c *GameClient) Create() *GameCreate
Create returns a builder for creating a Game entity.
func (*GameClient) CreateBulk ¶
func (c *GameClient) CreateBulk(builders ...*GameCreate) *GameCreateBulk
CreateBulk returns a builder for creating a bulk of Game entities.
func (*GameClient) Delete ¶
func (c *GameClient) Delete() *GameDelete
Delete returns a delete builder for Game.
func (*GameClient) DeleteOne ¶
func (c *GameClient) DeleteOne(ga *Game) *GameDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*GameClient) DeleteOneID ¶
func (c *GameClient) DeleteOneID(id string) *GameDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*GameClient) GetX ¶
func (c *GameClient) GetX(ctx context.Context, id string) *Game
GetX is like Get, but panics if an error occurs.
func (*GameClient) Intercept ¶
func (c *GameClient) Intercept(interceptors ...Interceptor)
Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `game.Intercept(f(g(h())))`.
func (*GameClient) Interceptors ¶
func (c *GameClient) Interceptors() []Interceptor
Interceptors returns the client interceptors.
func (*GameClient) MapCreateBulk ¶
func (c *GameClient) MapCreateBulk(slice any, setFunc func(*GameCreate, int)) *GameCreateBulk
MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.
func (*GameClient) Query ¶
func (c *GameClient) Query() *GameQuery
Query returns a query builder for Game.
func (*GameClient) Update ¶
func (c *GameClient) Update() *GameUpdate
Update returns an update builder for Game.
func (*GameClient) UpdateOne ¶
func (c *GameClient) UpdateOne(ga *Game) *GameUpdateOne
UpdateOne returns an update builder for the given entity.
func (*GameClient) UpdateOneID ¶
func (c *GameClient) UpdateOneID(id string) *GameUpdateOne
UpdateOneID returns an update builder for the given id.
func (*GameClient) Use ¶
func (c *GameClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `game.Hooks(f(g(h())))`.
type GameConnection ¶
type GameConnection struct { Edges []*GameEdge `json:"edges"` PageInfo PageInfo `json:"pageInfo"` TotalCount int `json:"totalCount"` }
GameConnection is the connection containing edges to Game.
type GameCreate ¶
type GameCreate struct {
// contains filtered or unexported fields
}
GameCreate is the builder for creating a Game entity.
func (*GameCreate) Exec ¶
func (gc *GameCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*GameCreate) ExecX ¶
func (gc *GameCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*GameCreate) Mutation ¶
func (gc *GameCreate) Mutation() *GameMutation
Mutation returns the GameMutation object of the builder.
func (*GameCreate) Save ¶
func (gc *GameCreate) Save(ctx context.Context) (*Game, error)
Save creates the Game in the database.
func (*GameCreate) SaveX ¶
func (gc *GameCreate) SaveX(ctx context.Context) *Game
SaveX calls Save and panics if Save returns an error.
func (*GameCreate) SetID ¶
func (gc *GameCreate) SetID(s string) *GameCreate
SetID sets the "id" field.
func (*GameCreate) SetName ¶
func (gc *GameCreate) SetName(s string) *GameCreate
SetName sets the "name" field.
func (*GameCreate) SetNillableID ¶
func (gc *GameCreate) SetNillableID(s *string) *GameCreate
SetNillableID sets the "id" field if the given value is not nil.
type GameCreateBulk ¶
type GameCreateBulk struct {
// contains filtered or unexported fields
}
GameCreateBulk is the builder for creating many Game entities in bulk.
func (*GameCreateBulk) Exec ¶
func (gcb *GameCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*GameCreateBulk) ExecX ¶
func (gcb *GameCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type GameDelete ¶
type GameDelete struct {
// contains filtered or unexported fields
}
GameDelete is the builder for deleting a Game entity.
func (*GameDelete) Exec ¶
func (gd *GameDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*GameDelete) ExecX ¶
func (gd *GameDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*GameDelete) Where ¶
func (gd *GameDelete) Where(ps ...predicate.Game) *GameDelete
Where appends a list predicates to the GameDelete builder.
type GameDeleteOne ¶
type GameDeleteOne struct {
// contains filtered or unexported fields
}
GameDeleteOne is the builder for deleting a single Game entity.
func (*GameDeleteOne) Exec ¶
func (gdo *GameDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*GameDeleteOne) ExecX ¶
func (gdo *GameDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*GameDeleteOne) Where ¶
func (gdo *GameDeleteOne) Where(ps ...predicate.Game) *GameDeleteOne
Where appends a list predicates to the GameDelete builder.
type GameGroupBy ¶
type GameGroupBy struct {
// contains filtered or unexported fields
}
GameGroupBy is the group-by builder for Game entities.
func (*GameGroupBy) Aggregate ¶
func (ggb *GameGroupBy) Aggregate(fns ...AggregateFunc) *GameGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*GameGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*GameGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*GameGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*GameGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*GameGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*GameGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*GameGroupBy) Scan ¶
func (ggb *GameGroupBy) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*GameGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type GameMutation ¶
type GameMutation struct {
// contains filtered or unexported fields
}
GameMutation represents an operation that mutates the Game nodes in the graph.
func (*GameMutation) AddField ¶
func (m *GameMutation) AddField(name string, value ent.Value) error
AddField adds the value to the field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.
func (*GameMutation) AddedEdges ¶
func (m *GameMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*GameMutation) AddedField ¶
func (m *GameMutation) AddedField(name string) (ent.Value, bool)
AddedField returns the numeric value that was incremented/decremented on a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.
func (*GameMutation) AddedFields ¶
func (m *GameMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*GameMutation) AddedIDs ¶
func (m *GameMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*GameMutation) ClearEdge ¶
func (m *GameMutation) ClearEdge(name string) error
ClearEdge clears the value of the edge with the given name. It returns an error if that edge is not defined in the schema.
func (*GameMutation) ClearField ¶
func (m *GameMutation) ClearField(name string) error
ClearField clears the value of the field with the given name. It returns an error if the field is not defined in the schema.
func (*GameMutation) ClearedEdges ¶
func (m *GameMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*GameMutation) ClearedFields ¶
func (m *GameMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (GameMutation) Client ¶
func (m GameMutation) Client() *Client
Client returns a new `ent.Client` from the mutation. If the mutation was executed in a transaction (ent.Tx), a transactional client is returned.
func (*GameMutation) EdgeCleared ¶
func (m *GameMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*GameMutation) Field ¶
func (m *GameMutation) Field(name string) (ent.Value, bool)
Field returns the value of a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.
func (*GameMutation) FieldCleared ¶
func (m *GameMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*GameMutation) Fields ¶
func (m *GameMutation) Fields() []string
Fields returns all fields that were changed during this mutation. Note that in order to get all numeric fields that were incremented/decremented, call AddedFields().
func (*GameMutation) ID ¶
func (m *GameMutation) ID() (id string, exists bool)
ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.
func (*GameMutation) IDs ¶
func (m *GameMutation) IDs(ctx context.Context) ([]string, error)
IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.
func (*GameMutation) Name ¶
func (m *GameMutation) Name() (r string, exists bool)
Name returns the value of the "name" field in the mutation.
func (*GameMutation) OldField ¶
OldField returns the old value of the field from the database. An error is returned if the mutation operation is not UpdateOne, or the query to the database failed.
func (*GameMutation) OldName ¶
func (m *GameMutation) OldName(ctx context.Context) (v string, err error)
OldName returns the old "name" field's value of the Game entity. If the Game object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*GameMutation) RemovedEdges ¶
func (m *GameMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*GameMutation) RemovedIDs ¶
func (m *GameMutation) RemovedIDs(name string) []ent.Value
RemovedIDs returns all IDs (to other nodes) that were removed for the edge with the given name in this mutation.
func (*GameMutation) ResetEdge ¶
func (m *GameMutation) ResetEdge(name string) error
ResetEdge resets all changes to the edge with the given name in this mutation. It returns an error if the edge is not defined in the schema.
func (*GameMutation) ResetField ¶
func (m *GameMutation) ResetField(name string) error
ResetField resets all changes in the mutation for the field with the given name. It returns an error if the field is not defined in the schema.
func (*GameMutation) ResetName ¶
func (m *GameMutation) ResetName()
ResetName resets all changes to the "name" field.
func (*GameMutation) SetField ¶
func (m *GameMutation) SetField(name string, value ent.Value) error
SetField sets the value of a field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.
func (*GameMutation) SetID ¶
func (m *GameMutation) SetID(id string)
SetID sets the value of the id field. Note that this operation is only accepted on creation of Game entities.
func (*GameMutation) SetName ¶
func (m *GameMutation) SetName(s string)
SetName sets the "name" field.
func (*GameMutation) SetOp ¶
func (m *GameMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (GameMutation) Tx ¶
func (m GameMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*GameMutation) Type ¶
func (m *GameMutation) Type() string
Type returns the node type of this mutation (Game).
func (*GameMutation) Where ¶
func (m *GameMutation) Where(ps ...predicate.Game)
Where appends a list predicates to the GameMutation builder.
func (*GameMutation) WhereP ¶
func (m *GameMutation) WhereP(ps ...func(*sql.Selector))
WhereP appends storage-level predicates to the GameMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.
type GameOrder ¶
type GameOrder struct { Direction OrderDirection `json:"direction"` Field *GameOrderField `json:"field"` }
GameOrder defines the ordering of Game.
type GameOrderField ¶
type GameOrderField struct { // Value extracts the ordering value from the given Game. Value func(*Game) (ent.Value, error) // contains filtered or unexported fields }
GameOrderField defines the ordering field of Game.
type GamePaginateOption ¶
type GamePaginateOption func(*gamePager) error
GamePaginateOption enables pagination customization.
func WithGameFilter ¶
func WithGameFilter(filter func(*GameQuery) (*GameQuery, error)) GamePaginateOption
WithGameFilter configures pagination filter.
func WithGameOrder ¶
func WithGameOrder(order *GameOrder) GamePaginateOption
WithGameOrder configures pagination ordering.
type GameQuery ¶
type GameQuery struct {
// contains filtered or unexported fields
}
GameQuery is the builder for querying Game entities.
func (*GameQuery) Aggregate ¶
func (gq *GameQuery) Aggregate(fns ...AggregateFunc) *GameSelect
Aggregate returns a GameSelect configured with the given aggregations.
func (*GameQuery) Clone ¶
Clone returns a duplicate of the GameQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*GameQuery) CollectFields ¶
CollectFields tells the query-builder to eagerly load connected nodes by resolver context.
func (*GameQuery) First ¶
First returns the first Game entity from the query. Returns a *NotFoundError when no Game was found.
func (*GameQuery) FirstID ¶
FirstID returns the first Game ID from the query. Returns a *NotFoundError when no Game ID was found.
func (*GameQuery) GroupBy ¶
func (gq *GameQuery) GroupBy(field string, fields ...string) *GameGroupBy
GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.
Example:
var v []struct { Name string `json:"name,omitempty"` Count int `json:"count,omitempty"` } client.Game.Query(). GroupBy(game.FieldName). Aggregate(ent.Count()). Scan(ctx, &v)
func (*GameQuery) Only ¶
Only returns a single Game entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Game entity is found. Returns a *NotFoundError when no Game entities are found.
func (*GameQuery) OnlyID ¶
OnlyID is like Only, but returns the only Game ID in the query. Returns a *NotSingularError when more than one Game ID is found. Returns a *NotFoundError when no entities are found.
func (*GameQuery) Order ¶
func (gq *GameQuery) Order(o ...game.OrderOption) *GameQuery
Order specifies how the records should be ordered.
func (*GameQuery) Paginate ¶
func (ga *GameQuery) Paginate( ctx context.Context, after *Cursor, first *int, before *Cursor, last *int, opts ...GamePaginateOption, ) (*GameConnection, error)
Paginate executes the query and returns a relay based cursor connection to Game.
func (*GameQuery) Select ¶
func (gq *GameQuery) Select(fields ...string) *GameSelect
Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.
Example:
var v []struct { Name string `json:"name,omitempty"` } client.Game.Query(). Select(game.FieldName). Scan(ctx, &v)
type GameSelect ¶
type GameSelect struct { *GameQuery // contains filtered or unexported fields }
GameSelect is the builder for selecting fields of Game entities.
func (*GameSelect) Aggregate ¶
func (gs *GameSelect) Aggregate(fns ...AggregateFunc) *GameSelect
Aggregate adds the given aggregation functions to the selector query.
func (*GameSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*GameSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*GameSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*GameSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*GameSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*GameSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*GameSelect) Scan ¶
func (gs *GameSelect) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*GameSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type GameUpdate ¶
type GameUpdate struct {
// contains filtered or unexported fields
}
GameUpdate is the builder for updating Game entities.
func (*GameUpdate) Exec ¶
func (gu *GameUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*GameUpdate) ExecX ¶
func (gu *GameUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*GameUpdate) Mutation ¶
func (gu *GameUpdate) Mutation() *GameMutation
Mutation returns the GameMutation object of the builder.
func (*GameUpdate) Save ¶
func (gu *GameUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*GameUpdate) SaveX ¶
func (gu *GameUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*GameUpdate) SetName ¶
func (gu *GameUpdate) SetName(s string) *GameUpdate
SetName sets the "name" field.
func (*GameUpdate) SetNillableName ¶
func (gu *GameUpdate) SetNillableName(s *string) *GameUpdate
SetNillableName sets the "name" field if the given value is not nil.
func (*GameUpdate) Where ¶
func (gu *GameUpdate) Where(ps ...predicate.Game) *GameUpdate
Where appends a list predicates to the GameUpdate builder.
type GameUpdateOne ¶
type GameUpdateOne struct {
// contains filtered or unexported fields
}
GameUpdateOne is the builder for updating a single Game entity.
func (*GameUpdateOne) Exec ¶
func (guo *GameUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*GameUpdateOne) ExecX ¶
func (guo *GameUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*GameUpdateOne) Mutation ¶
func (guo *GameUpdateOne) Mutation() *GameMutation
Mutation returns the GameMutation object of the builder.
func (*GameUpdateOne) Save ¶
func (guo *GameUpdateOne) Save(ctx context.Context) (*Game, error)
Save executes the query and returns the updated Game entity.
func (*GameUpdateOne) SaveX ¶
func (guo *GameUpdateOne) SaveX(ctx context.Context) *Game
SaveX is like Save, but panics if an error occurs.
func (*GameUpdateOne) Select ¶
func (guo *GameUpdateOne) Select(field string, fields ...string) *GameUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*GameUpdateOne) SetName ¶
func (guo *GameUpdateOne) SetName(s string) *GameUpdateOne
SetName sets the "name" field.
func (*GameUpdateOne) SetNillableName ¶
func (guo *GameUpdateOne) SetNillableName(s *string) *GameUpdateOne
SetNillableName sets the "name" field if the given value is not nil.
func (*GameUpdateOne) Where ¶
func (guo *GameUpdateOne) Where(ps ...predicate.Game) *GameUpdateOne
Where appends a list predicates to the GameUpdate builder.
type GameWhereInput ¶
type GameWhereInput struct { Predicates []predicate.Game `json:"-"` Not *GameWhereInput `json:"not,omitempty"` Or []*GameWhereInput `json:"or,omitempty"` And []*GameWhereInput `json:"and,omitempty"` // "id" field predicates. ID *string `json:"id,omitempty"` IDNEQ *string `json:"idNEQ,omitempty"` IDIn []string `json:"idIn,omitempty"` IDNotIn []string `json:"idNotIn,omitempty"` IDGT *string `json:"idGT,omitempty"` IDGTE *string `json:"idGTE,omitempty"` IDLT *string `json:"idLT,omitempty"` IDLTE *string `json:"idLTE,omitempty"` IDEqualFold *string `json:"idEqualFold,omitempty"` IDContainsFold *string `json:"idContainsFold,omitempty"` // "name" field predicates. Name *string `json:"name,omitempty"` NameNEQ *string `json:"nameNEQ,omitempty"` NameIn []string `json:"nameIn,omitempty"` NameNotIn []string `json:"nameNotIn,omitempty"` NameGT *string `json:"nameGT,omitempty"` NameGTE *string `json:"nameGTE,omitempty"` NameLT *string `json:"nameLT,omitempty"` NameLTE *string `json:"nameLTE,omitempty"` NameContains *string `json:"nameContains,omitempty"` NameHasPrefix *string `json:"nameHasPrefix,omitempty"` NameHasSuffix *string `json:"nameHasSuffix,omitempty"` NameEqualFold *string `json:"nameEqualFold,omitempty"` NameContainsFold *string `json:"nameContainsFold,omitempty"` }
GameWhereInput represents a where input for filtering Game queries.
func (*GameWhereInput) AddPredicates ¶
func (i *GameWhereInput) AddPredicates(predicates ...predicate.Game)
AddPredicates adds custom predicates to the where input to be used during the filtering phase.
type InterceptFunc ¶
type InterceptFunc = ent.InterceptFunc
ent aliases to avoid import conflicts in user's code.
type Interceptor ¶
type Interceptor = ent.Interceptor
ent aliases to avoid import conflicts in user's code.
type Location ¶
type Location struct { // ID of the ent. ID string `json:"id,omitempty"` // Name holds the value of the "name" field. Name string `json:"name,omitempty"` // DeduplicationKey holds the value of the "deduplication_key" field. DeduplicationKey string `json:"deduplication_key,omitempty"` // RawAddress holds the value of the "raw_address" field. RawAddress string `json:"raw_address,omitempty"` // Coordinate holds the value of the "coordinate" field. Coordinate *postgis.PointS `json:"coordinate,omitempty"` // Edges holds the relations/edges for other nodes in the graph. // The values are being populated by the LocationQuery when eager-loading is set. Edges LocationEdges `json:"edges"` // contains filtered or unexported fields }
Location is the model entity for the Location schema.
func (*Location) IsNode ¶
func (*Location) IsNode()
IsNode implements the Node interface check for GQLGen.
func (*Location) NamedCabinets ¶
NamedCabinets returns the Cabinets named value or an error if the edge was not loaded in eager-loading with this name.
func (*Location) QueryCabinets ¶
func (l *Location) QueryCabinets() *CabinetQuery
QueryCabinets queries the "cabinets" edge of the Location entity.
func (*Location) ToEdge ¶
func (l *Location) ToEdge(order *LocationOrder) *LocationEdge
ToEdge converts Location into LocationEdge.
func (*Location) Unwrap ¶
Unwrap unwraps the Location entity that was returned from a transaction after it was closed, so that all future queries will be executed through the driver which created the transaction.
func (*Location) Update ¶
func (l *Location) Update() *LocationUpdateOne
Update returns a builder for updating this Location. Note that you need to call Location.Unwrap() before calling this method if this Location was returned from a transaction, and the transaction was committed or rolled back.
type LocationClient ¶
type LocationClient struct {
// contains filtered or unexported fields
}
LocationClient is a client for the Location schema.
func NewLocationClient ¶
func NewLocationClient(c config) *LocationClient
NewLocationClient returns a client for the Location from the given config.
func (*LocationClient) Create ¶
func (c *LocationClient) Create() *LocationCreate
Create returns a builder for creating a Location entity.
func (*LocationClient) CreateBulk ¶
func (c *LocationClient) CreateBulk(builders ...*LocationCreate) *LocationCreateBulk
CreateBulk returns a builder for creating a bulk of Location entities.
func (*LocationClient) Delete ¶
func (c *LocationClient) Delete() *LocationDelete
Delete returns a delete builder for Location.
func (*LocationClient) DeleteOne ¶
func (c *LocationClient) DeleteOne(l *Location) *LocationDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*LocationClient) DeleteOneID ¶
func (c *LocationClient) DeleteOneID(id string) *LocationDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*LocationClient) GetX ¶
func (c *LocationClient) GetX(ctx context.Context, id string) *Location
GetX is like Get, but panics if an error occurs.
func (*LocationClient) Hooks ¶
func (c *LocationClient) Hooks() []Hook
Hooks returns the client hooks.
func (*LocationClient) Intercept ¶
func (c *LocationClient) Intercept(interceptors ...Interceptor)
Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `location.Intercept(f(g(h())))`.
func (*LocationClient) Interceptors ¶
func (c *LocationClient) Interceptors() []Interceptor
Interceptors returns the client interceptors.
func (*LocationClient) MapCreateBulk ¶
func (c *LocationClient) MapCreateBulk(slice any, setFunc func(*LocationCreate, int)) *LocationCreateBulk
MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.
func (*LocationClient) Query ¶
func (c *LocationClient) Query() *LocationQuery
Query returns a query builder for Location.
func (*LocationClient) QueryCabinets ¶
func (c *LocationClient) QueryCabinets(l *Location) *CabinetQuery
QueryCabinets queries the cabinets edge of a Location.
func (*LocationClient) Update ¶
func (c *LocationClient) Update() *LocationUpdate
Update returns an update builder for Location.
func (*LocationClient) UpdateOne ¶
func (c *LocationClient) UpdateOne(l *Location) *LocationUpdateOne
UpdateOne returns an update builder for the given entity.
func (*LocationClient) UpdateOneID ¶
func (c *LocationClient) UpdateOneID(id string) *LocationUpdateOne
UpdateOneID returns an update builder for the given id.
func (*LocationClient) Use ¶
func (c *LocationClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `location.Hooks(f(g(h())))`.
type LocationConnection ¶
type LocationConnection struct { Edges []*LocationEdge `json:"edges"` PageInfo PageInfo `json:"pageInfo"` TotalCount int `json:"totalCount"` }
LocationConnection is the connection containing edges to Location.
type LocationCreate ¶
type LocationCreate struct {
// contains filtered or unexported fields
}
LocationCreate is the builder for creating a Location entity.
func (*LocationCreate) AddCabinetIDs ¶
func (lc *LocationCreate) AddCabinetIDs(ids ...string) *LocationCreate
AddCabinetIDs adds the "cabinets" edge to the Cabinet entity by IDs.
func (*LocationCreate) AddCabinets ¶
func (lc *LocationCreate) AddCabinets(c ...*Cabinet) *LocationCreate
AddCabinets adds the "cabinets" edges to the Cabinet entity.
func (*LocationCreate) Exec ¶
func (lc *LocationCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*LocationCreate) ExecX ¶
func (lc *LocationCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*LocationCreate) Mutation ¶
func (lc *LocationCreate) Mutation() *LocationMutation
Mutation returns the LocationMutation object of the builder.
func (*LocationCreate) Save ¶
func (lc *LocationCreate) Save(ctx context.Context) (*Location, error)
Save creates the Location in the database.
func (*LocationCreate) SaveX ¶
func (lc *LocationCreate) SaveX(ctx context.Context) *Location
SaveX calls Save and panics if Save returns an error.
func (*LocationCreate) SetCoordinate ¶
func (lc *LocationCreate) SetCoordinate(po *postgis.PointS) *LocationCreate
SetCoordinate sets the "coordinate" field.
func (*LocationCreate) SetDeduplicationKey ¶
func (lc *LocationCreate) SetDeduplicationKey(s string) *LocationCreate
SetDeduplicationKey sets the "deduplication_key" field.
func (*LocationCreate) SetID ¶
func (lc *LocationCreate) SetID(s string) *LocationCreate
SetID sets the "id" field.
func (*LocationCreate) SetInput ¶
func (c *LocationCreate) SetInput(i CreateLocationInput) *LocationCreate
SetInput applies the change-set in the CreateLocationInput on the LocationCreate builder.
func (*LocationCreate) SetName ¶
func (lc *LocationCreate) SetName(s string) *LocationCreate
SetName sets the "name" field.
func (*LocationCreate) SetNillableID ¶
func (lc *LocationCreate) SetNillableID(s *string) *LocationCreate
SetNillableID sets the "id" field if the given value is not nil.
func (*LocationCreate) SetNillableRawAddress ¶
func (lc *LocationCreate) SetNillableRawAddress(s *string) *LocationCreate
SetNillableRawAddress sets the "raw_address" field if the given value is not nil.
func (*LocationCreate) SetRawAddress ¶
func (lc *LocationCreate) SetRawAddress(s string) *LocationCreate
SetRawAddress sets the "raw_address" field.
type LocationCreateBulk ¶
type LocationCreateBulk struct {
// contains filtered or unexported fields
}
LocationCreateBulk is the builder for creating many Location entities in bulk.
func (*LocationCreateBulk) Exec ¶
func (lcb *LocationCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*LocationCreateBulk) ExecX ¶
func (lcb *LocationCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type LocationDelete ¶
type LocationDelete struct {
// contains filtered or unexported fields
}
LocationDelete is the builder for deleting a Location entity.
func (*LocationDelete) Exec ¶
func (ld *LocationDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*LocationDelete) ExecX ¶
func (ld *LocationDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*LocationDelete) Where ¶
func (ld *LocationDelete) Where(ps ...predicate.Location) *LocationDelete
Where appends a list predicates to the LocationDelete builder.
type LocationDeleteOne ¶
type LocationDeleteOne struct {
// contains filtered or unexported fields
}
LocationDeleteOne is the builder for deleting a single Location entity.
func (*LocationDeleteOne) Exec ¶
func (ldo *LocationDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*LocationDeleteOne) ExecX ¶
func (ldo *LocationDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*LocationDeleteOne) Where ¶
func (ldo *LocationDeleteOne) Where(ps ...predicate.Location) *LocationDeleteOne
Where appends a list predicates to the LocationDelete builder.
type LocationEdge ¶
LocationEdge is the edge representation of Location.
type LocationEdges ¶
type LocationEdges struct { // Cabinets holds the value of the cabinets edge. Cabinets []*Cabinet `json:"cabinets,omitempty"` // contains filtered or unexported fields }
LocationEdges holds the relations/edges for other nodes in the graph.
func (LocationEdges) CabinetsOrErr ¶
func (e LocationEdges) CabinetsOrErr() ([]*Cabinet, error)
CabinetsOrErr returns the Cabinets value or an error if the edge was not loaded in eager-loading.
type LocationGroupBy ¶
type LocationGroupBy struct {
// contains filtered or unexported fields
}
LocationGroupBy is the group-by builder for Location entities.
func (*LocationGroupBy) Aggregate ¶
func (lgb *LocationGroupBy) Aggregate(fns ...AggregateFunc) *LocationGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*LocationGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*LocationGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*LocationGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*LocationGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*LocationGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*LocationGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*LocationGroupBy) Scan ¶
func (lgb *LocationGroupBy) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*LocationGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type LocationMutation ¶
type LocationMutation struct {
// contains filtered or unexported fields
}
LocationMutation represents an operation that mutates the Location nodes in the graph.
func (*LocationMutation) AddCabinetIDs ¶
func (m *LocationMutation) AddCabinetIDs(ids ...string)
AddCabinetIDs adds the "cabinets" edge to the Cabinet entity by ids.
func (*LocationMutation) AddField ¶
func (m *LocationMutation) AddField(name string, value ent.Value) error
AddField adds the value to the field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.
func (*LocationMutation) AddedEdges ¶
func (m *LocationMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*LocationMutation) AddedField ¶
func (m *LocationMutation) AddedField(name string) (ent.Value, bool)
AddedField returns the numeric value that was incremented/decremented on a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.
func (*LocationMutation) AddedFields ¶
func (m *LocationMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*LocationMutation) AddedIDs ¶
func (m *LocationMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*LocationMutation) CabinetsCleared ¶
func (m *LocationMutation) CabinetsCleared() bool
CabinetsCleared reports if the "cabinets" edge to the Cabinet entity was cleared.
func (*LocationMutation) CabinetsIDs ¶
func (m *LocationMutation) CabinetsIDs() (ids []string)
CabinetsIDs returns the "cabinets" edge IDs in the mutation.
func (*LocationMutation) ClearCabinets ¶
func (m *LocationMutation) ClearCabinets()
ClearCabinets clears the "cabinets" edge to the Cabinet entity.
func (*LocationMutation) ClearCoordinate ¶
func (m *LocationMutation) ClearCoordinate()
ClearCoordinate clears the value of the "coordinate" field.
func (*LocationMutation) ClearEdge ¶
func (m *LocationMutation) ClearEdge(name string) error
ClearEdge clears the value of the edge with the given name. It returns an error if that edge is not defined in the schema.
func (*LocationMutation) ClearField ¶
func (m *LocationMutation) ClearField(name string) error
ClearField clears the value of the field with the given name. It returns an error if the field is not defined in the schema.
func (*LocationMutation) ClearRawAddress ¶
func (m *LocationMutation) ClearRawAddress()
ClearRawAddress clears the value of the "raw_address" field.
func (*LocationMutation) ClearedEdges ¶
func (m *LocationMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*LocationMutation) ClearedFields ¶
func (m *LocationMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (LocationMutation) Client ¶
func (m LocationMutation) Client() *Client
Client returns a new `ent.Client` from the mutation. If the mutation was executed in a transaction (ent.Tx), a transactional client is returned.
func (*LocationMutation) Coordinate ¶
func (m *LocationMutation) Coordinate() (r *postgis.PointS, exists bool)
Coordinate returns the value of the "coordinate" field in the mutation.
func (*LocationMutation) CoordinateCleared ¶
func (m *LocationMutation) CoordinateCleared() bool
CoordinateCleared returns if the "coordinate" field was cleared in this mutation.
func (*LocationMutation) DeduplicationKey ¶
func (m *LocationMutation) DeduplicationKey() (r string, exists bool)
DeduplicationKey returns the value of the "deduplication_key" field in the mutation.
func (*LocationMutation) EdgeCleared ¶
func (m *LocationMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*LocationMutation) Field ¶
func (m *LocationMutation) Field(name string) (ent.Value, bool)
Field returns the value of a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.
func (*LocationMutation) FieldCleared ¶
func (m *LocationMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*LocationMutation) Fields ¶
func (m *LocationMutation) Fields() []string
Fields returns all fields that were changed during this mutation. Note that in order to get all numeric fields that were incremented/decremented, call AddedFields().
func (*LocationMutation) ID ¶
func (m *LocationMutation) ID() (id string, exists bool)
ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.
func (*LocationMutation) IDs ¶
func (m *LocationMutation) IDs(ctx context.Context) ([]string, error)
IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.
func (*LocationMutation) Name ¶
func (m *LocationMutation) Name() (r string, exists bool)
Name returns the value of the "name" field in the mutation.
func (*LocationMutation) OldCoordinate ¶
OldCoordinate returns the old "coordinate" field's value of the Location entity. If the Location object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*LocationMutation) OldDeduplicationKey ¶
func (m *LocationMutation) OldDeduplicationKey(ctx context.Context) (v string, err error)
OldDeduplicationKey returns the old "deduplication_key" field's value of the Location entity. If the Location object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*LocationMutation) OldField ¶
OldField returns the old value of the field from the database. An error is returned if the mutation operation is not UpdateOne, or the query to the database failed.
func (*LocationMutation) OldName ¶
func (m *LocationMutation) OldName(ctx context.Context) (v string, err error)
OldName returns the old "name" field's value of the Location entity. If the Location object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*LocationMutation) OldRawAddress ¶
func (m *LocationMutation) OldRawAddress(ctx context.Context) (v string, err error)
OldRawAddress returns the old "raw_address" field's value of the Location entity. If the Location object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*LocationMutation) RawAddress ¶
func (m *LocationMutation) RawAddress() (r string, exists bool)
RawAddress returns the value of the "raw_address" field in the mutation.
func (*LocationMutation) RawAddressCleared ¶
func (m *LocationMutation) RawAddressCleared() bool
RawAddressCleared returns if the "raw_address" field was cleared in this mutation.
func (*LocationMutation) RemoveCabinetIDs ¶
func (m *LocationMutation) RemoveCabinetIDs(ids ...string)
RemoveCabinetIDs removes the "cabinets" edge to the Cabinet entity by IDs.
func (*LocationMutation) RemovedCabinetsIDs ¶
func (m *LocationMutation) RemovedCabinetsIDs() (ids []string)
RemovedCabinets returns the removed IDs of the "cabinets" edge to the Cabinet entity.
func (*LocationMutation) RemovedEdges ¶
func (m *LocationMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*LocationMutation) RemovedIDs ¶
func (m *LocationMutation) RemovedIDs(name string) []ent.Value
RemovedIDs returns all IDs (to other nodes) that were removed for the edge with the given name in this mutation.
func (*LocationMutation) ResetCabinets ¶
func (m *LocationMutation) ResetCabinets()
ResetCabinets resets all changes to the "cabinets" edge.
func (*LocationMutation) ResetCoordinate ¶
func (m *LocationMutation) ResetCoordinate()
ResetCoordinate resets all changes to the "coordinate" field.
func (*LocationMutation) ResetDeduplicationKey ¶
func (m *LocationMutation) ResetDeduplicationKey()
ResetDeduplicationKey resets all changes to the "deduplication_key" field.
func (*LocationMutation) ResetEdge ¶
func (m *LocationMutation) ResetEdge(name string) error
ResetEdge resets all changes to the edge with the given name in this mutation. It returns an error if the edge is not defined in the schema.
func (*LocationMutation) ResetField ¶
func (m *LocationMutation) ResetField(name string) error
ResetField resets all changes in the mutation for the field with the given name. It returns an error if the field is not defined in the schema.
func (*LocationMutation) ResetName ¶
func (m *LocationMutation) ResetName()
ResetName resets all changes to the "name" field.
func (*LocationMutation) ResetRawAddress ¶
func (m *LocationMutation) ResetRawAddress()
ResetRawAddress resets all changes to the "raw_address" field.
func (*LocationMutation) SetCoordinate ¶
func (m *LocationMutation) SetCoordinate(po *postgis.PointS)
SetCoordinate sets the "coordinate" field.
func (*LocationMutation) SetDeduplicationKey ¶
func (m *LocationMutation) SetDeduplicationKey(s string)
SetDeduplicationKey sets the "deduplication_key" field.
func (*LocationMutation) SetField ¶
func (m *LocationMutation) SetField(name string, value ent.Value) error
SetField sets the value of a field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.
func (*LocationMutation) SetID ¶
func (m *LocationMutation) SetID(id string)
SetID sets the value of the id field. Note that this operation is only accepted on creation of Location entities.
func (*LocationMutation) SetName ¶
func (m *LocationMutation) SetName(s string)
SetName sets the "name" field.
func (*LocationMutation) SetOp ¶
func (m *LocationMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (*LocationMutation) SetRawAddress ¶
func (m *LocationMutation) SetRawAddress(s string)
SetRawAddress sets the "raw_address" field.
func (LocationMutation) Tx ¶
func (m LocationMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*LocationMutation) Type ¶
func (m *LocationMutation) Type() string
Type returns the node type of this mutation (Location).
func (*LocationMutation) Where ¶
func (m *LocationMutation) Where(ps ...predicate.Location)
Where appends a list predicates to the LocationMutation builder.
func (*LocationMutation) WhereP ¶
func (m *LocationMutation) WhereP(ps ...func(*sql.Selector))
WhereP appends storage-level predicates to the LocationMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.
type LocationOrder ¶
type LocationOrder struct { Direction OrderDirection `json:"direction"` Field *LocationOrderField `json:"field"` }
LocationOrder defines the ordering of Location.
type LocationOrderField ¶
type LocationOrderField struct { // Value extracts the ordering value from the given Location. Value func(*Location) (ent.Value, error) // contains filtered or unexported fields }
LocationOrderField defines the ordering field of Location.
type LocationPaginateOption ¶
type LocationPaginateOption func(*locationPager) error
LocationPaginateOption enables pagination customization.
func WithLocationFilter ¶
func WithLocationFilter(filter func(*LocationQuery) (*LocationQuery, error)) LocationPaginateOption
WithLocationFilter configures pagination filter.
func WithLocationOrder ¶
func WithLocationOrder(order []*LocationOrder) LocationPaginateOption
WithLocationOrder configures pagination ordering.
type LocationQuery ¶
type LocationQuery struct {
// contains filtered or unexported fields
}
LocationQuery is the builder for querying Location entities.
func (*LocationQuery) Aggregate ¶
func (lq *LocationQuery) Aggregate(fns ...AggregateFunc) *LocationSelect
Aggregate returns a LocationSelect configured with the given aggregations.
func (*LocationQuery) All ¶
func (lq *LocationQuery) All(ctx context.Context) ([]*Location, error)
All executes the query and returns a list of Locations.
func (*LocationQuery) AllX ¶
func (lq *LocationQuery) AllX(ctx context.Context) []*Location
AllX is like All, but panics if an error occurs.
func (*LocationQuery) Clone ¶
func (lq *LocationQuery) Clone() *LocationQuery
Clone returns a duplicate of the LocationQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*LocationQuery) CollectFields ¶
func (l *LocationQuery) CollectFields(ctx context.Context, satisfies ...string) (*LocationQuery, error)
CollectFields tells the query-builder to eagerly load connected nodes by resolver context.
func (*LocationQuery) Count ¶
func (lq *LocationQuery) Count(ctx context.Context) (int, error)
Count returns the count of the given query.
func (*LocationQuery) CountX ¶
func (lq *LocationQuery) CountX(ctx context.Context) int
CountX is like Count, but panics if an error occurs.
func (*LocationQuery) Exist ¶
func (lq *LocationQuery) Exist(ctx context.Context) (bool, error)
Exist returns true if the query has elements in the graph.
func (*LocationQuery) ExistX ¶
func (lq *LocationQuery) ExistX(ctx context.Context) bool
ExistX is like Exist, but panics if an error occurs.
func (*LocationQuery) First ¶
func (lq *LocationQuery) First(ctx context.Context) (*Location, error)
First returns the first Location entity from the query. Returns a *NotFoundError when no Location was found.
func (*LocationQuery) FirstID ¶
func (lq *LocationQuery) FirstID(ctx context.Context) (id string, err error)
FirstID returns the first Location ID from the query. Returns a *NotFoundError when no Location ID was found.
func (*LocationQuery) FirstIDX ¶
func (lq *LocationQuery) FirstIDX(ctx context.Context) string
FirstIDX is like FirstID, but panics if an error occurs.
func (*LocationQuery) FirstX ¶
func (lq *LocationQuery) FirstX(ctx context.Context) *Location
FirstX is like First, but panics if an error occurs.
func (*LocationQuery) GroupBy ¶
func (lq *LocationQuery) GroupBy(field string, fields ...string) *LocationGroupBy
GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.
Example:
var v []struct { Name string `json:"name,omitempty"` Count int `json:"count,omitempty"` } client.Location.Query(). GroupBy(location.FieldName). Aggregate(ent.Count()). Scan(ctx, &v)
func (*LocationQuery) IDs ¶
func (lq *LocationQuery) IDs(ctx context.Context) (ids []string, err error)
IDs executes the query and returns a list of Location IDs.
func (*LocationQuery) IDsX ¶
func (lq *LocationQuery) IDsX(ctx context.Context) []string
IDsX is like IDs, but panics if an error occurs.
func (*LocationQuery) Limit ¶
func (lq *LocationQuery) Limit(limit int) *LocationQuery
Limit the number of records to be returned by this query.
func (*LocationQuery) Offset ¶
func (lq *LocationQuery) Offset(offset int) *LocationQuery
Offset to start from.
func (*LocationQuery) Only ¶
func (lq *LocationQuery) Only(ctx context.Context) (*Location, error)
Only returns a single Location entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Location entity is found. Returns a *NotFoundError when no Location entities are found.
func (*LocationQuery) OnlyID ¶
func (lq *LocationQuery) OnlyID(ctx context.Context) (id string, err error)
OnlyID is like Only, but returns the only Location ID in the query. Returns a *NotSingularError when more than one Location ID is found. Returns a *NotFoundError when no entities are found.
func (*LocationQuery) OnlyIDX ¶
func (lq *LocationQuery) OnlyIDX(ctx context.Context) string
OnlyIDX is like OnlyID, but panics if an error occurs.
func (*LocationQuery) OnlyX ¶
func (lq *LocationQuery) OnlyX(ctx context.Context) *Location
OnlyX is like Only, but panics if an error occurs.
func (*LocationQuery) Order ¶
func (lq *LocationQuery) Order(o ...location.OrderOption) *LocationQuery
Order specifies how the records should be ordered.
func (*LocationQuery) Paginate ¶
func (l *LocationQuery) Paginate( ctx context.Context, after *Cursor, first *int, before *Cursor, last *int, opts ...LocationPaginateOption, ) (*LocationConnection, error)
Paginate executes the query and returns a relay based cursor connection to Location.
func (*LocationQuery) QueryCabinets ¶
func (lq *LocationQuery) QueryCabinets() *CabinetQuery
QueryCabinets chains the current query on the "cabinets" edge.
func (*LocationQuery) Select ¶
func (lq *LocationQuery) Select(fields ...string) *LocationSelect
Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.
Example:
var v []struct { Name string `json:"name,omitempty"` } client.Location.Query(). Select(location.FieldName). Scan(ctx, &v)
func (*LocationQuery) Unique ¶
func (lq *LocationQuery) Unique(unique bool) *LocationQuery
Unique configures the query builder to filter duplicate records on query. By default, unique is set to true, and can be disabled using this method.
func (*LocationQuery) Where ¶
func (lq *LocationQuery) Where(ps ...predicate.Location) *LocationQuery
Where adds a new predicate for the LocationQuery builder.
func (*LocationQuery) WithCabinets ¶
func (lq *LocationQuery) WithCabinets(opts ...func(*CabinetQuery)) *LocationQuery
WithCabinets tells the query-builder to eager-load the nodes that are connected to the "cabinets" edge. The optional arguments are used to configure the query builder of the edge.
func (*LocationQuery) WithNamedCabinets ¶
func (lq *LocationQuery) WithNamedCabinets(name string, opts ...func(*CabinetQuery)) *LocationQuery
WithNamedCabinets tells the query-builder to eager-load the nodes that are connected to the "cabinets" edge with the given name. The optional arguments are used to configure the query builder of the edge.
type LocationSelect ¶
type LocationSelect struct { *LocationQuery // contains filtered or unexported fields }
LocationSelect is the builder for selecting fields of Location entities.
func (*LocationSelect) Aggregate ¶
func (ls *LocationSelect) Aggregate(fns ...AggregateFunc) *LocationSelect
Aggregate adds the given aggregation functions to the selector query.
func (*LocationSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*LocationSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*LocationSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*LocationSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*LocationSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*LocationSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*LocationSelect) Scan ¶
func (ls *LocationSelect) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*LocationSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type LocationUpdate ¶
type LocationUpdate struct {
// contains filtered or unexported fields
}
LocationUpdate is the builder for updating Location entities.
func (*LocationUpdate) AddCabinetIDs ¶
func (lu *LocationUpdate) AddCabinetIDs(ids ...string) *LocationUpdate
AddCabinetIDs adds the "cabinets" edge to the Cabinet entity by IDs.
func (*LocationUpdate) AddCabinets ¶
func (lu *LocationUpdate) AddCabinets(c ...*Cabinet) *LocationUpdate
AddCabinets adds the "cabinets" edges to the Cabinet entity.
func (*LocationUpdate) ClearCabinets ¶
func (lu *LocationUpdate) ClearCabinets() *LocationUpdate
ClearCabinets clears all "cabinets" edges to the Cabinet entity.
func (*LocationUpdate) ClearCoordinate ¶
func (lu *LocationUpdate) ClearCoordinate() *LocationUpdate
ClearCoordinate clears the value of the "coordinate" field.
func (*LocationUpdate) ClearRawAddress ¶
func (lu *LocationUpdate) ClearRawAddress() *LocationUpdate
ClearRawAddress clears the value of the "raw_address" field.
func (*LocationUpdate) Exec ¶
func (lu *LocationUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*LocationUpdate) ExecX ¶
func (lu *LocationUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*LocationUpdate) Mutation ¶
func (lu *LocationUpdate) Mutation() *LocationMutation
Mutation returns the LocationMutation object of the builder.
func (*LocationUpdate) RemoveCabinetIDs ¶
func (lu *LocationUpdate) RemoveCabinetIDs(ids ...string) *LocationUpdate
RemoveCabinetIDs removes the "cabinets" edge to Cabinet entities by IDs.
func (*LocationUpdate) RemoveCabinets ¶
func (lu *LocationUpdate) RemoveCabinets(c ...*Cabinet) *LocationUpdate
RemoveCabinets removes "cabinets" edges to Cabinet entities.
func (*LocationUpdate) Save ¶
func (lu *LocationUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*LocationUpdate) SaveX ¶
func (lu *LocationUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*LocationUpdate) SetCoordinate ¶
func (lu *LocationUpdate) SetCoordinate(po *postgis.PointS) *LocationUpdate
SetCoordinate sets the "coordinate" field.
func (*LocationUpdate) SetDeduplicationKey ¶
func (lu *LocationUpdate) SetDeduplicationKey(s string) *LocationUpdate
SetDeduplicationKey sets the "deduplication_key" field.
func (*LocationUpdate) SetName ¶
func (lu *LocationUpdate) SetName(s string) *LocationUpdate
SetName sets the "name" field.
func (*LocationUpdate) SetNillableDeduplicationKey ¶
func (lu *LocationUpdate) SetNillableDeduplicationKey(s *string) *LocationUpdate
SetNillableDeduplicationKey sets the "deduplication_key" field if the given value is not nil.
func (*LocationUpdate) SetNillableName ¶
func (lu *LocationUpdate) SetNillableName(s *string) *LocationUpdate
SetNillableName sets the "name" field if the given value is not nil.
func (*LocationUpdate) SetNillableRawAddress ¶
func (lu *LocationUpdate) SetNillableRawAddress(s *string) *LocationUpdate
SetNillableRawAddress sets the "raw_address" field if the given value is not nil.
func (*LocationUpdate) SetRawAddress ¶
func (lu *LocationUpdate) SetRawAddress(s string) *LocationUpdate
SetRawAddress sets the "raw_address" field.
func (*LocationUpdate) Where ¶
func (lu *LocationUpdate) Where(ps ...predicate.Location) *LocationUpdate
Where appends a list predicates to the LocationUpdate builder.
type LocationUpdateOne ¶
type LocationUpdateOne struct {
// contains filtered or unexported fields
}
LocationUpdateOne is the builder for updating a single Location entity.
func (*LocationUpdateOne) AddCabinetIDs ¶
func (luo *LocationUpdateOne) AddCabinetIDs(ids ...string) *LocationUpdateOne
AddCabinetIDs adds the "cabinets" edge to the Cabinet entity by IDs.
func (*LocationUpdateOne) AddCabinets ¶
func (luo *LocationUpdateOne) AddCabinets(c ...*Cabinet) *LocationUpdateOne
AddCabinets adds the "cabinets" edges to the Cabinet entity.
func (*LocationUpdateOne) ClearCabinets ¶
func (luo *LocationUpdateOne) ClearCabinets() *LocationUpdateOne
ClearCabinets clears all "cabinets" edges to the Cabinet entity.
func (*LocationUpdateOne) ClearCoordinate ¶
func (luo *LocationUpdateOne) ClearCoordinate() *LocationUpdateOne
ClearCoordinate clears the value of the "coordinate" field.
func (*LocationUpdateOne) ClearRawAddress ¶
func (luo *LocationUpdateOne) ClearRawAddress() *LocationUpdateOne
ClearRawAddress clears the value of the "raw_address" field.
func (*LocationUpdateOne) Exec ¶
func (luo *LocationUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*LocationUpdateOne) ExecX ¶
func (luo *LocationUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*LocationUpdateOne) Mutation ¶
func (luo *LocationUpdateOne) Mutation() *LocationMutation
Mutation returns the LocationMutation object of the builder.
func (*LocationUpdateOne) RemoveCabinetIDs ¶
func (luo *LocationUpdateOne) RemoveCabinetIDs(ids ...string) *LocationUpdateOne
RemoveCabinetIDs removes the "cabinets" edge to Cabinet entities by IDs.
func (*LocationUpdateOne) RemoveCabinets ¶
func (luo *LocationUpdateOne) RemoveCabinets(c ...*Cabinet) *LocationUpdateOne
RemoveCabinets removes "cabinets" edges to Cabinet entities.
func (*LocationUpdateOne) Save ¶
func (luo *LocationUpdateOne) Save(ctx context.Context) (*Location, error)
Save executes the query and returns the updated Location entity.
func (*LocationUpdateOne) SaveX ¶
func (luo *LocationUpdateOne) SaveX(ctx context.Context) *Location
SaveX is like Save, but panics if an error occurs.
func (*LocationUpdateOne) Select ¶
func (luo *LocationUpdateOne) Select(field string, fields ...string) *LocationUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*LocationUpdateOne) SetCoordinate ¶
func (luo *LocationUpdateOne) SetCoordinate(po *postgis.PointS) *LocationUpdateOne
SetCoordinate sets the "coordinate" field.
func (*LocationUpdateOne) SetDeduplicationKey ¶
func (luo *LocationUpdateOne) SetDeduplicationKey(s string) *LocationUpdateOne
SetDeduplicationKey sets the "deduplication_key" field.
func (*LocationUpdateOne) SetName ¶
func (luo *LocationUpdateOne) SetName(s string) *LocationUpdateOne
SetName sets the "name" field.
func (*LocationUpdateOne) SetNillableDeduplicationKey ¶
func (luo *LocationUpdateOne) SetNillableDeduplicationKey(s *string) *LocationUpdateOne
SetNillableDeduplicationKey sets the "deduplication_key" field if the given value is not nil.
func (*LocationUpdateOne) SetNillableName ¶
func (luo *LocationUpdateOne) SetNillableName(s *string) *LocationUpdateOne
SetNillableName sets the "name" field if the given value is not nil.
func (*LocationUpdateOne) SetNillableRawAddress ¶
func (luo *LocationUpdateOne) SetNillableRawAddress(s *string) *LocationUpdateOne
SetNillableRawAddress sets the "raw_address" field if the given value is not nil.
func (*LocationUpdateOne) SetRawAddress ¶
func (luo *LocationUpdateOne) SetRawAddress(s string) *LocationUpdateOne
SetRawAddress sets the "raw_address" field.
func (*LocationUpdateOne) Where ¶
func (luo *LocationUpdateOne) Where(ps ...predicate.Location) *LocationUpdateOne
Where appends a list predicates to the LocationUpdate builder.
type LocationWhereInput ¶
type LocationWhereInput struct { Predicates []predicate.Location `json:"-"` Not *LocationWhereInput `json:"not,omitempty"` Or []*LocationWhereInput `json:"or,omitempty"` And []*LocationWhereInput `json:"and,omitempty"` // "id" field predicates. ID *string `json:"id,omitempty"` IDNEQ *string `json:"idNEQ,omitempty"` IDIn []string `json:"idIn,omitempty"` IDNotIn []string `json:"idNotIn,omitempty"` IDGT *string `json:"idGT,omitempty"` IDGTE *string `json:"idGTE,omitempty"` IDLT *string `json:"idLT,omitempty"` IDLTE *string `json:"idLTE,omitempty"` IDEqualFold *string `json:"idEqualFold,omitempty"` IDContainsFold *string `json:"idContainsFold,omitempty"` // "name" field predicates. Name *string `json:"name,omitempty"` NameNEQ *string `json:"nameNEQ,omitempty"` NameIn []string `json:"nameIn,omitempty"` NameNotIn []string `json:"nameNotIn,omitempty"` NameGT *string `json:"nameGT,omitempty"` NameGTE *string `json:"nameGTE,omitempty"` NameLT *string `json:"nameLT,omitempty"` NameLTE *string `json:"nameLTE,omitempty"` NameContains *string `json:"nameContains,omitempty"` NameHasPrefix *string `json:"nameHasPrefix,omitempty"` NameHasSuffix *string `json:"nameHasSuffix,omitempty"` NameEqualFold *string `json:"nameEqualFold,omitempty"` NameContainsFold *string `json:"nameContainsFold,omitempty"` // "cabinets" edge predicates. HasCabinets *bool `json:"hasCabinets,omitempty"` HasCabinetsWith []*CabinetWhereInput `json:"hasCabinetsWith,omitempty"` }
LocationWhereInput represents a where input for filtering Location queries.
func (*LocationWhereInput) AddPredicates ¶
func (i *LocationWhereInput) AddPredicates(predicates ...predicate.Location)
AddPredicates adds custom predicates to the where input to be used during the filtering phase.
func (*LocationWhereInput) Filter ¶
func (i *LocationWhereInput) Filter(q *LocationQuery) (*LocationQuery, error)
Filter applies the LocationWhereInput filter on the LocationQuery builder.
type MutateFunc ¶
type MutateFunc = ent.MutateFunc
ent aliases to avoid import conflicts in user's code.
type NodeOption ¶
type NodeOption func(*nodeOptions)
NodeOption allows configuring the Noder execution using functional options.
func WithFixedNodeType ¶
func WithFixedNodeType(t string) NodeOption
WithFixedNodeType sets the Type of the node to a fixed value.
func WithNodeType ¶
WithNodeType sets the node Type resolver function (i.e. the table to query). If was not provided, the table will be derived from the universal-id configuration as described in: https://entgo.io/docs/migrate/#universal-ids.
type NotFoundError ¶
type NotFoundError struct {
// contains filtered or unexported fields
}
NotFoundError returns when trying to fetch a specific entity and it was not found in the database.
func (*NotFoundError) Error ¶
func (e *NotFoundError) Error() string
Error implements the error interface.
type NotLoadedError ¶
type NotLoadedError struct {
// contains filtered or unexported fields
}
NotLoadedError returns when trying to get a node that was not loaded by the query.
func (*NotLoadedError) Error ¶
func (e *NotLoadedError) Error() string
Error implements the error interface.
type NotSingularError ¶
type NotSingularError struct {
// contains filtered or unexported fields
}
NotSingularError returns when trying to fetch a singular entity and more then one was found in the database.
func (*NotSingularError) Error ¶
func (e *NotSingularError) Error() string
Error implements the error interface.
type OrderFunc ¶
OrderFunc applies an ordering on the sql selector. Deprecated: Use Asc/Desc functions or the package builders instead.
type QuerierFunc ¶
type QuerierFunc = ent.QuerierFunc
ent aliases to avoid import conflicts in user's code.
type QueryContext ¶
type QueryContext = ent.QueryContext
ent aliases to avoid import conflicts in user's code.
type RollbackFunc ¶
The RollbackFunc type is an adapter to allow the use of ordinary function as a Rollbacker. If f is a function with the appropriate signature, RollbackFunc(f) is a Rollbacker that calls f.
type RollbackHook ¶
type RollbackHook func(Rollbacker) Rollbacker
RollbackHook defines the "rollback middleware". A function that gets a Rollbacker and returns a Rollbacker. For example:
hook := func(next ent.Rollbacker) ent.Rollbacker { return ent.RollbackFunc(func(ctx context.Context, tx *ent.Tx) error { // Do some stuff before. if err := next.Rollback(ctx, tx); err != nil { return err } // Do some stuff after. return nil }) }
type Rollbacker ¶
Rollbacker is the interface that wraps the Rollback method.
type TraverseFunc ¶
type TraverseFunc = ent.TraverseFunc
ent aliases to avoid import conflicts in user's code.
type Tx ¶
type Tx struct { // Cabinet is the client for interacting with the Cabinet builders. Cabinet *CabinetClient // Game is the client for interacting with the Game builders. Game *GameClient // Location is the client for interacting with the Location builders. Location *LocationClient // contains filtered or unexported fields }
Tx is a transactional client that is created by calling Client.Tx().
func TxFromContext ¶
TxFromContext returns a Tx stored inside a context, or nil if there isn't one.
func (*Tx) OnRollback ¶
func (tx *Tx) OnRollback(f RollbackHook)
OnRollback adds a hook to call on rollback.
type ValidationError ¶
type ValidationError struct { Name string // Field or edge name. // contains filtered or unexported fields }
ValidationError returns when validating a field or edge fails.
func (*ValidationError) Error ¶
func (e *ValidationError) Error() string
Error implements the error interface.
func (*ValidationError) Unwrap ¶
func (e *ValidationError) Unwrap() error
Unwrap implements the errors.Wrapper interface.
Source Files ¶
- cabinet.go
- cabinet_create.go
- cabinet_delete.go
- cabinet_query.go
- cabinet_update.go
- client.go
- ent.go
- game.go
- game_create.go
- game_delete.go
- game_query.go
- game_update.go
- generate.go
- gql_collection.go
- gql_edge.go
- gql_mutation_input.go
- gql_node.go
- gql_pagination.go
- gql_transaction.go
- gql_where_input.go
- location.go
- location_create.go
- location_delete.go
- location_query.go
- location_update.go
- mutation.go
- runtime.go
- tx.go