Documentation ¶
Index ¶
- Constants
- 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
- type AggregateFunc
- type Airline
- type AirlineClient
- func (c *AirlineClient) Create() *AirlineCreate
- func (c *AirlineClient) CreateBulk(builders ...*AirlineCreate) *AirlineCreateBulk
- func (c *AirlineClient) Delete() *AirlineDelete
- func (c *AirlineClient) DeleteOne(a *Airline) *AirlineDeleteOne
- func (c *AirlineClient) DeleteOneID(id int) *AirlineDeleteOne
- func (c *AirlineClient) Get(ctx context.Context, id int) (*Airline, error)
- func (c *AirlineClient) GetX(ctx context.Context, id int) *Airline
- func (c *AirlineClient) Hooks() []Hook
- func (c *AirlineClient) Intercept(interceptors ...Interceptor)
- func (c *AirlineClient) Interceptors() []Interceptor
- func (c *AirlineClient) Query() *AirlineQuery
- func (c *AirlineClient) Update() *AirlineUpdate
- func (c *AirlineClient) UpdateOne(a *Airline) *AirlineUpdateOne
- func (c *AirlineClient) UpdateOneID(id int) *AirlineUpdateOne
- func (c *AirlineClient) Use(hooks ...Hook)
- type AirlineCreate
- func (ac *AirlineCreate) Exec(ctx context.Context) error
- func (ac *AirlineCreate) ExecX(ctx context.Context)
- func (ac *AirlineCreate) Mutation() *AirlineMutation
- func (ac *AirlineCreate) Save(ctx context.Context) (*Airline, error)
- func (ac *AirlineCreate) SaveX(ctx context.Context) *Airline
- func (ac *AirlineCreate) SetActive(b bool) *AirlineCreate
- func (ac *AirlineCreate) SetAlias(s string) *AirlineCreate
- func (ac *AirlineCreate) SetCountry(s string) *AirlineCreate
- func (ac *AirlineCreate) SetID(i int) *AirlineCreate
- func (ac *AirlineCreate) SetName(s string) *AirlineCreate
- type AirlineCreateBulk
- type AirlineDelete
- type AirlineDeleteOne
- type AirlineGroupBy
- func (agb *AirlineGroupBy) Aggregate(fns ...AggregateFunc) *AirlineGroupBy
- func (s *AirlineGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *AirlineGroupBy) BoolX(ctx context.Context) bool
- func (s *AirlineGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *AirlineGroupBy) BoolsX(ctx context.Context) []bool
- func (s *AirlineGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *AirlineGroupBy) Float64X(ctx context.Context) float64
- func (s *AirlineGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *AirlineGroupBy) Float64sX(ctx context.Context) []float64
- func (s *AirlineGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *AirlineGroupBy) IntX(ctx context.Context) int
- func (s *AirlineGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *AirlineGroupBy) IntsX(ctx context.Context) []int
- func (agb *AirlineGroupBy) Scan(ctx context.Context, v any) error
- func (s *AirlineGroupBy) ScanX(ctx context.Context, v any)
- func (s *AirlineGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *AirlineGroupBy) StringX(ctx context.Context) string
- func (s *AirlineGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *AirlineGroupBy) StringsX(ctx context.Context) []string
- type AirlineMutation
- func (m *AirlineMutation) Active() (r bool, exists bool)
- func (m *AirlineMutation) AddField(name string, value ent.Value) error
- func (m *AirlineMutation) AddedEdges() []string
- func (m *AirlineMutation) AddedField(name string) (ent.Value, bool)
- func (m *AirlineMutation) AddedFields() []string
- func (m *AirlineMutation) AddedIDs(name string) []ent.Value
- func (m *AirlineMutation) Alias() (r string, exists bool)
- func (m *AirlineMutation) ClearEdge(name string) error
- func (m *AirlineMutation) ClearField(name string) error
- func (m *AirlineMutation) ClearedEdges() []string
- func (m *AirlineMutation) ClearedFields() []string
- func (m AirlineMutation) Client() *Client
- func (m *AirlineMutation) Country() (r string, exists bool)
- func (m *AirlineMutation) EdgeCleared(name string) bool
- func (m *AirlineMutation) Field(name string) (ent.Value, bool)
- func (m *AirlineMutation) FieldCleared(name string) bool
- func (m *AirlineMutation) Fields() []string
- func (m *AirlineMutation) ID() (id int, exists bool)
- func (m *AirlineMutation) IDs(ctx context.Context) ([]int, error)
- func (m *AirlineMutation) Name() (r string, exists bool)
- func (m *AirlineMutation) OldActive(ctx context.Context) (v bool, err error)
- func (m *AirlineMutation) OldAlias(ctx context.Context) (v string, err error)
- func (m *AirlineMutation) OldCountry(ctx context.Context) (v string, err error)
- func (m *AirlineMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *AirlineMutation) OldName(ctx context.Context) (v string, err error)
- func (m *AirlineMutation) Op() Op
- func (m *AirlineMutation) RemovedEdges() []string
- func (m *AirlineMutation) RemovedIDs(name string) []ent.Value
- func (m *AirlineMutation) ResetActive()
- func (m *AirlineMutation) ResetAlias()
- func (m *AirlineMutation) ResetCountry()
- func (m *AirlineMutation) ResetEdge(name string) error
- func (m *AirlineMutation) ResetField(name string) error
- func (m *AirlineMutation) ResetName()
- func (m *AirlineMutation) SetActive(b bool)
- func (m *AirlineMutation) SetAlias(s string)
- func (m *AirlineMutation) SetCountry(s string)
- func (m *AirlineMutation) SetField(name string, value ent.Value) error
- func (m *AirlineMutation) SetID(id int)
- func (m *AirlineMutation) SetName(s string)
- func (m *AirlineMutation) SetOp(op Op)
- func (m AirlineMutation) Tx() (*Tx, error)
- func (m *AirlineMutation) Type() string
- func (m *AirlineMutation) Where(ps ...predicate.Airline)
- func (m *AirlineMutation) WhereP(ps ...func(*sql.Selector))
- type AirlineQuery
- func (aq *AirlineQuery) Aggregate(fns ...AggregateFunc) *AirlineSelect
- func (aq *AirlineQuery) All(ctx context.Context) ([]*Airline, error)
- func (aq *AirlineQuery) AllX(ctx context.Context) []*Airline
- func (aq *AirlineQuery) Clone() *AirlineQuery
- func (aq *AirlineQuery) Count(ctx context.Context) (int, error)
- func (aq *AirlineQuery) CountX(ctx context.Context) int
- func (aq *AirlineQuery) Exist(ctx context.Context) (bool, error)
- func (aq *AirlineQuery) ExistX(ctx context.Context) bool
- func (aq *AirlineQuery) First(ctx context.Context) (*Airline, error)
- func (aq *AirlineQuery) FirstID(ctx context.Context) (id int, err error)
- func (aq *AirlineQuery) FirstIDX(ctx context.Context) int
- func (aq *AirlineQuery) FirstX(ctx context.Context) *Airline
- func (aq *AirlineQuery) GroupBy(field string, fields ...string) *AirlineGroupBy
- func (aq *AirlineQuery) IDs(ctx context.Context) (ids []int, err error)
- func (aq *AirlineQuery) IDsX(ctx context.Context) []int
- func (aq *AirlineQuery) Limit(limit int) *AirlineQuery
- func (aq *AirlineQuery) Offset(offset int) *AirlineQuery
- func (aq *AirlineQuery) Only(ctx context.Context) (*Airline, error)
- func (aq *AirlineQuery) OnlyID(ctx context.Context) (id int, err error)
- func (aq *AirlineQuery) OnlyIDX(ctx context.Context) int
- func (aq *AirlineQuery) OnlyX(ctx context.Context) *Airline
- func (aq *AirlineQuery) Order(o ...OrderFunc) *AirlineQuery
- func (aq *AirlineQuery) Select(fields ...string) *AirlineSelect
- func (aq *AirlineQuery) Unique(unique bool) *AirlineQuery
- func (aq *AirlineQuery) Where(ps ...predicate.Airline) *AirlineQuery
- type AirlineSelect
- func (as *AirlineSelect) Aggregate(fns ...AggregateFunc) *AirlineSelect
- func (s *AirlineSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *AirlineSelect) BoolX(ctx context.Context) bool
- func (s *AirlineSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *AirlineSelect) BoolsX(ctx context.Context) []bool
- func (s *AirlineSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *AirlineSelect) Float64X(ctx context.Context) float64
- func (s *AirlineSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *AirlineSelect) Float64sX(ctx context.Context) []float64
- func (s *AirlineSelect) Int(ctx context.Context) (_ int, err error)
- func (s *AirlineSelect) IntX(ctx context.Context) int
- func (s *AirlineSelect) Ints(ctx context.Context) ([]int, error)
- func (s *AirlineSelect) IntsX(ctx context.Context) []int
- func (as *AirlineSelect) Scan(ctx context.Context, v any) error
- func (s *AirlineSelect) ScanX(ctx context.Context, v any)
- func (s *AirlineSelect) String(ctx context.Context) (_ string, err error)
- func (s *AirlineSelect) StringX(ctx context.Context) string
- func (s *AirlineSelect) Strings(ctx context.Context) ([]string, error)
- func (s *AirlineSelect) StringsX(ctx context.Context) []string
- type AirlineUpdate
- func (au *AirlineUpdate) Exec(ctx context.Context) error
- func (au *AirlineUpdate) ExecX(ctx context.Context)
- func (au *AirlineUpdate) Mutation() *AirlineMutation
- func (au *AirlineUpdate) Save(ctx context.Context) (int, error)
- func (au *AirlineUpdate) SaveX(ctx context.Context) int
- func (au *AirlineUpdate) SetActive(b bool) *AirlineUpdate
- func (au *AirlineUpdate) SetAlias(s string) *AirlineUpdate
- func (au *AirlineUpdate) SetCountry(s string) *AirlineUpdate
- func (au *AirlineUpdate) SetName(s string) *AirlineUpdate
- func (au *AirlineUpdate) Where(ps ...predicate.Airline) *AirlineUpdate
- type AirlineUpdateOne
- func (auo *AirlineUpdateOne) Exec(ctx context.Context) error
- func (auo *AirlineUpdateOne) ExecX(ctx context.Context)
- func (auo *AirlineUpdateOne) Mutation() *AirlineMutation
- func (auo *AirlineUpdateOne) Save(ctx context.Context) (*Airline, error)
- func (auo *AirlineUpdateOne) SaveX(ctx context.Context) *Airline
- func (auo *AirlineUpdateOne) Select(field string, fields ...string) *AirlineUpdateOne
- func (auo *AirlineUpdateOne) SetActive(b bool) *AirlineUpdateOne
- func (auo *AirlineUpdateOne) SetAlias(s string) *AirlineUpdateOne
- func (auo *AirlineUpdateOne) SetCountry(s string) *AirlineUpdateOne
- func (auo *AirlineUpdateOne) SetName(s string) *AirlineUpdateOne
- func (auo *AirlineUpdateOne) Where(ps ...predicate.Airline) *AirlineUpdateOne
- type Airlines
- type Airport
- type AirportClient
- func (c *AirportClient) Create() *AirportCreate
- func (c *AirportClient) CreateBulk(builders ...*AirportCreate) *AirportCreateBulk
- func (c *AirportClient) Delete() *AirportDelete
- func (c *AirportClient) DeleteOne(a *Airport) *AirportDeleteOne
- func (c *AirportClient) DeleteOneID(id int) *AirportDeleteOne
- func (c *AirportClient) Get(ctx context.Context, id int) (*Airport, error)
- func (c *AirportClient) GetX(ctx context.Context, id int) *Airport
- func (c *AirportClient) Hooks() []Hook
- func (c *AirportClient) Intercept(interceptors ...Interceptor)
- func (c *AirportClient) Interceptors() []Interceptor
- func (c *AirportClient) Query() *AirportQuery
- func (c *AirportClient) Update() *AirportUpdate
- func (c *AirportClient) UpdateOne(a *Airport) *AirportUpdateOne
- func (c *AirportClient) UpdateOneID(id int) *AirportUpdateOne
- func (c *AirportClient) Use(hooks ...Hook)
- type AirportCreate
- func (ac *AirportCreate) Exec(ctx context.Context) error
- func (ac *AirportCreate) ExecX(ctx context.Context)
- func (ac *AirportCreate) Mutation() *AirportMutation
- func (ac *AirportCreate) Save(ctx context.Context) (*Airport, error)
- func (ac *AirportCreate) SaveX(ctx context.Context) *Airport
- func (ac *AirportCreate) SetAltitude(i int) *AirportCreate
- func (ac *AirportCreate) SetCity(s string) *AirportCreate
- func (ac *AirportCreate) SetCountry(s string) *AirportCreate
- func (ac *AirportCreate) SetDst(s string) *AirportCreate
- func (ac *AirportCreate) SetID(i int) *AirportCreate
- func (ac *AirportCreate) SetIata(s string) *AirportCreate
- func (ac *AirportCreate) SetIcao(s string) *AirportCreate
- func (ac *AirportCreate) SetLatitude(f float64) *AirportCreate
- func (ac *AirportCreate) SetLongitude(f float64) *AirportCreate
- func (ac *AirportCreate) SetName(s string) *AirportCreate
- func (ac *AirportCreate) SetNillableAltitude(i *int) *AirportCreate
- func (ac *AirportCreate) SetNillableCity(s *string) *AirportCreate
- func (ac *AirportCreate) SetNillableCountry(s *string) *AirportCreate
- func (ac *AirportCreate) SetNillableDst(s *string) *AirportCreate
- func (ac *AirportCreate) SetNillableIata(s *string) *AirportCreate
- func (ac *AirportCreate) SetNillableIcao(s *string) *AirportCreate
- func (ac *AirportCreate) SetNillableLatitude(f *float64) *AirportCreate
- func (ac *AirportCreate) SetNillableLongitude(f *float64) *AirportCreate
- func (ac *AirportCreate) SetNillableName(s *string) *AirportCreate
- func (ac *AirportCreate) SetNillableSource(s *string) *AirportCreate
- func (ac *AirportCreate) SetNillableTimezone(s *string) *AirportCreate
- func (ac *AirportCreate) SetNillableTimezoneName(s *string) *AirportCreate
- func (ac *AirportCreate) SetNillableType(s *string) *AirportCreate
- func (ac *AirportCreate) SetSource(s string) *AirportCreate
- func (ac *AirportCreate) SetTimezone(s string) *AirportCreate
- func (ac *AirportCreate) SetTimezoneName(s string) *AirportCreate
- func (ac *AirportCreate) SetType(s string) *AirportCreate
- type AirportCreateBulk
- type AirportDelete
- type AirportDeleteOne
- type AirportGroupBy
- func (agb *AirportGroupBy) Aggregate(fns ...AggregateFunc) *AirportGroupBy
- func (s *AirportGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *AirportGroupBy) BoolX(ctx context.Context) bool
- func (s *AirportGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *AirportGroupBy) BoolsX(ctx context.Context) []bool
- func (s *AirportGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *AirportGroupBy) Float64X(ctx context.Context) float64
- func (s *AirportGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *AirportGroupBy) Float64sX(ctx context.Context) []float64
- func (s *AirportGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *AirportGroupBy) IntX(ctx context.Context) int
- func (s *AirportGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *AirportGroupBy) IntsX(ctx context.Context) []int
- func (agb *AirportGroupBy) Scan(ctx context.Context, v any) error
- func (s *AirportGroupBy) ScanX(ctx context.Context, v any)
- func (s *AirportGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *AirportGroupBy) StringX(ctx context.Context) string
- func (s *AirportGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *AirportGroupBy) StringsX(ctx context.Context) []string
- type AirportMutation
- func (m *AirportMutation) AddAltitude(i int)
- func (m *AirportMutation) AddField(name string, value ent.Value) error
- func (m *AirportMutation) AddLatitude(f float64)
- func (m *AirportMutation) AddLongitude(f float64)
- func (m *AirportMutation) AddedAltitude() (r int, exists bool)
- func (m *AirportMutation) AddedEdges() []string
- func (m *AirportMutation) AddedField(name string) (ent.Value, bool)
- func (m *AirportMutation) AddedFields() []string
- func (m *AirportMutation) AddedIDs(name string) []ent.Value
- func (m *AirportMutation) AddedLatitude() (r float64, exists bool)
- func (m *AirportMutation) AddedLongitude() (r float64, exists bool)
- func (m *AirportMutation) Altitude() (r int, exists bool)
- func (m *AirportMutation) AltitudeCleared() bool
- func (m *AirportMutation) City() (r string, exists bool)
- func (m *AirportMutation) CityCleared() bool
- func (m *AirportMutation) ClearAltitude()
- func (m *AirportMutation) ClearCity()
- func (m *AirportMutation) ClearCountry()
- func (m *AirportMutation) ClearDst()
- func (m *AirportMutation) ClearEdge(name string) error
- func (m *AirportMutation) ClearField(name string) error
- func (m *AirportMutation) ClearIata()
- func (m *AirportMutation) ClearIcao()
- func (m *AirportMutation) ClearLatitude()
- func (m *AirportMutation) ClearLongitude()
- func (m *AirportMutation) ClearName()
- func (m *AirportMutation) ClearSource()
- func (m *AirportMutation) ClearTimezone()
- func (m *AirportMutation) ClearTimezoneName()
- func (m *AirportMutation) ClearType()
- func (m *AirportMutation) ClearedEdges() []string
- func (m *AirportMutation) ClearedFields() []string
- func (m AirportMutation) Client() *Client
- func (m *AirportMutation) Country() (r string, exists bool)
- func (m *AirportMutation) CountryCleared() bool
- func (m *AirportMutation) Dst() (r string, exists bool)
- func (m *AirportMutation) DstCleared() bool
- func (m *AirportMutation) EdgeCleared(name string) bool
- func (m *AirportMutation) Field(name string) (ent.Value, bool)
- func (m *AirportMutation) FieldCleared(name string) bool
- func (m *AirportMutation) Fields() []string
- func (m *AirportMutation) GetType() (r string, exists bool)
- func (m *AirportMutation) ID() (id int, exists bool)
- func (m *AirportMutation) IDs(ctx context.Context) ([]int, error)
- func (m *AirportMutation) Iata() (r string, exists bool)
- func (m *AirportMutation) IataCleared() bool
- func (m *AirportMutation) Icao() (r string, exists bool)
- func (m *AirportMutation) IcaoCleared() bool
- func (m *AirportMutation) Latitude() (r float64, exists bool)
- func (m *AirportMutation) LatitudeCleared() bool
- func (m *AirportMutation) Longitude() (r float64, exists bool)
- func (m *AirportMutation) LongitudeCleared() bool
- func (m *AirportMutation) Name() (r string, exists bool)
- func (m *AirportMutation) NameCleared() bool
- func (m *AirportMutation) OldAltitude(ctx context.Context) (v int, err error)
- func (m *AirportMutation) OldCity(ctx context.Context) (v string, err error)
- func (m *AirportMutation) OldCountry(ctx context.Context) (v string, err error)
- func (m *AirportMutation) OldDst(ctx context.Context) (v string, err error)
- func (m *AirportMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *AirportMutation) OldIata(ctx context.Context) (v string, err error)
- func (m *AirportMutation) OldIcao(ctx context.Context) (v string, err error)
- func (m *AirportMutation) OldLatitude(ctx context.Context) (v float64, err error)
- func (m *AirportMutation) OldLongitude(ctx context.Context) (v float64, err error)
- func (m *AirportMutation) OldName(ctx context.Context) (v string, err error)
- func (m *AirportMutation) OldSource(ctx context.Context) (v string, err error)
- func (m *AirportMutation) OldTimezone(ctx context.Context) (v string, err error)
- func (m *AirportMutation) OldTimezoneName(ctx context.Context) (v string, err error)
- func (m *AirportMutation) OldType(ctx context.Context) (v string, err error)
- func (m *AirportMutation) Op() Op
- func (m *AirportMutation) RemovedEdges() []string
- func (m *AirportMutation) RemovedIDs(name string) []ent.Value
- func (m *AirportMutation) ResetAltitude()
- func (m *AirportMutation) ResetCity()
- func (m *AirportMutation) ResetCountry()
- func (m *AirportMutation) ResetDst()
- func (m *AirportMutation) ResetEdge(name string) error
- func (m *AirportMutation) ResetField(name string) error
- func (m *AirportMutation) ResetIata()
- func (m *AirportMutation) ResetIcao()
- func (m *AirportMutation) ResetLatitude()
- func (m *AirportMutation) ResetLongitude()
- func (m *AirportMutation) ResetName()
- func (m *AirportMutation) ResetSource()
- func (m *AirportMutation) ResetTimezone()
- func (m *AirportMutation) ResetTimezoneName()
- func (m *AirportMutation) ResetType()
- func (m *AirportMutation) SetAltitude(i int)
- func (m *AirportMutation) SetCity(s string)
- func (m *AirportMutation) SetCountry(s string)
- func (m *AirportMutation) SetDst(s string)
- func (m *AirportMutation) SetField(name string, value ent.Value) error
- func (m *AirportMutation) SetID(id int)
- func (m *AirportMutation) SetIata(s string)
- func (m *AirportMutation) SetIcao(s string)
- func (m *AirportMutation) SetLatitude(f float64)
- func (m *AirportMutation) SetLongitude(f float64)
- func (m *AirportMutation) SetName(s string)
- func (m *AirportMutation) SetOp(op Op)
- func (m *AirportMutation) SetSource(s string)
- func (m *AirportMutation) SetTimezone(s string)
- func (m *AirportMutation) SetTimezoneName(s string)
- func (m *AirportMutation) SetType(s string)
- func (m *AirportMutation) Source() (r string, exists bool)
- func (m *AirportMutation) SourceCleared() bool
- func (m *AirportMutation) Timezone() (r string, exists bool)
- func (m *AirportMutation) TimezoneCleared() bool
- func (m *AirportMutation) TimezoneName() (r string, exists bool)
- func (m *AirportMutation) TimezoneNameCleared() bool
- func (m AirportMutation) Tx() (*Tx, error)
- func (m *AirportMutation) Type() string
- func (m *AirportMutation) TypeCleared() bool
- func (m *AirportMutation) Where(ps ...predicate.Airport)
- func (m *AirportMutation) WhereP(ps ...func(*sql.Selector))
- type AirportQuery
- func (aq *AirportQuery) Aggregate(fns ...AggregateFunc) *AirportSelect
- func (aq *AirportQuery) All(ctx context.Context) ([]*Airport, error)
- func (aq *AirportQuery) AllX(ctx context.Context) []*Airport
- func (aq *AirportQuery) Clone() *AirportQuery
- func (aq *AirportQuery) Count(ctx context.Context) (int, error)
- func (aq *AirportQuery) CountX(ctx context.Context) int
- func (aq *AirportQuery) Exist(ctx context.Context) (bool, error)
- func (aq *AirportQuery) ExistX(ctx context.Context) bool
- func (aq *AirportQuery) First(ctx context.Context) (*Airport, error)
- func (aq *AirportQuery) FirstID(ctx context.Context) (id int, err error)
- func (aq *AirportQuery) FirstIDX(ctx context.Context) int
- func (aq *AirportQuery) FirstX(ctx context.Context) *Airport
- func (aq *AirportQuery) GroupBy(field string, fields ...string) *AirportGroupBy
- func (aq *AirportQuery) IDs(ctx context.Context) (ids []int, err error)
- func (aq *AirportQuery) IDsX(ctx context.Context) []int
- func (aq *AirportQuery) Limit(limit int) *AirportQuery
- func (aq *AirportQuery) Offset(offset int) *AirportQuery
- func (aq *AirportQuery) Only(ctx context.Context) (*Airport, error)
- func (aq *AirportQuery) OnlyID(ctx context.Context) (id int, err error)
- func (aq *AirportQuery) OnlyIDX(ctx context.Context) int
- func (aq *AirportQuery) OnlyX(ctx context.Context) *Airport
- func (aq *AirportQuery) Order(o ...OrderFunc) *AirportQuery
- func (aq *AirportQuery) Select(fields ...string) *AirportSelect
- func (aq *AirportQuery) Unique(unique bool) *AirportQuery
- func (aq *AirportQuery) Where(ps ...predicate.Airport) *AirportQuery
- type AirportSelect
- func (as *AirportSelect) Aggregate(fns ...AggregateFunc) *AirportSelect
- func (s *AirportSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *AirportSelect) BoolX(ctx context.Context) bool
- func (s *AirportSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *AirportSelect) BoolsX(ctx context.Context) []bool
- func (s *AirportSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *AirportSelect) Float64X(ctx context.Context) float64
- func (s *AirportSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *AirportSelect) Float64sX(ctx context.Context) []float64
- func (s *AirportSelect) Int(ctx context.Context) (_ int, err error)
- func (s *AirportSelect) IntX(ctx context.Context) int
- func (s *AirportSelect) Ints(ctx context.Context) ([]int, error)
- func (s *AirportSelect) IntsX(ctx context.Context) []int
- func (as *AirportSelect) Scan(ctx context.Context, v any) error
- func (s *AirportSelect) ScanX(ctx context.Context, v any)
- func (s *AirportSelect) String(ctx context.Context) (_ string, err error)
- func (s *AirportSelect) StringX(ctx context.Context) string
- func (s *AirportSelect) Strings(ctx context.Context) ([]string, error)
- func (s *AirportSelect) StringsX(ctx context.Context) []string
- type AirportUpdate
- func (au *AirportUpdate) AddAltitude(i int) *AirportUpdate
- func (au *AirportUpdate) AddLatitude(f float64) *AirportUpdate
- func (au *AirportUpdate) AddLongitude(f float64) *AirportUpdate
- func (au *AirportUpdate) ClearAltitude() *AirportUpdate
- func (au *AirportUpdate) ClearCity() *AirportUpdate
- func (au *AirportUpdate) ClearCountry() *AirportUpdate
- func (au *AirportUpdate) ClearDst() *AirportUpdate
- func (au *AirportUpdate) ClearIata() *AirportUpdate
- func (au *AirportUpdate) ClearIcao() *AirportUpdate
- func (au *AirportUpdate) ClearLatitude() *AirportUpdate
- func (au *AirportUpdate) ClearLongitude() *AirportUpdate
- func (au *AirportUpdate) ClearName() *AirportUpdate
- func (au *AirportUpdate) ClearSource() *AirportUpdate
- func (au *AirportUpdate) ClearTimezone() *AirportUpdate
- func (au *AirportUpdate) ClearTimezoneName() *AirportUpdate
- func (au *AirportUpdate) ClearType() *AirportUpdate
- func (au *AirportUpdate) Exec(ctx context.Context) error
- func (au *AirportUpdate) ExecX(ctx context.Context)
- func (au *AirportUpdate) Mutation() *AirportMutation
- func (au *AirportUpdate) Save(ctx context.Context) (int, error)
- func (au *AirportUpdate) SaveX(ctx context.Context) int
- func (au *AirportUpdate) SetAltitude(i int) *AirportUpdate
- func (au *AirportUpdate) SetCity(s string) *AirportUpdate
- func (au *AirportUpdate) SetCountry(s string) *AirportUpdate
- func (au *AirportUpdate) SetDst(s string) *AirportUpdate
- func (au *AirportUpdate) SetIata(s string) *AirportUpdate
- func (au *AirportUpdate) SetIcao(s string) *AirportUpdate
- func (au *AirportUpdate) SetLatitude(f float64) *AirportUpdate
- func (au *AirportUpdate) SetLongitude(f float64) *AirportUpdate
- func (au *AirportUpdate) SetName(s string) *AirportUpdate
- func (au *AirportUpdate) SetNillableAltitude(i *int) *AirportUpdate
- func (au *AirportUpdate) SetNillableCity(s *string) *AirportUpdate
- func (au *AirportUpdate) SetNillableCountry(s *string) *AirportUpdate
- func (au *AirportUpdate) SetNillableDst(s *string) *AirportUpdate
- func (au *AirportUpdate) SetNillableIata(s *string) *AirportUpdate
- func (au *AirportUpdate) SetNillableIcao(s *string) *AirportUpdate
- func (au *AirportUpdate) SetNillableLatitude(f *float64) *AirportUpdate
- func (au *AirportUpdate) SetNillableLongitude(f *float64) *AirportUpdate
- func (au *AirportUpdate) SetNillableName(s *string) *AirportUpdate
- func (au *AirportUpdate) SetNillableSource(s *string) *AirportUpdate
- func (au *AirportUpdate) SetNillableTimezone(s *string) *AirportUpdate
- func (au *AirportUpdate) SetNillableTimezoneName(s *string) *AirportUpdate
- func (au *AirportUpdate) SetNillableType(s *string) *AirportUpdate
- func (au *AirportUpdate) SetSource(s string) *AirportUpdate
- func (au *AirportUpdate) SetTimezone(s string) *AirportUpdate
- func (au *AirportUpdate) SetTimezoneName(s string) *AirportUpdate
- func (au *AirportUpdate) SetType(s string) *AirportUpdate
- func (au *AirportUpdate) Where(ps ...predicate.Airport) *AirportUpdate
- type AirportUpdateOne
- func (auo *AirportUpdateOne) AddAltitude(i int) *AirportUpdateOne
- func (auo *AirportUpdateOne) AddLatitude(f float64) *AirportUpdateOne
- func (auo *AirportUpdateOne) AddLongitude(f float64) *AirportUpdateOne
- func (auo *AirportUpdateOne) ClearAltitude() *AirportUpdateOne
- func (auo *AirportUpdateOne) ClearCity() *AirportUpdateOne
- func (auo *AirportUpdateOne) ClearCountry() *AirportUpdateOne
- func (auo *AirportUpdateOne) ClearDst() *AirportUpdateOne
- func (auo *AirportUpdateOne) ClearIata() *AirportUpdateOne
- func (auo *AirportUpdateOne) ClearIcao() *AirportUpdateOne
- func (auo *AirportUpdateOne) ClearLatitude() *AirportUpdateOne
- func (auo *AirportUpdateOne) ClearLongitude() *AirportUpdateOne
- func (auo *AirportUpdateOne) ClearName() *AirportUpdateOne
- func (auo *AirportUpdateOne) ClearSource() *AirportUpdateOne
- func (auo *AirportUpdateOne) ClearTimezone() *AirportUpdateOne
- func (auo *AirportUpdateOne) ClearTimezoneName() *AirportUpdateOne
- func (auo *AirportUpdateOne) ClearType() *AirportUpdateOne
- func (auo *AirportUpdateOne) Exec(ctx context.Context) error
- func (auo *AirportUpdateOne) ExecX(ctx context.Context)
- func (auo *AirportUpdateOne) Mutation() *AirportMutation
- func (auo *AirportUpdateOne) Save(ctx context.Context) (*Airport, error)
- func (auo *AirportUpdateOne) SaveX(ctx context.Context) *Airport
- func (auo *AirportUpdateOne) Select(field string, fields ...string) *AirportUpdateOne
- func (auo *AirportUpdateOne) SetAltitude(i int) *AirportUpdateOne
- func (auo *AirportUpdateOne) SetCity(s string) *AirportUpdateOne
- func (auo *AirportUpdateOne) SetCountry(s string) *AirportUpdateOne
- func (auo *AirportUpdateOne) SetDst(s string) *AirportUpdateOne
- func (auo *AirportUpdateOne) SetIata(s string) *AirportUpdateOne
- func (auo *AirportUpdateOne) SetIcao(s string) *AirportUpdateOne
- func (auo *AirportUpdateOne) SetLatitude(f float64) *AirportUpdateOne
- func (auo *AirportUpdateOne) SetLongitude(f float64) *AirportUpdateOne
- func (auo *AirportUpdateOne) SetName(s string) *AirportUpdateOne
- func (auo *AirportUpdateOne) SetNillableAltitude(i *int) *AirportUpdateOne
- func (auo *AirportUpdateOne) SetNillableCity(s *string) *AirportUpdateOne
- func (auo *AirportUpdateOne) SetNillableCountry(s *string) *AirportUpdateOne
- func (auo *AirportUpdateOne) SetNillableDst(s *string) *AirportUpdateOne
- func (auo *AirportUpdateOne) SetNillableIata(s *string) *AirportUpdateOne
- func (auo *AirportUpdateOne) SetNillableIcao(s *string) *AirportUpdateOne
- func (auo *AirportUpdateOne) SetNillableLatitude(f *float64) *AirportUpdateOne
- func (auo *AirportUpdateOne) SetNillableLongitude(f *float64) *AirportUpdateOne
- func (auo *AirportUpdateOne) SetNillableName(s *string) *AirportUpdateOne
- func (auo *AirportUpdateOne) SetNillableSource(s *string) *AirportUpdateOne
- func (auo *AirportUpdateOne) SetNillableTimezone(s *string) *AirportUpdateOne
- func (auo *AirportUpdateOne) SetNillableTimezoneName(s *string) *AirportUpdateOne
- func (auo *AirportUpdateOne) SetNillableType(s *string) *AirportUpdateOne
- func (auo *AirportUpdateOne) SetSource(s string) *AirportUpdateOne
- func (auo *AirportUpdateOne) SetTimezone(s string) *AirportUpdateOne
- func (auo *AirportUpdateOne) SetTimezoneName(s string) *AirportUpdateOne
- func (auo *AirportUpdateOne) SetType(s string) *AirportUpdateOne
- func (auo *AirportUpdateOne) Where(ps ...predicate.Airport) *AirportUpdateOne
- type Airports
- 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) Tx(ctx context.Context) (*Tx, error)
- func (c *Client) Use(hooks ...Hook)
- type CommitFunc
- type CommitHook
- type Committer
- type ConstraintError
- type Hook
- type InterceptFunc
- type Interceptor
- type MutateFunc
- type Mutation
- type Mutator
- type NotFoundError
- type NotLoadedError
- type NotSingularError
- type Op
- type Option
- type OrderFunc
- type Plane
- type PlaneClient
- func (c *PlaneClient) Create() *PlaneCreate
- func (c *PlaneClient) CreateBulk(builders ...*PlaneCreate) *PlaneCreateBulk
- func (c *PlaneClient) Delete() *PlaneDelete
- func (c *PlaneClient) DeleteOne(pl *Plane) *PlaneDeleteOne
- func (c *PlaneClient) DeleteOneID(id int) *PlaneDeleteOne
- func (c *PlaneClient) Get(ctx context.Context, id int) (*Plane, error)
- func (c *PlaneClient) GetX(ctx context.Context, id int) *Plane
- func (c *PlaneClient) Hooks() []Hook
- func (c *PlaneClient) Intercept(interceptors ...Interceptor)
- func (c *PlaneClient) Interceptors() []Interceptor
- func (c *PlaneClient) Query() *PlaneQuery
- func (c *PlaneClient) Update() *PlaneUpdate
- func (c *PlaneClient) UpdateOne(pl *Plane) *PlaneUpdateOne
- func (c *PlaneClient) UpdateOneID(id int) *PlaneUpdateOne
- func (c *PlaneClient) Use(hooks ...Hook)
- type PlaneCreate
- func (pc *PlaneCreate) Exec(ctx context.Context) error
- func (pc *PlaneCreate) ExecX(ctx context.Context)
- func (pc *PlaneCreate) Mutation() *PlaneMutation
- func (pc *PlaneCreate) Save(ctx context.Context) (*Plane, error)
- func (pc *PlaneCreate) SaveX(ctx context.Context) *Plane
- func (pc *PlaneCreate) SetID(i int) *PlaneCreate
- func (pc *PlaneCreate) SetName(s string) *PlaneCreate
- func (pc *PlaneCreate) SetTailNumber(s string) *PlaneCreate
- type PlaneCreateBulk
- type PlaneDelete
- type PlaneDeleteOne
- type PlaneGroupBy
- func (pgb *PlaneGroupBy) Aggregate(fns ...AggregateFunc) *PlaneGroupBy
- func (s *PlaneGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *PlaneGroupBy) BoolX(ctx context.Context) bool
- func (s *PlaneGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *PlaneGroupBy) BoolsX(ctx context.Context) []bool
- func (s *PlaneGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *PlaneGroupBy) Float64X(ctx context.Context) float64
- func (s *PlaneGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *PlaneGroupBy) Float64sX(ctx context.Context) []float64
- func (s *PlaneGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *PlaneGroupBy) IntX(ctx context.Context) int
- func (s *PlaneGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *PlaneGroupBy) IntsX(ctx context.Context) []int
- func (pgb *PlaneGroupBy) Scan(ctx context.Context, v any) error
- func (s *PlaneGroupBy) ScanX(ctx context.Context, v any)
- func (s *PlaneGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *PlaneGroupBy) StringX(ctx context.Context) string
- func (s *PlaneGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *PlaneGroupBy) StringsX(ctx context.Context) []string
- type PlaneMutation
- func (m *PlaneMutation) AddField(name string, value ent.Value) error
- func (m *PlaneMutation) AddedEdges() []string
- func (m *PlaneMutation) AddedField(name string) (ent.Value, bool)
- func (m *PlaneMutation) AddedFields() []string
- func (m *PlaneMutation) AddedIDs(name string) []ent.Value
- func (m *PlaneMutation) ClearEdge(name string) error
- func (m *PlaneMutation) ClearField(name string) error
- func (m *PlaneMutation) ClearedEdges() []string
- func (m *PlaneMutation) ClearedFields() []string
- func (m PlaneMutation) Client() *Client
- func (m *PlaneMutation) EdgeCleared(name string) bool
- func (m *PlaneMutation) Field(name string) (ent.Value, bool)
- func (m *PlaneMutation) FieldCleared(name string) bool
- func (m *PlaneMutation) Fields() []string
- func (m *PlaneMutation) ID() (id int, exists bool)
- func (m *PlaneMutation) IDs(ctx context.Context) ([]int, error)
- func (m *PlaneMutation) Name() (r string, exists bool)
- func (m *PlaneMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *PlaneMutation) OldName(ctx context.Context) (v string, err error)
- func (m *PlaneMutation) OldTailNumber(ctx context.Context) (v string, err error)
- func (m *PlaneMutation) Op() Op
- func (m *PlaneMutation) RemovedEdges() []string
- func (m *PlaneMutation) RemovedIDs(name string) []ent.Value
- func (m *PlaneMutation) ResetEdge(name string) error
- func (m *PlaneMutation) ResetField(name string) error
- func (m *PlaneMutation) ResetName()
- func (m *PlaneMutation) ResetTailNumber()
- func (m *PlaneMutation) SetField(name string, value ent.Value) error
- func (m *PlaneMutation) SetID(id int)
- func (m *PlaneMutation) SetName(s string)
- func (m *PlaneMutation) SetOp(op Op)
- func (m *PlaneMutation) SetTailNumber(s string)
- func (m *PlaneMutation) TailNumber() (r string, exists bool)
- func (m PlaneMutation) Tx() (*Tx, error)
- func (m *PlaneMutation) Type() string
- func (m *PlaneMutation) Where(ps ...predicate.Plane)
- func (m *PlaneMutation) WhereP(ps ...func(*sql.Selector))
- type PlaneQuery
- func (pq *PlaneQuery) Aggregate(fns ...AggregateFunc) *PlaneSelect
- func (pq *PlaneQuery) All(ctx context.Context) ([]*Plane, error)
- func (pq *PlaneQuery) AllX(ctx context.Context) []*Plane
- func (pq *PlaneQuery) Clone() *PlaneQuery
- func (pq *PlaneQuery) Count(ctx context.Context) (int, error)
- func (pq *PlaneQuery) CountX(ctx context.Context) int
- func (pq *PlaneQuery) Exist(ctx context.Context) (bool, error)
- func (pq *PlaneQuery) ExistX(ctx context.Context) bool
- func (pq *PlaneQuery) First(ctx context.Context) (*Plane, error)
- func (pq *PlaneQuery) FirstID(ctx context.Context) (id int, err error)
- func (pq *PlaneQuery) FirstIDX(ctx context.Context) int
- func (pq *PlaneQuery) FirstX(ctx context.Context) *Plane
- func (pq *PlaneQuery) GroupBy(field string, fields ...string) *PlaneGroupBy
- func (pq *PlaneQuery) IDs(ctx context.Context) (ids []int, err error)
- func (pq *PlaneQuery) IDsX(ctx context.Context) []int
- func (pq *PlaneQuery) Limit(limit int) *PlaneQuery
- func (pq *PlaneQuery) Offset(offset int) *PlaneQuery
- func (pq *PlaneQuery) Only(ctx context.Context) (*Plane, error)
- func (pq *PlaneQuery) OnlyID(ctx context.Context) (id int, err error)
- func (pq *PlaneQuery) OnlyIDX(ctx context.Context) int
- func (pq *PlaneQuery) OnlyX(ctx context.Context) *Plane
- func (pq *PlaneQuery) Order(o ...OrderFunc) *PlaneQuery
- func (pq *PlaneQuery) Select(fields ...string) *PlaneSelect
- func (pq *PlaneQuery) Unique(unique bool) *PlaneQuery
- func (pq *PlaneQuery) Where(ps ...predicate.Plane) *PlaneQuery
- type PlaneSelect
- func (ps *PlaneSelect) Aggregate(fns ...AggregateFunc) *PlaneSelect
- func (s *PlaneSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *PlaneSelect) BoolX(ctx context.Context) bool
- func (s *PlaneSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *PlaneSelect) BoolsX(ctx context.Context) []bool
- func (s *PlaneSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *PlaneSelect) Float64X(ctx context.Context) float64
- func (s *PlaneSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *PlaneSelect) Float64sX(ctx context.Context) []float64
- func (s *PlaneSelect) Int(ctx context.Context) (_ int, err error)
- func (s *PlaneSelect) IntX(ctx context.Context) int
- func (s *PlaneSelect) Ints(ctx context.Context) ([]int, error)
- func (s *PlaneSelect) IntsX(ctx context.Context) []int
- func (ps *PlaneSelect) Scan(ctx context.Context, v any) error
- func (s *PlaneSelect) ScanX(ctx context.Context, v any)
- func (s *PlaneSelect) String(ctx context.Context) (_ string, err error)
- func (s *PlaneSelect) StringX(ctx context.Context) string
- func (s *PlaneSelect) Strings(ctx context.Context) ([]string, error)
- func (s *PlaneSelect) StringsX(ctx context.Context) []string
- type PlaneUpdate
- func (pu *PlaneUpdate) Exec(ctx context.Context) error
- func (pu *PlaneUpdate) ExecX(ctx context.Context)
- func (pu *PlaneUpdate) Mutation() *PlaneMutation
- func (pu *PlaneUpdate) Save(ctx context.Context) (int, error)
- func (pu *PlaneUpdate) SaveX(ctx context.Context) int
- func (pu *PlaneUpdate) SetName(s string) *PlaneUpdate
- func (pu *PlaneUpdate) SetTailNumber(s string) *PlaneUpdate
- func (pu *PlaneUpdate) Where(ps ...predicate.Plane) *PlaneUpdate
- type PlaneUpdateOne
- func (puo *PlaneUpdateOne) Exec(ctx context.Context) error
- func (puo *PlaneUpdateOne) ExecX(ctx context.Context)
- func (puo *PlaneUpdateOne) Mutation() *PlaneMutation
- func (puo *PlaneUpdateOne) Save(ctx context.Context) (*Plane, error)
- func (puo *PlaneUpdateOne) SaveX(ctx context.Context) *Plane
- func (puo *PlaneUpdateOne) Select(field string, fields ...string) *PlaneUpdateOne
- func (puo *PlaneUpdateOne) SetName(s string) *PlaneUpdateOne
- func (puo *PlaneUpdateOne) SetTailNumber(s string) *PlaneUpdateOne
- func (puo *PlaneUpdateOne) Where(ps ...predicate.Plane) *PlaneUpdateOne
- type Planes
- type Policy
- type Querier
- type QuerierFunc
- type Query
- type QueryContext
- type RollbackFunc
- type RollbackHook
- type Rollbacker
- type Route
- type RouteClient
- func (c *RouteClient) Create() *RouteCreate
- func (c *RouteClient) CreateBulk(builders ...*RouteCreate) *RouteCreateBulk
- func (c *RouteClient) Delete() *RouteDelete
- func (c *RouteClient) DeleteOne(r *Route) *RouteDeleteOne
- func (c *RouteClient) DeleteOneID(id int) *RouteDeleteOne
- func (c *RouteClient) Get(ctx context.Context, id int) (*Route, error)
- func (c *RouteClient) GetX(ctx context.Context, id int) *Route
- func (c *RouteClient) Hooks() []Hook
- func (c *RouteClient) Intercept(interceptors ...Interceptor)
- func (c *RouteClient) Interceptors() []Interceptor
- func (c *RouteClient) Query() *RouteQuery
- func (c *RouteClient) Update() *RouteUpdate
- func (c *RouteClient) UpdateOne(r *Route) *RouteUpdateOne
- func (c *RouteClient) UpdateOneID(id int) *RouteUpdateOne
- func (c *RouteClient) Use(hooks ...Hook)
- type RouteCreate
- func (rc *RouteCreate) Exec(ctx context.Context) error
- func (rc *RouteCreate) ExecX(ctx context.Context)
- func (rc *RouteCreate) Mutation() *RouteMutation
- func (rc *RouteCreate) Save(ctx context.Context) (*Route, error)
- func (rc *RouteCreate) SaveX(ctx context.Context) *Route
- func (rc *RouteCreate) SetAirlineId(i int) *RouteCreate
- func (rc *RouteCreate) SetDestinationAirportId(i int) *RouteCreate
- func (rc *RouteCreate) SetID(i int) *RouteCreate
- func (rc *RouteCreate) SetNumberOfStops(i int) *RouteCreate
- func (rc *RouteCreate) SetPlaneId(i int) *RouteCreate
- func (rc *RouteCreate) SetSourceAirportId(i int) *RouteCreate
- type RouteCreateBulk
- type RouteDelete
- type RouteDeleteOne
- type RouteGroupBy
- func (rgb *RouteGroupBy) Aggregate(fns ...AggregateFunc) *RouteGroupBy
- func (s *RouteGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *RouteGroupBy) BoolX(ctx context.Context) bool
- func (s *RouteGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *RouteGroupBy) BoolsX(ctx context.Context) []bool
- func (s *RouteGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *RouteGroupBy) Float64X(ctx context.Context) float64
- func (s *RouteGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *RouteGroupBy) Float64sX(ctx context.Context) []float64
- func (s *RouteGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *RouteGroupBy) IntX(ctx context.Context) int
- func (s *RouteGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *RouteGroupBy) IntsX(ctx context.Context) []int
- func (rgb *RouteGroupBy) Scan(ctx context.Context, v any) error
- func (s *RouteGroupBy) ScanX(ctx context.Context, v any)
- func (s *RouteGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *RouteGroupBy) StringX(ctx context.Context) string
- func (s *RouteGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *RouteGroupBy) StringsX(ctx context.Context) []string
- type RouteMutation
- func (m *RouteMutation) AddAirlineId(i int)
- func (m *RouteMutation) AddDestinationAirportId(i int)
- func (m *RouteMutation) AddField(name string, value ent.Value) error
- func (m *RouteMutation) AddNumberOfStops(i int)
- func (m *RouteMutation) AddPlaneId(i int)
- func (m *RouteMutation) AddSourceAirportId(i int)
- func (m *RouteMutation) AddedAirlineId() (r int, exists bool)
- func (m *RouteMutation) AddedDestinationAirportId() (r int, exists bool)
- func (m *RouteMutation) AddedEdges() []string
- func (m *RouteMutation) AddedField(name string) (ent.Value, bool)
- func (m *RouteMutation) AddedFields() []string
- func (m *RouteMutation) AddedIDs(name string) []ent.Value
- func (m *RouteMutation) AddedNumberOfStops() (r int, exists bool)
- func (m *RouteMutation) AddedPlaneId() (r int, exists bool)
- func (m *RouteMutation) AddedSourceAirportId() (r int, exists bool)
- func (m *RouteMutation) AirlineId() (r int, exists bool)
- func (m *RouteMutation) ClearEdge(name string) error
- func (m *RouteMutation) ClearField(name string) error
- func (m *RouteMutation) ClearedEdges() []string
- func (m *RouteMutation) ClearedFields() []string
- func (m RouteMutation) Client() *Client
- func (m *RouteMutation) DestinationAirportId() (r int, exists bool)
- func (m *RouteMutation) EdgeCleared(name string) bool
- func (m *RouteMutation) Field(name string) (ent.Value, bool)
- func (m *RouteMutation) FieldCleared(name string) bool
- func (m *RouteMutation) Fields() []string
- func (m *RouteMutation) ID() (id int, exists bool)
- func (m *RouteMutation) IDs(ctx context.Context) ([]int, error)
- func (m *RouteMutation) NumberOfStops() (r int, exists bool)
- func (m *RouteMutation) OldAirlineId(ctx context.Context) (v int, err error)
- func (m *RouteMutation) OldDestinationAirportId(ctx context.Context) (v int, err error)
- func (m *RouteMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *RouteMutation) OldNumberOfStops(ctx context.Context) (v int, err error)
- func (m *RouteMutation) OldPlaneId(ctx context.Context) (v int, err error)
- func (m *RouteMutation) OldSourceAirportId(ctx context.Context) (v int, err error)
- func (m *RouteMutation) Op() Op
- func (m *RouteMutation) PlaneId() (r int, exists bool)
- func (m *RouteMutation) RemovedEdges() []string
- func (m *RouteMutation) RemovedIDs(name string) []ent.Value
- func (m *RouteMutation) ResetAirlineId()
- func (m *RouteMutation) ResetDestinationAirportId()
- func (m *RouteMutation) ResetEdge(name string) error
- func (m *RouteMutation) ResetField(name string) error
- func (m *RouteMutation) ResetNumberOfStops()
- func (m *RouteMutation) ResetPlaneId()
- func (m *RouteMutation) ResetSourceAirportId()
- func (m *RouteMutation) SetAirlineId(i int)
- func (m *RouteMutation) SetDestinationAirportId(i int)
- func (m *RouteMutation) SetField(name string, value ent.Value) error
- func (m *RouteMutation) SetID(id int)
- func (m *RouteMutation) SetNumberOfStops(i int)
- func (m *RouteMutation) SetOp(op Op)
- func (m *RouteMutation) SetPlaneId(i int)
- func (m *RouteMutation) SetSourceAirportId(i int)
- func (m *RouteMutation) SourceAirportId() (r int, exists bool)
- func (m RouteMutation) Tx() (*Tx, error)
- func (m *RouteMutation) Type() string
- func (m *RouteMutation) Where(ps ...predicate.Route)
- func (m *RouteMutation) WhereP(ps ...func(*sql.Selector))
- type RouteQuery
- func (rq *RouteQuery) Aggregate(fns ...AggregateFunc) *RouteSelect
- func (rq *RouteQuery) All(ctx context.Context) ([]*Route, error)
- func (rq *RouteQuery) AllX(ctx context.Context) []*Route
- func (rq *RouteQuery) Clone() *RouteQuery
- func (rq *RouteQuery) Count(ctx context.Context) (int, error)
- func (rq *RouteQuery) CountX(ctx context.Context) int
- func (rq *RouteQuery) Exist(ctx context.Context) (bool, error)
- func (rq *RouteQuery) ExistX(ctx context.Context) bool
- func (rq *RouteQuery) First(ctx context.Context) (*Route, error)
- func (rq *RouteQuery) FirstID(ctx context.Context) (id int, err error)
- func (rq *RouteQuery) FirstIDX(ctx context.Context) int
- func (rq *RouteQuery) FirstX(ctx context.Context) *Route
- func (rq *RouteQuery) GroupBy(field string, fields ...string) *RouteGroupBy
- func (rq *RouteQuery) IDs(ctx context.Context) (ids []int, err error)
- func (rq *RouteQuery) IDsX(ctx context.Context) []int
- func (rq *RouteQuery) Limit(limit int) *RouteQuery
- func (rq *RouteQuery) Offset(offset int) *RouteQuery
- func (rq *RouteQuery) Only(ctx context.Context) (*Route, error)
- func (rq *RouteQuery) OnlyID(ctx context.Context) (id int, err error)
- func (rq *RouteQuery) OnlyIDX(ctx context.Context) int
- func (rq *RouteQuery) OnlyX(ctx context.Context) *Route
- func (rq *RouteQuery) Order(o ...OrderFunc) *RouteQuery
- func (rq *RouteQuery) Select(fields ...string) *RouteSelect
- func (rq *RouteQuery) Unique(unique bool) *RouteQuery
- func (rq *RouteQuery) Where(ps ...predicate.Route) *RouteQuery
- type RouteSelect
- func (rs *RouteSelect) Aggregate(fns ...AggregateFunc) *RouteSelect
- func (s *RouteSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *RouteSelect) BoolX(ctx context.Context) bool
- func (s *RouteSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *RouteSelect) BoolsX(ctx context.Context) []bool
- func (s *RouteSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *RouteSelect) Float64X(ctx context.Context) float64
- func (s *RouteSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *RouteSelect) Float64sX(ctx context.Context) []float64
- func (s *RouteSelect) Int(ctx context.Context) (_ int, err error)
- func (s *RouteSelect) IntX(ctx context.Context) int
- func (s *RouteSelect) Ints(ctx context.Context) ([]int, error)
- func (s *RouteSelect) IntsX(ctx context.Context) []int
- func (rs *RouteSelect) Scan(ctx context.Context, v any) error
- func (s *RouteSelect) ScanX(ctx context.Context, v any)
- func (s *RouteSelect) String(ctx context.Context) (_ string, err error)
- func (s *RouteSelect) StringX(ctx context.Context) string
- func (s *RouteSelect) Strings(ctx context.Context) ([]string, error)
- func (s *RouteSelect) StringsX(ctx context.Context) []string
- type RouteUpdate
- func (ru *RouteUpdate) AddAirlineId(i int) *RouteUpdate
- func (ru *RouteUpdate) AddDestinationAirportId(i int) *RouteUpdate
- func (ru *RouteUpdate) AddNumberOfStops(i int) *RouteUpdate
- func (ru *RouteUpdate) AddPlaneId(i int) *RouteUpdate
- func (ru *RouteUpdate) AddSourceAirportId(i int) *RouteUpdate
- func (ru *RouteUpdate) Exec(ctx context.Context) error
- func (ru *RouteUpdate) ExecX(ctx context.Context)
- func (ru *RouteUpdate) Mutation() *RouteMutation
- func (ru *RouteUpdate) Save(ctx context.Context) (int, error)
- func (ru *RouteUpdate) SaveX(ctx context.Context) int
- func (ru *RouteUpdate) SetAirlineId(i int) *RouteUpdate
- func (ru *RouteUpdate) SetDestinationAirportId(i int) *RouteUpdate
- func (ru *RouteUpdate) SetNumberOfStops(i int) *RouteUpdate
- func (ru *RouteUpdate) SetPlaneId(i int) *RouteUpdate
- func (ru *RouteUpdate) SetSourceAirportId(i int) *RouteUpdate
- func (ru *RouteUpdate) Where(ps ...predicate.Route) *RouteUpdate
- type RouteUpdateOne
- func (ruo *RouteUpdateOne) AddAirlineId(i int) *RouteUpdateOne
- func (ruo *RouteUpdateOne) AddDestinationAirportId(i int) *RouteUpdateOne
- func (ruo *RouteUpdateOne) AddNumberOfStops(i int) *RouteUpdateOne
- func (ruo *RouteUpdateOne) AddPlaneId(i int) *RouteUpdateOne
- func (ruo *RouteUpdateOne) AddSourceAirportId(i int) *RouteUpdateOne
- func (ruo *RouteUpdateOne) Exec(ctx context.Context) error
- func (ruo *RouteUpdateOne) ExecX(ctx context.Context)
- func (ruo *RouteUpdateOne) Mutation() *RouteMutation
- func (ruo *RouteUpdateOne) Save(ctx context.Context) (*Route, error)
- func (ruo *RouteUpdateOne) SaveX(ctx context.Context) *Route
- func (ruo *RouteUpdateOne) Select(field string, fields ...string) *RouteUpdateOne
- func (ruo *RouteUpdateOne) SetAirlineId(i int) *RouteUpdateOne
- func (ruo *RouteUpdateOne) SetDestinationAirportId(i int) *RouteUpdateOne
- func (ruo *RouteUpdateOne) SetNumberOfStops(i int) *RouteUpdateOne
- func (ruo *RouteUpdateOne) SetPlaneId(i int) *RouteUpdateOne
- func (ruo *RouteUpdateOne) SetSourceAirportId(i int) *RouteUpdateOne
- func (ruo *RouteUpdateOne) Where(ps ...predicate.Route) *RouteUpdateOne
- type Routes
- 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. TypeAirline = "Airline" TypeAirport = "Airport" TypePlane = "Plane" TypeRoute = "Route" )
Variables ¶
This section is empty.
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.
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 Airline ¶
type Airline struct { // ID of the ent. ID int `json:"id,omitempty"` // Name holds the value of the "name" field. Name string `json:"name,omitempty"` // Alias holds the value of the "alias" field. Alias string `json:"alias,omitempty"` // Country holds the value of the "country" field. Country string `json:"country,omitempty"` // Active holds the value of the "active" field. Active bool `json:"active,omitempty"` // contains filtered or unexported fields }
Airline is the model entity for the Airline schema.
func (*Airline) Unwrap ¶
Unwrap unwraps the Airline 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 (*Airline) Update ¶
func (a *Airline) Update() *AirlineUpdateOne
Update returns a builder for updating this Airline. Note that you need to call Airline.Unwrap() before calling this method if this Airline was returned from a transaction, and the transaction was committed or rolled back.
type AirlineClient ¶
type AirlineClient struct {
// contains filtered or unexported fields
}
AirlineClient is a client for the Airline schema.
func NewAirlineClient ¶
func NewAirlineClient(c config) *AirlineClient
NewAirlineClient returns a client for the Airline from the given config.
func (*AirlineClient) Create ¶
func (c *AirlineClient) Create() *AirlineCreate
Create returns a builder for creating a Airline entity.
func (*AirlineClient) CreateBulk ¶
func (c *AirlineClient) CreateBulk(builders ...*AirlineCreate) *AirlineCreateBulk
CreateBulk returns a builder for creating a bulk of Airline entities.
func (*AirlineClient) Delete ¶
func (c *AirlineClient) Delete() *AirlineDelete
Delete returns a delete builder for Airline.
func (*AirlineClient) DeleteOne ¶
func (c *AirlineClient) DeleteOne(a *Airline) *AirlineDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*AirlineClient) DeleteOneID ¶
func (c *AirlineClient) DeleteOneID(id int) *AirlineDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*AirlineClient) GetX ¶
func (c *AirlineClient) GetX(ctx context.Context, id int) *Airline
GetX is like Get, but panics if an error occurs.
func (*AirlineClient) Hooks ¶
func (c *AirlineClient) Hooks() []Hook
Hooks returns the client hooks.
func (*AirlineClient) Intercept ¶
func (c *AirlineClient) Intercept(interceptors ...Interceptor)
Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `airline.Intercept(f(g(h())))`.
func (*AirlineClient) Interceptors ¶
func (c *AirlineClient) Interceptors() []Interceptor
Interceptors returns the client interceptors.
func (*AirlineClient) Query ¶
func (c *AirlineClient) Query() *AirlineQuery
Query returns a query builder for Airline.
func (*AirlineClient) Update ¶
func (c *AirlineClient) Update() *AirlineUpdate
Update returns an update builder for Airline.
func (*AirlineClient) UpdateOne ¶
func (c *AirlineClient) UpdateOne(a *Airline) *AirlineUpdateOne
UpdateOne returns an update builder for the given entity.
func (*AirlineClient) UpdateOneID ¶
func (c *AirlineClient) UpdateOneID(id int) *AirlineUpdateOne
UpdateOneID returns an update builder for the given id.
func (*AirlineClient) Use ¶
func (c *AirlineClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `airline.Hooks(f(g(h())))`.
type AirlineCreate ¶
type AirlineCreate struct {
// contains filtered or unexported fields
}
AirlineCreate is the builder for creating a Airline entity.
func (*AirlineCreate) Exec ¶
func (ac *AirlineCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*AirlineCreate) ExecX ¶
func (ac *AirlineCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*AirlineCreate) Mutation ¶
func (ac *AirlineCreate) Mutation() *AirlineMutation
Mutation returns the AirlineMutation object of the builder.
func (*AirlineCreate) Save ¶
func (ac *AirlineCreate) Save(ctx context.Context) (*Airline, error)
Save creates the Airline in the database.
func (*AirlineCreate) SaveX ¶
func (ac *AirlineCreate) SaveX(ctx context.Context) *Airline
SaveX calls Save and panics if Save returns an error.
func (*AirlineCreate) SetActive ¶
func (ac *AirlineCreate) SetActive(b bool) *AirlineCreate
SetActive sets the "active" field.
func (*AirlineCreate) SetAlias ¶
func (ac *AirlineCreate) SetAlias(s string) *AirlineCreate
SetAlias sets the "alias" field.
func (*AirlineCreate) SetCountry ¶
func (ac *AirlineCreate) SetCountry(s string) *AirlineCreate
SetCountry sets the "country" field.
func (*AirlineCreate) SetID ¶
func (ac *AirlineCreate) SetID(i int) *AirlineCreate
SetID sets the "id" field.
func (*AirlineCreate) SetName ¶
func (ac *AirlineCreate) SetName(s string) *AirlineCreate
SetName sets the "name" field.
type AirlineCreateBulk ¶
type AirlineCreateBulk struct {
// contains filtered or unexported fields
}
AirlineCreateBulk is the builder for creating many Airline entities in bulk.
func (*AirlineCreateBulk) Exec ¶
func (acb *AirlineCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*AirlineCreateBulk) ExecX ¶
func (acb *AirlineCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type AirlineDelete ¶
type AirlineDelete struct {
// contains filtered or unexported fields
}
AirlineDelete is the builder for deleting a Airline entity.
func (*AirlineDelete) Exec ¶
func (ad *AirlineDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*AirlineDelete) ExecX ¶
func (ad *AirlineDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*AirlineDelete) Where ¶
func (ad *AirlineDelete) Where(ps ...predicate.Airline) *AirlineDelete
Where appends a list predicates to the AirlineDelete builder.
type AirlineDeleteOne ¶
type AirlineDeleteOne struct {
// contains filtered or unexported fields
}
AirlineDeleteOne is the builder for deleting a single Airline entity.
func (*AirlineDeleteOne) Exec ¶
func (ado *AirlineDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*AirlineDeleteOne) ExecX ¶
func (ado *AirlineDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*AirlineDeleteOne) Where ¶
func (ado *AirlineDeleteOne) Where(ps ...predicate.Airline) *AirlineDeleteOne
Where appends a list predicates to the AirlineDelete builder.
type AirlineGroupBy ¶
type AirlineGroupBy struct {
// contains filtered or unexported fields
}
AirlineGroupBy is the group-by builder for Airline entities.
func (*AirlineGroupBy) Aggregate ¶
func (agb *AirlineGroupBy) Aggregate(fns ...AggregateFunc) *AirlineGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*AirlineGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*AirlineGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*AirlineGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*AirlineGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*AirlineGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*AirlineGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*AirlineGroupBy) Scan ¶
func (agb *AirlineGroupBy) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*AirlineGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type AirlineMutation ¶
type AirlineMutation struct {
// contains filtered or unexported fields
}
AirlineMutation represents an operation that mutates the Airline nodes in the graph.
func (*AirlineMutation) Active ¶
func (m *AirlineMutation) Active() (r bool, exists bool)
Active returns the value of the "active" field in the mutation.
func (*AirlineMutation) AddField ¶
func (m *AirlineMutation) 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 (*AirlineMutation) AddedEdges ¶
func (m *AirlineMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*AirlineMutation) AddedField ¶
func (m *AirlineMutation) 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 (*AirlineMutation) AddedFields ¶
func (m *AirlineMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*AirlineMutation) AddedIDs ¶
func (m *AirlineMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*AirlineMutation) Alias ¶
func (m *AirlineMutation) Alias() (r string, exists bool)
Alias returns the value of the "alias" field in the mutation.
func (*AirlineMutation) ClearEdge ¶
func (m *AirlineMutation) 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 (*AirlineMutation) ClearField ¶
func (m *AirlineMutation) 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 (*AirlineMutation) ClearedEdges ¶
func (m *AirlineMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*AirlineMutation) ClearedFields ¶
func (m *AirlineMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (AirlineMutation) Client ¶
func (m AirlineMutation) 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 (*AirlineMutation) Country ¶
func (m *AirlineMutation) Country() (r string, exists bool)
Country returns the value of the "country" field in the mutation.
func (*AirlineMutation) EdgeCleared ¶
func (m *AirlineMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*AirlineMutation) Field ¶
func (m *AirlineMutation) 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 (*AirlineMutation) FieldCleared ¶
func (m *AirlineMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*AirlineMutation) Fields ¶
func (m *AirlineMutation) 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 (*AirlineMutation) ID ¶
func (m *AirlineMutation) ID() (id int, 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 (*AirlineMutation) IDs ¶
func (m *AirlineMutation) IDs(ctx context.Context) ([]int, 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 (*AirlineMutation) Name ¶
func (m *AirlineMutation) Name() (r string, exists bool)
Name returns the value of the "name" field in the mutation.
func (*AirlineMutation) OldActive ¶
func (m *AirlineMutation) OldActive(ctx context.Context) (v bool, err error)
OldActive returns the old "active" field's value of the Airline entity. If the Airline 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 (*AirlineMutation) OldAlias ¶
func (m *AirlineMutation) OldAlias(ctx context.Context) (v string, err error)
OldAlias returns the old "alias" field's value of the Airline entity. If the Airline 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 (*AirlineMutation) OldCountry ¶
func (m *AirlineMutation) OldCountry(ctx context.Context) (v string, err error)
OldCountry returns the old "country" field's value of the Airline entity. If the Airline 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 (*AirlineMutation) 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 (*AirlineMutation) OldName ¶
func (m *AirlineMutation) OldName(ctx context.Context) (v string, err error)
OldName returns the old "name" field's value of the Airline entity. If the Airline 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 (*AirlineMutation) RemovedEdges ¶
func (m *AirlineMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*AirlineMutation) RemovedIDs ¶
func (m *AirlineMutation) 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 (*AirlineMutation) ResetActive ¶
func (m *AirlineMutation) ResetActive()
ResetActive resets all changes to the "active" field.
func (*AirlineMutation) ResetAlias ¶
func (m *AirlineMutation) ResetAlias()
ResetAlias resets all changes to the "alias" field.
func (*AirlineMutation) ResetCountry ¶
func (m *AirlineMutation) ResetCountry()
ResetCountry resets all changes to the "country" field.
func (*AirlineMutation) ResetEdge ¶
func (m *AirlineMutation) 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 (*AirlineMutation) ResetField ¶
func (m *AirlineMutation) 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 (*AirlineMutation) ResetName ¶
func (m *AirlineMutation) ResetName()
ResetName resets all changes to the "name" field.
func (*AirlineMutation) SetActive ¶
func (m *AirlineMutation) SetActive(b bool)
SetActive sets the "active" field.
func (*AirlineMutation) SetAlias ¶
func (m *AirlineMutation) SetAlias(s string)
SetAlias sets the "alias" field.
func (*AirlineMutation) SetCountry ¶
func (m *AirlineMutation) SetCountry(s string)
SetCountry sets the "country" field.
func (*AirlineMutation) SetField ¶
func (m *AirlineMutation) 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 (*AirlineMutation) SetID ¶
func (m *AirlineMutation) SetID(id int)
SetID sets the value of the id field. Note that this operation is only accepted on creation of Airline entities.
func (*AirlineMutation) SetName ¶
func (m *AirlineMutation) SetName(s string)
SetName sets the "name" field.
func (*AirlineMutation) SetOp ¶
func (m *AirlineMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (AirlineMutation) Tx ¶
func (m AirlineMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*AirlineMutation) Type ¶
func (m *AirlineMutation) Type() string
Type returns the node type of this mutation (Airline).
func (*AirlineMutation) Where ¶
func (m *AirlineMutation) Where(ps ...predicate.Airline)
Where appends a list predicates to the AirlineMutation builder.
func (*AirlineMutation) WhereP ¶
func (m *AirlineMutation) WhereP(ps ...func(*sql.Selector))
WhereP appends storage-level predicates to the AirlineMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.
type AirlineQuery ¶
type AirlineQuery struct {
// contains filtered or unexported fields
}
AirlineQuery is the builder for querying Airline entities.
func (*AirlineQuery) Aggregate ¶
func (aq *AirlineQuery) Aggregate(fns ...AggregateFunc) *AirlineSelect
Aggregate returns a AirlineSelect configured with the given aggregations.
func (*AirlineQuery) All ¶
func (aq *AirlineQuery) All(ctx context.Context) ([]*Airline, error)
All executes the query and returns a list of Airlines.
func (*AirlineQuery) AllX ¶
func (aq *AirlineQuery) AllX(ctx context.Context) []*Airline
AllX is like All, but panics if an error occurs.
func (*AirlineQuery) Clone ¶
func (aq *AirlineQuery) Clone() *AirlineQuery
Clone returns a duplicate of the AirlineQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*AirlineQuery) Count ¶
func (aq *AirlineQuery) Count(ctx context.Context) (int, error)
Count returns the count of the given query.
func (*AirlineQuery) CountX ¶
func (aq *AirlineQuery) CountX(ctx context.Context) int
CountX is like Count, but panics if an error occurs.
func (*AirlineQuery) Exist ¶
func (aq *AirlineQuery) Exist(ctx context.Context) (bool, error)
Exist returns true if the query has elements in the graph.
func (*AirlineQuery) ExistX ¶
func (aq *AirlineQuery) ExistX(ctx context.Context) bool
ExistX is like Exist, but panics if an error occurs.
func (*AirlineQuery) First ¶
func (aq *AirlineQuery) First(ctx context.Context) (*Airline, error)
First returns the first Airline entity from the query. Returns a *NotFoundError when no Airline was found.
func (*AirlineQuery) FirstID ¶
func (aq *AirlineQuery) FirstID(ctx context.Context) (id int, err error)
FirstID returns the first Airline ID from the query. Returns a *NotFoundError when no Airline ID was found.
func (*AirlineQuery) FirstIDX ¶
func (aq *AirlineQuery) FirstIDX(ctx context.Context) int
FirstIDX is like FirstID, but panics if an error occurs.
func (*AirlineQuery) FirstX ¶
func (aq *AirlineQuery) FirstX(ctx context.Context) *Airline
FirstX is like First, but panics if an error occurs.
func (*AirlineQuery) GroupBy ¶
func (aq *AirlineQuery) GroupBy(field string, fields ...string) *AirlineGroupBy
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.Airline.Query(). GroupBy(airline.FieldName). Aggregate(ent.Count()). Scan(ctx, &v)
func (*AirlineQuery) IDs ¶
func (aq *AirlineQuery) IDs(ctx context.Context) (ids []int, err error)
IDs executes the query and returns a list of Airline IDs.
func (*AirlineQuery) IDsX ¶
func (aq *AirlineQuery) IDsX(ctx context.Context) []int
IDsX is like IDs, but panics if an error occurs.
func (*AirlineQuery) Limit ¶
func (aq *AirlineQuery) Limit(limit int) *AirlineQuery
Limit the number of records to be returned by this query.
func (*AirlineQuery) Offset ¶
func (aq *AirlineQuery) Offset(offset int) *AirlineQuery
Offset to start from.
func (*AirlineQuery) Only ¶
func (aq *AirlineQuery) Only(ctx context.Context) (*Airline, error)
Only returns a single Airline entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Airline entity is found. Returns a *NotFoundError when no Airline entities are found.
func (*AirlineQuery) OnlyID ¶
func (aq *AirlineQuery) OnlyID(ctx context.Context) (id int, err error)
OnlyID is like Only, but returns the only Airline ID in the query. Returns a *NotSingularError when more than one Airline ID is found. Returns a *NotFoundError when no entities are found.
func (*AirlineQuery) OnlyIDX ¶
func (aq *AirlineQuery) OnlyIDX(ctx context.Context) int
OnlyIDX is like OnlyID, but panics if an error occurs.
func (*AirlineQuery) OnlyX ¶
func (aq *AirlineQuery) OnlyX(ctx context.Context) *Airline
OnlyX is like Only, but panics if an error occurs.
func (*AirlineQuery) Order ¶
func (aq *AirlineQuery) Order(o ...OrderFunc) *AirlineQuery
Order specifies how the records should be ordered.
func (*AirlineQuery) Select ¶
func (aq *AirlineQuery) Select(fields ...string) *AirlineSelect
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.Airline.Query(). Select(airline.FieldName). Scan(ctx, &v)
func (*AirlineQuery) Unique ¶
func (aq *AirlineQuery) Unique(unique bool) *AirlineQuery
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 (*AirlineQuery) Where ¶
func (aq *AirlineQuery) Where(ps ...predicate.Airline) *AirlineQuery
Where adds a new predicate for the AirlineQuery builder.
type AirlineSelect ¶
type AirlineSelect struct { *AirlineQuery // contains filtered or unexported fields }
AirlineSelect is the builder for selecting fields of Airline entities.
func (*AirlineSelect) Aggregate ¶
func (as *AirlineSelect) Aggregate(fns ...AggregateFunc) *AirlineSelect
Aggregate adds the given aggregation functions to the selector query.
func (*AirlineSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*AirlineSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*AirlineSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*AirlineSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*AirlineSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*AirlineSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*AirlineSelect) Scan ¶
func (as *AirlineSelect) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*AirlineSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type AirlineUpdate ¶
type AirlineUpdate struct {
// contains filtered or unexported fields
}
AirlineUpdate is the builder for updating Airline entities.
func (*AirlineUpdate) Exec ¶
func (au *AirlineUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*AirlineUpdate) ExecX ¶
func (au *AirlineUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*AirlineUpdate) Mutation ¶
func (au *AirlineUpdate) Mutation() *AirlineMutation
Mutation returns the AirlineMutation object of the builder.
func (*AirlineUpdate) Save ¶
func (au *AirlineUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*AirlineUpdate) SaveX ¶
func (au *AirlineUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*AirlineUpdate) SetActive ¶
func (au *AirlineUpdate) SetActive(b bool) *AirlineUpdate
SetActive sets the "active" field.
func (*AirlineUpdate) SetAlias ¶
func (au *AirlineUpdate) SetAlias(s string) *AirlineUpdate
SetAlias sets the "alias" field.
func (*AirlineUpdate) SetCountry ¶
func (au *AirlineUpdate) SetCountry(s string) *AirlineUpdate
SetCountry sets the "country" field.
func (*AirlineUpdate) SetName ¶
func (au *AirlineUpdate) SetName(s string) *AirlineUpdate
SetName sets the "name" field.
func (*AirlineUpdate) Where ¶
func (au *AirlineUpdate) Where(ps ...predicate.Airline) *AirlineUpdate
Where appends a list predicates to the AirlineUpdate builder.
type AirlineUpdateOne ¶
type AirlineUpdateOne struct {
// contains filtered or unexported fields
}
AirlineUpdateOne is the builder for updating a single Airline entity.
func (*AirlineUpdateOne) Exec ¶
func (auo *AirlineUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*AirlineUpdateOne) ExecX ¶
func (auo *AirlineUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*AirlineUpdateOne) Mutation ¶
func (auo *AirlineUpdateOne) Mutation() *AirlineMutation
Mutation returns the AirlineMutation object of the builder.
func (*AirlineUpdateOne) Save ¶
func (auo *AirlineUpdateOne) Save(ctx context.Context) (*Airline, error)
Save executes the query and returns the updated Airline entity.
func (*AirlineUpdateOne) SaveX ¶
func (auo *AirlineUpdateOne) SaveX(ctx context.Context) *Airline
SaveX is like Save, but panics if an error occurs.
func (*AirlineUpdateOne) Select ¶
func (auo *AirlineUpdateOne) Select(field string, fields ...string) *AirlineUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*AirlineUpdateOne) SetActive ¶
func (auo *AirlineUpdateOne) SetActive(b bool) *AirlineUpdateOne
SetActive sets the "active" field.
func (*AirlineUpdateOne) SetAlias ¶
func (auo *AirlineUpdateOne) SetAlias(s string) *AirlineUpdateOne
SetAlias sets the "alias" field.
func (*AirlineUpdateOne) SetCountry ¶
func (auo *AirlineUpdateOne) SetCountry(s string) *AirlineUpdateOne
SetCountry sets the "country" field.
func (*AirlineUpdateOne) SetName ¶
func (auo *AirlineUpdateOne) SetName(s string) *AirlineUpdateOne
SetName sets the "name" field.
func (*AirlineUpdateOne) Where ¶
func (auo *AirlineUpdateOne) Where(ps ...predicate.Airline) *AirlineUpdateOne
Where appends a list predicates to the AirlineUpdate builder.
type Airport ¶
type Airport struct { // ID of the ent. ID int `json:"id,omitempty"` // Name holds the value of the "name" field. Name string `json:"name,omitempty"` // City holds the value of the "city" field. City string `json:"city,omitempty"` // Country holds the value of the "country" field. Country string `json:"country,omitempty"` // Iata holds the value of the "iata" field. Iata string `json:"iata,omitempty"` // Icao holds the value of the "icao" field. Icao string `json:"icao,omitempty"` // Latitude holds the value of the "latitude" field. Latitude float64 `json:"latitude,omitempty"` // Longitude holds the value of the "longitude" field. Longitude float64 `json:"longitude,omitempty"` // Altitude holds the value of the "altitude" field. Altitude int `json:"altitude,omitempty"` // Timezone holds the value of the "timezone" field. Timezone string `json:"timezone,omitempty"` // Dst holds the value of the "dst" field. Dst string `json:"dst,omitempty"` // TimezoneName holds the value of the "timezoneName" field. TimezoneName string `json:"timezoneName,omitempty"` // Type holds the value of the "type" field. Type string `json:"type,omitempty"` // Source holds the value of the "source" field. Source string `json:"source,omitempty"` // contains filtered or unexported fields }
Airport is the model entity for the Airport schema.
func (*Airport) Unwrap ¶
Unwrap unwraps the Airport 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 (*Airport) Update ¶
func (a *Airport) Update() *AirportUpdateOne
Update returns a builder for updating this Airport. Note that you need to call Airport.Unwrap() before calling this method if this Airport was returned from a transaction, and the transaction was committed or rolled back.
type AirportClient ¶
type AirportClient struct {
// contains filtered or unexported fields
}
AirportClient is a client for the Airport schema.
func NewAirportClient ¶
func NewAirportClient(c config) *AirportClient
NewAirportClient returns a client for the Airport from the given config.
func (*AirportClient) Create ¶
func (c *AirportClient) Create() *AirportCreate
Create returns a builder for creating a Airport entity.
func (*AirportClient) CreateBulk ¶
func (c *AirportClient) CreateBulk(builders ...*AirportCreate) *AirportCreateBulk
CreateBulk returns a builder for creating a bulk of Airport entities.
func (*AirportClient) Delete ¶
func (c *AirportClient) Delete() *AirportDelete
Delete returns a delete builder for Airport.
func (*AirportClient) DeleteOne ¶
func (c *AirportClient) DeleteOne(a *Airport) *AirportDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*AirportClient) DeleteOneID ¶
func (c *AirportClient) DeleteOneID(id int) *AirportDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*AirportClient) GetX ¶
func (c *AirportClient) GetX(ctx context.Context, id int) *Airport
GetX is like Get, but panics if an error occurs.
func (*AirportClient) Hooks ¶
func (c *AirportClient) Hooks() []Hook
Hooks returns the client hooks.
func (*AirportClient) Intercept ¶
func (c *AirportClient) Intercept(interceptors ...Interceptor)
Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `airport.Intercept(f(g(h())))`.
func (*AirportClient) Interceptors ¶
func (c *AirportClient) Interceptors() []Interceptor
Interceptors returns the client interceptors.
func (*AirportClient) Query ¶
func (c *AirportClient) Query() *AirportQuery
Query returns a query builder for Airport.
func (*AirportClient) Update ¶
func (c *AirportClient) Update() *AirportUpdate
Update returns an update builder for Airport.
func (*AirportClient) UpdateOne ¶
func (c *AirportClient) UpdateOne(a *Airport) *AirportUpdateOne
UpdateOne returns an update builder for the given entity.
func (*AirportClient) UpdateOneID ¶
func (c *AirportClient) UpdateOneID(id int) *AirportUpdateOne
UpdateOneID returns an update builder for the given id.
func (*AirportClient) Use ¶
func (c *AirportClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `airport.Hooks(f(g(h())))`.
type AirportCreate ¶
type AirportCreate struct {
// contains filtered or unexported fields
}
AirportCreate is the builder for creating a Airport entity.
func (*AirportCreate) Exec ¶
func (ac *AirportCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*AirportCreate) ExecX ¶
func (ac *AirportCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*AirportCreate) Mutation ¶
func (ac *AirportCreate) Mutation() *AirportMutation
Mutation returns the AirportMutation object of the builder.
func (*AirportCreate) Save ¶
func (ac *AirportCreate) Save(ctx context.Context) (*Airport, error)
Save creates the Airport in the database.
func (*AirportCreate) SaveX ¶
func (ac *AirportCreate) SaveX(ctx context.Context) *Airport
SaveX calls Save and panics if Save returns an error.
func (*AirportCreate) SetAltitude ¶
func (ac *AirportCreate) SetAltitude(i int) *AirportCreate
SetAltitude sets the "altitude" field.
func (*AirportCreate) SetCity ¶
func (ac *AirportCreate) SetCity(s string) *AirportCreate
SetCity sets the "city" field.
func (*AirportCreate) SetCountry ¶
func (ac *AirportCreate) SetCountry(s string) *AirportCreate
SetCountry sets the "country" field.
func (*AirportCreate) SetDst ¶
func (ac *AirportCreate) SetDst(s string) *AirportCreate
SetDst sets the "dst" field.
func (*AirportCreate) SetID ¶
func (ac *AirportCreate) SetID(i int) *AirportCreate
SetID sets the "id" field.
func (*AirportCreate) SetIata ¶
func (ac *AirportCreate) SetIata(s string) *AirportCreate
SetIata sets the "iata" field.
func (*AirportCreate) SetIcao ¶
func (ac *AirportCreate) SetIcao(s string) *AirportCreate
SetIcao sets the "icao" field.
func (*AirportCreate) SetLatitude ¶
func (ac *AirportCreate) SetLatitude(f float64) *AirportCreate
SetLatitude sets the "latitude" field.
func (*AirportCreate) SetLongitude ¶
func (ac *AirportCreate) SetLongitude(f float64) *AirportCreate
SetLongitude sets the "longitude" field.
func (*AirportCreate) SetName ¶
func (ac *AirportCreate) SetName(s string) *AirportCreate
SetName sets the "name" field.
func (*AirportCreate) SetNillableAltitude ¶
func (ac *AirportCreate) SetNillableAltitude(i *int) *AirportCreate
SetNillableAltitude sets the "altitude" field if the given value is not nil.
func (*AirportCreate) SetNillableCity ¶
func (ac *AirportCreate) SetNillableCity(s *string) *AirportCreate
SetNillableCity sets the "city" field if the given value is not nil.
func (*AirportCreate) SetNillableCountry ¶
func (ac *AirportCreate) SetNillableCountry(s *string) *AirportCreate
SetNillableCountry sets the "country" field if the given value is not nil.
func (*AirportCreate) SetNillableDst ¶
func (ac *AirportCreate) SetNillableDst(s *string) *AirportCreate
SetNillableDst sets the "dst" field if the given value is not nil.
func (*AirportCreate) SetNillableIata ¶
func (ac *AirportCreate) SetNillableIata(s *string) *AirportCreate
SetNillableIata sets the "iata" field if the given value is not nil.
func (*AirportCreate) SetNillableIcao ¶
func (ac *AirportCreate) SetNillableIcao(s *string) *AirportCreate
SetNillableIcao sets the "icao" field if the given value is not nil.
func (*AirportCreate) SetNillableLatitude ¶
func (ac *AirportCreate) SetNillableLatitude(f *float64) *AirportCreate
SetNillableLatitude sets the "latitude" field if the given value is not nil.
func (*AirportCreate) SetNillableLongitude ¶
func (ac *AirportCreate) SetNillableLongitude(f *float64) *AirportCreate
SetNillableLongitude sets the "longitude" field if the given value is not nil.
func (*AirportCreate) SetNillableName ¶
func (ac *AirportCreate) SetNillableName(s *string) *AirportCreate
SetNillableName sets the "name" field if the given value is not nil.
func (*AirportCreate) SetNillableSource ¶
func (ac *AirportCreate) SetNillableSource(s *string) *AirportCreate
SetNillableSource sets the "source" field if the given value is not nil.
func (*AirportCreate) SetNillableTimezone ¶
func (ac *AirportCreate) SetNillableTimezone(s *string) *AirportCreate
SetNillableTimezone sets the "timezone" field if the given value is not nil.
func (*AirportCreate) SetNillableTimezoneName ¶
func (ac *AirportCreate) SetNillableTimezoneName(s *string) *AirportCreate
SetNillableTimezoneName sets the "timezoneName" field if the given value is not nil.
func (*AirportCreate) SetNillableType ¶
func (ac *AirportCreate) SetNillableType(s *string) *AirportCreate
SetNillableType sets the "type" field if the given value is not nil.
func (*AirportCreate) SetSource ¶
func (ac *AirportCreate) SetSource(s string) *AirportCreate
SetSource sets the "source" field.
func (*AirportCreate) SetTimezone ¶
func (ac *AirportCreate) SetTimezone(s string) *AirportCreate
SetTimezone sets the "timezone" field.
func (*AirportCreate) SetTimezoneName ¶
func (ac *AirportCreate) SetTimezoneName(s string) *AirportCreate
SetTimezoneName sets the "timezoneName" field.
func (*AirportCreate) SetType ¶
func (ac *AirportCreate) SetType(s string) *AirportCreate
SetType sets the "type" field.
type AirportCreateBulk ¶
type AirportCreateBulk struct {
// contains filtered or unexported fields
}
AirportCreateBulk is the builder for creating many Airport entities in bulk.
func (*AirportCreateBulk) Exec ¶
func (acb *AirportCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*AirportCreateBulk) ExecX ¶
func (acb *AirportCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type AirportDelete ¶
type AirportDelete struct {
// contains filtered or unexported fields
}
AirportDelete is the builder for deleting a Airport entity.
func (*AirportDelete) Exec ¶
func (ad *AirportDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*AirportDelete) ExecX ¶
func (ad *AirportDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*AirportDelete) Where ¶
func (ad *AirportDelete) Where(ps ...predicate.Airport) *AirportDelete
Where appends a list predicates to the AirportDelete builder.
type AirportDeleteOne ¶
type AirportDeleteOne struct {
// contains filtered or unexported fields
}
AirportDeleteOne is the builder for deleting a single Airport entity.
func (*AirportDeleteOne) Exec ¶
func (ado *AirportDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*AirportDeleteOne) ExecX ¶
func (ado *AirportDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*AirportDeleteOne) Where ¶
func (ado *AirportDeleteOne) Where(ps ...predicate.Airport) *AirportDeleteOne
Where appends a list predicates to the AirportDelete builder.
type AirportGroupBy ¶
type AirportGroupBy struct {
// contains filtered or unexported fields
}
AirportGroupBy is the group-by builder for Airport entities.
func (*AirportGroupBy) Aggregate ¶
func (agb *AirportGroupBy) Aggregate(fns ...AggregateFunc) *AirportGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*AirportGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*AirportGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*AirportGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*AirportGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*AirportGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*AirportGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*AirportGroupBy) Scan ¶
func (agb *AirportGroupBy) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*AirportGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type AirportMutation ¶
type AirportMutation struct {
// contains filtered or unexported fields
}
AirportMutation represents an operation that mutates the Airport nodes in the graph.
func (*AirportMutation) AddAltitude ¶
func (m *AirportMutation) AddAltitude(i int)
AddAltitude adds i to the "altitude" field.
func (*AirportMutation) AddField ¶
func (m *AirportMutation) 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 (*AirportMutation) AddLatitude ¶
func (m *AirportMutation) AddLatitude(f float64)
AddLatitude adds f to the "latitude" field.
func (*AirportMutation) AddLongitude ¶
func (m *AirportMutation) AddLongitude(f float64)
AddLongitude adds f to the "longitude" field.
func (*AirportMutation) AddedAltitude ¶
func (m *AirportMutation) AddedAltitude() (r int, exists bool)
AddedAltitude returns the value that was added to the "altitude" field in this mutation.
func (*AirportMutation) AddedEdges ¶
func (m *AirportMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*AirportMutation) AddedField ¶
func (m *AirportMutation) 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 (*AirportMutation) AddedFields ¶
func (m *AirportMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*AirportMutation) AddedIDs ¶
func (m *AirportMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*AirportMutation) AddedLatitude ¶
func (m *AirportMutation) AddedLatitude() (r float64, exists bool)
AddedLatitude returns the value that was added to the "latitude" field in this mutation.
func (*AirportMutation) AddedLongitude ¶
func (m *AirportMutation) AddedLongitude() (r float64, exists bool)
AddedLongitude returns the value that was added to the "longitude" field in this mutation.
func (*AirportMutation) Altitude ¶
func (m *AirportMutation) Altitude() (r int, exists bool)
Altitude returns the value of the "altitude" field in the mutation.
func (*AirportMutation) AltitudeCleared ¶
func (m *AirportMutation) AltitudeCleared() bool
AltitudeCleared returns if the "altitude" field was cleared in this mutation.
func (*AirportMutation) City ¶
func (m *AirportMutation) City() (r string, exists bool)
City returns the value of the "city" field in the mutation.
func (*AirportMutation) CityCleared ¶
func (m *AirportMutation) CityCleared() bool
CityCleared returns if the "city" field was cleared in this mutation.
func (*AirportMutation) ClearAltitude ¶
func (m *AirportMutation) ClearAltitude()
ClearAltitude clears the value of the "altitude" field.
func (*AirportMutation) ClearCity ¶
func (m *AirportMutation) ClearCity()
ClearCity clears the value of the "city" field.
func (*AirportMutation) ClearCountry ¶
func (m *AirportMutation) ClearCountry()
ClearCountry clears the value of the "country" field.
func (*AirportMutation) ClearDst ¶
func (m *AirportMutation) ClearDst()
ClearDst clears the value of the "dst" field.
func (*AirportMutation) ClearEdge ¶
func (m *AirportMutation) 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 (*AirportMutation) ClearField ¶
func (m *AirportMutation) 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 (*AirportMutation) ClearIata ¶
func (m *AirportMutation) ClearIata()
ClearIata clears the value of the "iata" field.
func (*AirportMutation) ClearIcao ¶
func (m *AirportMutation) ClearIcao()
ClearIcao clears the value of the "icao" field.
func (*AirportMutation) ClearLatitude ¶
func (m *AirportMutation) ClearLatitude()
ClearLatitude clears the value of the "latitude" field.
func (*AirportMutation) ClearLongitude ¶
func (m *AirportMutation) ClearLongitude()
ClearLongitude clears the value of the "longitude" field.
func (*AirportMutation) ClearName ¶
func (m *AirportMutation) ClearName()
ClearName clears the value of the "name" field.
func (*AirportMutation) ClearSource ¶
func (m *AirportMutation) ClearSource()
ClearSource clears the value of the "source" field.
func (*AirportMutation) ClearTimezone ¶
func (m *AirportMutation) ClearTimezone()
ClearTimezone clears the value of the "timezone" field.
func (*AirportMutation) ClearTimezoneName ¶
func (m *AirportMutation) ClearTimezoneName()
ClearTimezoneName clears the value of the "timezoneName" field.
func (*AirportMutation) ClearType ¶
func (m *AirportMutation) ClearType()
ClearType clears the value of the "type" field.
func (*AirportMutation) ClearedEdges ¶
func (m *AirportMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*AirportMutation) ClearedFields ¶
func (m *AirportMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (AirportMutation) Client ¶
func (m AirportMutation) 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 (*AirportMutation) Country ¶
func (m *AirportMutation) Country() (r string, exists bool)
Country returns the value of the "country" field in the mutation.
func (*AirportMutation) CountryCleared ¶
func (m *AirportMutation) CountryCleared() bool
CountryCleared returns if the "country" field was cleared in this mutation.
func (*AirportMutation) Dst ¶
func (m *AirportMutation) Dst() (r string, exists bool)
Dst returns the value of the "dst" field in the mutation.
func (*AirportMutation) DstCleared ¶
func (m *AirportMutation) DstCleared() bool
DstCleared returns if the "dst" field was cleared in this mutation.
func (*AirportMutation) EdgeCleared ¶
func (m *AirportMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*AirportMutation) Field ¶
func (m *AirportMutation) 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 (*AirportMutation) FieldCleared ¶
func (m *AirportMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*AirportMutation) Fields ¶
func (m *AirportMutation) 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 (*AirportMutation) GetType ¶
func (m *AirportMutation) GetType() (r string, exists bool)
GetType returns the value of the "type" field in the mutation.
func (*AirportMutation) ID ¶
func (m *AirportMutation) ID() (id int, 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 (*AirportMutation) IDs ¶
func (m *AirportMutation) IDs(ctx context.Context) ([]int, 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 (*AirportMutation) Iata ¶
func (m *AirportMutation) Iata() (r string, exists bool)
Iata returns the value of the "iata" field in the mutation.
func (*AirportMutation) IataCleared ¶
func (m *AirportMutation) IataCleared() bool
IataCleared returns if the "iata" field was cleared in this mutation.
func (*AirportMutation) Icao ¶
func (m *AirportMutation) Icao() (r string, exists bool)
Icao returns the value of the "icao" field in the mutation.
func (*AirportMutation) IcaoCleared ¶
func (m *AirportMutation) IcaoCleared() bool
IcaoCleared returns if the "icao" field was cleared in this mutation.
func (*AirportMutation) Latitude ¶
func (m *AirportMutation) Latitude() (r float64, exists bool)
Latitude returns the value of the "latitude" field in the mutation.
func (*AirportMutation) LatitudeCleared ¶
func (m *AirportMutation) LatitudeCleared() bool
LatitudeCleared returns if the "latitude" field was cleared in this mutation.
func (*AirportMutation) Longitude ¶
func (m *AirportMutation) Longitude() (r float64, exists bool)
Longitude returns the value of the "longitude" field in the mutation.
func (*AirportMutation) LongitudeCleared ¶
func (m *AirportMutation) LongitudeCleared() bool
LongitudeCleared returns if the "longitude" field was cleared in this mutation.
func (*AirportMutation) Name ¶
func (m *AirportMutation) Name() (r string, exists bool)
Name returns the value of the "name" field in the mutation.
func (*AirportMutation) NameCleared ¶
func (m *AirportMutation) NameCleared() bool
NameCleared returns if the "name" field was cleared in this mutation.
func (*AirportMutation) OldAltitude ¶
func (m *AirportMutation) OldAltitude(ctx context.Context) (v int, err error)
OldAltitude returns the old "altitude" field's value of the Airport entity. If the Airport 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 (*AirportMutation) OldCity ¶
func (m *AirportMutation) OldCity(ctx context.Context) (v string, err error)
OldCity returns the old "city" field's value of the Airport entity. If the Airport 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 (*AirportMutation) OldCountry ¶
func (m *AirportMutation) OldCountry(ctx context.Context) (v string, err error)
OldCountry returns the old "country" field's value of the Airport entity. If the Airport 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 (*AirportMutation) OldDst ¶
func (m *AirportMutation) OldDst(ctx context.Context) (v string, err error)
OldDst returns the old "dst" field's value of the Airport entity. If the Airport 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 (*AirportMutation) 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 (*AirportMutation) OldIata ¶
func (m *AirportMutation) OldIata(ctx context.Context) (v string, err error)
OldIata returns the old "iata" field's value of the Airport entity. If the Airport 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 (*AirportMutation) OldIcao ¶
func (m *AirportMutation) OldIcao(ctx context.Context) (v string, err error)
OldIcao returns the old "icao" field's value of the Airport entity. If the Airport 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 (*AirportMutation) OldLatitude ¶
func (m *AirportMutation) OldLatitude(ctx context.Context) (v float64, err error)
OldLatitude returns the old "latitude" field's value of the Airport entity. If the Airport 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 (*AirportMutation) OldLongitude ¶
func (m *AirportMutation) OldLongitude(ctx context.Context) (v float64, err error)
OldLongitude returns the old "longitude" field's value of the Airport entity. If the Airport 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 (*AirportMutation) OldName ¶
func (m *AirportMutation) OldName(ctx context.Context) (v string, err error)
OldName returns the old "name" field's value of the Airport entity. If the Airport 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 (*AirportMutation) OldSource ¶
func (m *AirportMutation) OldSource(ctx context.Context) (v string, err error)
OldSource returns the old "source" field's value of the Airport entity. If the Airport 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 (*AirportMutation) OldTimezone ¶
func (m *AirportMutation) OldTimezone(ctx context.Context) (v string, err error)
OldTimezone returns the old "timezone" field's value of the Airport entity. If the Airport 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 (*AirportMutation) OldTimezoneName ¶
func (m *AirportMutation) OldTimezoneName(ctx context.Context) (v string, err error)
OldTimezoneName returns the old "timezoneName" field's value of the Airport entity. If the Airport 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 (*AirportMutation) OldType ¶
func (m *AirportMutation) OldType(ctx context.Context) (v string, err error)
OldType returns the old "type" field's value of the Airport entity. If the Airport 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 (*AirportMutation) RemovedEdges ¶
func (m *AirportMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*AirportMutation) RemovedIDs ¶
func (m *AirportMutation) 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 (*AirportMutation) ResetAltitude ¶
func (m *AirportMutation) ResetAltitude()
ResetAltitude resets all changes to the "altitude" field.
func (*AirportMutation) ResetCity ¶
func (m *AirportMutation) ResetCity()
ResetCity resets all changes to the "city" field.
func (*AirportMutation) ResetCountry ¶
func (m *AirportMutation) ResetCountry()
ResetCountry resets all changes to the "country" field.
func (*AirportMutation) ResetDst ¶
func (m *AirportMutation) ResetDst()
ResetDst resets all changes to the "dst" field.
func (*AirportMutation) ResetEdge ¶
func (m *AirportMutation) 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 (*AirportMutation) ResetField ¶
func (m *AirportMutation) 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 (*AirportMutation) ResetIata ¶
func (m *AirportMutation) ResetIata()
ResetIata resets all changes to the "iata" field.
func (*AirportMutation) ResetIcao ¶
func (m *AirportMutation) ResetIcao()
ResetIcao resets all changes to the "icao" field.
func (*AirportMutation) ResetLatitude ¶
func (m *AirportMutation) ResetLatitude()
ResetLatitude resets all changes to the "latitude" field.
func (*AirportMutation) ResetLongitude ¶
func (m *AirportMutation) ResetLongitude()
ResetLongitude resets all changes to the "longitude" field.
func (*AirportMutation) ResetName ¶
func (m *AirportMutation) ResetName()
ResetName resets all changes to the "name" field.
func (*AirportMutation) ResetSource ¶
func (m *AirportMutation) ResetSource()
ResetSource resets all changes to the "source" field.
func (*AirportMutation) ResetTimezone ¶
func (m *AirportMutation) ResetTimezone()
ResetTimezone resets all changes to the "timezone" field.
func (*AirportMutation) ResetTimezoneName ¶
func (m *AirportMutation) ResetTimezoneName()
ResetTimezoneName resets all changes to the "timezoneName" field.
func (*AirportMutation) ResetType ¶
func (m *AirportMutation) ResetType()
ResetType resets all changes to the "type" field.
func (*AirportMutation) SetAltitude ¶
func (m *AirportMutation) SetAltitude(i int)
SetAltitude sets the "altitude" field.
func (*AirportMutation) SetCity ¶
func (m *AirportMutation) SetCity(s string)
SetCity sets the "city" field.
func (*AirportMutation) SetCountry ¶
func (m *AirportMutation) SetCountry(s string)
SetCountry sets the "country" field.
func (*AirportMutation) SetDst ¶
func (m *AirportMutation) SetDst(s string)
SetDst sets the "dst" field.
func (*AirportMutation) SetField ¶
func (m *AirportMutation) 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 (*AirportMutation) SetID ¶
func (m *AirportMutation) SetID(id int)
SetID sets the value of the id field. Note that this operation is only accepted on creation of Airport entities.
func (*AirportMutation) SetIata ¶
func (m *AirportMutation) SetIata(s string)
SetIata sets the "iata" field.
func (*AirportMutation) SetIcao ¶
func (m *AirportMutation) SetIcao(s string)
SetIcao sets the "icao" field.
func (*AirportMutation) SetLatitude ¶
func (m *AirportMutation) SetLatitude(f float64)
SetLatitude sets the "latitude" field.
func (*AirportMutation) SetLongitude ¶
func (m *AirportMutation) SetLongitude(f float64)
SetLongitude sets the "longitude" field.
func (*AirportMutation) SetName ¶
func (m *AirportMutation) SetName(s string)
SetName sets the "name" field.
func (*AirportMutation) SetOp ¶
func (m *AirportMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (*AirportMutation) SetSource ¶
func (m *AirportMutation) SetSource(s string)
SetSource sets the "source" field.
func (*AirportMutation) SetTimezone ¶
func (m *AirportMutation) SetTimezone(s string)
SetTimezone sets the "timezone" field.
func (*AirportMutation) SetTimezoneName ¶
func (m *AirportMutation) SetTimezoneName(s string)
SetTimezoneName sets the "timezoneName" field.
func (*AirportMutation) SetType ¶
func (m *AirportMutation) SetType(s string)
SetType sets the "type" field.
func (*AirportMutation) Source ¶
func (m *AirportMutation) Source() (r string, exists bool)
Source returns the value of the "source" field in the mutation.
func (*AirportMutation) SourceCleared ¶
func (m *AirportMutation) SourceCleared() bool
SourceCleared returns if the "source" field was cleared in this mutation.
func (*AirportMutation) Timezone ¶
func (m *AirportMutation) Timezone() (r string, exists bool)
Timezone returns the value of the "timezone" field in the mutation.
func (*AirportMutation) TimezoneCleared ¶
func (m *AirportMutation) TimezoneCleared() bool
TimezoneCleared returns if the "timezone" field was cleared in this mutation.
func (*AirportMutation) TimezoneName ¶
func (m *AirportMutation) TimezoneName() (r string, exists bool)
TimezoneName returns the value of the "timezoneName" field in the mutation.
func (*AirportMutation) TimezoneNameCleared ¶
func (m *AirportMutation) TimezoneNameCleared() bool
TimezoneNameCleared returns if the "timezoneName" field was cleared in this mutation.
func (AirportMutation) Tx ¶
func (m AirportMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*AirportMutation) Type ¶
func (m *AirportMutation) Type() string
Type returns the node type of this mutation (Airport).
func (*AirportMutation) TypeCleared ¶
func (m *AirportMutation) TypeCleared() bool
TypeCleared returns if the "type" field was cleared in this mutation.
func (*AirportMutation) Where ¶
func (m *AirportMutation) Where(ps ...predicate.Airport)
Where appends a list predicates to the AirportMutation builder.
func (*AirportMutation) WhereP ¶
func (m *AirportMutation) WhereP(ps ...func(*sql.Selector))
WhereP appends storage-level predicates to the AirportMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.
type AirportQuery ¶
type AirportQuery struct {
// contains filtered or unexported fields
}
AirportQuery is the builder for querying Airport entities.
func (*AirportQuery) Aggregate ¶
func (aq *AirportQuery) Aggregate(fns ...AggregateFunc) *AirportSelect
Aggregate returns a AirportSelect configured with the given aggregations.
func (*AirportQuery) All ¶
func (aq *AirportQuery) All(ctx context.Context) ([]*Airport, error)
All executes the query and returns a list of Airports.
func (*AirportQuery) AllX ¶
func (aq *AirportQuery) AllX(ctx context.Context) []*Airport
AllX is like All, but panics if an error occurs.
func (*AirportQuery) Clone ¶
func (aq *AirportQuery) Clone() *AirportQuery
Clone returns a duplicate of the AirportQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*AirportQuery) Count ¶
func (aq *AirportQuery) Count(ctx context.Context) (int, error)
Count returns the count of the given query.
func (*AirportQuery) CountX ¶
func (aq *AirportQuery) CountX(ctx context.Context) int
CountX is like Count, but panics if an error occurs.
func (*AirportQuery) Exist ¶
func (aq *AirportQuery) Exist(ctx context.Context) (bool, error)
Exist returns true if the query has elements in the graph.
func (*AirportQuery) ExistX ¶
func (aq *AirportQuery) ExistX(ctx context.Context) bool
ExistX is like Exist, but panics if an error occurs.
func (*AirportQuery) First ¶
func (aq *AirportQuery) First(ctx context.Context) (*Airport, error)
First returns the first Airport entity from the query. Returns a *NotFoundError when no Airport was found.
func (*AirportQuery) FirstID ¶
func (aq *AirportQuery) FirstID(ctx context.Context) (id int, err error)
FirstID returns the first Airport ID from the query. Returns a *NotFoundError when no Airport ID was found.
func (*AirportQuery) FirstIDX ¶
func (aq *AirportQuery) FirstIDX(ctx context.Context) int
FirstIDX is like FirstID, but panics if an error occurs.
func (*AirportQuery) FirstX ¶
func (aq *AirportQuery) FirstX(ctx context.Context) *Airport
FirstX is like First, but panics if an error occurs.
func (*AirportQuery) GroupBy ¶
func (aq *AirportQuery) GroupBy(field string, fields ...string) *AirportGroupBy
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.Airport.Query(). GroupBy(airport.FieldName). Aggregate(ent.Count()). Scan(ctx, &v)
func (*AirportQuery) IDs ¶
func (aq *AirportQuery) IDs(ctx context.Context) (ids []int, err error)
IDs executes the query and returns a list of Airport IDs.
func (*AirportQuery) IDsX ¶
func (aq *AirportQuery) IDsX(ctx context.Context) []int
IDsX is like IDs, but panics if an error occurs.
func (*AirportQuery) Limit ¶
func (aq *AirportQuery) Limit(limit int) *AirportQuery
Limit the number of records to be returned by this query.
func (*AirportQuery) Offset ¶
func (aq *AirportQuery) Offset(offset int) *AirportQuery
Offset to start from.
func (*AirportQuery) Only ¶
func (aq *AirportQuery) Only(ctx context.Context) (*Airport, error)
Only returns a single Airport entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Airport entity is found. Returns a *NotFoundError when no Airport entities are found.
func (*AirportQuery) OnlyID ¶
func (aq *AirportQuery) OnlyID(ctx context.Context) (id int, err error)
OnlyID is like Only, but returns the only Airport ID in the query. Returns a *NotSingularError when more than one Airport ID is found. Returns a *NotFoundError when no entities are found.
func (*AirportQuery) OnlyIDX ¶
func (aq *AirportQuery) OnlyIDX(ctx context.Context) int
OnlyIDX is like OnlyID, but panics if an error occurs.
func (*AirportQuery) OnlyX ¶
func (aq *AirportQuery) OnlyX(ctx context.Context) *Airport
OnlyX is like Only, but panics if an error occurs.
func (*AirportQuery) Order ¶
func (aq *AirportQuery) Order(o ...OrderFunc) *AirportQuery
Order specifies how the records should be ordered.
func (*AirportQuery) Select ¶
func (aq *AirportQuery) Select(fields ...string) *AirportSelect
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.Airport.Query(). Select(airport.FieldName). Scan(ctx, &v)
func (*AirportQuery) Unique ¶
func (aq *AirportQuery) Unique(unique bool) *AirportQuery
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 (*AirportQuery) Where ¶
func (aq *AirportQuery) Where(ps ...predicate.Airport) *AirportQuery
Where adds a new predicate for the AirportQuery builder.
type AirportSelect ¶
type AirportSelect struct { *AirportQuery // contains filtered or unexported fields }
AirportSelect is the builder for selecting fields of Airport entities.
func (*AirportSelect) Aggregate ¶
func (as *AirportSelect) Aggregate(fns ...AggregateFunc) *AirportSelect
Aggregate adds the given aggregation functions to the selector query.
func (*AirportSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*AirportSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*AirportSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*AirportSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*AirportSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*AirportSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*AirportSelect) Scan ¶
func (as *AirportSelect) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*AirportSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type AirportUpdate ¶
type AirportUpdate struct {
// contains filtered or unexported fields
}
AirportUpdate is the builder for updating Airport entities.
func (*AirportUpdate) AddAltitude ¶
func (au *AirportUpdate) AddAltitude(i int) *AirportUpdate
AddAltitude adds i to the "altitude" field.
func (*AirportUpdate) AddLatitude ¶
func (au *AirportUpdate) AddLatitude(f float64) *AirportUpdate
AddLatitude adds f to the "latitude" field.
func (*AirportUpdate) AddLongitude ¶
func (au *AirportUpdate) AddLongitude(f float64) *AirportUpdate
AddLongitude adds f to the "longitude" field.
func (*AirportUpdate) ClearAltitude ¶
func (au *AirportUpdate) ClearAltitude() *AirportUpdate
ClearAltitude clears the value of the "altitude" field.
func (*AirportUpdate) ClearCity ¶
func (au *AirportUpdate) ClearCity() *AirportUpdate
ClearCity clears the value of the "city" field.
func (*AirportUpdate) ClearCountry ¶
func (au *AirportUpdate) ClearCountry() *AirportUpdate
ClearCountry clears the value of the "country" field.
func (*AirportUpdate) ClearDst ¶
func (au *AirportUpdate) ClearDst() *AirportUpdate
ClearDst clears the value of the "dst" field.
func (*AirportUpdate) ClearIata ¶
func (au *AirportUpdate) ClearIata() *AirportUpdate
ClearIata clears the value of the "iata" field.
func (*AirportUpdate) ClearIcao ¶
func (au *AirportUpdate) ClearIcao() *AirportUpdate
ClearIcao clears the value of the "icao" field.
func (*AirportUpdate) ClearLatitude ¶
func (au *AirportUpdate) ClearLatitude() *AirportUpdate
ClearLatitude clears the value of the "latitude" field.
func (*AirportUpdate) ClearLongitude ¶
func (au *AirportUpdate) ClearLongitude() *AirportUpdate
ClearLongitude clears the value of the "longitude" field.
func (*AirportUpdate) ClearName ¶
func (au *AirportUpdate) ClearName() *AirportUpdate
ClearName clears the value of the "name" field.
func (*AirportUpdate) ClearSource ¶
func (au *AirportUpdate) ClearSource() *AirportUpdate
ClearSource clears the value of the "source" field.
func (*AirportUpdate) ClearTimezone ¶
func (au *AirportUpdate) ClearTimezone() *AirportUpdate
ClearTimezone clears the value of the "timezone" field.
func (*AirportUpdate) ClearTimezoneName ¶
func (au *AirportUpdate) ClearTimezoneName() *AirportUpdate
ClearTimezoneName clears the value of the "timezoneName" field.
func (*AirportUpdate) ClearType ¶
func (au *AirportUpdate) ClearType() *AirportUpdate
ClearType clears the value of the "type" field.
func (*AirportUpdate) Exec ¶
func (au *AirportUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*AirportUpdate) ExecX ¶
func (au *AirportUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*AirportUpdate) Mutation ¶
func (au *AirportUpdate) Mutation() *AirportMutation
Mutation returns the AirportMutation object of the builder.
func (*AirportUpdate) Save ¶
func (au *AirportUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*AirportUpdate) SaveX ¶
func (au *AirportUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*AirportUpdate) SetAltitude ¶
func (au *AirportUpdate) SetAltitude(i int) *AirportUpdate
SetAltitude sets the "altitude" field.
func (*AirportUpdate) SetCity ¶
func (au *AirportUpdate) SetCity(s string) *AirportUpdate
SetCity sets the "city" field.
func (*AirportUpdate) SetCountry ¶
func (au *AirportUpdate) SetCountry(s string) *AirportUpdate
SetCountry sets the "country" field.
func (*AirportUpdate) SetDst ¶
func (au *AirportUpdate) SetDst(s string) *AirportUpdate
SetDst sets the "dst" field.
func (*AirportUpdate) SetIata ¶
func (au *AirportUpdate) SetIata(s string) *AirportUpdate
SetIata sets the "iata" field.
func (*AirportUpdate) SetIcao ¶
func (au *AirportUpdate) SetIcao(s string) *AirportUpdate
SetIcao sets the "icao" field.
func (*AirportUpdate) SetLatitude ¶
func (au *AirportUpdate) SetLatitude(f float64) *AirportUpdate
SetLatitude sets the "latitude" field.
func (*AirportUpdate) SetLongitude ¶
func (au *AirportUpdate) SetLongitude(f float64) *AirportUpdate
SetLongitude sets the "longitude" field.
func (*AirportUpdate) SetName ¶
func (au *AirportUpdate) SetName(s string) *AirportUpdate
SetName sets the "name" field.
func (*AirportUpdate) SetNillableAltitude ¶
func (au *AirportUpdate) SetNillableAltitude(i *int) *AirportUpdate
SetNillableAltitude sets the "altitude" field if the given value is not nil.
func (*AirportUpdate) SetNillableCity ¶
func (au *AirportUpdate) SetNillableCity(s *string) *AirportUpdate
SetNillableCity sets the "city" field if the given value is not nil.
func (*AirportUpdate) SetNillableCountry ¶
func (au *AirportUpdate) SetNillableCountry(s *string) *AirportUpdate
SetNillableCountry sets the "country" field if the given value is not nil.
func (*AirportUpdate) SetNillableDst ¶
func (au *AirportUpdate) SetNillableDst(s *string) *AirportUpdate
SetNillableDst sets the "dst" field if the given value is not nil.
func (*AirportUpdate) SetNillableIata ¶
func (au *AirportUpdate) SetNillableIata(s *string) *AirportUpdate
SetNillableIata sets the "iata" field if the given value is not nil.
func (*AirportUpdate) SetNillableIcao ¶
func (au *AirportUpdate) SetNillableIcao(s *string) *AirportUpdate
SetNillableIcao sets the "icao" field if the given value is not nil.
func (*AirportUpdate) SetNillableLatitude ¶
func (au *AirportUpdate) SetNillableLatitude(f *float64) *AirportUpdate
SetNillableLatitude sets the "latitude" field if the given value is not nil.
func (*AirportUpdate) SetNillableLongitude ¶
func (au *AirportUpdate) SetNillableLongitude(f *float64) *AirportUpdate
SetNillableLongitude sets the "longitude" field if the given value is not nil.
func (*AirportUpdate) SetNillableName ¶
func (au *AirportUpdate) SetNillableName(s *string) *AirportUpdate
SetNillableName sets the "name" field if the given value is not nil.
func (*AirportUpdate) SetNillableSource ¶
func (au *AirportUpdate) SetNillableSource(s *string) *AirportUpdate
SetNillableSource sets the "source" field if the given value is not nil.
func (*AirportUpdate) SetNillableTimezone ¶
func (au *AirportUpdate) SetNillableTimezone(s *string) *AirportUpdate
SetNillableTimezone sets the "timezone" field if the given value is not nil.
func (*AirportUpdate) SetNillableTimezoneName ¶
func (au *AirportUpdate) SetNillableTimezoneName(s *string) *AirportUpdate
SetNillableTimezoneName sets the "timezoneName" field if the given value is not nil.
func (*AirportUpdate) SetNillableType ¶
func (au *AirportUpdate) SetNillableType(s *string) *AirportUpdate
SetNillableType sets the "type" field if the given value is not nil.
func (*AirportUpdate) SetSource ¶
func (au *AirportUpdate) SetSource(s string) *AirportUpdate
SetSource sets the "source" field.
func (*AirportUpdate) SetTimezone ¶
func (au *AirportUpdate) SetTimezone(s string) *AirportUpdate
SetTimezone sets the "timezone" field.
func (*AirportUpdate) SetTimezoneName ¶
func (au *AirportUpdate) SetTimezoneName(s string) *AirportUpdate
SetTimezoneName sets the "timezoneName" field.
func (*AirportUpdate) SetType ¶
func (au *AirportUpdate) SetType(s string) *AirportUpdate
SetType sets the "type" field.
func (*AirportUpdate) Where ¶
func (au *AirportUpdate) Where(ps ...predicate.Airport) *AirportUpdate
Where appends a list predicates to the AirportUpdate builder.
type AirportUpdateOne ¶
type AirportUpdateOne struct {
// contains filtered or unexported fields
}
AirportUpdateOne is the builder for updating a single Airport entity.
func (*AirportUpdateOne) AddAltitude ¶
func (auo *AirportUpdateOne) AddAltitude(i int) *AirportUpdateOne
AddAltitude adds i to the "altitude" field.
func (*AirportUpdateOne) AddLatitude ¶
func (auo *AirportUpdateOne) AddLatitude(f float64) *AirportUpdateOne
AddLatitude adds f to the "latitude" field.
func (*AirportUpdateOne) AddLongitude ¶
func (auo *AirportUpdateOne) AddLongitude(f float64) *AirportUpdateOne
AddLongitude adds f to the "longitude" field.
func (*AirportUpdateOne) ClearAltitude ¶
func (auo *AirportUpdateOne) ClearAltitude() *AirportUpdateOne
ClearAltitude clears the value of the "altitude" field.
func (*AirportUpdateOne) ClearCity ¶
func (auo *AirportUpdateOne) ClearCity() *AirportUpdateOne
ClearCity clears the value of the "city" field.
func (*AirportUpdateOne) ClearCountry ¶
func (auo *AirportUpdateOne) ClearCountry() *AirportUpdateOne
ClearCountry clears the value of the "country" field.
func (*AirportUpdateOne) ClearDst ¶
func (auo *AirportUpdateOne) ClearDst() *AirportUpdateOne
ClearDst clears the value of the "dst" field.
func (*AirportUpdateOne) ClearIata ¶
func (auo *AirportUpdateOne) ClearIata() *AirportUpdateOne
ClearIata clears the value of the "iata" field.
func (*AirportUpdateOne) ClearIcao ¶
func (auo *AirportUpdateOne) ClearIcao() *AirportUpdateOne
ClearIcao clears the value of the "icao" field.
func (*AirportUpdateOne) ClearLatitude ¶
func (auo *AirportUpdateOne) ClearLatitude() *AirportUpdateOne
ClearLatitude clears the value of the "latitude" field.
func (*AirportUpdateOne) ClearLongitude ¶
func (auo *AirportUpdateOne) ClearLongitude() *AirportUpdateOne
ClearLongitude clears the value of the "longitude" field.
func (*AirportUpdateOne) ClearName ¶
func (auo *AirportUpdateOne) ClearName() *AirportUpdateOne
ClearName clears the value of the "name" field.
func (*AirportUpdateOne) ClearSource ¶
func (auo *AirportUpdateOne) ClearSource() *AirportUpdateOne
ClearSource clears the value of the "source" field.
func (*AirportUpdateOne) ClearTimezone ¶
func (auo *AirportUpdateOne) ClearTimezone() *AirportUpdateOne
ClearTimezone clears the value of the "timezone" field.
func (*AirportUpdateOne) ClearTimezoneName ¶
func (auo *AirportUpdateOne) ClearTimezoneName() *AirportUpdateOne
ClearTimezoneName clears the value of the "timezoneName" field.
func (*AirportUpdateOne) ClearType ¶
func (auo *AirportUpdateOne) ClearType() *AirportUpdateOne
ClearType clears the value of the "type" field.
func (*AirportUpdateOne) Exec ¶
func (auo *AirportUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*AirportUpdateOne) ExecX ¶
func (auo *AirportUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*AirportUpdateOne) Mutation ¶
func (auo *AirportUpdateOne) Mutation() *AirportMutation
Mutation returns the AirportMutation object of the builder.
func (*AirportUpdateOne) Save ¶
func (auo *AirportUpdateOne) Save(ctx context.Context) (*Airport, error)
Save executes the query and returns the updated Airport entity.
func (*AirportUpdateOne) SaveX ¶
func (auo *AirportUpdateOne) SaveX(ctx context.Context) *Airport
SaveX is like Save, but panics if an error occurs.
func (*AirportUpdateOne) Select ¶
func (auo *AirportUpdateOne) Select(field string, fields ...string) *AirportUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*AirportUpdateOne) SetAltitude ¶
func (auo *AirportUpdateOne) SetAltitude(i int) *AirportUpdateOne
SetAltitude sets the "altitude" field.
func (*AirportUpdateOne) SetCity ¶
func (auo *AirportUpdateOne) SetCity(s string) *AirportUpdateOne
SetCity sets the "city" field.
func (*AirportUpdateOne) SetCountry ¶
func (auo *AirportUpdateOne) SetCountry(s string) *AirportUpdateOne
SetCountry sets the "country" field.
func (*AirportUpdateOne) SetDst ¶
func (auo *AirportUpdateOne) SetDst(s string) *AirportUpdateOne
SetDst sets the "dst" field.
func (*AirportUpdateOne) SetIata ¶
func (auo *AirportUpdateOne) SetIata(s string) *AirportUpdateOne
SetIata sets the "iata" field.
func (*AirportUpdateOne) SetIcao ¶
func (auo *AirportUpdateOne) SetIcao(s string) *AirportUpdateOne
SetIcao sets the "icao" field.
func (*AirportUpdateOne) SetLatitude ¶
func (auo *AirportUpdateOne) SetLatitude(f float64) *AirportUpdateOne
SetLatitude sets the "latitude" field.
func (*AirportUpdateOne) SetLongitude ¶
func (auo *AirportUpdateOne) SetLongitude(f float64) *AirportUpdateOne
SetLongitude sets the "longitude" field.
func (*AirportUpdateOne) SetName ¶
func (auo *AirportUpdateOne) SetName(s string) *AirportUpdateOne
SetName sets the "name" field.
func (*AirportUpdateOne) SetNillableAltitude ¶
func (auo *AirportUpdateOne) SetNillableAltitude(i *int) *AirportUpdateOne
SetNillableAltitude sets the "altitude" field if the given value is not nil.
func (*AirportUpdateOne) SetNillableCity ¶
func (auo *AirportUpdateOne) SetNillableCity(s *string) *AirportUpdateOne
SetNillableCity sets the "city" field if the given value is not nil.
func (*AirportUpdateOne) SetNillableCountry ¶
func (auo *AirportUpdateOne) SetNillableCountry(s *string) *AirportUpdateOne
SetNillableCountry sets the "country" field if the given value is not nil.
func (*AirportUpdateOne) SetNillableDst ¶
func (auo *AirportUpdateOne) SetNillableDst(s *string) *AirportUpdateOne
SetNillableDst sets the "dst" field if the given value is not nil.
func (*AirportUpdateOne) SetNillableIata ¶
func (auo *AirportUpdateOne) SetNillableIata(s *string) *AirportUpdateOne
SetNillableIata sets the "iata" field if the given value is not nil.
func (*AirportUpdateOne) SetNillableIcao ¶
func (auo *AirportUpdateOne) SetNillableIcao(s *string) *AirportUpdateOne
SetNillableIcao sets the "icao" field if the given value is not nil.
func (*AirportUpdateOne) SetNillableLatitude ¶
func (auo *AirportUpdateOne) SetNillableLatitude(f *float64) *AirportUpdateOne
SetNillableLatitude sets the "latitude" field if the given value is not nil.
func (*AirportUpdateOne) SetNillableLongitude ¶
func (auo *AirportUpdateOne) SetNillableLongitude(f *float64) *AirportUpdateOne
SetNillableLongitude sets the "longitude" field if the given value is not nil.
func (*AirportUpdateOne) SetNillableName ¶
func (auo *AirportUpdateOne) SetNillableName(s *string) *AirportUpdateOne
SetNillableName sets the "name" field if the given value is not nil.
func (*AirportUpdateOne) SetNillableSource ¶
func (auo *AirportUpdateOne) SetNillableSource(s *string) *AirportUpdateOne
SetNillableSource sets the "source" field if the given value is not nil.
func (*AirportUpdateOne) SetNillableTimezone ¶
func (auo *AirportUpdateOne) SetNillableTimezone(s *string) *AirportUpdateOne
SetNillableTimezone sets the "timezone" field if the given value is not nil.
func (*AirportUpdateOne) SetNillableTimezoneName ¶
func (auo *AirportUpdateOne) SetNillableTimezoneName(s *string) *AirportUpdateOne
SetNillableTimezoneName sets the "timezoneName" field if the given value is not nil.
func (*AirportUpdateOne) SetNillableType ¶
func (auo *AirportUpdateOne) SetNillableType(s *string) *AirportUpdateOne
SetNillableType sets the "type" field if the given value is not nil.
func (*AirportUpdateOne) SetSource ¶
func (auo *AirportUpdateOne) SetSource(s string) *AirportUpdateOne
SetSource sets the "source" field.
func (*AirportUpdateOne) SetTimezone ¶
func (auo *AirportUpdateOne) SetTimezone(s string) *AirportUpdateOne
SetTimezone sets the "timezone" field.
func (*AirportUpdateOne) SetTimezoneName ¶
func (auo *AirportUpdateOne) SetTimezoneName(s string) *AirportUpdateOne
SetTimezoneName sets the "timezoneName" field.
func (*AirportUpdateOne) SetType ¶
func (auo *AirportUpdateOne) SetType(s string) *AirportUpdateOne
SetType sets the "type" field.
func (*AirportUpdateOne) Where ¶
func (auo *AirportUpdateOne) Where(ps ...predicate.Airport) *AirportUpdateOne
Where appends a list predicates to the AirportUpdate builder.
type Client ¶
type Client struct { // Schema is the client for creating, migrating and dropping schema. Schema *migrate.Schema // Airline is the client for interacting with the Airline builders. Airline *AirlineClient // Airport is the client for interacting with the Airport builders. Airport *AirportClient // Plane is the client for interacting with the Plane builders. Plane *PlaneClient // Route is the client for interacting with the Route builders. Route *RouteClient // 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(). Airline. 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(...)`.
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 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 MutateFunc ¶
type MutateFunc = ent.MutateFunc
ent aliases to avoid import conflicts in user's code.
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 Plane ¶
type Plane struct { // ID of the ent. ID int `json:"id,omitempty"` // Name holds the value of the "name" field. Name string `json:"name,omitempty"` // TailNumber holds the value of the "tailNumber" field. TailNumber string `json:"tailNumber,omitempty"` // contains filtered or unexported fields }
Plane is the model entity for the Plane schema.
func (*Plane) Unwrap ¶
Unwrap unwraps the Plane 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 (*Plane) Update ¶
func (pl *Plane) Update() *PlaneUpdateOne
Update returns a builder for updating this Plane. Note that you need to call Plane.Unwrap() before calling this method if this Plane was returned from a transaction, and the transaction was committed or rolled back.
type PlaneClient ¶
type PlaneClient struct {
// contains filtered or unexported fields
}
PlaneClient is a client for the Plane schema.
func NewPlaneClient ¶
func NewPlaneClient(c config) *PlaneClient
NewPlaneClient returns a client for the Plane from the given config.
func (*PlaneClient) Create ¶
func (c *PlaneClient) Create() *PlaneCreate
Create returns a builder for creating a Plane entity.
func (*PlaneClient) CreateBulk ¶
func (c *PlaneClient) CreateBulk(builders ...*PlaneCreate) *PlaneCreateBulk
CreateBulk returns a builder for creating a bulk of Plane entities.
func (*PlaneClient) Delete ¶
func (c *PlaneClient) Delete() *PlaneDelete
Delete returns a delete builder for Plane.
func (*PlaneClient) DeleteOne ¶
func (c *PlaneClient) DeleteOne(pl *Plane) *PlaneDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*PlaneClient) DeleteOneID ¶
func (c *PlaneClient) DeleteOneID(id int) *PlaneDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*PlaneClient) GetX ¶
func (c *PlaneClient) GetX(ctx context.Context, id int) *Plane
GetX is like Get, but panics if an error occurs.
func (*PlaneClient) Intercept ¶
func (c *PlaneClient) Intercept(interceptors ...Interceptor)
Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `plane.Intercept(f(g(h())))`.
func (*PlaneClient) Interceptors ¶
func (c *PlaneClient) Interceptors() []Interceptor
Interceptors returns the client interceptors.
func (*PlaneClient) Query ¶
func (c *PlaneClient) Query() *PlaneQuery
Query returns a query builder for Plane.
func (*PlaneClient) Update ¶
func (c *PlaneClient) Update() *PlaneUpdate
Update returns an update builder for Plane.
func (*PlaneClient) UpdateOne ¶
func (c *PlaneClient) UpdateOne(pl *Plane) *PlaneUpdateOne
UpdateOne returns an update builder for the given entity.
func (*PlaneClient) UpdateOneID ¶
func (c *PlaneClient) UpdateOneID(id int) *PlaneUpdateOne
UpdateOneID returns an update builder for the given id.
func (*PlaneClient) Use ¶
func (c *PlaneClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `plane.Hooks(f(g(h())))`.
type PlaneCreate ¶
type PlaneCreate struct {
// contains filtered or unexported fields
}
PlaneCreate is the builder for creating a Plane entity.
func (*PlaneCreate) Exec ¶
func (pc *PlaneCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*PlaneCreate) ExecX ¶
func (pc *PlaneCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*PlaneCreate) Mutation ¶
func (pc *PlaneCreate) Mutation() *PlaneMutation
Mutation returns the PlaneMutation object of the builder.
func (*PlaneCreate) Save ¶
func (pc *PlaneCreate) Save(ctx context.Context) (*Plane, error)
Save creates the Plane in the database.
func (*PlaneCreate) SaveX ¶
func (pc *PlaneCreate) SaveX(ctx context.Context) *Plane
SaveX calls Save and panics if Save returns an error.
func (*PlaneCreate) SetID ¶
func (pc *PlaneCreate) SetID(i int) *PlaneCreate
SetID sets the "id" field.
func (*PlaneCreate) SetName ¶
func (pc *PlaneCreate) SetName(s string) *PlaneCreate
SetName sets the "name" field.
func (*PlaneCreate) SetTailNumber ¶
func (pc *PlaneCreate) SetTailNumber(s string) *PlaneCreate
SetTailNumber sets the "tailNumber" field.
type PlaneCreateBulk ¶
type PlaneCreateBulk struct {
// contains filtered or unexported fields
}
PlaneCreateBulk is the builder for creating many Plane entities in bulk.
func (*PlaneCreateBulk) Exec ¶
func (pcb *PlaneCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*PlaneCreateBulk) ExecX ¶
func (pcb *PlaneCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type PlaneDelete ¶
type PlaneDelete struct {
// contains filtered or unexported fields
}
PlaneDelete is the builder for deleting a Plane entity.
func (*PlaneDelete) Exec ¶
func (pd *PlaneDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*PlaneDelete) ExecX ¶
func (pd *PlaneDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*PlaneDelete) Where ¶
func (pd *PlaneDelete) Where(ps ...predicate.Plane) *PlaneDelete
Where appends a list predicates to the PlaneDelete builder.
type PlaneDeleteOne ¶
type PlaneDeleteOne struct {
// contains filtered or unexported fields
}
PlaneDeleteOne is the builder for deleting a single Plane entity.
func (*PlaneDeleteOne) Exec ¶
func (pdo *PlaneDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*PlaneDeleteOne) ExecX ¶
func (pdo *PlaneDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*PlaneDeleteOne) Where ¶
func (pdo *PlaneDeleteOne) Where(ps ...predicate.Plane) *PlaneDeleteOne
Where appends a list predicates to the PlaneDelete builder.
type PlaneGroupBy ¶
type PlaneGroupBy struct {
// contains filtered or unexported fields
}
PlaneGroupBy is the group-by builder for Plane entities.
func (*PlaneGroupBy) Aggregate ¶
func (pgb *PlaneGroupBy) Aggregate(fns ...AggregateFunc) *PlaneGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*PlaneGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*PlaneGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*PlaneGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*PlaneGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*PlaneGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*PlaneGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*PlaneGroupBy) Scan ¶
func (pgb *PlaneGroupBy) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*PlaneGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type PlaneMutation ¶
type PlaneMutation struct {
// contains filtered or unexported fields
}
PlaneMutation represents an operation that mutates the Plane nodes in the graph.
func (*PlaneMutation) AddField ¶
func (m *PlaneMutation) 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 (*PlaneMutation) AddedEdges ¶
func (m *PlaneMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*PlaneMutation) AddedField ¶
func (m *PlaneMutation) 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 (*PlaneMutation) AddedFields ¶
func (m *PlaneMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*PlaneMutation) AddedIDs ¶
func (m *PlaneMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*PlaneMutation) ClearEdge ¶
func (m *PlaneMutation) 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 (*PlaneMutation) ClearField ¶
func (m *PlaneMutation) 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 (*PlaneMutation) ClearedEdges ¶
func (m *PlaneMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*PlaneMutation) ClearedFields ¶
func (m *PlaneMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (PlaneMutation) Client ¶
func (m PlaneMutation) 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 (*PlaneMutation) EdgeCleared ¶
func (m *PlaneMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*PlaneMutation) Field ¶
func (m *PlaneMutation) 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 (*PlaneMutation) FieldCleared ¶
func (m *PlaneMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*PlaneMutation) Fields ¶
func (m *PlaneMutation) 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 (*PlaneMutation) ID ¶
func (m *PlaneMutation) ID() (id int, 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 (*PlaneMutation) IDs ¶
func (m *PlaneMutation) IDs(ctx context.Context) ([]int, 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 (*PlaneMutation) Name ¶
func (m *PlaneMutation) Name() (r string, exists bool)
Name returns the value of the "name" field in the mutation.
func (*PlaneMutation) 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 (*PlaneMutation) OldName ¶
func (m *PlaneMutation) OldName(ctx context.Context) (v string, err error)
OldName returns the old "name" field's value of the Plane entity. If the Plane 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 (*PlaneMutation) OldTailNumber ¶
func (m *PlaneMutation) OldTailNumber(ctx context.Context) (v string, err error)
OldTailNumber returns the old "tailNumber" field's value of the Plane entity. If the Plane 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 (*PlaneMutation) RemovedEdges ¶
func (m *PlaneMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*PlaneMutation) RemovedIDs ¶
func (m *PlaneMutation) 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 (*PlaneMutation) ResetEdge ¶
func (m *PlaneMutation) 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 (*PlaneMutation) ResetField ¶
func (m *PlaneMutation) 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 (*PlaneMutation) ResetName ¶
func (m *PlaneMutation) ResetName()
ResetName resets all changes to the "name" field.
func (*PlaneMutation) ResetTailNumber ¶
func (m *PlaneMutation) ResetTailNumber()
ResetTailNumber resets all changes to the "tailNumber" field.
func (*PlaneMutation) SetField ¶
func (m *PlaneMutation) 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 (*PlaneMutation) SetID ¶
func (m *PlaneMutation) SetID(id int)
SetID sets the value of the id field. Note that this operation is only accepted on creation of Plane entities.
func (*PlaneMutation) SetName ¶
func (m *PlaneMutation) SetName(s string)
SetName sets the "name" field.
func (*PlaneMutation) SetOp ¶
func (m *PlaneMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (*PlaneMutation) SetTailNumber ¶
func (m *PlaneMutation) SetTailNumber(s string)
SetTailNumber sets the "tailNumber" field.
func (*PlaneMutation) TailNumber ¶
func (m *PlaneMutation) TailNumber() (r string, exists bool)
TailNumber returns the value of the "tailNumber" field in the mutation.
func (PlaneMutation) Tx ¶
func (m PlaneMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*PlaneMutation) Type ¶
func (m *PlaneMutation) Type() string
Type returns the node type of this mutation (Plane).
func (*PlaneMutation) Where ¶
func (m *PlaneMutation) Where(ps ...predicate.Plane)
Where appends a list predicates to the PlaneMutation builder.
func (*PlaneMutation) WhereP ¶
func (m *PlaneMutation) WhereP(ps ...func(*sql.Selector))
WhereP appends storage-level predicates to the PlaneMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.
type PlaneQuery ¶
type PlaneQuery struct {
// contains filtered or unexported fields
}
PlaneQuery is the builder for querying Plane entities.
func (*PlaneQuery) Aggregate ¶
func (pq *PlaneQuery) Aggregate(fns ...AggregateFunc) *PlaneSelect
Aggregate returns a PlaneSelect configured with the given aggregations.
func (*PlaneQuery) All ¶
func (pq *PlaneQuery) All(ctx context.Context) ([]*Plane, error)
All executes the query and returns a list of Planes.
func (*PlaneQuery) AllX ¶
func (pq *PlaneQuery) AllX(ctx context.Context) []*Plane
AllX is like All, but panics if an error occurs.
func (*PlaneQuery) Clone ¶
func (pq *PlaneQuery) Clone() *PlaneQuery
Clone returns a duplicate of the PlaneQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*PlaneQuery) Count ¶
func (pq *PlaneQuery) Count(ctx context.Context) (int, error)
Count returns the count of the given query.
func (*PlaneQuery) CountX ¶
func (pq *PlaneQuery) CountX(ctx context.Context) int
CountX is like Count, but panics if an error occurs.
func (*PlaneQuery) Exist ¶
func (pq *PlaneQuery) Exist(ctx context.Context) (bool, error)
Exist returns true if the query has elements in the graph.
func (*PlaneQuery) ExistX ¶
func (pq *PlaneQuery) ExistX(ctx context.Context) bool
ExistX is like Exist, but panics if an error occurs.
func (*PlaneQuery) First ¶
func (pq *PlaneQuery) First(ctx context.Context) (*Plane, error)
First returns the first Plane entity from the query. Returns a *NotFoundError when no Plane was found.
func (*PlaneQuery) FirstID ¶
func (pq *PlaneQuery) FirstID(ctx context.Context) (id int, err error)
FirstID returns the first Plane ID from the query. Returns a *NotFoundError when no Plane ID was found.
func (*PlaneQuery) FirstIDX ¶
func (pq *PlaneQuery) FirstIDX(ctx context.Context) int
FirstIDX is like FirstID, but panics if an error occurs.
func (*PlaneQuery) FirstX ¶
func (pq *PlaneQuery) FirstX(ctx context.Context) *Plane
FirstX is like First, but panics if an error occurs.
func (*PlaneQuery) GroupBy ¶
func (pq *PlaneQuery) GroupBy(field string, fields ...string) *PlaneGroupBy
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.Plane.Query(). GroupBy(plane.FieldName). Aggregate(ent.Count()). Scan(ctx, &v)
func (*PlaneQuery) IDs ¶
func (pq *PlaneQuery) IDs(ctx context.Context) (ids []int, err error)
IDs executes the query and returns a list of Plane IDs.
func (*PlaneQuery) IDsX ¶
func (pq *PlaneQuery) IDsX(ctx context.Context) []int
IDsX is like IDs, but panics if an error occurs.
func (*PlaneQuery) Limit ¶
func (pq *PlaneQuery) Limit(limit int) *PlaneQuery
Limit the number of records to be returned by this query.
func (*PlaneQuery) Offset ¶
func (pq *PlaneQuery) Offset(offset int) *PlaneQuery
Offset to start from.
func (*PlaneQuery) Only ¶
func (pq *PlaneQuery) Only(ctx context.Context) (*Plane, error)
Only returns a single Plane entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Plane entity is found. Returns a *NotFoundError when no Plane entities are found.
func (*PlaneQuery) OnlyID ¶
func (pq *PlaneQuery) OnlyID(ctx context.Context) (id int, err error)
OnlyID is like Only, but returns the only Plane ID in the query. Returns a *NotSingularError when more than one Plane ID is found. Returns a *NotFoundError when no entities are found.
func (*PlaneQuery) OnlyIDX ¶
func (pq *PlaneQuery) OnlyIDX(ctx context.Context) int
OnlyIDX is like OnlyID, but panics if an error occurs.
func (*PlaneQuery) OnlyX ¶
func (pq *PlaneQuery) OnlyX(ctx context.Context) *Plane
OnlyX is like Only, but panics if an error occurs.
func (*PlaneQuery) Order ¶
func (pq *PlaneQuery) Order(o ...OrderFunc) *PlaneQuery
Order specifies how the records should be ordered.
func (*PlaneQuery) Select ¶
func (pq *PlaneQuery) Select(fields ...string) *PlaneSelect
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.Plane.Query(). Select(plane.FieldName). Scan(ctx, &v)
func (*PlaneQuery) Unique ¶
func (pq *PlaneQuery) Unique(unique bool) *PlaneQuery
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 (*PlaneQuery) Where ¶
func (pq *PlaneQuery) Where(ps ...predicate.Plane) *PlaneQuery
Where adds a new predicate for the PlaneQuery builder.
type PlaneSelect ¶
type PlaneSelect struct { *PlaneQuery // contains filtered or unexported fields }
PlaneSelect is the builder for selecting fields of Plane entities.
func (*PlaneSelect) Aggregate ¶
func (ps *PlaneSelect) Aggregate(fns ...AggregateFunc) *PlaneSelect
Aggregate adds the given aggregation functions to the selector query.
func (*PlaneSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*PlaneSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*PlaneSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*PlaneSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*PlaneSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*PlaneSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*PlaneSelect) Scan ¶
func (ps *PlaneSelect) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*PlaneSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type PlaneUpdate ¶
type PlaneUpdate struct {
// contains filtered or unexported fields
}
PlaneUpdate is the builder for updating Plane entities.
func (*PlaneUpdate) Exec ¶
func (pu *PlaneUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*PlaneUpdate) ExecX ¶
func (pu *PlaneUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*PlaneUpdate) Mutation ¶
func (pu *PlaneUpdate) Mutation() *PlaneMutation
Mutation returns the PlaneMutation object of the builder.
func (*PlaneUpdate) Save ¶
func (pu *PlaneUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*PlaneUpdate) SaveX ¶
func (pu *PlaneUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*PlaneUpdate) SetName ¶
func (pu *PlaneUpdate) SetName(s string) *PlaneUpdate
SetName sets the "name" field.
func (*PlaneUpdate) SetTailNumber ¶
func (pu *PlaneUpdate) SetTailNumber(s string) *PlaneUpdate
SetTailNumber sets the "tailNumber" field.
func (*PlaneUpdate) Where ¶
func (pu *PlaneUpdate) Where(ps ...predicate.Plane) *PlaneUpdate
Where appends a list predicates to the PlaneUpdate builder.
type PlaneUpdateOne ¶
type PlaneUpdateOne struct {
// contains filtered or unexported fields
}
PlaneUpdateOne is the builder for updating a single Plane entity.
func (*PlaneUpdateOne) Exec ¶
func (puo *PlaneUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*PlaneUpdateOne) ExecX ¶
func (puo *PlaneUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*PlaneUpdateOne) Mutation ¶
func (puo *PlaneUpdateOne) Mutation() *PlaneMutation
Mutation returns the PlaneMutation object of the builder.
func (*PlaneUpdateOne) Save ¶
func (puo *PlaneUpdateOne) Save(ctx context.Context) (*Plane, error)
Save executes the query and returns the updated Plane entity.
func (*PlaneUpdateOne) SaveX ¶
func (puo *PlaneUpdateOne) SaveX(ctx context.Context) *Plane
SaveX is like Save, but panics if an error occurs.
func (*PlaneUpdateOne) Select ¶
func (puo *PlaneUpdateOne) Select(field string, fields ...string) *PlaneUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*PlaneUpdateOne) SetName ¶
func (puo *PlaneUpdateOne) SetName(s string) *PlaneUpdateOne
SetName sets the "name" field.
func (*PlaneUpdateOne) SetTailNumber ¶
func (puo *PlaneUpdateOne) SetTailNumber(s string) *PlaneUpdateOne
SetTailNumber sets the "tailNumber" field.
func (*PlaneUpdateOne) Where ¶
func (puo *PlaneUpdateOne) Where(ps ...predicate.Plane) *PlaneUpdateOne
Where appends a list predicates to the PlaneUpdate builder.
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 Route ¶
type Route struct { // ID of the ent. ID int `json:"id,omitempty"` // AirlineId holds the value of the "airlineId" field. AirlineId int `json:"airlineId,omitempty"` // SourceAirportId holds the value of the "sourceAirportId" field. SourceAirportId int `json:"sourceAirportId,omitempty"` // DestinationAirportId holds the value of the "destinationAirportId" field. DestinationAirportId int `json:"destinationAirportId,omitempty"` // PlaneId holds the value of the "planeId" field. PlaneId int `json:"planeId,omitempty"` // NumberOfStops holds the value of the "numberOfStops" field. NumberOfStops int `json:"numberOfStops,omitempty"` // contains filtered or unexported fields }
Route is the model entity for the Route schema.
func (*Route) Unwrap ¶
Unwrap unwraps the Route 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 (*Route) Update ¶
func (r *Route) Update() *RouteUpdateOne
Update returns a builder for updating this Route. Note that you need to call Route.Unwrap() before calling this method if this Route was returned from a transaction, and the transaction was committed or rolled back.
type RouteClient ¶
type RouteClient struct {
// contains filtered or unexported fields
}
RouteClient is a client for the Route schema.
func NewRouteClient ¶
func NewRouteClient(c config) *RouteClient
NewRouteClient returns a client for the Route from the given config.
func (*RouteClient) Create ¶
func (c *RouteClient) Create() *RouteCreate
Create returns a builder for creating a Route entity.
func (*RouteClient) CreateBulk ¶
func (c *RouteClient) CreateBulk(builders ...*RouteCreate) *RouteCreateBulk
CreateBulk returns a builder for creating a bulk of Route entities.
func (*RouteClient) Delete ¶
func (c *RouteClient) Delete() *RouteDelete
Delete returns a delete builder for Route.
func (*RouteClient) DeleteOne ¶
func (c *RouteClient) DeleteOne(r *Route) *RouteDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*RouteClient) DeleteOneID ¶
func (c *RouteClient) DeleteOneID(id int) *RouteDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*RouteClient) GetX ¶
func (c *RouteClient) GetX(ctx context.Context, id int) *Route
GetX is like Get, but panics if an error occurs.
func (*RouteClient) Intercept ¶
func (c *RouteClient) Intercept(interceptors ...Interceptor)
Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `route.Intercept(f(g(h())))`.
func (*RouteClient) Interceptors ¶
func (c *RouteClient) Interceptors() []Interceptor
Interceptors returns the client interceptors.
func (*RouteClient) Query ¶
func (c *RouteClient) Query() *RouteQuery
Query returns a query builder for Route.
func (*RouteClient) Update ¶
func (c *RouteClient) Update() *RouteUpdate
Update returns an update builder for Route.
func (*RouteClient) UpdateOne ¶
func (c *RouteClient) UpdateOne(r *Route) *RouteUpdateOne
UpdateOne returns an update builder for the given entity.
func (*RouteClient) UpdateOneID ¶
func (c *RouteClient) UpdateOneID(id int) *RouteUpdateOne
UpdateOneID returns an update builder for the given id.
func (*RouteClient) Use ¶
func (c *RouteClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `route.Hooks(f(g(h())))`.
type RouteCreate ¶
type RouteCreate struct {
// contains filtered or unexported fields
}
RouteCreate is the builder for creating a Route entity.
func (*RouteCreate) Exec ¶
func (rc *RouteCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*RouteCreate) ExecX ¶
func (rc *RouteCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*RouteCreate) Mutation ¶
func (rc *RouteCreate) Mutation() *RouteMutation
Mutation returns the RouteMutation object of the builder.
func (*RouteCreate) Save ¶
func (rc *RouteCreate) Save(ctx context.Context) (*Route, error)
Save creates the Route in the database.
func (*RouteCreate) SaveX ¶
func (rc *RouteCreate) SaveX(ctx context.Context) *Route
SaveX calls Save and panics if Save returns an error.
func (*RouteCreate) SetAirlineId ¶
func (rc *RouteCreate) SetAirlineId(i int) *RouteCreate
SetAirlineId sets the "airlineId" field.
func (*RouteCreate) SetDestinationAirportId ¶
func (rc *RouteCreate) SetDestinationAirportId(i int) *RouteCreate
SetDestinationAirportId sets the "destinationAirportId" field.
func (*RouteCreate) SetID ¶
func (rc *RouteCreate) SetID(i int) *RouteCreate
SetID sets the "id" field.
func (*RouteCreate) SetNumberOfStops ¶
func (rc *RouteCreate) SetNumberOfStops(i int) *RouteCreate
SetNumberOfStops sets the "numberOfStops" field.
func (*RouteCreate) SetPlaneId ¶
func (rc *RouteCreate) SetPlaneId(i int) *RouteCreate
SetPlaneId sets the "planeId" field.
func (*RouteCreate) SetSourceAirportId ¶
func (rc *RouteCreate) SetSourceAirportId(i int) *RouteCreate
SetSourceAirportId sets the "sourceAirportId" field.
type RouteCreateBulk ¶
type RouteCreateBulk struct {
// contains filtered or unexported fields
}
RouteCreateBulk is the builder for creating many Route entities in bulk.
func (*RouteCreateBulk) Exec ¶
func (rcb *RouteCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*RouteCreateBulk) ExecX ¶
func (rcb *RouteCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type RouteDelete ¶
type RouteDelete struct {
// contains filtered or unexported fields
}
RouteDelete is the builder for deleting a Route entity.
func (*RouteDelete) Exec ¶
func (rd *RouteDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*RouteDelete) ExecX ¶
func (rd *RouteDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*RouteDelete) Where ¶
func (rd *RouteDelete) Where(ps ...predicate.Route) *RouteDelete
Where appends a list predicates to the RouteDelete builder.
type RouteDeleteOne ¶
type RouteDeleteOne struct {
// contains filtered or unexported fields
}
RouteDeleteOne is the builder for deleting a single Route entity.
func (*RouteDeleteOne) Exec ¶
func (rdo *RouteDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*RouteDeleteOne) ExecX ¶
func (rdo *RouteDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*RouteDeleteOne) Where ¶
func (rdo *RouteDeleteOne) Where(ps ...predicate.Route) *RouteDeleteOne
Where appends a list predicates to the RouteDelete builder.
type RouteGroupBy ¶
type RouteGroupBy struct {
// contains filtered or unexported fields
}
RouteGroupBy is the group-by builder for Route entities.
func (*RouteGroupBy) Aggregate ¶
func (rgb *RouteGroupBy) Aggregate(fns ...AggregateFunc) *RouteGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*RouteGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*RouteGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*RouteGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*RouteGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*RouteGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*RouteGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*RouteGroupBy) Scan ¶
func (rgb *RouteGroupBy) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*RouteGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type RouteMutation ¶
type RouteMutation struct {
// contains filtered or unexported fields
}
RouteMutation represents an operation that mutates the Route nodes in the graph.
func (*RouteMutation) AddAirlineId ¶
func (m *RouteMutation) AddAirlineId(i int)
AddAirlineId adds i to the "airlineId" field.
func (*RouteMutation) AddDestinationAirportId ¶
func (m *RouteMutation) AddDestinationAirportId(i int)
AddDestinationAirportId adds i to the "destinationAirportId" field.
func (*RouteMutation) AddField ¶
func (m *RouteMutation) 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 (*RouteMutation) AddNumberOfStops ¶
func (m *RouteMutation) AddNumberOfStops(i int)
AddNumberOfStops adds i to the "numberOfStops" field.
func (*RouteMutation) AddPlaneId ¶
func (m *RouteMutation) AddPlaneId(i int)
AddPlaneId adds i to the "planeId" field.
func (*RouteMutation) AddSourceAirportId ¶
func (m *RouteMutation) AddSourceAirportId(i int)
AddSourceAirportId adds i to the "sourceAirportId" field.
func (*RouteMutation) AddedAirlineId ¶
func (m *RouteMutation) AddedAirlineId() (r int, exists bool)
AddedAirlineId returns the value that was added to the "airlineId" field in this mutation.
func (*RouteMutation) AddedDestinationAirportId ¶
func (m *RouteMutation) AddedDestinationAirportId() (r int, exists bool)
AddedDestinationAirportId returns the value that was added to the "destinationAirportId" field in this mutation.
func (*RouteMutation) AddedEdges ¶
func (m *RouteMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*RouteMutation) AddedField ¶
func (m *RouteMutation) 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 (*RouteMutation) AddedFields ¶
func (m *RouteMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*RouteMutation) AddedIDs ¶
func (m *RouteMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*RouteMutation) AddedNumberOfStops ¶
func (m *RouteMutation) AddedNumberOfStops() (r int, exists bool)
AddedNumberOfStops returns the value that was added to the "numberOfStops" field in this mutation.
func (*RouteMutation) AddedPlaneId ¶
func (m *RouteMutation) AddedPlaneId() (r int, exists bool)
AddedPlaneId returns the value that was added to the "planeId" field in this mutation.
func (*RouteMutation) AddedSourceAirportId ¶
func (m *RouteMutation) AddedSourceAirportId() (r int, exists bool)
AddedSourceAirportId returns the value that was added to the "sourceAirportId" field in this mutation.
func (*RouteMutation) AirlineId ¶
func (m *RouteMutation) AirlineId() (r int, exists bool)
AirlineId returns the value of the "airlineId" field in the mutation.
func (*RouteMutation) ClearEdge ¶
func (m *RouteMutation) 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 (*RouteMutation) ClearField ¶
func (m *RouteMutation) 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 (*RouteMutation) ClearedEdges ¶
func (m *RouteMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*RouteMutation) ClearedFields ¶
func (m *RouteMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (RouteMutation) Client ¶
func (m RouteMutation) 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 (*RouteMutation) DestinationAirportId ¶
func (m *RouteMutation) DestinationAirportId() (r int, exists bool)
DestinationAirportId returns the value of the "destinationAirportId" field in the mutation.
func (*RouteMutation) EdgeCleared ¶
func (m *RouteMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*RouteMutation) Field ¶
func (m *RouteMutation) 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 (*RouteMutation) FieldCleared ¶
func (m *RouteMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*RouteMutation) Fields ¶
func (m *RouteMutation) 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 (*RouteMutation) ID ¶
func (m *RouteMutation) ID() (id int, 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 (*RouteMutation) IDs ¶
func (m *RouteMutation) IDs(ctx context.Context) ([]int, 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 (*RouteMutation) NumberOfStops ¶
func (m *RouteMutation) NumberOfStops() (r int, exists bool)
NumberOfStops returns the value of the "numberOfStops" field in the mutation.
func (*RouteMutation) OldAirlineId ¶
func (m *RouteMutation) OldAirlineId(ctx context.Context) (v int, err error)
OldAirlineId returns the old "airlineId" field's value of the Route entity. If the Route 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 (*RouteMutation) OldDestinationAirportId ¶
func (m *RouteMutation) OldDestinationAirportId(ctx context.Context) (v int, err error)
OldDestinationAirportId returns the old "destinationAirportId" field's value of the Route entity. If the Route 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 (*RouteMutation) 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 (*RouteMutation) OldNumberOfStops ¶
func (m *RouteMutation) OldNumberOfStops(ctx context.Context) (v int, err error)
OldNumberOfStops returns the old "numberOfStops" field's value of the Route entity. If the Route 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 (*RouteMutation) OldPlaneId ¶
func (m *RouteMutation) OldPlaneId(ctx context.Context) (v int, err error)
OldPlaneId returns the old "planeId" field's value of the Route entity. If the Route 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 (*RouteMutation) OldSourceAirportId ¶
func (m *RouteMutation) OldSourceAirportId(ctx context.Context) (v int, err error)
OldSourceAirportId returns the old "sourceAirportId" field's value of the Route entity. If the Route 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 (*RouteMutation) PlaneId ¶
func (m *RouteMutation) PlaneId() (r int, exists bool)
PlaneId returns the value of the "planeId" field in the mutation.
func (*RouteMutation) RemovedEdges ¶
func (m *RouteMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*RouteMutation) RemovedIDs ¶
func (m *RouteMutation) 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 (*RouteMutation) ResetAirlineId ¶
func (m *RouteMutation) ResetAirlineId()
ResetAirlineId resets all changes to the "airlineId" field.
func (*RouteMutation) ResetDestinationAirportId ¶
func (m *RouteMutation) ResetDestinationAirportId()
ResetDestinationAirportId resets all changes to the "destinationAirportId" field.
func (*RouteMutation) ResetEdge ¶
func (m *RouteMutation) 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 (*RouteMutation) ResetField ¶
func (m *RouteMutation) 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 (*RouteMutation) ResetNumberOfStops ¶
func (m *RouteMutation) ResetNumberOfStops()
ResetNumberOfStops resets all changes to the "numberOfStops" field.
func (*RouteMutation) ResetPlaneId ¶
func (m *RouteMutation) ResetPlaneId()
ResetPlaneId resets all changes to the "planeId" field.
func (*RouteMutation) ResetSourceAirportId ¶
func (m *RouteMutation) ResetSourceAirportId()
ResetSourceAirportId resets all changes to the "sourceAirportId" field.
func (*RouteMutation) SetAirlineId ¶
func (m *RouteMutation) SetAirlineId(i int)
SetAirlineId sets the "airlineId" field.
func (*RouteMutation) SetDestinationAirportId ¶
func (m *RouteMutation) SetDestinationAirportId(i int)
SetDestinationAirportId sets the "destinationAirportId" field.
func (*RouteMutation) SetField ¶
func (m *RouteMutation) 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 (*RouteMutation) SetID ¶
func (m *RouteMutation) SetID(id int)
SetID sets the value of the id field. Note that this operation is only accepted on creation of Route entities.
func (*RouteMutation) SetNumberOfStops ¶
func (m *RouteMutation) SetNumberOfStops(i int)
SetNumberOfStops sets the "numberOfStops" field.
func (*RouteMutation) SetOp ¶
func (m *RouteMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (*RouteMutation) SetPlaneId ¶
func (m *RouteMutation) SetPlaneId(i int)
SetPlaneId sets the "planeId" field.
func (*RouteMutation) SetSourceAirportId ¶
func (m *RouteMutation) SetSourceAirportId(i int)
SetSourceAirportId sets the "sourceAirportId" field.
func (*RouteMutation) SourceAirportId ¶
func (m *RouteMutation) SourceAirportId() (r int, exists bool)
SourceAirportId returns the value of the "sourceAirportId" field in the mutation.
func (RouteMutation) Tx ¶
func (m RouteMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*RouteMutation) Type ¶
func (m *RouteMutation) Type() string
Type returns the node type of this mutation (Route).
func (*RouteMutation) Where ¶
func (m *RouteMutation) Where(ps ...predicate.Route)
Where appends a list predicates to the RouteMutation builder.
func (*RouteMutation) WhereP ¶
func (m *RouteMutation) WhereP(ps ...func(*sql.Selector))
WhereP appends storage-level predicates to the RouteMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.
type RouteQuery ¶
type RouteQuery struct {
// contains filtered or unexported fields
}
RouteQuery is the builder for querying Route entities.
func (*RouteQuery) Aggregate ¶
func (rq *RouteQuery) Aggregate(fns ...AggregateFunc) *RouteSelect
Aggregate returns a RouteSelect configured with the given aggregations.
func (*RouteQuery) All ¶
func (rq *RouteQuery) All(ctx context.Context) ([]*Route, error)
All executes the query and returns a list of Routes.
func (*RouteQuery) AllX ¶
func (rq *RouteQuery) AllX(ctx context.Context) []*Route
AllX is like All, but panics if an error occurs.
func (*RouteQuery) Clone ¶
func (rq *RouteQuery) Clone() *RouteQuery
Clone returns a duplicate of the RouteQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*RouteQuery) Count ¶
func (rq *RouteQuery) Count(ctx context.Context) (int, error)
Count returns the count of the given query.
func (*RouteQuery) CountX ¶
func (rq *RouteQuery) CountX(ctx context.Context) int
CountX is like Count, but panics if an error occurs.
func (*RouteQuery) Exist ¶
func (rq *RouteQuery) Exist(ctx context.Context) (bool, error)
Exist returns true if the query has elements in the graph.
func (*RouteQuery) ExistX ¶
func (rq *RouteQuery) ExistX(ctx context.Context) bool
ExistX is like Exist, but panics if an error occurs.
func (*RouteQuery) First ¶
func (rq *RouteQuery) First(ctx context.Context) (*Route, error)
First returns the first Route entity from the query. Returns a *NotFoundError when no Route was found.
func (*RouteQuery) FirstID ¶
func (rq *RouteQuery) FirstID(ctx context.Context) (id int, err error)
FirstID returns the first Route ID from the query. Returns a *NotFoundError when no Route ID was found.
func (*RouteQuery) FirstIDX ¶
func (rq *RouteQuery) FirstIDX(ctx context.Context) int
FirstIDX is like FirstID, but panics if an error occurs.
func (*RouteQuery) FirstX ¶
func (rq *RouteQuery) FirstX(ctx context.Context) *Route
FirstX is like First, but panics if an error occurs.
func (*RouteQuery) GroupBy ¶
func (rq *RouteQuery) GroupBy(field string, fields ...string) *RouteGroupBy
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 { AirlineId int `json:"airlineId,omitempty"` Count int `json:"count,omitempty"` } client.Route.Query(). GroupBy(route.FieldAirlineId). Aggregate(ent.Count()). Scan(ctx, &v)
func (*RouteQuery) IDs ¶
func (rq *RouteQuery) IDs(ctx context.Context) (ids []int, err error)
IDs executes the query and returns a list of Route IDs.
func (*RouteQuery) IDsX ¶
func (rq *RouteQuery) IDsX(ctx context.Context) []int
IDsX is like IDs, but panics if an error occurs.
func (*RouteQuery) Limit ¶
func (rq *RouteQuery) Limit(limit int) *RouteQuery
Limit the number of records to be returned by this query.
func (*RouteQuery) Offset ¶
func (rq *RouteQuery) Offset(offset int) *RouteQuery
Offset to start from.
func (*RouteQuery) Only ¶
func (rq *RouteQuery) Only(ctx context.Context) (*Route, error)
Only returns a single Route entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Route entity is found. Returns a *NotFoundError when no Route entities are found.
func (*RouteQuery) OnlyID ¶
func (rq *RouteQuery) OnlyID(ctx context.Context) (id int, err error)
OnlyID is like Only, but returns the only Route ID in the query. Returns a *NotSingularError when more than one Route ID is found. Returns a *NotFoundError when no entities are found.
func (*RouteQuery) OnlyIDX ¶
func (rq *RouteQuery) OnlyIDX(ctx context.Context) int
OnlyIDX is like OnlyID, but panics if an error occurs.
func (*RouteQuery) OnlyX ¶
func (rq *RouteQuery) OnlyX(ctx context.Context) *Route
OnlyX is like Only, but panics if an error occurs.
func (*RouteQuery) Order ¶
func (rq *RouteQuery) Order(o ...OrderFunc) *RouteQuery
Order specifies how the records should be ordered.
func (*RouteQuery) Select ¶
func (rq *RouteQuery) Select(fields ...string) *RouteSelect
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 { AirlineId int `json:"airlineId,omitempty"` } client.Route.Query(). Select(route.FieldAirlineId). Scan(ctx, &v)
func (*RouteQuery) Unique ¶
func (rq *RouteQuery) Unique(unique bool) *RouteQuery
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 (*RouteQuery) Where ¶
func (rq *RouteQuery) Where(ps ...predicate.Route) *RouteQuery
Where adds a new predicate for the RouteQuery builder.
type RouteSelect ¶
type RouteSelect struct { *RouteQuery // contains filtered or unexported fields }
RouteSelect is the builder for selecting fields of Route entities.
func (*RouteSelect) Aggregate ¶
func (rs *RouteSelect) Aggregate(fns ...AggregateFunc) *RouteSelect
Aggregate adds the given aggregation functions to the selector query.
func (*RouteSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*RouteSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*RouteSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*RouteSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*RouteSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*RouteSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*RouteSelect) Scan ¶
func (rs *RouteSelect) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*RouteSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type RouteUpdate ¶
type RouteUpdate struct {
// contains filtered or unexported fields
}
RouteUpdate is the builder for updating Route entities.
func (*RouteUpdate) AddAirlineId ¶
func (ru *RouteUpdate) AddAirlineId(i int) *RouteUpdate
AddAirlineId adds i to the "airlineId" field.
func (*RouteUpdate) AddDestinationAirportId ¶
func (ru *RouteUpdate) AddDestinationAirportId(i int) *RouteUpdate
AddDestinationAirportId adds i to the "destinationAirportId" field.
func (*RouteUpdate) AddNumberOfStops ¶
func (ru *RouteUpdate) AddNumberOfStops(i int) *RouteUpdate
AddNumberOfStops adds i to the "numberOfStops" field.
func (*RouteUpdate) AddPlaneId ¶
func (ru *RouteUpdate) AddPlaneId(i int) *RouteUpdate
AddPlaneId adds i to the "planeId" field.
func (*RouteUpdate) AddSourceAirportId ¶
func (ru *RouteUpdate) AddSourceAirportId(i int) *RouteUpdate
AddSourceAirportId adds i to the "sourceAirportId" field.
func (*RouteUpdate) Exec ¶
func (ru *RouteUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*RouteUpdate) ExecX ¶
func (ru *RouteUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*RouteUpdate) Mutation ¶
func (ru *RouteUpdate) Mutation() *RouteMutation
Mutation returns the RouteMutation object of the builder.
func (*RouteUpdate) Save ¶
func (ru *RouteUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*RouteUpdate) SaveX ¶
func (ru *RouteUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*RouteUpdate) SetAirlineId ¶
func (ru *RouteUpdate) SetAirlineId(i int) *RouteUpdate
SetAirlineId sets the "airlineId" field.
func (*RouteUpdate) SetDestinationAirportId ¶
func (ru *RouteUpdate) SetDestinationAirportId(i int) *RouteUpdate
SetDestinationAirportId sets the "destinationAirportId" field.
func (*RouteUpdate) SetNumberOfStops ¶
func (ru *RouteUpdate) SetNumberOfStops(i int) *RouteUpdate
SetNumberOfStops sets the "numberOfStops" field.
func (*RouteUpdate) SetPlaneId ¶
func (ru *RouteUpdate) SetPlaneId(i int) *RouteUpdate
SetPlaneId sets the "planeId" field.
func (*RouteUpdate) SetSourceAirportId ¶
func (ru *RouteUpdate) SetSourceAirportId(i int) *RouteUpdate
SetSourceAirportId sets the "sourceAirportId" field.
func (*RouteUpdate) Where ¶
func (ru *RouteUpdate) Where(ps ...predicate.Route) *RouteUpdate
Where appends a list predicates to the RouteUpdate builder.
type RouteUpdateOne ¶
type RouteUpdateOne struct {
// contains filtered or unexported fields
}
RouteUpdateOne is the builder for updating a single Route entity.
func (*RouteUpdateOne) AddAirlineId ¶
func (ruo *RouteUpdateOne) AddAirlineId(i int) *RouteUpdateOne
AddAirlineId adds i to the "airlineId" field.
func (*RouteUpdateOne) AddDestinationAirportId ¶
func (ruo *RouteUpdateOne) AddDestinationAirportId(i int) *RouteUpdateOne
AddDestinationAirportId adds i to the "destinationAirportId" field.
func (*RouteUpdateOne) AddNumberOfStops ¶
func (ruo *RouteUpdateOne) AddNumberOfStops(i int) *RouteUpdateOne
AddNumberOfStops adds i to the "numberOfStops" field.
func (*RouteUpdateOne) AddPlaneId ¶
func (ruo *RouteUpdateOne) AddPlaneId(i int) *RouteUpdateOne
AddPlaneId adds i to the "planeId" field.
func (*RouteUpdateOne) AddSourceAirportId ¶
func (ruo *RouteUpdateOne) AddSourceAirportId(i int) *RouteUpdateOne
AddSourceAirportId adds i to the "sourceAirportId" field.
func (*RouteUpdateOne) Exec ¶
func (ruo *RouteUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*RouteUpdateOne) ExecX ¶
func (ruo *RouteUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*RouteUpdateOne) Mutation ¶
func (ruo *RouteUpdateOne) Mutation() *RouteMutation
Mutation returns the RouteMutation object of the builder.
func (*RouteUpdateOne) Save ¶
func (ruo *RouteUpdateOne) Save(ctx context.Context) (*Route, error)
Save executes the query and returns the updated Route entity.
func (*RouteUpdateOne) SaveX ¶
func (ruo *RouteUpdateOne) SaveX(ctx context.Context) *Route
SaveX is like Save, but panics if an error occurs.
func (*RouteUpdateOne) Select ¶
func (ruo *RouteUpdateOne) Select(field string, fields ...string) *RouteUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*RouteUpdateOne) SetAirlineId ¶
func (ruo *RouteUpdateOne) SetAirlineId(i int) *RouteUpdateOne
SetAirlineId sets the "airlineId" field.
func (*RouteUpdateOne) SetDestinationAirportId ¶
func (ruo *RouteUpdateOne) SetDestinationAirportId(i int) *RouteUpdateOne
SetDestinationAirportId sets the "destinationAirportId" field.
func (*RouteUpdateOne) SetNumberOfStops ¶
func (ruo *RouteUpdateOne) SetNumberOfStops(i int) *RouteUpdateOne
SetNumberOfStops sets the "numberOfStops" field.
func (*RouteUpdateOne) SetPlaneId ¶
func (ruo *RouteUpdateOne) SetPlaneId(i int) *RouteUpdateOne
SetPlaneId sets the "planeId" field.
func (*RouteUpdateOne) SetSourceAirportId ¶
func (ruo *RouteUpdateOne) SetSourceAirportId(i int) *RouteUpdateOne
SetSourceAirportId sets the "sourceAirportId" field.
func (*RouteUpdateOne) Where ¶
func (ruo *RouteUpdateOne) Where(ps ...predicate.Route) *RouteUpdateOne
Where appends a list predicates to the RouteUpdate builder.
type TraverseFunc ¶
type TraverseFunc = ent.TraverseFunc
ent aliases to avoid import conflicts in user's code.
type Tx ¶
type Tx struct { // Airline is the client for interacting with the Airline builders. Airline *AirlineClient // Airport is the client for interacting with the Airport builders. Airport *AirportClient // Plane is the client for interacting with the Plane builders. Plane *PlaneClient // Route is the client for interacting with the Route builders. Route *RouteClient // 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 ¶
- airline.go
- airline_create.go
- airline_delete.go
- airline_query.go
- airline_update.go
- airport.go
- airport_create.go
- airport_delete.go
- airport_query.go
- airport_update.go
- client.go
- ent.go
- generate.go
- mutation.go
- plane.go
- plane_create.go
- plane_delete.go
- plane_query.go
- plane_update.go
- route.go
- route_create.go
- route_delete.go
- route_query.go
- route_update.go
- runtime.go
- tx.go