ent

package
v0.0.0-...-2ed13ab Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 13, 2022 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Operation types.
	OpCreate    = ent.OpCreate
	OpDelete    = ent.OpDelete
	OpDeleteOne = ent.OpDeleteOne
	OpUpdate    = ent.OpUpdate
	OpUpdateOne = ent.OpUpdateOne

	// Node types.
	TypeApp             = "App"
	TypeHome            = "Home"
	TypeHomeConnection  = "HomeConnection"
	TypeRoom            = "Room"
	TypeRoomConnection  = "RoomConnection"
	TypeThing           = "Thing"
	TypeThingConnection = "ThingConnection"
	TypeUser            = "User"
)

Variables

This section is empty.

Functions

func IsConstraintError

func IsConstraintError(err error) bool

IsConstraintError returns a boolean indicating whether the error is a constraint failure.

func IsNotFound

func IsNotFound(err error) bool

IsNotFound returns a boolean indicating whether the error is a not found error.

func IsNotLoaded

func IsNotLoaded(err error) bool

IsNotLoaded returns a boolean indicating whether the error is a not loaded error.

func IsNotSingular

func IsNotSingular(err error) bool

IsNotSingular returns a boolean indicating whether the error is a not singular error.

func IsValidationError

func IsValidationError(err error) bool

IsValidationError returns a boolean indicating whether the error is a validation error.

func MaskNotFound

func MaskNotFound(err error) error

MaskNotFound masks not found error.

func NewContext

func NewContext(parent context.Context, c *Client) context.Context

NewContext returns a new context with the given Client attached.

func NewTxContext

func NewTxContext(parent context.Context, tx *Tx) context.Context

NewTxContext returns a new context with the given Tx attached.

Types

type AggregateFunc

type AggregateFunc func(*sql.Selector) string

AggregateFunc applies an aggregation step on the group-by traversal/selector.

func As

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 App

type App struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// UUID holds the value of the "uuid" field.
	UUID uuid.UUID `json:"uuid,omitempty"`
	// Name holds the value of the "name" field.
	Name string `json:"name,omitempty"`
	// SecretKey holds the value of the "secret_key" field.
	SecretKey uuid.UUID `json:"secret_key,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the AppQuery when eager-loading is set.
	Edges AppEdges `json:"edges"`
	// contains filtered or unexported fields
}

App is the model entity for the App schema.

func (*App) QueryUser

func (a *App) QueryUser() *UserQuery

QueryUser queries the "user" edge of the App entity.

func (*App) String

func (a *App) String() string

String implements the fmt.Stringer.

func (*App) Unwrap

func (a *App) Unwrap() *App

Unwrap unwraps the App 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 (*App) Update

func (a *App) Update() *AppUpdateOne

Update returns a builder for updating this App. Note that you need to call App.Unwrap() before calling this method if this App was returned from a transaction, and the transaction was committed or rolled back.

type AppClient

type AppClient struct {
	// contains filtered or unexported fields
}

AppClient is a client for the App schema.

func NewAppClient

func NewAppClient(c config) *AppClient

NewAppClient returns a client for the App from the given config.

func (*AppClient) Create

func (c *AppClient) Create() *AppCreate

Create returns a create builder for App.

func (*AppClient) CreateBulk

func (c *AppClient) CreateBulk(builders ...*AppCreate) *AppCreateBulk

CreateBulk returns a builder for creating a bulk of App entities.

func (*AppClient) Delete

func (c *AppClient) Delete() *AppDelete

Delete returns a delete builder for App.

func (*AppClient) DeleteOne

func (c *AppClient) DeleteOne(a *App) *AppDeleteOne

DeleteOne returns a delete builder for the given entity.

func (*AppClient) DeleteOneID

func (c *AppClient) DeleteOneID(id int) *AppDeleteOne

DeleteOneID returns a delete builder for the given id.

func (*AppClient) Get

func (c *AppClient) Get(ctx context.Context, id int) (*App, error)

Get returns a App entity by its id.

func (*AppClient) GetX

func (c *AppClient) GetX(ctx context.Context, id int) *App

GetX is like Get, but panics if an error occurs.

func (*AppClient) Hooks

func (c *AppClient) Hooks() []Hook

Hooks returns the client hooks.

func (*AppClient) Query

func (c *AppClient) Query() *AppQuery

Query returns a query builder for App.

func (*AppClient) QueryUser

func (c *AppClient) QueryUser(a *App) *UserQuery

QueryUser queries the user edge of a App.

func (*AppClient) Update

func (c *AppClient) Update() *AppUpdate

Update returns an update builder for App.

func (*AppClient) UpdateOne

func (c *AppClient) UpdateOne(a *App) *AppUpdateOne

UpdateOne returns an update builder for the given entity.

func (*AppClient) UpdateOneID

func (c *AppClient) UpdateOneID(id int) *AppUpdateOne

UpdateOneID returns an update builder for the given id.

func (*AppClient) Use

func (c *AppClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `app.Hooks(f(g(h())))`.

type AppCreate

type AppCreate struct {
	// contains filtered or unexported fields
}

AppCreate is the builder for creating a App entity.

func (*AppCreate) Exec

func (ac *AppCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*AppCreate) ExecX

func (ac *AppCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*AppCreate) Mutation

func (ac *AppCreate) Mutation() *AppMutation

Mutation returns the AppMutation object of the builder.

func (*AppCreate) Save

func (ac *AppCreate) Save(ctx context.Context) (*App, error)

Save creates the App in the database.

func (*AppCreate) SaveX

func (ac *AppCreate) SaveX(ctx context.Context) *App

SaveX calls Save and panics if Save returns an error.

func (*AppCreate) SetName

func (ac *AppCreate) SetName(s string) *AppCreate

SetName sets the "name" field.

func (*AppCreate) SetSecretKey

func (ac *AppCreate) SetSecretKey(u uuid.UUID) *AppCreate

SetSecretKey sets the "secret_key" field.

func (*AppCreate) SetUUID

func (ac *AppCreate) SetUUID(u uuid.UUID) *AppCreate

SetUUID sets the "uuid" field.

func (*AppCreate) SetUser

func (ac *AppCreate) SetUser(u *User) *AppCreate

SetUser sets the "user" edge to the User entity.

func (*AppCreate) SetUserID

func (ac *AppCreate) SetUserID(id int) *AppCreate

SetUserID sets the "user" edge to the User entity by ID.

type AppCreateBulk

type AppCreateBulk struct {
	// contains filtered or unexported fields
}

AppCreateBulk is the builder for creating many App entities in bulk.

func (*AppCreateBulk) Exec

func (acb *AppCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*AppCreateBulk) ExecX

func (acb *AppCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*AppCreateBulk) Save

func (acb *AppCreateBulk) Save(ctx context.Context) ([]*App, error)

Save creates the App entities in the database.

func (*AppCreateBulk) SaveX

func (acb *AppCreateBulk) SaveX(ctx context.Context) []*App

SaveX is like Save, but panics if an error occurs.

type AppDelete

type AppDelete struct {
	// contains filtered or unexported fields
}

AppDelete is the builder for deleting a App entity.

func (*AppDelete) Exec

func (ad *AppDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*AppDelete) ExecX

func (ad *AppDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*AppDelete) Where

func (ad *AppDelete) Where(ps ...predicate.App) *AppDelete

Where appends a list predicates to the AppDelete builder.

type AppDeleteOne

type AppDeleteOne struct {
	// contains filtered or unexported fields
}

AppDeleteOne is the builder for deleting a single App entity.

func (*AppDeleteOne) Exec

func (ado *AppDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*AppDeleteOne) ExecX

func (ado *AppDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

type AppEdges

type AppEdges struct {
	// User holds the value of the user edge.
	User *User `json:"user,omitempty"`
	// contains filtered or unexported fields
}

AppEdges holds the relations/edges for other nodes in the graph.

func (AppEdges) UserOrErr

func (e AppEdges) UserOrErr() (*User, error)

UserOrErr returns the User value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

type AppGroupBy

type AppGroupBy struct {
	// contains filtered or unexported fields
}

AppGroupBy is the group-by builder for App entities.

func (*AppGroupBy) Aggregate

func (agb *AppGroupBy) Aggregate(fns ...AggregateFunc) *AppGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*AppGroupBy) Bool

func (agb *AppGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a group-by query. It is only allowed when executing a group-by query with one field.

func (*AppGroupBy) BoolX

func (agb *AppGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*AppGroupBy) Bools

func (agb *AppGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from group-by. It is only allowed when executing a group-by query with one field.

func (*AppGroupBy) BoolsX

func (agb *AppGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*AppGroupBy) Float64

func (agb *AppGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a group-by query. It is only allowed when executing a group-by query with one field.

func (*AppGroupBy) Float64X

func (agb *AppGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*AppGroupBy) Float64s

func (agb *AppGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from group-by. It is only allowed when executing a group-by query with one field.

func (*AppGroupBy) Float64sX

func (agb *AppGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*AppGroupBy) Int

func (agb *AppGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a group-by query. It is only allowed when executing a group-by query with one field.

func (*AppGroupBy) IntX

func (agb *AppGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*AppGroupBy) Ints

func (agb *AppGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from group-by. It is only allowed when executing a group-by query with one field.

func (*AppGroupBy) IntsX

func (agb *AppGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*AppGroupBy) Scan

func (agb *AppGroupBy) Scan(ctx context.Context, v interface{}) error

Scan applies the group-by query and scans the result into the given value.

func (*AppGroupBy) ScanX

func (agb *AppGroupBy) ScanX(ctx context.Context, v interface{})

ScanX is like Scan, but panics if an error occurs.

func (*AppGroupBy) String

func (agb *AppGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a group-by query. It is only allowed when executing a group-by query with one field.

func (*AppGroupBy) StringX

func (agb *AppGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*AppGroupBy) Strings

func (agb *AppGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from group-by. It is only allowed when executing a group-by query with one field.

func (*AppGroupBy) StringsX

func (agb *AppGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type AppMutation

type AppMutation struct {
	// contains filtered or unexported fields
}

AppMutation represents an operation that mutates the App nodes in the graph.

func (*AppMutation) AddField

func (m *AppMutation) 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 (*AppMutation) AddedEdges

func (m *AppMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*AppMutation) AddedField

func (m *AppMutation) 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 (*AppMutation) AddedFields

func (m *AppMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*AppMutation) AddedIDs

func (m *AppMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*AppMutation) ClearEdge

func (m *AppMutation) 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 (*AppMutation) ClearField

func (m *AppMutation) 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 (*AppMutation) ClearUser

func (m *AppMutation) ClearUser()

ClearUser clears the "user" edge to the User entity.

func (*AppMutation) ClearedEdges

func (m *AppMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*AppMutation) ClearedFields

func (m *AppMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (AppMutation) Client

func (m AppMutation) 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 (*AppMutation) EdgeCleared

func (m *AppMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*AppMutation) Field

func (m *AppMutation) 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 (*AppMutation) FieldCleared

func (m *AppMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*AppMutation) Fields

func (m *AppMutation) 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 (*AppMutation) ID

func (m *AppMutation) 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 (*AppMutation) Name

func (m *AppMutation) Name() (r string, exists bool)

Name returns the value of the "name" field in the mutation.

func (*AppMutation) OldField

func (m *AppMutation) OldField(ctx context.Context, name string) (ent.Value, error)

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 (*AppMutation) OldName

func (m *AppMutation) OldName(ctx context.Context) (v string, err error)

OldName returns the old "name" field's value of the App entity. If the App 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 (*AppMutation) OldSecretKey

func (m *AppMutation) OldSecretKey(ctx context.Context) (v uuid.UUID, err error)

OldSecretKey returns the old "secret_key" field's value of the App entity. If the App 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 (*AppMutation) OldUUID

func (m *AppMutation) OldUUID(ctx context.Context) (v uuid.UUID, err error)

OldUUID returns the old "uuid" field's value of the App entity. If the App 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 (*AppMutation) Op

func (m *AppMutation) Op() Op

Op returns the operation name.

func (*AppMutation) RemovedEdges

func (m *AppMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*AppMutation) RemovedIDs

func (m *AppMutation) 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 (*AppMutation) ResetEdge

func (m *AppMutation) 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 (*AppMutation) ResetField

func (m *AppMutation) 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 (*AppMutation) ResetName

func (m *AppMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*AppMutation) ResetSecretKey

func (m *AppMutation) ResetSecretKey()

ResetSecretKey resets all changes to the "secret_key" field.

func (*AppMutation) ResetUUID

func (m *AppMutation) ResetUUID()

ResetUUID resets all changes to the "uuid" field.

func (*AppMutation) ResetUser

func (m *AppMutation) ResetUser()

ResetUser resets all changes to the "user" edge.

func (*AppMutation) SecretKey

func (m *AppMutation) SecretKey() (r uuid.UUID, exists bool)

SecretKey returns the value of the "secret_key" field in the mutation.

func (*AppMutation) SetField

func (m *AppMutation) 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 (*AppMutation) SetName

func (m *AppMutation) SetName(s string)

SetName sets the "name" field.

func (*AppMutation) SetSecretKey

func (m *AppMutation) SetSecretKey(u uuid.UUID)

SetSecretKey sets the "secret_key" field.

func (*AppMutation) SetUUID

func (m *AppMutation) SetUUID(u uuid.UUID)

SetUUID sets the "uuid" field.

func (*AppMutation) SetUserID

func (m *AppMutation) SetUserID(id int)

SetUserID sets the "user" edge to the User entity by id.

func (AppMutation) Tx

func (m AppMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*AppMutation) Type

func (m *AppMutation) Type() string

Type returns the node type of this mutation (App).

func (*AppMutation) UUID

func (m *AppMutation) UUID() (r uuid.UUID, exists bool)

UUID returns the value of the "uuid" field in the mutation.

func (*AppMutation) UserCleared

func (m *AppMutation) UserCleared() bool

UserCleared reports if the "user" edge to the User entity was cleared.

func (*AppMutation) UserID

func (m *AppMutation) UserID() (id int, exists bool)

UserID returns the "user" edge ID in the mutation.

func (*AppMutation) UserIDs

func (m *AppMutation) UserIDs() (ids []int)

UserIDs returns the "user" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use UserID instead. It exists only for internal usage by the builders.

func (*AppMutation) Where

func (m *AppMutation) Where(ps ...predicate.App)

Where appends a list predicates to the AppMutation builder.

type AppQuery

type AppQuery struct {
	// contains filtered or unexported fields
}

AppQuery is the builder for querying App entities.

func (*AppQuery) All

func (aq *AppQuery) All(ctx context.Context) ([]*App, error)

All executes the query and returns a list of Apps.

func (*AppQuery) AllX

func (aq *AppQuery) AllX(ctx context.Context) []*App

AllX is like All, but panics if an error occurs.

func (*AppQuery) Clone

func (aq *AppQuery) Clone() *AppQuery

Clone returns a duplicate of the AppQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*AppQuery) Count

func (aq *AppQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*AppQuery) CountX

func (aq *AppQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*AppQuery) Exist

func (aq *AppQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*AppQuery) ExistX

func (aq *AppQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*AppQuery) First

func (aq *AppQuery) First(ctx context.Context) (*App, error)

First returns the first App entity from the query. Returns a *NotFoundError when no App was found.

func (*AppQuery) FirstID

func (aq *AppQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first App ID from the query. Returns a *NotFoundError when no App ID was found.

func (*AppQuery) FirstIDX

func (aq *AppQuery) FirstIDX(ctx context.Context) int

FirstIDX is like FirstID, but panics if an error occurs.

func (*AppQuery) FirstX

func (aq *AppQuery) FirstX(ctx context.Context) *App

FirstX is like First, but panics if an error occurs.

func (*AppQuery) GroupBy

func (aq *AppQuery) GroupBy(field string, fields ...string) *AppGroupBy

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 {
	UUID uuid.UUID `json:"uuid,omitempty"`
	Count int `json:"count,omitempty"`
}

client.App.Query().
	GroupBy(app.FieldUUID).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*AppQuery) IDs

func (aq *AppQuery) IDs(ctx context.Context) ([]int, error)

IDs executes the query and returns a list of App IDs.

func (*AppQuery) IDsX

func (aq *AppQuery) IDsX(ctx context.Context) []int

IDsX is like IDs, but panics if an error occurs.

func (*AppQuery) Limit

func (aq *AppQuery) Limit(limit int) *AppQuery

Limit adds a limit step to the query.

func (*AppQuery) Offset

func (aq *AppQuery) Offset(offset int) *AppQuery

Offset adds an offset step to the query.

func (*AppQuery) Only

func (aq *AppQuery) Only(ctx context.Context) (*App, error)

Only returns a single App entity found by the query, ensuring it only returns one. Returns a *NotSingularError when exactly one App entity is not found. Returns a *NotFoundError when no App entities are found.

func (*AppQuery) OnlyID

func (aq *AppQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID is like Only, but returns the only App ID in the query. Returns a *NotSingularError when exactly one App ID is not found. Returns a *NotFoundError when no entities are found.

func (*AppQuery) OnlyIDX

func (aq *AppQuery) OnlyIDX(ctx context.Context) int

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*AppQuery) OnlyX

func (aq *AppQuery) OnlyX(ctx context.Context) *App

OnlyX is like Only, but panics if an error occurs.

func (*AppQuery) Order

func (aq *AppQuery) Order(o ...OrderFunc) *AppQuery

Order adds an order step to the query.

func (*AppQuery) QueryUser

func (aq *AppQuery) QueryUser() *UserQuery

QueryUser chains the current query on the "user" edge.

func (*AppQuery) Select

func (aq *AppQuery) Select(fields ...string) *AppSelect

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 {
	UUID uuid.UUID `json:"uuid,omitempty"`
}

client.App.Query().
	Select(app.FieldUUID).
	Scan(ctx, &v)

func (*AppQuery) Unique

func (aq *AppQuery) Unique(unique bool) *AppQuery

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 (*AppQuery) Where

func (aq *AppQuery) Where(ps ...predicate.App) *AppQuery

Where adds a new predicate for the AppQuery builder.

func (*AppQuery) WithUser

func (aq *AppQuery) WithUser(opts ...func(*UserQuery)) *AppQuery

WithUser tells the query-builder to eager-load the nodes that are connected to the "user" edge. The optional arguments are used to configure the query builder of the edge.

type AppSelect

type AppSelect struct {
	*AppQuery
	// contains filtered or unexported fields
}

AppSelect is the builder for selecting fields of App entities.

func (*AppSelect) Bool

func (as *AppSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*AppSelect) BoolX

func (as *AppSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*AppSelect) Bools

func (as *AppSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*AppSelect) BoolsX

func (as *AppSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*AppSelect) Float64

func (as *AppSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*AppSelect) Float64X

func (as *AppSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*AppSelect) Float64s

func (as *AppSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*AppSelect) Float64sX

func (as *AppSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*AppSelect) Int

func (as *AppSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*AppSelect) IntX

func (as *AppSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*AppSelect) Ints

func (as *AppSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*AppSelect) IntsX

func (as *AppSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*AppSelect) Scan

func (as *AppSelect) Scan(ctx context.Context, v interface{}) error

Scan applies the selector query and scans the result into the given value.

func (*AppSelect) ScanX

func (as *AppSelect) ScanX(ctx context.Context, v interface{})

ScanX is like Scan, but panics if an error occurs.

func (*AppSelect) String

func (as *AppSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*AppSelect) StringX

func (as *AppSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*AppSelect) Strings

func (as *AppSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*AppSelect) StringsX

func (as *AppSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type AppUpdate

type AppUpdate struct {
	// contains filtered or unexported fields
}

AppUpdate is the builder for updating App entities.

func (*AppUpdate) ClearUser

func (au *AppUpdate) ClearUser() *AppUpdate

ClearUser clears the "user" edge to the User entity.

func (*AppUpdate) Exec

func (au *AppUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*AppUpdate) ExecX

func (au *AppUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*AppUpdate) Mutation

func (au *AppUpdate) Mutation() *AppMutation

Mutation returns the AppMutation object of the builder.

func (*AppUpdate) Save

func (au *AppUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*AppUpdate) SaveX

func (au *AppUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*AppUpdate) SetName

func (au *AppUpdate) SetName(s string) *AppUpdate

SetName sets the "name" field.

func (*AppUpdate) SetSecretKey

func (au *AppUpdate) SetSecretKey(u uuid.UUID) *AppUpdate

SetSecretKey sets the "secret_key" field.

func (*AppUpdate) SetUser

func (au *AppUpdate) SetUser(u *User) *AppUpdate

SetUser sets the "user" edge to the User entity.

func (*AppUpdate) SetUserID

func (au *AppUpdate) SetUserID(id int) *AppUpdate

SetUserID sets the "user" edge to the User entity by ID.

func (*AppUpdate) Where

func (au *AppUpdate) Where(ps ...predicate.App) *AppUpdate

Where appends a list predicates to the AppUpdate builder.

type AppUpdateOne

type AppUpdateOne struct {
	// contains filtered or unexported fields
}

AppUpdateOne is the builder for updating a single App entity.

func (*AppUpdateOne) ClearUser

func (auo *AppUpdateOne) ClearUser() *AppUpdateOne

ClearUser clears the "user" edge to the User entity.

func (*AppUpdateOne) Exec

func (auo *AppUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*AppUpdateOne) ExecX

func (auo *AppUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*AppUpdateOne) Mutation

func (auo *AppUpdateOne) Mutation() *AppMutation

Mutation returns the AppMutation object of the builder.

func (*AppUpdateOne) Save

func (auo *AppUpdateOne) Save(ctx context.Context) (*App, error)

Save executes the query and returns the updated App entity.

func (*AppUpdateOne) SaveX

func (auo *AppUpdateOne) SaveX(ctx context.Context) *App

SaveX is like Save, but panics if an error occurs.

func (*AppUpdateOne) Select

func (auo *AppUpdateOne) Select(field string, fields ...string) *AppUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*AppUpdateOne) SetName

func (auo *AppUpdateOne) SetName(s string) *AppUpdateOne

SetName sets the "name" field.

func (*AppUpdateOne) SetSecretKey

func (auo *AppUpdateOne) SetSecretKey(u uuid.UUID) *AppUpdateOne

SetSecretKey sets the "secret_key" field.

func (*AppUpdateOne) SetUser

func (auo *AppUpdateOne) SetUser(u *User) *AppUpdateOne

SetUser sets the "user" edge to the User entity.

func (*AppUpdateOne) SetUserID

func (auo *AppUpdateOne) SetUserID(id int) *AppUpdateOne

SetUserID sets the "user" edge to the User entity by ID.

type Apps

type Apps []*App

Apps is a parsable slice of App.

type Client

type Client struct {

	// Schema is the client for creating, migrating and dropping schema.
	Schema *migrate.Schema
	// App is the client for interacting with the App builders.
	App *AppClient
	// Home is the client for interacting with the Home builders.
	Home *HomeClient
	// HomeConnection is the client for interacting with the HomeConnection builders.
	HomeConnection *HomeConnectionClient
	// Room is the client for interacting with the Room builders.
	Room *RoomClient
	// RoomConnection is the client for interacting with the RoomConnection builders.
	RoomConnection *RoomConnectionClient
	// Thing is the client for interacting with the Thing builders.
	Thing *ThingClient
	// ThingConnection is the client for interacting with the ThingConnection builders.
	ThingConnection *ThingConnectionClient
	// User is the client for interacting with the User builders.
	User *UserClient
	// contains filtered or unexported fields
}

Client is the client that holds all ent builders.

func FromContext

func FromContext(ctx context.Context) *Client

FromContext returns a Client stored inside a context, or nil if there isn't one.

func NewClient

func NewClient(opts ...Option) *Client

NewClient creates a new client configured with the given options.

func Open

func Open(driverName, dataSourceName string, options ...Option) (*Client, error)

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) BeginTx

func (c *Client) BeginTx(ctx context.Context, opts *sql.TxOptions) (*Tx, error)

BeginTx returns a transactional client with specified options.

func (*Client) Close

func (c *Client) Close() error

Close closes the database connection and prevents new queries from starting.

func (*Client) Debug

func (c *Client) Debug() *Client

Debug returns a new debug-client. It's used to get verbose logging on specific operations.

client.Debug().
	App.
	Query().
	Count(ctx)

func (*Client) Tx

func (c *Client) Tx(ctx context.Context) (*Tx, error)

Tx returns a new transactional client. The provided context is used until the transaction is committed or rolled back.

func (*Client) Use

func (c *Client) Use(hooks ...Hook)

Use adds the mutation hooks to all the entity clients. In order to add hooks to a specific client, call: `client.Node.Use(...)`.

type CommitFunc

type CommitFunc func(context.Context, *Tx) error

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.

func (CommitFunc) Commit

func (f CommitFunc) Commit(ctx context.Context, tx *Tx) error

Commit calls f(ctx, m).

type CommitHook

type CommitHook func(Committer) Committer

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(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 Committer

type Committer interface {
	Commit(context.Context, *Tx) error
}

Committer is the interface that wraps the Committer method.

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 Home

type Home struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// UUID holds the value of the "uuid" field.
	UUID uuid.UUID `json:"uuid,omitempty"`
	// Name holds the value of the "name" field.
	Name string `json:"name,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the HomeQuery when eager-loading is set.
	Edges HomeEdges `json:"edges"`
	// contains filtered or unexported fields
}

Home is the model entity for the Home schema.

func (*Home) QueryRooms

func (h *Home) QueryRooms() *RoomQuery

QueryRooms queries the "rooms" edge of the Home entity.

func (*Home) String

func (h *Home) String() string

String implements the fmt.Stringer.

func (*Home) Unwrap

func (h *Home) Unwrap() *Home

Unwrap unwraps the Home 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 (*Home) Update

func (h *Home) Update() *HomeUpdateOne

Update returns a builder for updating this Home. Note that you need to call Home.Unwrap() before calling this method if this Home was returned from a transaction, and the transaction was committed or rolled back.

type HomeClient

type HomeClient struct {
	// contains filtered or unexported fields
}

HomeClient is a client for the Home schema.

func NewHomeClient

func NewHomeClient(c config) *HomeClient

NewHomeClient returns a client for the Home from the given config.

func (*HomeClient) Create

func (c *HomeClient) Create() *HomeCreate

Create returns a create builder for Home.

func (*HomeClient) CreateBulk

func (c *HomeClient) CreateBulk(builders ...*HomeCreate) *HomeCreateBulk

CreateBulk returns a builder for creating a bulk of Home entities.

func (*HomeClient) Delete

func (c *HomeClient) Delete() *HomeDelete

Delete returns a delete builder for Home.

func (*HomeClient) DeleteOne

func (c *HomeClient) DeleteOne(h *Home) *HomeDeleteOne

DeleteOne returns a delete builder for the given entity.

func (*HomeClient) DeleteOneID

func (c *HomeClient) DeleteOneID(id int) *HomeDeleteOne

DeleteOneID returns a delete builder for the given id.

func (*HomeClient) Get

func (c *HomeClient) Get(ctx context.Context, id int) (*Home, error)

Get returns a Home entity by its id.

func (*HomeClient) GetX

func (c *HomeClient) GetX(ctx context.Context, id int) *Home

GetX is like Get, but panics if an error occurs.

func (*HomeClient) Hooks

func (c *HomeClient) Hooks() []Hook

Hooks returns the client hooks.

func (*HomeClient) Query

func (c *HomeClient) Query() *HomeQuery

Query returns a query builder for Home.

func (*HomeClient) QueryRooms

func (c *HomeClient) QueryRooms(h *Home) *RoomQuery

QueryRooms queries the rooms edge of a Home.

func (*HomeClient) Update

func (c *HomeClient) Update() *HomeUpdate

Update returns an update builder for Home.

func (*HomeClient) UpdateOne

func (c *HomeClient) UpdateOne(h *Home) *HomeUpdateOne

UpdateOne returns an update builder for the given entity.

func (*HomeClient) UpdateOneID

func (c *HomeClient) UpdateOneID(id int) *HomeUpdateOne

UpdateOneID returns an update builder for the given id.

func (*HomeClient) Use

func (c *HomeClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `home.Hooks(f(g(h())))`.

type HomeConnection

type HomeConnection struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// StartTime holds the value of the "start_time" field.
	StartTime string `json:"start_time,omitempty"`
	// EndTime holds the value of the "end_time" field.
	EndTime string `json:"end_time,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the HomeConnectionQuery when eager-loading is set.
	Edges HomeConnectionEdges `json:"edges"`
	// contains filtered or unexported fields
}

HomeConnection is the model entity for the HomeConnection schema.

func (*HomeConnection) QueryHome

func (hc *HomeConnection) QueryHome() *HomeQuery

QueryHome queries the "home" edge of the HomeConnection entity.

func (*HomeConnection) QueryUser

func (hc *HomeConnection) QueryUser() *UserQuery

QueryUser queries the "user" edge of the HomeConnection entity.

func (*HomeConnection) String

func (hc *HomeConnection) String() string

String implements the fmt.Stringer.

func (*HomeConnection) Unwrap

func (hc *HomeConnection) Unwrap() *HomeConnection

Unwrap unwraps the HomeConnection 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 (*HomeConnection) Update

Update returns a builder for updating this HomeConnection. Note that you need to call HomeConnection.Unwrap() before calling this method if this HomeConnection was returned from a transaction, and the transaction was committed or rolled back.

type HomeConnectionClient

type HomeConnectionClient struct {
	// contains filtered or unexported fields
}

HomeConnectionClient is a client for the HomeConnection schema.

func NewHomeConnectionClient

func NewHomeConnectionClient(c config) *HomeConnectionClient

NewHomeConnectionClient returns a client for the HomeConnection from the given config.

func (*HomeConnectionClient) Create

Create returns a create builder for HomeConnection.

func (*HomeConnectionClient) CreateBulk

CreateBulk returns a builder for creating a bulk of HomeConnection entities.

func (*HomeConnectionClient) Delete

Delete returns a delete builder for HomeConnection.

func (*HomeConnectionClient) DeleteOne

DeleteOne returns a delete builder for the given entity.

func (*HomeConnectionClient) DeleteOneID

func (c *HomeConnectionClient) DeleteOneID(id int) *HomeConnectionDeleteOne

DeleteOneID returns a delete builder for the given id.

func (*HomeConnectionClient) Get

Get returns a HomeConnection entity by its id.

func (*HomeConnectionClient) GetX

GetX is like Get, but panics if an error occurs.

func (*HomeConnectionClient) Hooks

func (c *HomeConnectionClient) Hooks() []Hook

Hooks returns the client hooks.

func (*HomeConnectionClient) Query

Query returns a query builder for HomeConnection.

func (*HomeConnectionClient) QueryHome

func (c *HomeConnectionClient) QueryHome(hc *HomeConnection) *HomeQuery

QueryHome queries the home edge of a HomeConnection.

func (*HomeConnectionClient) QueryUser

func (c *HomeConnectionClient) QueryUser(hc *HomeConnection) *UserQuery

QueryUser queries the user edge of a HomeConnection.

func (*HomeConnectionClient) Update

Update returns an update builder for HomeConnection.

func (*HomeConnectionClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*HomeConnectionClient) UpdateOneID

func (c *HomeConnectionClient) UpdateOneID(id int) *HomeConnectionUpdateOne

UpdateOneID returns an update builder for the given id.

func (*HomeConnectionClient) Use

func (c *HomeConnectionClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `homeconnection.Hooks(f(g(h())))`.

type HomeConnectionCreate

type HomeConnectionCreate struct {
	// contains filtered or unexported fields
}

HomeConnectionCreate is the builder for creating a HomeConnection entity.

func (*HomeConnectionCreate) Exec

func (hcc *HomeConnectionCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*HomeConnectionCreate) ExecX

func (hcc *HomeConnectionCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*HomeConnectionCreate) Mutation

Mutation returns the HomeConnectionMutation object of the builder.

func (*HomeConnectionCreate) Save

Save creates the HomeConnection in the database.

func (*HomeConnectionCreate) SaveX

SaveX calls Save and panics if Save returns an error.

func (*HomeConnectionCreate) SetEndTime

func (hcc *HomeConnectionCreate) SetEndTime(s string) *HomeConnectionCreate

SetEndTime sets the "end_time" field.

func (*HomeConnectionCreate) SetHome

SetHome sets the "home" edge to the Home entity.

func (*HomeConnectionCreate) SetHomeID

func (hcc *HomeConnectionCreate) SetHomeID(id int) *HomeConnectionCreate

SetHomeID sets the "home" edge to the Home entity by ID.

func (*HomeConnectionCreate) SetNillableEndTime

func (hcc *HomeConnectionCreate) SetNillableEndTime(s *string) *HomeConnectionCreate

SetNillableEndTime sets the "end_time" field if the given value is not nil.

func (*HomeConnectionCreate) SetNillableStartTime

func (hcc *HomeConnectionCreate) SetNillableStartTime(s *string) *HomeConnectionCreate

SetNillableStartTime sets the "start_time" field if the given value is not nil.

func (*HomeConnectionCreate) SetStartTime

func (hcc *HomeConnectionCreate) SetStartTime(s string) *HomeConnectionCreate

SetStartTime sets the "start_time" field.

func (*HomeConnectionCreate) SetUser

SetUser sets the "user" edge to the User entity.

func (*HomeConnectionCreate) SetUserID

func (hcc *HomeConnectionCreate) SetUserID(id int) *HomeConnectionCreate

SetUserID sets the "user" edge to the User entity by ID.

type HomeConnectionCreateBulk

type HomeConnectionCreateBulk struct {
	// contains filtered or unexported fields
}

HomeConnectionCreateBulk is the builder for creating many HomeConnection entities in bulk.

func (*HomeConnectionCreateBulk) Exec

Exec executes the query.

func (*HomeConnectionCreateBulk) ExecX

func (hccb *HomeConnectionCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*HomeConnectionCreateBulk) Save

Save creates the HomeConnection entities in the database.

func (*HomeConnectionCreateBulk) SaveX

SaveX is like Save, but panics if an error occurs.

type HomeConnectionDelete

type HomeConnectionDelete struct {
	// contains filtered or unexported fields
}

HomeConnectionDelete is the builder for deleting a HomeConnection entity.

func (*HomeConnectionDelete) Exec

func (hcd *HomeConnectionDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*HomeConnectionDelete) ExecX

func (hcd *HomeConnectionDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*HomeConnectionDelete) Where

Where appends a list predicates to the HomeConnectionDelete builder.

type HomeConnectionDeleteOne

type HomeConnectionDeleteOne struct {
	// contains filtered or unexported fields
}

HomeConnectionDeleteOne is the builder for deleting a single HomeConnection entity.

func (*HomeConnectionDeleteOne) Exec

func (hcdo *HomeConnectionDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*HomeConnectionDeleteOne) ExecX

func (hcdo *HomeConnectionDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

type HomeConnectionEdges

type HomeConnectionEdges struct {
	// User holds the value of the user edge.
	User *User `json:"user,omitempty"`
	// Home holds the value of the home edge.
	Home *Home `json:"home,omitempty"`
	// contains filtered or unexported fields
}

HomeConnectionEdges holds the relations/edges for other nodes in the graph.

func (HomeConnectionEdges) HomeOrErr

func (e HomeConnectionEdges) HomeOrErr() (*Home, error)

HomeOrErr returns the Home value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

func (HomeConnectionEdges) UserOrErr

func (e HomeConnectionEdges) UserOrErr() (*User, error)

UserOrErr returns the User value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

type HomeConnectionGroupBy

type HomeConnectionGroupBy struct {
	// contains filtered or unexported fields
}

HomeConnectionGroupBy is the group-by builder for HomeConnection entities.

func (*HomeConnectionGroupBy) Aggregate

Aggregate adds the given aggregation functions to the group-by query.

func (*HomeConnectionGroupBy) Bool

func (hcgb *HomeConnectionGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a group-by query. It is only allowed when executing a group-by query with one field.

func (*HomeConnectionGroupBy) BoolX

func (hcgb *HomeConnectionGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*HomeConnectionGroupBy) Bools

func (hcgb *HomeConnectionGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from group-by. It is only allowed when executing a group-by query with one field.

func (*HomeConnectionGroupBy) BoolsX

func (hcgb *HomeConnectionGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*HomeConnectionGroupBy) Float64

func (hcgb *HomeConnectionGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a group-by query. It is only allowed when executing a group-by query with one field.

func (*HomeConnectionGroupBy) Float64X

func (hcgb *HomeConnectionGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*HomeConnectionGroupBy) Float64s

func (hcgb *HomeConnectionGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from group-by. It is only allowed when executing a group-by query with one field.

func (*HomeConnectionGroupBy) Float64sX

func (hcgb *HomeConnectionGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*HomeConnectionGroupBy) Int

func (hcgb *HomeConnectionGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a group-by query. It is only allowed when executing a group-by query with one field.

func (*HomeConnectionGroupBy) IntX

func (hcgb *HomeConnectionGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*HomeConnectionGroupBy) Ints

func (hcgb *HomeConnectionGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from group-by. It is only allowed when executing a group-by query with one field.

func (*HomeConnectionGroupBy) IntsX

func (hcgb *HomeConnectionGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*HomeConnectionGroupBy) Scan

func (hcgb *HomeConnectionGroupBy) Scan(ctx context.Context, v interface{}) error

Scan applies the group-by query and scans the result into the given value.

func (*HomeConnectionGroupBy) ScanX

func (hcgb *HomeConnectionGroupBy) ScanX(ctx context.Context, v interface{})

ScanX is like Scan, but panics if an error occurs.

func (*HomeConnectionGroupBy) String

func (hcgb *HomeConnectionGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a group-by query. It is only allowed when executing a group-by query with one field.

func (*HomeConnectionGroupBy) StringX

func (hcgb *HomeConnectionGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*HomeConnectionGroupBy) Strings

func (hcgb *HomeConnectionGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from group-by. It is only allowed when executing a group-by query with one field.

func (*HomeConnectionGroupBy) StringsX

func (hcgb *HomeConnectionGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type HomeConnectionMutation

type HomeConnectionMutation struct {
	// contains filtered or unexported fields
}

HomeConnectionMutation represents an operation that mutates the HomeConnection nodes in the graph.

func (*HomeConnectionMutation) AddField

func (m *HomeConnectionMutation) 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 (*HomeConnectionMutation) AddedEdges

func (m *HomeConnectionMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*HomeConnectionMutation) AddedField

func (m *HomeConnectionMutation) 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 (*HomeConnectionMutation) AddedFields

func (m *HomeConnectionMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*HomeConnectionMutation) AddedIDs

func (m *HomeConnectionMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*HomeConnectionMutation) ClearEdge

func (m *HomeConnectionMutation) 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 (*HomeConnectionMutation) ClearField

func (m *HomeConnectionMutation) 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 (*HomeConnectionMutation) ClearHome

func (m *HomeConnectionMutation) ClearHome()

ClearHome clears the "home" edge to the Home entity.

func (*HomeConnectionMutation) ClearUser

func (m *HomeConnectionMutation) ClearUser()

ClearUser clears the "user" edge to the User entity.

func (*HomeConnectionMutation) ClearedEdges

func (m *HomeConnectionMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*HomeConnectionMutation) ClearedFields

func (m *HomeConnectionMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (HomeConnectionMutation) Client

func (m HomeConnectionMutation) 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 (*HomeConnectionMutation) EdgeCleared

func (m *HomeConnectionMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*HomeConnectionMutation) EndTime

func (m *HomeConnectionMutation) EndTime() (r string, exists bool)

EndTime returns the value of the "end_time" field in the mutation.

func (*HomeConnectionMutation) Field

func (m *HomeConnectionMutation) 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 (*HomeConnectionMutation) FieldCleared

func (m *HomeConnectionMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*HomeConnectionMutation) Fields

func (m *HomeConnectionMutation) 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 (*HomeConnectionMutation) HomeCleared

func (m *HomeConnectionMutation) HomeCleared() bool

HomeCleared reports if the "home" edge to the Home entity was cleared.

func (*HomeConnectionMutation) HomeID

func (m *HomeConnectionMutation) HomeID() (id int, exists bool)

HomeID returns the "home" edge ID in the mutation.

func (*HomeConnectionMutation) HomeIDs

func (m *HomeConnectionMutation) HomeIDs() (ids []int)

HomeIDs returns the "home" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use HomeID instead. It exists only for internal usage by the builders.

func (*HomeConnectionMutation) ID

func (m *HomeConnectionMutation) 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 (*HomeConnectionMutation) OldEndTime

func (m *HomeConnectionMutation) OldEndTime(ctx context.Context) (v string, err error)

OldEndTime returns the old "end_time" field's value of the HomeConnection entity. If the HomeConnection 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 (*HomeConnectionMutation) OldField

func (m *HomeConnectionMutation) OldField(ctx context.Context, name string) (ent.Value, error)

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 (*HomeConnectionMutation) OldStartTime

func (m *HomeConnectionMutation) OldStartTime(ctx context.Context) (v string, err error)

OldStartTime returns the old "start_time" field's value of the HomeConnection entity. If the HomeConnection 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 (*HomeConnectionMutation) Op

func (m *HomeConnectionMutation) Op() Op

Op returns the operation name.

func (*HomeConnectionMutation) RemovedEdges

func (m *HomeConnectionMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*HomeConnectionMutation) RemovedIDs

func (m *HomeConnectionMutation) 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 (*HomeConnectionMutation) ResetEdge

func (m *HomeConnectionMutation) 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 (*HomeConnectionMutation) ResetEndTime

func (m *HomeConnectionMutation) ResetEndTime()

ResetEndTime resets all changes to the "end_time" field.

func (*HomeConnectionMutation) ResetField

func (m *HomeConnectionMutation) 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 (*HomeConnectionMutation) ResetHome

func (m *HomeConnectionMutation) ResetHome()

ResetHome resets all changes to the "home" edge.

func (*HomeConnectionMutation) ResetStartTime

func (m *HomeConnectionMutation) ResetStartTime()

ResetStartTime resets all changes to the "start_time" field.

func (*HomeConnectionMutation) ResetUser

func (m *HomeConnectionMutation) ResetUser()

ResetUser resets all changes to the "user" edge.

func (*HomeConnectionMutation) SetEndTime

func (m *HomeConnectionMutation) SetEndTime(s string)

SetEndTime sets the "end_time" field.

func (*HomeConnectionMutation) SetField

func (m *HomeConnectionMutation) 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 (*HomeConnectionMutation) SetHomeID

func (m *HomeConnectionMutation) SetHomeID(id int)

SetHomeID sets the "home" edge to the Home entity by id.

func (*HomeConnectionMutation) SetStartTime

func (m *HomeConnectionMutation) SetStartTime(s string)

SetStartTime sets the "start_time" field.

func (*HomeConnectionMutation) SetUserID

func (m *HomeConnectionMutation) SetUserID(id int)

SetUserID sets the "user" edge to the User entity by id.

func (*HomeConnectionMutation) StartTime

func (m *HomeConnectionMutation) StartTime() (r string, exists bool)

StartTime returns the value of the "start_time" field in the mutation.

func (HomeConnectionMutation) Tx

func (m HomeConnectionMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*HomeConnectionMutation) Type

func (m *HomeConnectionMutation) Type() string

Type returns the node type of this mutation (HomeConnection).

func (*HomeConnectionMutation) UserCleared

func (m *HomeConnectionMutation) UserCleared() bool

UserCleared reports if the "user" edge to the User entity was cleared.

func (*HomeConnectionMutation) UserID

func (m *HomeConnectionMutation) UserID() (id int, exists bool)

UserID returns the "user" edge ID in the mutation.

func (*HomeConnectionMutation) UserIDs

func (m *HomeConnectionMutation) UserIDs() (ids []int)

UserIDs returns the "user" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use UserID instead. It exists only for internal usage by the builders.

func (*HomeConnectionMutation) Where

Where appends a list predicates to the HomeConnectionMutation builder.

type HomeConnectionQuery

type HomeConnectionQuery struct {
	// contains filtered or unexported fields
}

HomeConnectionQuery is the builder for querying HomeConnection entities.

func (*HomeConnectionQuery) All

All executes the query and returns a list of HomeConnections.

func (*HomeConnectionQuery) AllX

AllX is like All, but panics if an error occurs.

func (*HomeConnectionQuery) Clone

Clone returns a duplicate of the HomeConnectionQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*HomeConnectionQuery) Count

func (hcq *HomeConnectionQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*HomeConnectionQuery) CountX

func (hcq *HomeConnectionQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*HomeConnectionQuery) Exist

func (hcq *HomeConnectionQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*HomeConnectionQuery) ExistX

func (hcq *HomeConnectionQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*HomeConnectionQuery) First

First returns the first HomeConnection entity from the query. Returns a *NotFoundError when no HomeConnection was found.

func (*HomeConnectionQuery) FirstID

func (hcq *HomeConnectionQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first HomeConnection ID from the query. Returns a *NotFoundError when no HomeConnection ID was found.

func (*HomeConnectionQuery) FirstIDX

func (hcq *HomeConnectionQuery) FirstIDX(ctx context.Context) int

FirstIDX is like FirstID, but panics if an error occurs.

func (*HomeConnectionQuery) FirstX

FirstX is like First, but panics if an error occurs.

func (*HomeConnectionQuery) GroupBy

func (hcq *HomeConnectionQuery) GroupBy(field string, fields ...string) *HomeConnectionGroupBy

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 {
	StartTime string `json:"start_time,omitempty"`
	Count int `json:"count,omitempty"`
}

client.HomeConnection.Query().
	GroupBy(homeconnection.FieldStartTime).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*HomeConnectionQuery) IDs

func (hcq *HomeConnectionQuery) IDs(ctx context.Context) ([]int, error)

IDs executes the query and returns a list of HomeConnection IDs.

func (*HomeConnectionQuery) IDsX

func (hcq *HomeConnectionQuery) IDsX(ctx context.Context) []int

IDsX is like IDs, but panics if an error occurs.

func (*HomeConnectionQuery) Limit

func (hcq *HomeConnectionQuery) Limit(limit int) *HomeConnectionQuery

Limit adds a limit step to the query.

func (*HomeConnectionQuery) Offset

func (hcq *HomeConnectionQuery) Offset(offset int) *HomeConnectionQuery

Offset adds an offset step to the query.

func (*HomeConnectionQuery) Only

Only returns a single HomeConnection entity found by the query, ensuring it only returns one. Returns a *NotSingularError when exactly one HomeConnection entity is not found. Returns a *NotFoundError when no HomeConnection entities are found.

func (*HomeConnectionQuery) OnlyID

func (hcq *HomeConnectionQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID is like Only, but returns the only HomeConnection ID in the query. Returns a *NotSingularError when exactly one HomeConnection ID is not found. Returns a *NotFoundError when no entities are found.

func (*HomeConnectionQuery) OnlyIDX

func (hcq *HomeConnectionQuery) OnlyIDX(ctx context.Context) int

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*HomeConnectionQuery) OnlyX

OnlyX is like Only, but panics if an error occurs.

func (*HomeConnectionQuery) Order

Order adds an order step to the query.

func (*HomeConnectionQuery) QueryHome

func (hcq *HomeConnectionQuery) QueryHome() *HomeQuery

QueryHome chains the current query on the "home" edge.

func (*HomeConnectionQuery) QueryUser

func (hcq *HomeConnectionQuery) QueryUser() *UserQuery

QueryUser chains the current query on the "user" edge.

func (*HomeConnectionQuery) Select

func (hcq *HomeConnectionQuery) Select(fields ...string) *HomeConnectionSelect

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 {
	StartTime string `json:"start_time,omitempty"`
}

client.HomeConnection.Query().
	Select(homeconnection.FieldStartTime).
	Scan(ctx, &v)

func (*HomeConnectionQuery) Unique

func (hcq *HomeConnectionQuery) Unique(unique bool) *HomeConnectionQuery

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 (*HomeConnectionQuery) Where

Where adds a new predicate for the HomeConnectionQuery builder.

func (*HomeConnectionQuery) WithHome

func (hcq *HomeConnectionQuery) WithHome(opts ...func(*HomeQuery)) *HomeConnectionQuery

WithHome tells the query-builder to eager-load the nodes that are connected to the "home" edge. The optional arguments are used to configure the query builder of the edge.

func (*HomeConnectionQuery) WithUser

func (hcq *HomeConnectionQuery) WithUser(opts ...func(*UserQuery)) *HomeConnectionQuery

WithUser tells the query-builder to eager-load the nodes that are connected to the "user" edge. The optional arguments are used to configure the query builder of the edge.

type HomeConnectionSelect

type HomeConnectionSelect struct {
	*HomeConnectionQuery
	// contains filtered or unexported fields
}

HomeConnectionSelect is the builder for selecting fields of HomeConnection entities.

func (*HomeConnectionSelect) Bool

func (hcs *HomeConnectionSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*HomeConnectionSelect) BoolX

func (hcs *HomeConnectionSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*HomeConnectionSelect) Bools

func (hcs *HomeConnectionSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*HomeConnectionSelect) BoolsX

func (hcs *HomeConnectionSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*HomeConnectionSelect) Float64

func (hcs *HomeConnectionSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*HomeConnectionSelect) Float64X

func (hcs *HomeConnectionSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*HomeConnectionSelect) Float64s

func (hcs *HomeConnectionSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*HomeConnectionSelect) Float64sX

func (hcs *HomeConnectionSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*HomeConnectionSelect) Int

func (hcs *HomeConnectionSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*HomeConnectionSelect) IntX

func (hcs *HomeConnectionSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*HomeConnectionSelect) Ints

func (hcs *HomeConnectionSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*HomeConnectionSelect) IntsX

func (hcs *HomeConnectionSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*HomeConnectionSelect) Scan

func (hcs *HomeConnectionSelect) Scan(ctx context.Context, v interface{}) error

Scan applies the selector query and scans the result into the given value.

func (*HomeConnectionSelect) ScanX

func (hcs *HomeConnectionSelect) ScanX(ctx context.Context, v interface{})

ScanX is like Scan, but panics if an error occurs.

func (*HomeConnectionSelect) String

func (hcs *HomeConnectionSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*HomeConnectionSelect) StringX

func (hcs *HomeConnectionSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*HomeConnectionSelect) Strings

func (hcs *HomeConnectionSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*HomeConnectionSelect) StringsX

func (hcs *HomeConnectionSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type HomeConnectionUpdate

type HomeConnectionUpdate struct {
	// contains filtered or unexported fields
}

HomeConnectionUpdate is the builder for updating HomeConnection entities.

func (*HomeConnectionUpdate) ClearHome

func (hcu *HomeConnectionUpdate) ClearHome() *HomeConnectionUpdate

ClearHome clears the "home" edge to the Home entity.

func (*HomeConnectionUpdate) ClearUser

func (hcu *HomeConnectionUpdate) ClearUser() *HomeConnectionUpdate

ClearUser clears the "user" edge to the User entity.

func (*HomeConnectionUpdate) Exec

func (hcu *HomeConnectionUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*HomeConnectionUpdate) ExecX

func (hcu *HomeConnectionUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*HomeConnectionUpdate) Mutation

Mutation returns the HomeConnectionMutation object of the builder.

func (*HomeConnectionUpdate) Save

func (hcu *HomeConnectionUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*HomeConnectionUpdate) SaveX

func (hcu *HomeConnectionUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*HomeConnectionUpdate) SetEndTime

func (hcu *HomeConnectionUpdate) SetEndTime(s string) *HomeConnectionUpdate

SetEndTime sets the "end_time" field.

func (*HomeConnectionUpdate) SetHome

SetHome sets the "home" edge to the Home entity.

func (*HomeConnectionUpdate) SetHomeID

func (hcu *HomeConnectionUpdate) SetHomeID(id int) *HomeConnectionUpdate

SetHomeID sets the "home" edge to the Home entity by ID.

func (*HomeConnectionUpdate) SetNillableEndTime

func (hcu *HomeConnectionUpdate) SetNillableEndTime(s *string) *HomeConnectionUpdate

SetNillableEndTime sets the "end_time" field if the given value is not nil.

func (*HomeConnectionUpdate) SetNillableStartTime

func (hcu *HomeConnectionUpdate) SetNillableStartTime(s *string) *HomeConnectionUpdate

SetNillableStartTime sets the "start_time" field if the given value is not nil.

func (*HomeConnectionUpdate) SetStartTime

func (hcu *HomeConnectionUpdate) SetStartTime(s string) *HomeConnectionUpdate

SetStartTime sets the "start_time" field.

func (*HomeConnectionUpdate) SetUser

SetUser sets the "user" edge to the User entity.

func (*HomeConnectionUpdate) SetUserID

func (hcu *HomeConnectionUpdate) SetUserID(id int) *HomeConnectionUpdate

SetUserID sets the "user" edge to the User entity by ID.

func (*HomeConnectionUpdate) Where

Where appends a list predicates to the HomeConnectionUpdate builder.

type HomeConnectionUpdateOne

type HomeConnectionUpdateOne struct {
	// contains filtered or unexported fields
}

HomeConnectionUpdateOne is the builder for updating a single HomeConnection entity.

func (*HomeConnectionUpdateOne) ClearHome

ClearHome clears the "home" edge to the Home entity.

func (*HomeConnectionUpdateOne) ClearUser

ClearUser clears the "user" edge to the User entity.

func (*HomeConnectionUpdateOne) Exec

func (hcuo *HomeConnectionUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*HomeConnectionUpdateOne) ExecX

func (hcuo *HomeConnectionUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*HomeConnectionUpdateOne) Mutation

Mutation returns the HomeConnectionMutation object of the builder.

func (*HomeConnectionUpdateOne) Save

Save executes the query and returns the updated HomeConnection entity.

func (*HomeConnectionUpdateOne) SaveX

SaveX is like Save, but panics if an error occurs.

func (*HomeConnectionUpdateOne) Select

func (hcuo *HomeConnectionUpdateOne) Select(field string, fields ...string) *HomeConnectionUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*HomeConnectionUpdateOne) SetEndTime

SetEndTime sets the "end_time" field.

func (*HomeConnectionUpdateOne) SetHome

SetHome sets the "home" edge to the Home entity.

func (*HomeConnectionUpdateOne) SetHomeID

SetHomeID sets the "home" edge to the Home entity by ID.

func (*HomeConnectionUpdateOne) SetNillableEndTime

func (hcuo *HomeConnectionUpdateOne) SetNillableEndTime(s *string) *HomeConnectionUpdateOne

SetNillableEndTime sets the "end_time" field if the given value is not nil.

func (*HomeConnectionUpdateOne) SetNillableStartTime

func (hcuo *HomeConnectionUpdateOne) SetNillableStartTime(s *string) *HomeConnectionUpdateOne

SetNillableStartTime sets the "start_time" field if the given value is not nil.

func (*HomeConnectionUpdateOne) SetStartTime

SetStartTime sets the "start_time" field.

func (*HomeConnectionUpdateOne) SetUser

SetUser sets the "user" edge to the User entity.

func (*HomeConnectionUpdateOne) SetUserID

SetUserID sets the "user" edge to the User entity by ID.

type HomeConnections

type HomeConnections []*HomeConnection

HomeConnections is a parsable slice of HomeConnection.

type HomeCreate

type HomeCreate struct {
	// contains filtered or unexported fields
}

HomeCreate is the builder for creating a Home entity.

func (*HomeCreate) AddRoomIDs

func (hc *HomeCreate) AddRoomIDs(ids ...int) *HomeCreate

AddRoomIDs adds the "rooms" edge to the Room entity by IDs.

func (*HomeCreate) AddRooms

func (hc *HomeCreate) AddRooms(r ...*Room) *HomeCreate

AddRooms adds the "rooms" edges to the Room entity.

func (*HomeCreate) Exec

func (hc *HomeCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*HomeCreate) ExecX

func (hc *HomeCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*HomeCreate) Mutation

func (hc *HomeCreate) Mutation() *HomeMutation

Mutation returns the HomeMutation object of the builder.

func (*HomeCreate) Save

func (hc *HomeCreate) Save(ctx context.Context) (*Home, error)

Save creates the Home in the database.

func (*HomeCreate) SaveX

func (hc *HomeCreate) SaveX(ctx context.Context) *Home

SaveX calls Save and panics if Save returns an error.

func (*HomeCreate) SetName

func (hc *HomeCreate) SetName(s string) *HomeCreate

SetName sets the "name" field.

func (*HomeCreate) SetUUID

func (hc *HomeCreate) SetUUID(u uuid.UUID) *HomeCreate

SetUUID sets the "uuid" field.

type HomeCreateBulk

type HomeCreateBulk struct {
	// contains filtered or unexported fields
}

HomeCreateBulk is the builder for creating many Home entities in bulk.

func (*HomeCreateBulk) Exec

func (hcb *HomeCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*HomeCreateBulk) ExecX

func (hcb *HomeCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*HomeCreateBulk) Save

func (hcb *HomeCreateBulk) Save(ctx context.Context) ([]*Home, error)

Save creates the Home entities in the database.

func (*HomeCreateBulk) SaveX

func (hcb *HomeCreateBulk) SaveX(ctx context.Context) []*Home

SaveX is like Save, but panics if an error occurs.

type HomeDelete

type HomeDelete struct {
	// contains filtered or unexported fields
}

HomeDelete is the builder for deleting a Home entity.

func (*HomeDelete) Exec

func (hd *HomeDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*HomeDelete) ExecX

func (hd *HomeDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*HomeDelete) Where

func (hd *HomeDelete) Where(ps ...predicate.Home) *HomeDelete

Where appends a list predicates to the HomeDelete builder.

type HomeDeleteOne

type HomeDeleteOne struct {
	// contains filtered or unexported fields
}

HomeDeleteOne is the builder for deleting a single Home entity.

func (*HomeDeleteOne) Exec

func (hdo *HomeDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*HomeDeleteOne) ExecX

func (hdo *HomeDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

type HomeEdges

type HomeEdges struct {
	// Rooms holds the value of the rooms edge.
	Rooms []*Room `json:"rooms,omitempty"`
	// contains filtered or unexported fields
}

HomeEdges holds the relations/edges for other nodes in the graph.

func (HomeEdges) RoomsOrErr

func (e HomeEdges) RoomsOrErr() ([]*Room, error)

RoomsOrErr returns the Rooms value or an error if the edge was not loaded in eager-loading.

type HomeGroupBy

type HomeGroupBy struct {
	// contains filtered or unexported fields
}

HomeGroupBy is the group-by builder for Home entities.

func (*HomeGroupBy) Aggregate

func (hgb *HomeGroupBy) Aggregate(fns ...AggregateFunc) *HomeGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*HomeGroupBy) Bool

func (hgb *HomeGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a group-by query. It is only allowed when executing a group-by query with one field.

func (*HomeGroupBy) BoolX

func (hgb *HomeGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*HomeGroupBy) Bools

func (hgb *HomeGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from group-by. It is only allowed when executing a group-by query with one field.

func (*HomeGroupBy) BoolsX

func (hgb *HomeGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*HomeGroupBy) Float64

func (hgb *HomeGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a group-by query. It is only allowed when executing a group-by query with one field.

func (*HomeGroupBy) Float64X

func (hgb *HomeGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*HomeGroupBy) Float64s

func (hgb *HomeGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from group-by. It is only allowed when executing a group-by query with one field.

func (*HomeGroupBy) Float64sX

func (hgb *HomeGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*HomeGroupBy) Int

func (hgb *HomeGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a group-by query. It is only allowed when executing a group-by query with one field.

func (*HomeGroupBy) IntX

func (hgb *HomeGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*HomeGroupBy) Ints

func (hgb *HomeGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from group-by. It is only allowed when executing a group-by query with one field.

func (*HomeGroupBy) IntsX

func (hgb *HomeGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*HomeGroupBy) Scan

func (hgb *HomeGroupBy) Scan(ctx context.Context, v interface{}) error

Scan applies the group-by query and scans the result into the given value.

func (*HomeGroupBy) ScanX

func (hgb *HomeGroupBy) ScanX(ctx context.Context, v interface{})

ScanX is like Scan, but panics if an error occurs.

func (*HomeGroupBy) String

func (hgb *HomeGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a group-by query. It is only allowed when executing a group-by query with one field.

func (*HomeGroupBy) StringX

func (hgb *HomeGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*HomeGroupBy) Strings

func (hgb *HomeGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from group-by. It is only allowed when executing a group-by query with one field.

func (*HomeGroupBy) StringsX

func (hgb *HomeGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type HomeMutation

type HomeMutation struct {
	// contains filtered or unexported fields
}

HomeMutation represents an operation that mutates the Home nodes in the graph.

func (*HomeMutation) AddField

func (m *HomeMutation) 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 (*HomeMutation) AddRoomIDs

func (m *HomeMutation) AddRoomIDs(ids ...int)

AddRoomIDs adds the "rooms" edge to the Room entity by ids.

func (*HomeMutation) AddedEdges

func (m *HomeMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*HomeMutation) AddedField

func (m *HomeMutation) 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 (*HomeMutation) AddedFields

func (m *HomeMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*HomeMutation) AddedIDs

func (m *HomeMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*HomeMutation) ClearEdge

func (m *HomeMutation) 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 (*HomeMutation) ClearField

func (m *HomeMutation) 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 (*HomeMutation) ClearRooms

func (m *HomeMutation) ClearRooms()

ClearRooms clears the "rooms" edge to the Room entity.

func (*HomeMutation) ClearedEdges

func (m *HomeMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*HomeMutation) ClearedFields

func (m *HomeMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (HomeMutation) Client

func (m HomeMutation) 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 (*HomeMutation) EdgeCleared

func (m *HomeMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*HomeMutation) Field

func (m *HomeMutation) 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 (*HomeMutation) FieldCleared

func (m *HomeMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*HomeMutation) Fields

func (m *HomeMutation) 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 (*HomeMutation) ID

func (m *HomeMutation) 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 (*HomeMutation) Name

func (m *HomeMutation) Name() (r string, exists bool)

Name returns the value of the "name" field in the mutation.

func (*HomeMutation) OldField

func (m *HomeMutation) OldField(ctx context.Context, name string) (ent.Value, error)

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 (*HomeMutation) OldName

func (m *HomeMutation) OldName(ctx context.Context) (v string, err error)

OldName returns the old "name" field's value of the Home entity. If the Home 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 (*HomeMutation) OldUUID

func (m *HomeMutation) OldUUID(ctx context.Context) (v uuid.UUID, err error)

OldUUID returns the old "uuid" field's value of the Home entity. If the Home 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 (*HomeMutation) Op

func (m *HomeMutation) Op() Op

Op returns the operation name.

func (*HomeMutation) RemoveRoomIDs

func (m *HomeMutation) RemoveRoomIDs(ids ...int)

RemoveRoomIDs removes the "rooms" edge to the Room entity by IDs.

func (*HomeMutation) RemovedEdges

func (m *HomeMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*HomeMutation) RemovedIDs

func (m *HomeMutation) 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 (*HomeMutation) RemovedRoomsIDs

func (m *HomeMutation) RemovedRoomsIDs() (ids []int)

RemovedRooms returns the removed IDs of the "rooms" edge to the Room entity.

func (*HomeMutation) ResetEdge

func (m *HomeMutation) 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 (*HomeMutation) ResetField

func (m *HomeMutation) 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 (*HomeMutation) ResetName

func (m *HomeMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*HomeMutation) ResetRooms

func (m *HomeMutation) ResetRooms()

ResetRooms resets all changes to the "rooms" edge.

func (*HomeMutation) ResetUUID

func (m *HomeMutation) ResetUUID()

ResetUUID resets all changes to the "uuid" field.

func (*HomeMutation) RoomsCleared

func (m *HomeMutation) RoomsCleared() bool

RoomsCleared reports if the "rooms" edge to the Room entity was cleared.

func (*HomeMutation) RoomsIDs

func (m *HomeMutation) RoomsIDs() (ids []int)

RoomsIDs returns the "rooms" edge IDs in the mutation.

func (*HomeMutation) SetField

func (m *HomeMutation) 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 (*HomeMutation) SetName

func (m *HomeMutation) SetName(s string)

SetName sets the "name" field.

func (*HomeMutation) SetUUID

func (m *HomeMutation) SetUUID(u uuid.UUID)

SetUUID sets the "uuid" field.

func (HomeMutation) Tx

func (m HomeMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*HomeMutation) Type

func (m *HomeMutation) Type() string

Type returns the node type of this mutation (Home).

func (*HomeMutation) UUID

func (m *HomeMutation) UUID() (r uuid.UUID, exists bool)

UUID returns the value of the "uuid" field in the mutation.

func (*HomeMutation) Where

func (m *HomeMutation) Where(ps ...predicate.Home)

Where appends a list predicates to the HomeMutation builder.

type HomeQuery

type HomeQuery struct {
	// contains filtered or unexported fields
}

HomeQuery is the builder for querying Home entities.

func (*HomeQuery) All

func (hq *HomeQuery) All(ctx context.Context) ([]*Home, error)

All executes the query and returns a list of Homes.

func (*HomeQuery) AllX

func (hq *HomeQuery) AllX(ctx context.Context) []*Home

AllX is like All, but panics if an error occurs.

func (*HomeQuery) Clone

func (hq *HomeQuery) Clone() *HomeQuery

Clone returns a duplicate of the HomeQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*HomeQuery) Count

func (hq *HomeQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*HomeQuery) CountX

func (hq *HomeQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*HomeQuery) Exist

func (hq *HomeQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*HomeQuery) ExistX

func (hq *HomeQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*HomeQuery) First

func (hq *HomeQuery) First(ctx context.Context) (*Home, error)

First returns the first Home entity from the query. Returns a *NotFoundError when no Home was found.

func (*HomeQuery) FirstID

func (hq *HomeQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first Home ID from the query. Returns a *NotFoundError when no Home ID was found.

func (*HomeQuery) FirstIDX

func (hq *HomeQuery) FirstIDX(ctx context.Context) int

FirstIDX is like FirstID, but panics if an error occurs.

func (*HomeQuery) FirstX

func (hq *HomeQuery) FirstX(ctx context.Context) *Home

FirstX is like First, but panics if an error occurs.

func (*HomeQuery) GroupBy

func (hq *HomeQuery) GroupBy(field string, fields ...string) *HomeGroupBy

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 {
	UUID uuid.UUID `json:"uuid,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Home.Query().
	GroupBy(home.FieldUUID).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*HomeQuery) IDs

func (hq *HomeQuery) IDs(ctx context.Context) ([]int, error)

IDs executes the query and returns a list of Home IDs.

func (*HomeQuery) IDsX

func (hq *HomeQuery) IDsX(ctx context.Context) []int

IDsX is like IDs, but panics if an error occurs.

func (*HomeQuery) Limit

func (hq *HomeQuery) Limit(limit int) *HomeQuery

Limit adds a limit step to the query.

func (*HomeQuery) Offset

func (hq *HomeQuery) Offset(offset int) *HomeQuery

Offset adds an offset step to the query.

func (*HomeQuery) Only

func (hq *HomeQuery) Only(ctx context.Context) (*Home, error)

Only returns a single Home entity found by the query, ensuring it only returns one. Returns a *NotSingularError when exactly one Home entity is not found. Returns a *NotFoundError when no Home entities are found.

func (*HomeQuery) OnlyID

func (hq *HomeQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID is like Only, but returns the only Home ID in the query. Returns a *NotSingularError when exactly one Home ID is not found. Returns a *NotFoundError when no entities are found.

func (*HomeQuery) OnlyIDX

func (hq *HomeQuery) OnlyIDX(ctx context.Context) int

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*HomeQuery) OnlyX

func (hq *HomeQuery) OnlyX(ctx context.Context) *Home

OnlyX is like Only, but panics if an error occurs.

func (*HomeQuery) Order

func (hq *HomeQuery) Order(o ...OrderFunc) *HomeQuery

Order adds an order step to the query.

func (*HomeQuery) QueryRooms

func (hq *HomeQuery) QueryRooms() *RoomQuery

QueryRooms chains the current query on the "rooms" edge.

func (*HomeQuery) Select

func (hq *HomeQuery) Select(fields ...string) *HomeSelect

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 {
	UUID uuid.UUID `json:"uuid,omitempty"`
}

client.Home.Query().
	Select(home.FieldUUID).
	Scan(ctx, &v)

func (*HomeQuery) Unique

func (hq *HomeQuery) Unique(unique bool) *HomeQuery

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 (*HomeQuery) Where

func (hq *HomeQuery) Where(ps ...predicate.Home) *HomeQuery

Where adds a new predicate for the HomeQuery builder.

func (*HomeQuery) WithRooms

func (hq *HomeQuery) WithRooms(opts ...func(*RoomQuery)) *HomeQuery

WithRooms tells the query-builder to eager-load the nodes that are connected to the "rooms" edge. The optional arguments are used to configure the query builder of the edge.

type HomeSelect

type HomeSelect struct {
	*HomeQuery
	// contains filtered or unexported fields
}

HomeSelect is the builder for selecting fields of Home entities.

func (*HomeSelect) Bool

func (hs *HomeSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*HomeSelect) BoolX

func (hs *HomeSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*HomeSelect) Bools

func (hs *HomeSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*HomeSelect) BoolsX

func (hs *HomeSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*HomeSelect) Float64

func (hs *HomeSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*HomeSelect) Float64X

func (hs *HomeSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*HomeSelect) Float64s

func (hs *HomeSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*HomeSelect) Float64sX

func (hs *HomeSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*HomeSelect) Int

func (hs *HomeSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*HomeSelect) IntX

func (hs *HomeSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*HomeSelect) Ints

func (hs *HomeSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*HomeSelect) IntsX

func (hs *HomeSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*HomeSelect) Scan

func (hs *HomeSelect) Scan(ctx context.Context, v interface{}) error

Scan applies the selector query and scans the result into the given value.

func (*HomeSelect) ScanX

func (hs *HomeSelect) ScanX(ctx context.Context, v interface{})

ScanX is like Scan, but panics if an error occurs.

func (*HomeSelect) String

func (hs *HomeSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*HomeSelect) StringX

func (hs *HomeSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*HomeSelect) Strings

func (hs *HomeSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*HomeSelect) StringsX

func (hs *HomeSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type HomeUpdate

type HomeUpdate struct {
	// contains filtered or unexported fields
}

HomeUpdate is the builder for updating Home entities.

func (*HomeUpdate) AddRoomIDs

func (hu *HomeUpdate) AddRoomIDs(ids ...int) *HomeUpdate

AddRoomIDs adds the "rooms" edge to the Room entity by IDs.

func (*HomeUpdate) AddRooms

func (hu *HomeUpdate) AddRooms(r ...*Room) *HomeUpdate

AddRooms adds the "rooms" edges to the Room entity.

func (*HomeUpdate) ClearRooms

func (hu *HomeUpdate) ClearRooms() *HomeUpdate

ClearRooms clears all "rooms" edges to the Room entity.

func (*HomeUpdate) Exec

func (hu *HomeUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*HomeUpdate) ExecX

func (hu *HomeUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*HomeUpdate) Mutation

func (hu *HomeUpdate) Mutation() *HomeMutation

Mutation returns the HomeMutation object of the builder.

func (*HomeUpdate) RemoveRoomIDs

func (hu *HomeUpdate) RemoveRoomIDs(ids ...int) *HomeUpdate

RemoveRoomIDs removes the "rooms" edge to Room entities by IDs.

func (*HomeUpdate) RemoveRooms

func (hu *HomeUpdate) RemoveRooms(r ...*Room) *HomeUpdate

RemoveRooms removes "rooms" edges to Room entities.

func (*HomeUpdate) Save

func (hu *HomeUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*HomeUpdate) SaveX

func (hu *HomeUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*HomeUpdate) SetName

func (hu *HomeUpdate) SetName(s string) *HomeUpdate

SetName sets the "name" field.

func (*HomeUpdate) Where

func (hu *HomeUpdate) Where(ps ...predicate.Home) *HomeUpdate

Where appends a list predicates to the HomeUpdate builder.

type HomeUpdateOne

type HomeUpdateOne struct {
	// contains filtered or unexported fields
}

HomeUpdateOne is the builder for updating a single Home entity.

func (*HomeUpdateOne) AddRoomIDs

func (huo *HomeUpdateOne) AddRoomIDs(ids ...int) *HomeUpdateOne

AddRoomIDs adds the "rooms" edge to the Room entity by IDs.

func (*HomeUpdateOne) AddRooms

func (huo *HomeUpdateOne) AddRooms(r ...*Room) *HomeUpdateOne

AddRooms adds the "rooms" edges to the Room entity.

func (*HomeUpdateOne) ClearRooms

func (huo *HomeUpdateOne) ClearRooms() *HomeUpdateOne

ClearRooms clears all "rooms" edges to the Room entity.

func (*HomeUpdateOne) Exec

func (huo *HomeUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*HomeUpdateOne) ExecX

func (huo *HomeUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*HomeUpdateOne) Mutation

func (huo *HomeUpdateOne) Mutation() *HomeMutation

Mutation returns the HomeMutation object of the builder.

func (*HomeUpdateOne) RemoveRoomIDs

func (huo *HomeUpdateOne) RemoveRoomIDs(ids ...int) *HomeUpdateOne

RemoveRoomIDs removes the "rooms" edge to Room entities by IDs.

func (*HomeUpdateOne) RemoveRooms

func (huo *HomeUpdateOne) RemoveRooms(r ...*Room) *HomeUpdateOne

RemoveRooms removes "rooms" edges to Room entities.

func (*HomeUpdateOne) Save

func (huo *HomeUpdateOne) Save(ctx context.Context) (*Home, error)

Save executes the query and returns the updated Home entity.

func (*HomeUpdateOne) SaveX

func (huo *HomeUpdateOne) SaveX(ctx context.Context) *Home

SaveX is like Save, but panics if an error occurs.

func (*HomeUpdateOne) Select

func (huo *HomeUpdateOne) Select(field string, fields ...string) *HomeUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*HomeUpdateOne) SetName

func (huo *HomeUpdateOne) SetName(s string) *HomeUpdateOne

SetName sets the "name" field.

type Homes

type Homes []*Home

Homes is a parsable slice of Home.

type Hook

type Hook = ent.Hook

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 Mutation

type Mutation = ent.Mutation

ent aliases to avoid import conflicts in user's code.

type Mutator

type Mutator = ent.Mutator

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 Op

type Op = ent.Op

ent aliases to avoid import conflicts in user's code.

type Option

type Option func(*config)

Option function to configure the client.

func Debug

func Debug() Option

Debug enables debug logging on the ent.Driver.

func Driver

func Driver(driver dialect.Driver) Option

Driver configures the client driver.

func Log

func Log(fn func(...interface{})) Option

Log sets the logging function for debug mode.

type OrderFunc

type OrderFunc func(*sql.Selector)

OrderFunc applies an ordering on the sql selector.

func Asc

func Asc(fields ...string) OrderFunc

Asc applies the given fields in ASC order.

func Desc

func Desc(fields ...string) OrderFunc

Desc applies the given fields in DESC order.

type Policy

type Policy = ent.Policy

ent aliases to avoid import conflicts in user's code.

type Query

type Query = ent.Query

ent aliases to avoid import conflicts in user's code.

type RollbackFunc

type RollbackFunc func(context.Context, *Tx) error

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.

func (RollbackFunc) Rollback

func (f RollbackFunc) Rollback(ctx context.Context, tx *Tx) error

Rollback calls f(ctx, m).

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(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

type Rollbacker interface {
	Rollback(context.Context, *Tx) error
}

Rollbacker is the interface that wraps the Rollbacker method.

type Room

type Room struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// UUID holds the value of the "uuid" field.
	UUID uuid.UUID `json:"uuid,omitempty"`
	// Name holds the value of the "name" field.
	Name string `json:"name,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the RoomQuery when eager-loading is set.
	Edges RoomEdges `json:"edges"`
	// contains filtered or unexported fields
}

Room is the model entity for the Room schema.

func (*Room) QueryHome

func (r *Room) QueryHome() *HomeQuery

QueryHome queries the "home" edge of the Room entity.

func (*Room) QueryThings

func (r *Room) QueryThings() *ThingQuery

QueryThings queries the "things" edge of the Room entity.

func (*Room) String

func (r *Room) String() string

String implements the fmt.Stringer.

func (*Room) Unwrap

func (r *Room) Unwrap() *Room

Unwrap unwraps the Room 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 (*Room) Update

func (r *Room) Update() *RoomUpdateOne

Update returns a builder for updating this Room. Note that you need to call Room.Unwrap() before calling this method if this Room was returned from a transaction, and the transaction was committed or rolled back.

type RoomClient

type RoomClient struct {
	// contains filtered or unexported fields
}

RoomClient is a client for the Room schema.

func NewRoomClient

func NewRoomClient(c config) *RoomClient

NewRoomClient returns a client for the Room from the given config.

func (*RoomClient) Create

func (c *RoomClient) Create() *RoomCreate

Create returns a create builder for Room.

func (*RoomClient) CreateBulk

func (c *RoomClient) CreateBulk(builders ...*RoomCreate) *RoomCreateBulk

CreateBulk returns a builder for creating a bulk of Room entities.

func (*RoomClient) Delete

func (c *RoomClient) Delete() *RoomDelete

Delete returns a delete builder for Room.

func (*RoomClient) DeleteOne

func (c *RoomClient) DeleteOne(r *Room) *RoomDeleteOne

DeleteOne returns a delete builder for the given entity.

func (*RoomClient) DeleteOneID

func (c *RoomClient) DeleteOneID(id int) *RoomDeleteOne

DeleteOneID returns a delete builder for the given id.

func (*RoomClient) Get

func (c *RoomClient) Get(ctx context.Context, id int) (*Room, error)

Get returns a Room entity by its id.

func (*RoomClient) GetX

func (c *RoomClient) GetX(ctx context.Context, id int) *Room

GetX is like Get, but panics if an error occurs.

func (*RoomClient) Hooks

func (c *RoomClient) Hooks() []Hook

Hooks returns the client hooks.

func (*RoomClient) Query

func (c *RoomClient) Query() *RoomQuery

Query returns a query builder for Room.

func (*RoomClient) QueryHome

func (c *RoomClient) QueryHome(r *Room) *HomeQuery

QueryHome queries the home edge of a Room.

func (*RoomClient) QueryThings

func (c *RoomClient) QueryThings(r *Room) *ThingQuery

QueryThings queries the things edge of a Room.

func (*RoomClient) Update

func (c *RoomClient) Update() *RoomUpdate

Update returns an update builder for Room.

func (*RoomClient) UpdateOne

func (c *RoomClient) UpdateOne(r *Room) *RoomUpdateOne

UpdateOne returns an update builder for the given entity.

func (*RoomClient) UpdateOneID

func (c *RoomClient) UpdateOneID(id int) *RoomUpdateOne

UpdateOneID returns an update builder for the given id.

func (*RoomClient) Use

func (c *RoomClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `room.Hooks(f(g(h())))`.

type RoomConnection

type RoomConnection struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// StartTime holds the value of the "start_time" field.
	StartTime string `json:"start_time,omitempty"`
	// EndTime holds the value of the "end_time" field.
	EndTime string `json:"end_time,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the RoomConnectionQuery when eager-loading is set.
	Edges RoomConnectionEdges `json:"edges"`
	// contains filtered or unexported fields
}

RoomConnection is the model entity for the RoomConnection schema.

func (*RoomConnection) QueryRoom

func (rc *RoomConnection) QueryRoom() *RoomQuery

QueryRoom queries the "room" edge of the RoomConnection entity.

func (*RoomConnection) QueryUser

func (rc *RoomConnection) QueryUser() *UserQuery

QueryUser queries the "user" edge of the RoomConnection entity.

func (*RoomConnection) String

func (rc *RoomConnection) String() string

String implements the fmt.Stringer.

func (*RoomConnection) Unwrap

func (rc *RoomConnection) Unwrap() *RoomConnection

Unwrap unwraps the RoomConnection 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 (*RoomConnection) Update

Update returns a builder for updating this RoomConnection. Note that you need to call RoomConnection.Unwrap() before calling this method if this RoomConnection was returned from a transaction, and the transaction was committed or rolled back.

type RoomConnectionClient

type RoomConnectionClient struct {
	// contains filtered or unexported fields
}

RoomConnectionClient is a client for the RoomConnection schema.

func NewRoomConnectionClient

func NewRoomConnectionClient(c config) *RoomConnectionClient

NewRoomConnectionClient returns a client for the RoomConnection from the given config.

func (*RoomConnectionClient) Create

Create returns a create builder for RoomConnection.

func (*RoomConnectionClient) CreateBulk

CreateBulk returns a builder for creating a bulk of RoomConnection entities.

func (*RoomConnectionClient) Delete

Delete returns a delete builder for RoomConnection.

func (*RoomConnectionClient) DeleteOne

DeleteOne returns a delete builder for the given entity.

func (*RoomConnectionClient) DeleteOneID

func (c *RoomConnectionClient) DeleteOneID(id int) *RoomConnectionDeleteOne

DeleteOneID returns a delete builder for the given id.

func (*RoomConnectionClient) Get

Get returns a RoomConnection entity by its id.

func (*RoomConnectionClient) GetX

GetX is like Get, but panics if an error occurs.

func (*RoomConnectionClient) Hooks

func (c *RoomConnectionClient) Hooks() []Hook

Hooks returns the client hooks.

func (*RoomConnectionClient) Query

Query returns a query builder for RoomConnection.

func (*RoomConnectionClient) QueryRoom

func (c *RoomConnectionClient) QueryRoom(rc *RoomConnection) *RoomQuery

QueryRoom queries the room edge of a RoomConnection.

func (*RoomConnectionClient) QueryUser

func (c *RoomConnectionClient) QueryUser(rc *RoomConnection) *UserQuery

QueryUser queries the user edge of a RoomConnection.

func (*RoomConnectionClient) Update

Update returns an update builder for RoomConnection.

func (*RoomConnectionClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*RoomConnectionClient) UpdateOneID

func (c *RoomConnectionClient) UpdateOneID(id int) *RoomConnectionUpdateOne

UpdateOneID returns an update builder for the given id.

func (*RoomConnectionClient) Use

func (c *RoomConnectionClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `roomconnection.Hooks(f(g(h())))`.

type RoomConnectionCreate

type RoomConnectionCreate struct {
	// contains filtered or unexported fields
}

RoomConnectionCreate is the builder for creating a RoomConnection entity.

func (*RoomConnectionCreate) Exec

func (rcc *RoomConnectionCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*RoomConnectionCreate) ExecX

func (rcc *RoomConnectionCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*RoomConnectionCreate) Mutation

Mutation returns the RoomConnectionMutation object of the builder.

func (*RoomConnectionCreate) Save

Save creates the RoomConnection in the database.

func (*RoomConnectionCreate) SaveX

SaveX calls Save and panics if Save returns an error.

func (*RoomConnectionCreate) SetEndTime

func (rcc *RoomConnectionCreate) SetEndTime(s string) *RoomConnectionCreate

SetEndTime sets the "end_time" field.

func (*RoomConnectionCreate) SetNillableEndTime

func (rcc *RoomConnectionCreate) SetNillableEndTime(s *string) *RoomConnectionCreate

SetNillableEndTime sets the "end_time" field if the given value is not nil.

func (*RoomConnectionCreate) SetNillableStartTime

func (rcc *RoomConnectionCreate) SetNillableStartTime(s *string) *RoomConnectionCreate

SetNillableStartTime sets the "start_time" field if the given value is not nil.

func (*RoomConnectionCreate) SetRoom

SetRoom sets the "room" edge to the Room entity.

func (*RoomConnectionCreate) SetRoomID

func (rcc *RoomConnectionCreate) SetRoomID(id int) *RoomConnectionCreate

SetRoomID sets the "room" edge to the Room entity by ID.

func (*RoomConnectionCreate) SetStartTime

func (rcc *RoomConnectionCreate) SetStartTime(s string) *RoomConnectionCreate

SetStartTime sets the "start_time" field.

func (*RoomConnectionCreate) SetUser

SetUser sets the "user" edge to the User entity.

func (*RoomConnectionCreate) SetUserID

func (rcc *RoomConnectionCreate) SetUserID(id int) *RoomConnectionCreate

SetUserID sets the "user" edge to the User entity by ID.

type RoomConnectionCreateBulk

type RoomConnectionCreateBulk struct {
	// contains filtered or unexported fields
}

RoomConnectionCreateBulk is the builder for creating many RoomConnection entities in bulk.

func (*RoomConnectionCreateBulk) Exec

Exec executes the query.

func (*RoomConnectionCreateBulk) ExecX

func (rccb *RoomConnectionCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*RoomConnectionCreateBulk) Save

Save creates the RoomConnection entities in the database.

func (*RoomConnectionCreateBulk) SaveX

SaveX is like Save, but panics if an error occurs.

type RoomConnectionDelete

type RoomConnectionDelete struct {
	// contains filtered or unexported fields
}

RoomConnectionDelete is the builder for deleting a RoomConnection entity.

func (*RoomConnectionDelete) Exec

func (rcd *RoomConnectionDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*RoomConnectionDelete) ExecX

func (rcd *RoomConnectionDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*RoomConnectionDelete) Where

Where appends a list predicates to the RoomConnectionDelete builder.

type RoomConnectionDeleteOne

type RoomConnectionDeleteOne struct {
	// contains filtered or unexported fields
}

RoomConnectionDeleteOne is the builder for deleting a single RoomConnection entity.

func (*RoomConnectionDeleteOne) Exec

func (rcdo *RoomConnectionDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*RoomConnectionDeleteOne) ExecX

func (rcdo *RoomConnectionDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

type RoomConnectionEdges

type RoomConnectionEdges struct {
	// User holds the value of the user edge.
	User *User `json:"user,omitempty"`
	// Room holds the value of the room edge.
	Room *Room `json:"room,omitempty"`
	// contains filtered or unexported fields
}

RoomConnectionEdges holds the relations/edges for other nodes in the graph.

func (RoomConnectionEdges) RoomOrErr

func (e RoomConnectionEdges) RoomOrErr() (*Room, error)

RoomOrErr returns the Room value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

func (RoomConnectionEdges) UserOrErr

func (e RoomConnectionEdges) UserOrErr() (*User, error)

UserOrErr returns the User value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

type RoomConnectionGroupBy

type RoomConnectionGroupBy struct {
	// contains filtered or unexported fields
}

RoomConnectionGroupBy is the group-by builder for RoomConnection entities.

func (*RoomConnectionGroupBy) Aggregate

Aggregate adds the given aggregation functions to the group-by query.

func (*RoomConnectionGroupBy) Bool

func (rcgb *RoomConnectionGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a group-by query. It is only allowed when executing a group-by query with one field.

func (*RoomConnectionGroupBy) BoolX

func (rcgb *RoomConnectionGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*RoomConnectionGroupBy) Bools

func (rcgb *RoomConnectionGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from group-by. It is only allowed when executing a group-by query with one field.

func (*RoomConnectionGroupBy) BoolsX

func (rcgb *RoomConnectionGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*RoomConnectionGroupBy) Float64

func (rcgb *RoomConnectionGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a group-by query. It is only allowed when executing a group-by query with one field.

func (*RoomConnectionGroupBy) Float64X

func (rcgb *RoomConnectionGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*RoomConnectionGroupBy) Float64s

func (rcgb *RoomConnectionGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from group-by. It is only allowed when executing a group-by query with one field.

func (*RoomConnectionGroupBy) Float64sX

func (rcgb *RoomConnectionGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*RoomConnectionGroupBy) Int

func (rcgb *RoomConnectionGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a group-by query. It is only allowed when executing a group-by query with one field.

func (*RoomConnectionGroupBy) IntX

func (rcgb *RoomConnectionGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*RoomConnectionGroupBy) Ints

func (rcgb *RoomConnectionGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from group-by. It is only allowed when executing a group-by query with one field.

func (*RoomConnectionGroupBy) IntsX

func (rcgb *RoomConnectionGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*RoomConnectionGroupBy) Scan

func (rcgb *RoomConnectionGroupBy) Scan(ctx context.Context, v interface{}) error

Scan applies the group-by query and scans the result into the given value.

func (*RoomConnectionGroupBy) ScanX

func (rcgb *RoomConnectionGroupBy) ScanX(ctx context.Context, v interface{})

ScanX is like Scan, but panics if an error occurs.

func (*RoomConnectionGroupBy) String

func (rcgb *RoomConnectionGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a group-by query. It is only allowed when executing a group-by query with one field.

func (*RoomConnectionGroupBy) StringX

func (rcgb *RoomConnectionGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*RoomConnectionGroupBy) Strings

func (rcgb *RoomConnectionGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from group-by. It is only allowed when executing a group-by query with one field.

func (*RoomConnectionGroupBy) StringsX

func (rcgb *RoomConnectionGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type RoomConnectionMutation

type RoomConnectionMutation struct {
	// contains filtered or unexported fields
}

RoomConnectionMutation represents an operation that mutates the RoomConnection nodes in the graph.

func (*RoomConnectionMutation) AddField

func (m *RoomConnectionMutation) 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 (*RoomConnectionMutation) AddedEdges

func (m *RoomConnectionMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*RoomConnectionMutation) AddedField

func (m *RoomConnectionMutation) 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 (*RoomConnectionMutation) AddedFields

func (m *RoomConnectionMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*RoomConnectionMutation) AddedIDs

func (m *RoomConnectionMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*RoomConnectionMutation) ClearEdge

func (m *RoomConnectionMutation) 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 (*RoomConnectionMutation) ClearField

func (m *RoomConnectionMutation) 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 (*RoomConnectionMutation) ClearRoom

func (m *RoomConnectionMutation) ClearRoom()

ClearRoom clears the "room" edge to the Room entity.

func (*RoomConnectionMutation) ClearUser

func (m *RoomConnectionMutation) ClearUser()

ClearUser clears the "user" edge to the User entity.

func (*RoomConnectionMutation) ClearedEdges

func (m *RoomConnectionMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*RoomConnectionMutation) ClearedFields

func (m *RoomConnectionMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (RoomConnectionMutation) Client

func (m RoomConnectionMutation) 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 (*RoomConnectionMutation) EdgeCleared

func (m *RoomConnectionMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*RoomConnectionMutation) EndTime

func (m *RoomConnectionMutation) EndTime() (r string, exists bool)

EndTime returns the value of the "end_time" field in the mutation.

func (*RoomConnectionMutation) Field

func (m *RoomConnectionMutation) 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 (*RoomConnectionMutation) FieldCleared

func (m *RoomConnectionMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*RoomConnectionMutation) Fields

func (m *RoomConnectionMutation) 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 (*RoomConnectionMutation) ID

func (m *RoomConnectionMutation) 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 (*RoomConnectionMutation) OldEndTime

func (m *RoomConnectionMutation) OldEndTime(ctx context.Context) (v string, err error)

OldEndTime returns the old "end_time" field's value of the RoomConnection entity. If the RoomConnection 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 (*RoomConnectionMutation) OldField

func (m *RoomConnectionMutation) OldField(ctx context.Context, name string) (ent.Value, error)

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 (*RoomConnectionMutation) OldStartTime

func (m *RoomConnectionMutation) OldStartTime(ctx context.Context) (v string, err error)

OldStartTime returns the old "start_time" field's value of the RoomConnection entity. If the RoomConnection 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 (*RoomConnectionMutation) Op

func (m *RoomConnectionMutation) Op() Op

Op returns the operation name.

func (*RoomConnectionMutation) RemovedEdges

func (m *RoomConnectionMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*RoomConnectionMutation) RemovedIDs

func (m *RoomConnectionMutation) 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 (*RoomConnectionMutation) ResetEdge

func (m *RoomConnectionMutation) 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 (*RoomConnectionMutation) ResetEndTime

func (m *RoomConnectionMutation) ResetEndTime()

ResetEndTime resets all changes to the "end_time" field.

func (*RoomConnectionMutation) ResetField

func (m *RoomConnectionMutation) 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 (*RoomConnectionMutation) ResetRoom

func (m *RoomConnectionMutation) ResetRoom()

ResetRoom resets all changes to the "room" edge.

func (*RoomConnectionMutation) ResetStartTime

func (m *RoomConnectionMutation) ResetStartTime()

ResetStartTime resets all changes to the "start_time" field.

func (*RoomConnectionMutation) ResetUser

func (m *RoomConnectionMutation) ResetUser()

ResetUser resets all changes to the "user" edge.

func (*RoomConnectionMutation) RoomCleared

func (m *RoomConnectionMutation) RoomCleared() bool

RoomCleared reports if the "room" edge to the Room entity was cleared.

func (*RoomConnectionMutation) RoomID

func (m *RoomConnectionMutation) RoomID() (id int, exists bool)

RoomID returns the "room" edge ID in the mutation.

func (*RoomConnectionMutation) RoomIDs

func (m *RoomConnectionMutation) RoomIDs() (ids []int)

RoomIDs returns the "room" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use RoomID instead. It exists only for internal usage by the builders.

func (*RoomConnectionMutation) SetEndTime

func (m *RoomConnectionMutation) SetEndTime(s string)

SetEndTime sets the "end_time" field.

func (*RoomConnectionMutation) SetField

func (m *RoomConnectionMutation) 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 (*RoomConnectionMutation) SetRoomID

func (m *RoomConnectionMutation) SetRoomID(id int)

SetRoomID sets the "room" edge to the Room entity by id.

func (*RoomConnectionMutation) SetStartTime

func (m *RoomConnectionMutation) SetStartTime(s string)

SetStartTime sets the "start_time" field.

func (*RoomConnectionMutation) SetUserID

func (m *RoomConnectionMutation) SetUserID(id int)

SetUserID sets the "user" edge to the User entity by id.

func (*RoomConnectionMutation) StartTime

func (m *RoomConnectionMutation) StartTime() (r string, exists bool)

StartTime returns the value of the "start_time" field in the mutation.

func (RoomConnectionMutation) Tx

func (m RoomConnectionMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*RoomConnectionMutation) Type

func (m *RoomConnectionMutation) Type() string

Type returns the node type of this mutation (RoomConnection).

func (*RoomConnectionMutation) UserCleared

func (m *RoomConnectionMutation) UserCleared() bool

UserCleared reports if the "user" edge to the User entity was cleared.

func (*RoomConnectionMutation) UserID

func (m *RoomConnectionMutation) UserID() (id int, exists bool)

UserID returns the "user" edge ID in the mutation.

func (*RoomConnectionMutation) UserIDs

func (m *RoomConnectionMutation) UserIDs() (ids []int)

UserIDs returns the "user" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use UserID instead. It exists only for internal usage by the builders.

func (*RoomConnectionMutation) Where

Where appends a list predicates to the RoomConnectionMutation builder.

type RoomConnectionQuery

type RoomConnectionQuery struct {
	// contains filtered or unexported fields
}

RoomConnectionQuery is the builder for querying RoomConnection entities.

func (*RoomConnectionQuery) All

All executes the query and returns a list of RoomConnections.

func (*RoomConnectionQuery) AllX

AllX is like All, but panics if an error occurs.

func (*RoomConnectionQuery) Clone

Clone returns a duplicate of the RoomConnectionQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*RoomConnectionQuery) Count

func (rcq *RoomConnectionQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*RoomConnectionQuery) CountX

func (rcq *RoomConnectionQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*RoomConnectionQuery) Exist

func (rcq *RoomConnectionQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*RoomConnectionQuery) ExistX

func (rcq *RoomConnectionQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*RoomConnectionQuery) First

First returns the first RoomConnection entity from the query. Returns a *NotFoundError when no RoomConnection was found.

func (*RoomConnectionQuery) FirstID

func (rcq *RoomConnectionQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first RoomConnection ID from the query. Returns a *NotFoundError when no RoomConnection ID was found.

func (*RoomConnectionQuery) FirstIDX

func (rcq *RoomConnectionQuery) FirstIDX(ctx context.Context) int

FirstIDX is like FirstID, but panics if an error occurs.

func (*RoomConnectionQuery) FirstX

FirstX is like First, but panics if an error occurs.

func (*RoomConnectionQuery) GroupBy

func (rcq *RoomConnectionQuery) GroupBy(field string, fields ...string) *RoomConnectionGroupBy

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 {
	StartTime string `json:"start_time,omitempty"`
	Count int `json:"count,omitempty"`
}

client.RoomConnection.Query().
	GroupBy(roomconnection.FieldStartTime).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*RoomConnectionQuery) IDs

func (rcq *RoomConnectionQuery) IDs(ctx context.Context) ([]int, error)

IDs executes the query and returns a list of RoomConnection IDs.

func (*RoomConnectionQuery) IDsX

func (rcq *RoomConnectionQuery) IDsX(ctx context.Context) []int

IDsX is like IDs, but panics if an error occurs.

func (*RoomConnectionQuery) Limit

func (rcq *RoomConnectionQuery) Limit(limit int) *RoomConnectionQuery

Limit adds a limit step to the query.

func (*RoomConnectionQuery) Offset

func (rcq *RoomConnectionQuery) Offset(offset int) *RoomConnectionQuery

Offset adds an offset step to the query.

func (*RoomConnectionQuery) Only

Only returns a single RoomConnection entity found by the query, ensuring it only returns one. Returns a *NotSingularError when exactly one RoomConnection entity is not found. Returns a *NotFoundError when no RoomConnection entities are found.

func (*RoomConnectionQuery) OnlyID

func (rcq *RoomConnectionQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID is like Only, but returns the only RoomConnection ID in the query. Returns a *NotSingularError when exactly one RoomConnection ID is not found. Returns a *NotFoundError when no entities are found.

func (*RoomConnectionQuery) OnlyIDX

func (rcq *RoomConnectionQuery) OnlyIDX(ctx context.Context) int

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*RoomConnectionQuery) OnlyX

OnlyX is like Only, but panics if an error occurs.

func (*RoomConnectionQuery) Order

Order adds an order step to the query.

func (*RoomConnectionQuery) QueryRoom

func (rcq *RoomConnectionQuery) QueryRoom() *RoomQuery

QueryRoom chains the current query on the "room" edge.

func (*RoomConnectionQuery) QueryUser

func (rcq *RoomConnectionQuery) QueryUser() *UserQuery

QueryUser chains the current query on the "user" edge.

func (*RoomConnectionQuery) Select

func (rcq *RoomConnectionQuery) Select(fields ...string) *RoomConnectionSelect

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 {
	StartTime string `json:"start_time,omitempty"`
}

client.RoomConnection.Query().
	Select(roomconnection.FieldStartTime).
	Scan(ctx, &v)

func (*RoomConnectionQuery) Unique

func (rcq *RoomConnectionQuery) Unique(unique bool) *RoomConnectionQuery

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 (*RoomConnectionQuery) Where

Where adds a new predicate for the RoomConnectionQuery builder.

func (*RoomConnectionQuery) WithRoom

func (rcq *RoomConnectionQuery) WithRoom(opts ...func(*RoomQuery)) *RoomConnectionQuery

WithRoom tells the query-builder to eager-load the nodes that are connected to the "room" edge. The optional arguments are used to configure the query builder of the edge.

func (*RoomConnectionQuery) WithUser

func (rcq *RoomConnectionQuery) WithUser(opts ...func(*UserQuery)) *RoomConnectionQuery

WithUser tells the query-builder to eager-load the nodes that are connected to the "user" edge. The optional arguments are used to configure the query builder of the edge.

type RoomConnectionSelect

type RoomConnectionSelect struct {
	*RoomConnectionQuery
	// contains filtered or unexported fields
}

RoomConnectionSelect is the builder for selecting fields of RoomConnection entities.

func (*RoomConnectionSelect) Bool

func (rcs *RoomConnectionSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*RoomConnectionSelect) BoolX

func (rcs *RoomConnectionSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*RoomConnectionSelect) Bools

func (rcs *RoomConnectionSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*RoomConnectionSelect) BoolsX

func (rcs *RoomConnectionSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*RoomConnectionSelect) Float64

func (rcs *RoomConnectionSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*RoomConnectionSelect) Float64X

func (rcs *RoomConnectionSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*RoomConnectionSelect) Float64s

func (rcs *RoomConnectionSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*RoomConnectionSelect) Float64sX

func (rcs *RoomConnectionSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*RoomConnectionSelect) Int

func (rcs *RoomConnectionSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*RoomConnectionSelect) IntX

func (rcs *RoomConnectionSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*RoomConnectionSelect) Ints

func (rcs *RoomConnectionSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*RoomConnectionSelect) IntsX

func (rcs *RoomConnectionSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*RoomConnectionSelect) Scan

func (rcs *RoomConnectionSelect) Scan(ctx context.Context, v interface{}) error

Scan applies the selector query and scans the result into the given value.

func (*RoomConnectionSelect) ScanX

func (rcs *RoomConnectionSelect) ScanX(ctx context.Context, v interface{})

ScanX is like Scan, but panics if an error occurs.

func (*RoomConnectionSelect) String

func (rcs *RoomConnectionSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*RoomConnectionSelect) StringX

func (rcs *RoomConnectionSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*RoomConnectionSelect) Strings

func (rcs *RoomConnectionSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*RoomConnectionSelect) StringsX

func (rcs *RoomConnectionSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type RoomConnectionUpdate

type RoomConnectionUpdate struct {
	// contains filtered or unexported fields
}

RoomConnectionUpdate is the builder for updating RoomConnection entities.

func (*RoomConnectionUpdate) ClearRoom

func (rcu *RoomConnectionUpdate) ClearRoom() *RoomConnectionUpdate

ClearRoom clears the "room" edge to the Room entity.

func (*RoomConnectionUpdate) ClearUser

func (rcu *RoomConnectionUpdate) ClearUser() *RoomConnectionUpdate

ClearUser clears the "user" edge to the User entity.

func (*RoomConnectionUpdate) Exec

func (rcu *RoomConnectionUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*RoomConnectionUpdate) ExecX

func (rcu *RoomConnectionUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*RoomConnectionUpdate) Mutation

Mutation returns the RoomConnectionMutation object of the builder.

func (*RoomConnectionUpdate) Save

func (rcu *RoomConnectionUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*RoomConnectionUpdate) SaveX

func (rcu *RoomConnectionUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*RoomConnectionUpdate) SetEndTime

func (rcu *RoomConnectionUpdate) SetEndTime(s string) *RoomConnectionUpdate

SetEndTime sets the "end_time" field.

func (*RoomConnectionUpdate) SetNillableEndTime

func (rcu *RoomConnectionUpdate) SetNillableEndTime(s *string) *RoomConnectionUpdate

SetNillableEndTime sets the "end_time" field if the given value is not nil.

func (*RoomConnectionUpdate) SetNillableStartTime

func (rcu *RoomConnectionUpdate) SetNillableStartTime(s *string) *RoomConnectionUpdate

SetNillableStartTime sets the "start_time" field if the given value is not nil.

func (*RoomConnectionUpdate) SetRoom

SetRoom sets the "room" edge to the Room entity.

func (*RoomConnectionUpdate) SetRoomID

func (rcu *RoomConnectionUpdate) SetRoomID(id int) *RoomConnectionUpdate

SetRoomID sets the "room" edge to the Room entity by ID.

func (*RoomConnectionUpdate) SetStartTime

func (rcu *RoomConnectionUpdate) SetStartTime(s string) *RoomConnectionUpdate

SetStartTime sets the "start_time" field.

func (*RoomConnectionUpdate) SetUser

SetUser sets the "user" edge to the User entity.

func (*RoomConnectionUpdate) SetUserID

func (rcu *RoomConnectionUpdate) SetUserID(id int) *RoomConnectionUpdate

SetUserID sets the "user" edge to the User entity by ID.

func (*RoomConnectionUpdate) Where

Where appends a list predicates to the RoomConnectionUpdate builder.

type RoomConnectionUpdateOne

type RoomConnectionUpdateOne struct {
	// contains filtered or unexported fields
}

RoomConnectionUpdateOne is the builder for updating a single RoomConnection entity.

func (*RoomConnectionUpdateOne) ClearRoom

ClearRoom clears the "room" edge to the Room entity.

func (*RoomConnectionUpdateOne) ClearUser

ClearUser clears the "user" edge to the User entity.

func (*RoomConnectionUpdateOne) Exec

func (rcuo *RoomConnectionUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*RoomConnectionUpdateOne) ExecX

func (rcuo *RoomConnectionUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*RoomConnectionUpdateOne) Mutation

Mutation returns the RoomConnectionMutation object of the builder.

func (*RoomConnectionUpdateOne) Save

Save executes the query and returns the updated RoomConnection entity.

func (*RoomConnectionUpdateOne) SaveX

SaveX is like Save, but panics if an error occurs.

func (*RoomConnectionUpdateOne) Select

func (rcuo *RoomConnectionUpdateOne) Select(field string, fields ...string) *RoomConnectionUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*RoomConnectionUpdateOne) SetEndTime

SetEndTime sets the "end_time" field.

func (*RoomConnectionUpdateOne) SetNillableEndTime

func (rcuo *RoomConnectionUpdateOne) SetNillableEndTime(s *string) *RoomConnectionUpdateOne

SetNillableEndTime sets the "end_time" field if the given value is not nil.

func (*RoomConnectionUpdateOne) SetNillableStartTime

func (rcuo *RoomConnectionUpdateOne) SetNillableStartTime(s *string) *RoomConnectionUpdateOne

SetNillableStartTime sets the "start_time" field if the given value is not nil.

func (*RoomConnectionUpdateOne) SetRoom

SetRoom sets the "room" edge to the Room entity.

func (*RoomConnectionUpdateOne) SetRoomID

SetRoomID sets the "room" edge to the Room entity by ID.

func (*RoomConnectionUpdateOne) SetStartTime

SetStartTime sets the "start_time" field.

func (*RoomConnectionUpdateOne) SetUser

SetUser sets the "user" edge to the User entity.

func (*RoomConnectionUpdateOne) SetUserID

SetUserID sets the "user" edge to the User entity by ID.

type RoomConnections

type RoomConnections []*RoomConnection

RoomConnections is a parsable slice of RoomConnection.

type RoomCreate

type RoomCreate struct {
	// contains filtered or unexported fields
}

RoomCreate is the builder for creating a Room entity.

func (*RoomCreate) AddThingIDs

func (rc *RoomCreate) AddThingIDs(ids ...int) *RoomCreate

AddThingIDs adds the "things" edge to the Thing entity by IDs.

func (*RoomCreate) AddThings

func (rc *RoomCreate) AddThings(t ...*Thing) *RoomCreate

AddThings adds the "things" edges to the Thing entity.

func (*RoomCreate) Exec

func (rc *RoomCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*RoomCreate) ExecX

func (rc *RoomCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*RoomCreate) Mutation

func (rc *RoomCreate) Mutation() *RoomMutation

Mutation returns the RoomMutation object of the builder.

func (*RoomCreate) Save

func (rc *RoomCreate) Save(ctx context.Context) (*Room, error)

Save creates the Room in the database.

func (*RoomCreate) SaveX

func (rc *RoomCreate) SaveX(ctx context.Context) *Room

SaveX calls Save and panics if Save returns an error.

func (*RoomCreate) SetHome

func (rc *RoomCreate) SetHome(h *Home) *RoomCreate

SetHome sets the "home" edge to the Home entity.

func (*RoomCreate) SetHomeID

func (rc *RoomCreate) SetHomeID(id int) *RoomCreate

SetHomeID sets the "home" edge to the Home entity by ID.

func (*RoomCreate) SetName

func (rc *RoomCreate) SetName(s string) *RoomCreate

SetName sets the "name" field.

func (*RoomCreate) SetUUID

func (rc *RoomCreate) SetUUID(u uuid.UUID) *RoomCreate

SetUUID sets the "uuid" field.

type RoomCreateBulk

type RoomCreateBulk struct {
	// contains filtered or unexported fields
}

RoomCreateBulk is the builder for creating many Room entities in bulk.

func (*RoomCreateBulk) Exec

func (rcb *RoomCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*RoomCreateBulk) ExecX

func (rcb *RoomCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*RoomCreateBulk) Save

func (rcb *RoomCreateBulk) Save(ctx context.Context) ([]*Room, error)

Save creates the Room entities in the database.

func (*RoomCreateBulk) SaveX

func (rcb *RoomCreateBulk) SaveX(ctx context.Context) []*Room

SaveX is like Save, but panics if an error occurs.

type RoomDelete

type RoomDelete struct {
	// contains filtered or unexported fields
}

RoomDelete is the builder for deleting a Room entity.

func (*RoomDelete) Exec

func (rd *RoomDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*RoomDelete) ExecX

func (rd *RoomDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*RoomDelete) Where

func (rd *RoomDelete) Where(ps ...predicate.Room) *RoomDelete

Where appends a list predicates to the RoomDelete builder.

type RoomDeleteOne

type RoomDeleteOne struct {
	// contains filtered or unexported fields
}

RoomDeleteOne is the builder for deleting a single Room entity.

func (*RoomDeleteOne) Exec

func (rdo *RoomDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*RoomDeleteOne) ExecX

func (rdo *RoomDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

type RoomEdges

type RoomEdges struct {
	// Home holds the value of the home edge.
	Home *Home `json:"home,omitempty"`
	// Things holds the value of the things edge.
	Things []*Thing `json:"things,omitempty"`
	// contains filtered or unexported fields
}

RoomEdges holds the relations/edges for other nodes in the graph.

func (RoomEdges) HomeOrErr

func (e RoomEdges) HomeOrErr() (*Home, error)

HomeOrErr returns the Home value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

func (RoomEdges) ThingsOrErr

func (e RoomEdges) ThingsOrErr() ([]*Thing, error)

ThingsOrErr returns the Things value or an error if the edge was not loaded in eager-loading.

type RoomGroupBy

type RoomGroupBy struct {
	// contains filtered or unexported fields
}

RoomGroupBy is the group-by builder for Room entities.

func (*RoomGroupBy) Aggregate

func (rgb *RoomGroupBy) Aggregate(fns ...AggregateFunc) *RoomGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*RoomGroupBy) Bool

func (rgb *RoomGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a group-by query. It is only allowed when executing a group-by query with one field.

func (*RoomGroupBy) BoolX

func (rgb *RoomGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*RoomGroupBy) Bools

func (rgb *RoomGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from group-by. It is only allowed when executing a group-by query with one field.

func (*RoomGroupBy) BoolsX

func (rgb *RoomGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*RoomGroupBy) Float64

func (rgb *RoomGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a group-by query. It is only allowed when executing a group-by query with one field.

func (*RoomGroupBy) Float64X

func (rgb *RoomGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*RoomGroupBy) Float64s

func (rgb *RoomGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from group-by. It is only allowed when executing a group-by query with one field.

func (*RoomGroupBy) Float64sX

func (rgb *RoomGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*RoomGroupBy) Int

func (rgb *RoomGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a group-by query. It is only allowed when executing a group-by query with one field.

func (*RoomGroupBy) IntX

func (rgb *RoomGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*RoomGroupBy) Ints

func (rgb *RoomGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from group-by. It is only allowed when executing a group-by query with one field.

func (*RoomGroupBy) IntsX

func (rgb *RoomGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*RoomGroupBy) Scan

func (rgb *RoomGroupBy) Scan(ctx context.Context, v interface{}) error

Scan applies the group-by query and scans the result into the given value.

func (*RoomGroupBy) ScanX

func (rgb *RoomGroupBy) ScanX(ctx context.Context, v interface{})

ScanX is like Scan, but panics if an error occurs.

func (*RoomGroupBy) String

func (rgb *RoomGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a group-by query. It is only allowed when executing a group-by query with one field.

func (*RoomGroupBy) StringX

func (rgb *RoomGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*RoomGroupBy) Strings

func (rgb *RoomGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from group-by. It is only allowed when executing a group-by query with one field.

func (*RoomGroupBy) StringsX

func (rgb *RoomGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type RoomMutation

type RoomMutation struct {
	// contains filtered or unexported fields
}

RoomMutation represents an operation that mutates the Room nodes in the graph.

func (*RoomMutation) AddField

func (m *RoomMutation) 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 (*RoomMutation) AddThingIDs

func (m *RoomMutation) AddThingIDs(ids ...int)

AddThingIDs adds the "things" edge to the Thing entity by ids.

func (*RoomMutation) AddedEdges

func (m *RoomMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*RoomMutation) AddedField

func (m *RoomMutation) 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 (*RoomMutation) AddedFields

func (m *RoomMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*RoomMutation) AddedIDs

func (m *RoomMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*RoomMutation) ClearEdge

func (m *RoomMutation) 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 (*RoomMutation) ClearField

func (m *RoomMutation) 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 (*RoomMutation) ClearHome

func (m *RoomMutation) ClearHome()

ClearHome clears the "home" edge to the Home entity.

func (*RoomMutation) ClearThings

func (m *RoomMutation) ClearThings()

ClearThings clears the "things" edge to the Thing entity.

func (*RoomMutation) ClearedEdges

func (m *RoomMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*RoomMutation) ClearedFields

func (m *RoomMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (RoomMutation) Client

func (m RoomMutation) 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 (*RoomMutation) EdgeCleared

func (m *RoomMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*RoomMutation) Field

func (m *RoomMutation) 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 (*RoomMutation) FieldCleared

func (m *RoomMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*RoomMutation) Fields

func (m *RoomMutation) 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 (*RoomMutation) HomeCleared

func (m *RoomMutation) HomeCleared() bool

HomeCleared reports if the "home" edge to the Home entity was cleared.

func (*RoomMutation) HomeID

func (m *RoomMutation) HomeID() (id int, exists bool)

HomeID returns the "home" edge ID in the mutation.

func (*RoomMutation) HomeIDs

func (m *RoomMutation) HomeIDs() (ids []int)

HomeIDs returns the "home" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use HomeID instead. It exists only for internal usage by the builders.

func (*RoomMutation) ID

func (m *RoomMutation) 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 (*RoomMutation) Name

func (m *RoomMutation) Name() (r string, exists bool)

Name returns the value of the "name" field in the mutation.

func (*RoomMutation) OldField

func (m *RoomMutation) OldField(ctx context.Context, name string) (ent.Value, error)

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 (*RoomMutation) OldName

func (m *RoomMutation) OldName(ctx context.Context) (v string, err error)

OldName returns the old "name" field's value of the Room entity. If the Room 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 (*RoomMutation) OldUUID

func (m *RoomMutation) OldUUID(ctx context.Context) (v uuid.UUID, err error)

OldUUID returns the old "uuid" field's value of the Room entity. If the Room 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 (*RoomMutation) Op

func (m *RoomMutation) Op() Op

Op returns the operation name.

func (*RoomMutation) RemoveThingIDs

func (m *RoomMutation) RemoveThingIDs(ids ...int)

RemoveThingIDs removes the "things" edge to the Thing entity by IDs.

func (*RoomMutation) RemovedEdges

func (m *RoomMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*RoomMutation) RemovedIDs

func (m *RoomMutation) 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 (*RoomMutation) RemovedThingsIDs

func (m *RoomMutation) RemovedThingsIDs() (ids []int)

RemovedThings returns the removed IDs of the "things" edge to the Thing entity.

func (*RoomMutation) ResetEdge

func (m *RoomMutation) 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 (*RoomMutation) ResetField

func (m *RoomMutation) 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 (*RoomMutation) ResetHome

func (m *RoomMutation) ResetHome()

ResetHome resets all changes to the "home" edge.

func (*RoomMutation) ResetName

func (m *RoomMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*RoomMutation) ResetThings

func (m *RoomMutation) ResetThings()

ResetThings resets all changes to the "things" edge.

func (*RoomMutation) ResetUUID

func (m *RoomMutation) ResetUUID()

ResetUUID resets all changes to the "uuid" field.

func (*RoomMutation) SetField

func (m *RoomMutation) 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 (*RoomMutation) SetHomeID

func (m *RoomMutation) SetHomeID(id int)

SetHomeID sets the "home" edge to the Home entity by id.

func (*RoomMutation) SetName

func (m *RoomMutation) SetName(s string)

SetName sets the "name" field.

func (*RoomMutation) SetUUID

func (m *RoomMutation) SetUUID(u uuid.UUID)

SetUUID sets the "uuid" field.

func (*RoomMutation) ThingsCleared

func (m *RoomMutation) ThingsCleared() bool

ThingsCleared reports if the "things" edge to the Thing entity was cleared.

func (*RoomMutation) ThingsIDs

func (m *RoomMutation) ThingsIDs() (ids []int)

ThingsIDs returns the "things" edge IDs in the mutation.

func (RoomMutation) Tx

func (m RoomMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*RoomMutation) Type

func (m *RoomMutation) Type() string

Type returns the node type of this mutation (Room).

func (*RoomMutation) UUID

func (m *RoomMutation) UUID() (r uuid.UUID, exists bool)

UUID returns the value of the "uuid" field in the mutation.

func (*RoomMutation) Where

func (m *RoomMutation) Where(ps ...predicate.Room)

Where appends a list predicates to the RoomMutation builder.

type RoomQuery

type RoomQuery struct {
	// contains filtered or unexported fields
}

RoomQuery is the builder for querying Room entities.

func (*RoomQuery) All

func (rq *RoomQuery) All(ctx context.Context) ([]*Room, error)

All executes the query and returns a list of Rooms.

func (*RoomQuery) AllX

func (rq *RoomQuery) AllX(ctx context.Context) []*Room

AllX is like All, but panics if an error occurs.

func (*RoomQuery) Clone

func (rq *RoomQuery) Clone() *RoomQuery

Clone returns a duplicate of the RoomQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*RoomQuery) Count

func (rq *RoomQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*RoomQuery) CountX

func (rq *RoomQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*RoomQuery) Exist

func (rq *RoomQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*RoomQuery) ExistX

func (rq *RoomQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*RoomQuery) First

func (rq *RoomQuery) First(ctx context.Context) (*Room, error)

First returns the first Room entity from the query. Returns a *NotFoundError when no Room was found.

func (*RoomQuery) FirstID

func (rq *RoomQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first Room ID from the query. Returns a *NotFoundError when no Room ID was found.

func (*RoomQuery) FirstIDX

func (rq *RoomQuery) FirstIDX(ctx context.Context) int

FirstIDX is like FirstID, but panics if an error occurs.

func (*RoomQuery) FirstX

func (rq *RoomQuery) FirstX(ctx context.Context) *Room

FirstX is like First, but panics if an error occurs.

func (*RoomQuery) GroupBy

func (rq *RoomQuery) GroupBy(field string, fields ...string) *RoomGroupBy

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 {
	UUID uuid.UUID `json:"uuid,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Room.Query().
	GroupBy(room.FieldUUID).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*RoomQuery) IDs

func (rq *RoomQuery) IDs(ctx context.Context) ([]int, error)

IDs executes the query and returns a list of Room IDs.

func (*RoomQuery) IDsX

func (rq *RoomQuery) IDsX(ctx context.Context) []int

IDsX is like IDs, but panics if an error occurs.

func (*RoomQuery) Limit

func (rq *RoomQuery) Limit(limit int) *RoomQuery

Limit adds a limit step to the query.

func (*RoomQuery) Offset

func (rq *RoomQuery) Offset(offset int) *RoomQuery

Offset adds an offset step to the query.

func (*RoomQuery) Only

func (rq *RoomQuery) Only(ctx context.Context) (*Room, error)

Only returns a single Room entity found by the query, ensuring it only returns one. Returns a *NotSingularError when exactly one Room entity is not found. Returns a *NotFoundError when no Room entities are found.

func (*RoomQuery) OnlyID

func (rq *RoomQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID is like Only, but returns the only Room ID in the query. Returns a *NotSingularError when exactly one Room ID is not found. Returns a *NotFoundError when no entities are found.

func (*RoomQuery) OnlyIDX

func (rq *RoomQuery) OnlyIDX(ctx context.Context) int

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*RoomQuery) OnlyX

func (rq *RoomQuery) OnlyX(ctx context.Context) *Room

OnlyX is like Only, but panics if an error occurs.

func (*RoomQuery) Order

func (rq *RoomQuery) Order(o ...OrderFunc) *RoomQuery

Order adds an order step to the query.

func (*RoomQuery) QueryHome

func (rq *RoomQuery) QueryHome() *HomeQuery

QueryHome chains the current query on the "home" edge.

func (*RoomQuery) QueryThings

func (rq *RoomQuery) QueryThings() *ThingQuery

QueryThings chains the current query on the "things" edge.

func (*RoomQuery) Select

func (rq *RoomQuery) Select(fields ...string) *RoomSelect

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 {
	UUID uuid.UUID `json:"uuid,omitempty"`
}

client.Room.Query().
	Select(room.FieldUUID).
	Scan(ctx, &v)

func (*RoomQuery) Unique

func (rq *RoomQuery) Unique(unique bool) *RoomQuery

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 (*RoomQuery) Where

func (rq *RoomQuery) Where(ps ...predicate.Room) *RoomQuery

Where adds a new predicate for the RoomQuery builder.

func (*RoomQuery) WithHome

func (rq *RoomQuery) WithHome(opts ...func(*HomeQuery)) *RoomQuery

WithHome tells the query-builder to eager-load the nodes that are connected to the "home" edge. The optional arguments are used to configure the query builder of the edge.

func (*RoomQuery) WithThings

func (rq *RoomQuery) WithThings(opts ...func(*ThingQuery)) *RoomQuery

WithThings tells the query-builder to eager-load the nodes that are connected to the "things" edge. The optional arguments are used to configure the query builder of the edge.

type RoomSelect

type RoomSelect struct {
	*RoomQuery
	// contains filtered or unexported fields
}

RoomSelect is the builder for selecting fields of Room entities.

func (*RoomSelect) Bool

func (rs *RoomSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*RoomSelect) BoolX

func (rs *RoomSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*RoomSelect) Bools

func (rs *RoomSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*RoomSelect) BoolsX

func (rs *RoomSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*RoomSelect) Float64

func (rs *RoomSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*RoomSelect) Float64X

func (rs *RoomSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*RoomSelect) Float64s

func (rs *RoomSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*RoomSelect) Float64sX

func (rs *RoomSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*RoomSelect) Int

func (rs *RoomSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*RoomSelect) IntX

func (rs *RoomSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*RoomSelect) Ints

func (rs *RoomSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*RoomSelect) IntsX

func (rs *RoomSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*RoomSelect) Scan

func (rs *RoomSelect) Scan(ctx context.Context, v interface{}) error

Scan applies the selector query and scans the result into the given value.

func (*RoomSelect) ScanX

func (rs *RoomSelect) ScanX(ctx context.Context, v interface{})

ScanX is like Scan, but panics if an error occurs.

func (*RoomSelect) String

func (rs *RoomSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*RoomSelect) StringX

func (rs *RoomSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*RoomSelect) Strings

func (rs *RoomSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*RoomSelect) StringsX

func (rs *RoomSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type RoomUpdate

type RoomUpdate struct {
	// contains filtered or unexported fields
}

RoomUpdate is the builder for updating Room entities.

func (*RoomUpdate) AddThingIDs

func (ru *RoomUpdate) AddThingIDs(ids ...int) *RoomUpdate

AddThingIDs adds the "things" edge to the Thing entity by IDs.

func (*RoomUpdate) AddThings

func (ru *RoomUpdate) AddThings(t ...*Thing) *RoomUpdate

AddThings adds the "things" edges to the Thing entity.

func (*RoomUpdate) ClearHome

func (ru *RoomUpdate) ClearHome() *RoomUpdate

ClearHome clears the "home" edge to the Home entity.

func (*RoomUpdate) ClearThings

func (ru *RoomUpdate) ClearThings() *RoomUpdate

ClearThings clears all "things" edges to the Thing entity.

func (*RoomUpdate) Exec

func (ru *RoomUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*RoomUpdate) ExecX

func (ru *RoomUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*RoomUpdate) Mutation

func (ru *RoomUpdate) Mutation() *RoomMutation

Mutation returns the RoomMutation object of the builder.

func (*RoomUpdate) RemoveThingIDs

func (ru *RoomUpdate) RemoveThingIDs(ids ...int) *RoomUpdate

RemoveThingIDs removes the "things" edge to Thing entities by IDs.

func (*RoomUpdate) RemoveThings

func (ru *RoomUpdate) RemoveThings(t ...*Thing) *RoomUpdate

RemoveThings removes "things" edges to Thing entities.

func (*RoomUpdate) Save

func (ru *RoomUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*RoomUpdate) SaveX

func (ru *RoomUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*RoomUpdate) SetHome

func (ru *RoomUpdate) SetHome(h *Home) *RoomUpdate

SetHome sets the "home" edge to the Home entity.

func (*RoomUpdate) SetHomeID

func (ru *RoomUpdate) SetHomeID(id int) *RoomUpdate

SetHomeID sets the "home" edge to the Home entity by ID.

func (*RoomUpdate) SetName

func (ru *RoomUpdate) SetName(s string) *RoomUpdate

SetName sets the "name" field.

func (*RoomUpdate) Where

func (ru *RoomUpdate) Where(ps ...predicate.Room) *RoomUpdate

Where appends a list predicates to the RoomUpdate builder.

type RoomUpdateOne

type RoomUpdateOne struct {
	// contains filtered or unexported fields
}

RoomUpdateOne is the builder for updating a single Room entity.

func (*RoomUpdateOne) AddThingIDs

func (ruo *RoomUpdateOne) AddThingIDs(ids ...int) *RoomUpdateOne

AddThingIDs adds the "things" edge to the Thing entity by IDs.

func (*RoomUpdateOne) AddThings

func (ruo *RoomUpdateOne) AddThings(t ...*Thing) *RoomUpdateOne

AddThings adds the "things" edges to the Thing entity.

func (*RoomUpdateOne) ClearHome

func (ruo *RoomUpdateOne) ClearHome() *RoomUpdateOne

ClearHome clears the "home" edge to the Home entity.

func (*RoomUpdateOne) ClearThings

func (ruo *RoomUpdateOne) ClearThings() *RoomUpdateOne

ClearThings clears all "things" edges to the Thing entity.

func (*RoomUpdateOne) Exec

func (ruo *RoomUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*RoomUpdateOne) ExecX

func (ruo *RoomUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*RoomUpdateOne) Mutation

func (ruo *RoomUpdateOne) Mutation() *RoomMutation

Mutation returns the RoomMutation object of the builder.

func (*RoomUpdateOne) RemoveThingIDs

func (ruo *RoomUpdateOne) RemoveThingIDs(ids ...int) *RoomUpdateOne

RemoveThingIDs removes the "things" edge to Thing entities by IDs.

func (*RoomUpdateOne) RemoveThings

func (ruo *RoomUpdateOne) RemoveThings(t ...*Thing) *RoomUpdateOne

RemoveThings removes "things" edges to Thing entities.

func (*RoomUpdateOne) Save

func (ruo *RoomUpdateOne) Save(ctx context.Context) (*Room, error)

Save executes the query and returns the updated Room entity.

func (*RoomUpdateOne) SaveX

func (ruo *RoomUpdateOne) SaveX(ctx context.Context) *Room

SaveX is like Save, but panics if an error occurs.

func (*RoomUpdateOne) Select

func (ruo *RoomUpdateOne) Select(field string, fields ...string) *RoomUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*RoomUpdateOne) SetHome

func (ruo *RoomUpdateOne) SetHome(h *Home) *RoomUpdateOne

SetHome sets the "home" edge to the Home entity.

func (*RoomUpdateOne) SetHomeID

func (ruo *RoomUpdateOne) SetHomeID(id int) *RoomUpdateOne

SetHomeID sets the "home" edge to the Home entity by ID.

func (*RoomUpdateOne) SetName

func (ruo *RoomUpdateOne) SetName(s string) *RoomUpdateOne

SetName sets the "name" field.

type Rooms

type Rooms []*Room

Rooms is a parsable slice of Room.

type Thing

type Thing struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// UUID holds the value of the "uuid" field.
	UUID uuid.UUID `json:"uuid,omitempty"`
	// Name holds the value of the "name" field.
	Name string `json:"name,omitempty"`
	// SecretKey holds the value of the "secret_key" field.
	SecretKey uuid.UUID `json:"secret_key,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the ThingQuery when eager-loading is set.
	Edges ThingEdges `json:"edges"`
	// contains filtered or unexported fields
}

Thing is the model entity for the Thing schema.

func (*Thing) QueryRoom

func (t *Thing) QueryRoom() *RoomQuery

QueryRoom queries the "room" edge of the Thing entity.

func (*Thing) String

func (t *Thing) String() string

String implements the fmt.Stringer.

func (*Thing) Unwrap

func (t *Thing) Unwrap() *Thing

Unwrap unwraps the Thing 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 (*Thing) Update

func (t *Thing) Update() *ThingUpdateOne

Update returns a builder for updating this Thing. Note that you need to call Thing.Unwrap() before calling this method if this Thing was returned from a transaction, and the transaction was committed or rolled back.

type ThingClient

type ThingClient struct {
	// contains filtered or unexported fields
}

ThingClient is a client for the Thing schema.

func NewThingClient

func NewThingClient(c config) *ThingClient

NewThingClient returns a client for the Thing from the given config.

func (*ThingClient) Create

func (c *ThingClient) Create() *ThingCreate

Create returns a create builder for Thing.

func (*ThingClient) CreateBulk

func (c *ThingClient) CreateBulk(builders ...*ThingCreate) *ThingCreateBulk

CreateBulk returns a builder for creating a bulk of Thing entities.

func (*ThingClient) Delete

func (c *ThingClient) Delete() *ThingDelete

Delete returns a delete builder for Thing.

func (*ThingClient) DeleteOne

func (c *ThingClient) DeleteOne(t *Thing) *ThingDeleteOne

DeleteOne returns a delete builder for the given entity.

func (*ThingClient) DeleteOneID

func (c *ThingClient) DeleteOneID(id int) *ThingDeleteOne

DeleteOneID returns a delete builder for the given id.

func (*ThingClient) Get

func (c *ThingClient) Get(ctx context.Context, id int) (*Thing, error)

Get returns a Thing entity by its id.

func (*ThingClient) GetX

func (c *ThingClient) GetX(ctx context.Context, id int) *Thing

GetX is like Get, but panics if an error occurs.

func (*ThingClient) Hooks

func (c *ThingClient) Hooks() []Hook

Hooks returns the client hooks.

func (*ThingClient) Query

func (c *ThingClient) Query() *ThingQuery

Query returns a query builder for Thing.

func (*ThingClient) QueryRoom

func (c *ThingClient) QueryRoom(t *Thing) *RoomQuery

QueryRoom queries the room edge of a Thing.

func (*ThingClient) Update

func (c *ThingClient) Update() *ThingUpdate

Update returns an update builder for Thing.

func (*ThingClient) UpdateOne

func (c *ThingClient) UpdateOne(t *Thing) *ThingUpdateOne

UpdateOne returns an update builder for the given entity.

func (*ThingClient) UpdateOneID

func (c *ThingClient) UpdateOneID(id int) *ThingUpdateOne

UpdateOneID returns an update builder for the given id.

func (*ThingClient) Use

func (c *ThingClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `thing.Hooks(f(g(h())))`.

type ThingConnection

type ThingConnection struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// StartTime holds the value of the "start_time" field.
	StartTime string `json:"start_time,omitempty"`
	// EndTime holds the value of the "end_time" field.
	EndTime string `json:"end_time,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the ThingConnectionQuery when eager-loading is set.
	Edges ThingConnectionEdges `json:"edges"`
	// contains filtered or unexported fields
}

ThingConnection is the model entity for the ThingConnection schema.

func (*ThingConnection) QueryThing

func (tc *ThingConnection) QueryThing() *ThingQuery

QueryThing queries the "thing" edge of the ThingConnection entity.

func (*ThingConnection) QueryUser

func (tc *ThingConnection) QueryUser() *UserQuery

QueryUser queries the "user" edge of the ThingConnection entity.

func (*ThingConnection) String

func (tc *ThingConnection) String() string

String implements the fmt.Stringer.

func (*ThingConnection) Unwrap

func (tc *ThingConnection) Unwrap() *ThingConnection

Unwrap unwraps the ThingConnection 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 (*ThingConnection) Update

Update returns a builder for updating this ThingConnection. Note that you need to call ThingConnection.Unwrap() before calling this method if this ThingConnection was returned from a transaction, and the transaction was committed or rolled back.

type ThingConnectionClient

type ThingConnectionClient struct {
	// contains filtered or unexported fields
}

ThingConnectionClient is a client for the ThingConnection schema.

func NewThingConnectionClient

func NewThingConnectionClient(c config) *ThingConnectionClient

NewThingConnectionClient returns a client for the ThingConnection from the given config.

func (*ThingConnectionClient) Create

Create returns a create builder for ThingConnection.

func (*ThingConnectionClient) CreateBulk

CreateBulk returns a builder for creating a bulk of ThingConnection entities.

func (*ThingConnectionClient) Delete

Delete returns a delete builder for ThingConnection.

func (*ThingConnectionClient) DeleteOne

DeleteOne returns a delete builder for the given entity.

func (*ThingConnectionClient) DeleteOneID

DeleteOneID returns a delete builder for the given id.

func (*ThingConnectionClient) Get

Get returns a ThingConnection entity by its id.

func (*ThingConnectionClient) GetX

GetX is like Get, but panics if an error occurs.

func (*ThingConnectionClient) Hooks

func (c *ThingConnectionClient) Hooks() []Hook

Hooks returns the client hooks.

func (*ThingConnectionClient) Query

Query returns a query builder for ThingConnection.

func (*ThingConnectionClient) QueryThing

func (c *ThingConnectionClient) QueryThing(tc *ThingConnection) *ThingQuery

QueryThing queries the thing edge of a ThingConnection.

func (*ThingConnectionClient) QueryUser

func (c *ThingConnectionClient) QueryUser(tc *ThingConnection) *UserQuery

QueryUser queries the user edge of a ThingConnection.

func (*ThingConnectionClient) Update

Update returns an update builder for ThingConnection.

func (*ThingConnectionClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*ThingConnectionClient) UpdateOneID

UpdateOneID returns an update builder for the given id.

func (*ThingConnectionClient) Use

func (c *ThingConnectionClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `thingconnection.Hooks(f(g(h())))`.

type ThingConnectionCreate

type ThingConnectionCreate struct {
	// contains filtered or unexported fields
}

ThingConnectionCreate is the builder for creating a ThingConnection entity.

func (*ThingConnectionCreate) Exec

func (tcc *ThingConnectionCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*ThingConnectionCreate) ExecX

func (tcc *ThingConnectionCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ThingConnectionCreate) Mutation

Mutation returns the ThingConnectionMutation object of the builder.

func (*ThingConnectionCreate) Save

Save creates the ThingConnection in the database.

func (*ThingConnectionCreate) SaveX

SaveX calls Save and panics if Save returns an error.

func (*ThingConnectionCreate) SetEndTime

SetEndTime sets the "end_time" field.

func (*ThingConnectionCreate) SetNillableEndTime

func (tcc *ThingConnectionCreate) SetNillableEndTime(s *string) *ThingConnectionCreate

SetNillableEndTime sets the "end_time" field if the given value is not nil.

func (*ThingConnectionCreate) SetNillableStartTime

func (tcc *ThingConnectionCreate) SetNillableStartTime(s *string) *ThingConnectionCreate

SetNillableStartTime sets the "start_time" field if the given value is not nil.

func (*ThingConnectionCreate) SetStartTime

func (tcc *ThingConnectionCreate) SetStartTime(s string) *ThingConnectionCreate

SetStartTime sets the "start_time" field.

func (*ThingConnectionCreate) SetThing

SetThing sets the "thing" edge to the Thing entity.

func (*ThingConnectionCreate) SetThingID

func (tcc *ThingConnectionCreate) SetThingID(id int) *ThingConnectionCreate

SetThingID sets the "thing" edge to the Thing entity by ID.

func (*ThingConnectionCreate) SetUser

SetUser sets the "user" edge to the User entity.

func (*ThingConnectionCreate) SetUserID

func (tcc *ThingConnectionCreate) SetUserID(id int) *ThingConnectionCreate

SetUserID sets the "user" edge to the User entity by ID.

type ThingConnectionCreateBulk

type ThingConnectionCreateBulk struct {
	// contains filtered or unexported fields
}

ThingConnectionCreateBulk is the builder for creating many ThingConnection entities in bulk.

func (*ThingConnectionCreateBulk) Exec

Exec executes the query.

func (*ThingConnectionCreateBulk) ExecX

func (tccb *ThingConnectionCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ThingConnectionCreateBulk) Save

Save creates the ThingConnection entities in the database.

func (*ThingConnectionCreateBulk) SaveX

SaveX is like Save, but panics if an error occurs.

type ThingConnectionDelete

type ThingConnectionDelete struct {
	// contains filtered or unexported fields
}

ThingConnectionDelete is the builder for deleting a ThingConnection entity.

func (*ThingConnectionDelete) Exec

func (tcd *ThingConnectionDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*ThingConnectionDelete) ExecX

func (tcd *ThingConnectionDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*ThingConnectionDelete) Where

Where appends a list predicates to the ThingConnectionDelete builder.

type ThingConnectionDeleteOne

type ThingConnectionDeleteOne struct {
	// contains filtered or unexported fields
}

ThingConnectionDeleteOne is the builder for deleting a single ThingConnection entity.

func (*ThingConnectionDeleteOne) Exec

Exec executes the deletion query.

func (*ThingConnectionDeleteOne) ExecX

func (tcdo *ThingConnectionDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

type ThingConnectionEdges

type ThingConnectionEdges struct {
	// User holds the value of the user edge.
	User *User `json:"user,omitempty"`
	// Thing holds the value of the thing edge.
	Thing *Thing `json:"thing,omitempty"`
	// contains filtered or unexported fields
}

ThingConnectionEdges holds the relations/edges for other nodes in the graph.

func (ThingConnectionEdges) ThingOrErr

func (e ThingConnectionEdges) ThingOrErr() (*Thing, error)

ThingOrErr returns the Thing value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

func (ThingConnectionEdges) UserOrErr

func (e ThingConnectionEdges) UserOrErr() (*User, error)

UserOrErr returns the User value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

type ThingConnectionGroupBy

type ThingConnectionGroupBy struct {
	// contains filtered or unexported fields
}

ThingConnectionGroupBy is the group-by builder for ThingConnection entities.

func (*ThingConnectionGroupBy) Aggregate

Aggregate adds the given aggregation functions to the group-by query.

func (*ThingConnectionGroupBy) Bool

func (tcgb *ThingConnectionGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a group-by query. It is only allowed when executing a group-by query with one field.

func (*ThingConnectionGroupBy) BoolX

func (tcgb *ThingConnectionGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*ThingConnectionGroupBy) Bools

func (tcgb *ThingConnectionGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from group-by. It is only allowed when executing a group-by query with one field.

func (*ThingConnectionGroupBy) BoolsX

func (tcgb *ThingConnectionGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*ThingConnectionGroupBy) Float64

func (tcgb *ThingConnectionGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a group-by query. It is only allowed when executing a group-by query with one field.

func (*ThingConnectionGroupBy) Float64X

func (tcgb *ThingConnectionGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*ThingConnectionGroupBy) Float64s

func (tcgb *ThingConnectionGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from group-by. It is only allowed when executing a group-by query with one field.

func (*ThingConnectionGroupBy) Float64sX

func (tcgb *ThingConnectionGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*ThingConnectionGroupBy) Int

func (tcgb *ThingConnectionGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a group-by query. It is only allowed when executing a group-by query with one field.

func (*ThingConnectionGroupBy) IntX

func (tcgb *ThingConnectionGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*ThingConnectionGroupBy) Ints

func (tcgb *ThingConnectionGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from group-by. It is only allowed when executing a group-by query with one field.

func (*ThingConnectionGroupBy) IntsX

func (tcgb *ThingConnectionGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*ThingConnectionGroupBy) Scan

func (tcgb *ThingConnectionGroupBy) Scan(ctx context.Context, v interface{}) error

Scan applies the group-by query and scans the result into the given value.

func (*ThingConnectionGroupBy) ScanX

func (tcgb *ThingConnectionGroupBy) ScanX(ctx context.Context, v interface{})

ScanX is like Scan, but panics if an error occurs.

func (*ThingConnectionGroupBy) String

func (tcgb *ThingConnectionGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a group-by query. It is only allowed when executing a group-by query with one field.

func (*ThingConnectionGroupBy) StringX

func (tcgb *ThingConnectionGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*ThingConnectionGroupBy) Strings

func (tcgb *ThingConnectionGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from group-by. It is only allowed when executing a group-by query with one field.

func (*ThingConnectionGroupBy) StringsX

func (tcgb *ThingConnectionGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type ThingConnectionMutation

type ThingConnectionMutation struct {
	// contains filtered or unexported fields
}

ThingConnectionMutation represents an operation that mutates the ThingConnection nodes in the graph.

func (*ThingConnectionMutation) AddField

func (m *ThingConnectionMutation) 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 (*ThingConnectionMutation) AddedEdges

func (m *ThingConnectionMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*ThingConnectionMutation) AddedField

func (m *ThingConnectionMutation) 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 (*ThingConnectionMutation) AddedFields

func (m *ThingConnectionMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*ThingConnectionMutation) AddedIDs

func (m *ThingConnectionMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*ThingConnectionMutation) ClearEdge

func (m *ThingConnectionMutation) 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 (*ThingConnectionMutation) ClearField

func (m *ThingConnectionMutation) 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 (*ThingConnectionMutation) ClearThing

func (m *ThingConnectionMutation) ClearThing()

ClearThing clears the "thing" edge to the Thing entity.

func (*ThingConnectionMutation) ClearUser

func (m *ThingConnectionMutation) ClearUser()

ClearUser clears the "user" edge to the User entity.

func (*ThingConnectionMutation) ClearedEdges

func (m *ThingConnectionMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*ThingConnectionMutation) ClearedFields

func (m *ThingConnectionMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (ThingConnectionMutation) Client

func (m ThingConnectionMutation) 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 (*ThingConnectionMutation) EdgeCleared

func (m *ThingConnectionMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*ThingConnectionMutation) EndTime

func (m *ThingConnectionMutation) EndTime() (r string, exists bool)

EndTime returns the value of the "end_time" field in the mutation.

func (*ThingConnectionMutation) Field

func (m *ThingConnectionMutation) 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 (*ThingConnectionMutation) FieldCleared

func (m *ThingConnectionMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*ThingConnectionMutation) Fields

func (m *ThingConnectionMutation) 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 (*ThingConnectionMutation) ID

func (m *ThingConnectionMutation) 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 (*ThingConnectionMutation) OldEndTime

func (m *ThingConnectionMutation) OldEndTime(ctx context.Context) (v string, err error)

OldEndTime returns the old "end_time" field's value of the ThingConnection entity. If the ThingConnection 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 (*ThingConnectionMutation) OldField

func (m *ThingConnectionMutation) OldField(ctx context.Context, name string) (ent.Value, error)

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 (*ThingConnectionMutation) OldStartTime

func (m *ThingConnectionMutation) OldStartTime(ctx context.Context) (v string, err error)

OldStartTime returns the old "start_time" field's value of the ThingConnection entity. If the ThingConnection 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 (*ThingConnectionMutation) Op

func (m *ThingConnectionMutation) Op() Op

Op returns the operation name.

func (*ThingConnectionMutation) RemovedEdges

func (m *ThingConnectionMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*ThingConnectionMutation) RemovedIDs

func (m *ThingConnectionMutation) 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 (*ThingConnectionMutation) ResetEdge

func (m *ThingConnectionMutation) 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 (*ThingConnectionMutation) ResetEndTime

func (m *ThingConnectionMutation) ResetEndTime()

ResetEndTime resets all changes to the "end_time" field.

func (*ThingConnectionMutation) ResetField

func (m *ThingConnectionMutation) 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 (*ThingConnectionMutation) ResetStartTime

func (m *ThingConnectionMutation) ResetStartTime()

ResetStartTime resets all changes to the "start_time" field.

func (*ThingConnectionMutation) ResetThing

func (m *ThingConnectionMutation) ResetThing()

ResetThing resets all changes to the "thing" edge.

func (*ThingConnectionMutation) ResetUser

func (m *ThingConnectionMutation) ResetUser()

ResetUser resets all changes to the "user" edge.

func (*ThingConnectionMutation) SetEndTime

func (m *ThingConnectionMutation) SetEndTime(s string)

SetEndTime sets the "end_time" field.

func (*ThingConnectionMutation) SetField

func (m *ThingConnectionMutation) 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 (*ThingConnectionMutation) SetStartTime

func (m *ThingConnectionMutation) SetStartTime(s string)

SetStartTime sets the "start_time" field.

func (*ThingConnectionMutation) SetThingID

func (m *ThingConnectionMutation) SetThingID(id int)

SetThingID sets the "thing" edge to the Thing entity by id.

func (*ThingConnectionMutation) SetUserID

func (m *ThingConnectionMutation) SetUserID(id int)

SetUserID sets the "user" edge to the User entity by id.

func (*ThingConnectionMutation) StartTime

func (m *ThingConnectionMutation) StartTime() (r string, exists bool)

StartTime returns the value of the "start_time" field in the mutation.

func (*ThingConnectionMutation) ThingCleared

func (m *ThingConnectionMutation) ThingCleared() bool

ThingCleared reports if the "thing" edge to the Thing entity was cleared.

func (*ThingConnectionMutation) ThingID

func (m *ThingConnectionMutation) ThingID() (id int, exists bool)

ThingID returns the "thing" edge ID in the mutation.

func (*ThingConnectionMutation) ThingIDs

func (m *ThingConnectionMutation) ThingIDs() (ids []int)

ThingIDs returns the "thing" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use ThingID instead. It exists only for internal usage by the builders.

func (ThingConnectionMutation) Tx

func (m ThingConnectionMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*ThingConnectionMutation) Type

func (m *ThingConnectionMutation) Type() string

Type returns the node type of this mutation (ThingConnection).

func (*ThingConnectionMutation) UserCleared

func (m *ThingConnectionMutation) UserCleared() bool

UserCleared reports if the "user" edge to the User entity was cleared.

func (*ThingConnectionMutation) UserID

func (m *ThingConnectionMutation) UserID() (id int, exists bool)

UserID returns the "user" edge ID in the mutation.

func (*ThingConnectionMutation) UserIDs

func (m *ThingConnectionMutation) UserIDs() (ids []int)

UserIDs returns the "user" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use UserID instead. It exists only for internal usage by the builders.

func (*ThingConnectionMutation) Where

Where appends a list predicates to the ThingConnectionMutation builder.

type ThingConnectionQuery

type ThingConnectionQuery struct {
	// contains filtered or unexported fields
}

ThingConnectionQuery is the builder for querying ThingConnection entities.

func (*ThingConnectionQuery) All

All executes the query and returns a list of ThingConnections.

func (*ThingConnectionQuery) AllX

AllX is like All, but panics if an error occurs.

func (*ThingConnectionQuery) Clone

Clone returns a duplicate of the ThingConnectionQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*ThingConnectionQuery) Count

func (tcq *ThingConnectionQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*ThingConnectionQuery) CountX

func (tcq *ThingConnectionQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*ThingConnectionQuery) Exist

func (tcq *ThingConnectionQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*ThingConnectionQuery) ExistX

func (tcq *ThingConnectionQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*ThingConnectionQuery) First

First returns the first ThingConnection entity from the query. Returns a *NotFoundError when no ThingConnection was found.

func (*ThingConnectionQuery) FirstID

func (tcq *ThingConnectionQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first ThingConnection ID from the query. Returns a *NotFoundError when no ThingConnection ID was found.

func (*ThingConnectionQuery) FirstIDX

func (tcq *ThingConnectionQuery) FirstIDX(ctx context.Context) int

FirstIDX is like FirstID, but panics if an error occurs.

func (*ThingConnectionQuery) FirstX

FirstX is like First, but panics if an error occurs.

func (*ThingConnectionQuery) GroupBy

func (tcq *ThingConnectionQuery) GroupBy(field string, fields ...string) *ThingConnectionGroupBy

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 {
	StartTime string `json:"start_time,omitempty"`
	Count int `json:"count,omitempty"`
}

client.ThingConnection.Query().
	GroupBy(thingconnection.FieldStartTime).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*ThingConnectionQuery) IDs

func (tcq *ThingConnectionQuery) IDs(ctx context.Context) ([]int, error)

IDs executes the query and returns a list of ThingConnection IDs.

func (*ThingConnectionQuery) IDsX

func (tcq *ThingConnectionQuery) IDsX(ctx context.Context) []int

IDsX is like IDs, but panics if an error occurs.

func (*ThingConnectionQuery) Limit

func (tcq *ThingConnectionQuery) Limit(limit int) *ThingConnectionQuery

Limit adds a limit step to the query.

func (*ThingConnectionQuery) Offset

func (tcq *ThingConnectionQuery) Offset(offset int) *ThingConnectionQuery

Offset adds an offset step to the query.

func (*ThingConnectionQuery) Only

Only returns a single ThingConnection entity found by the query, ensuring it only returns one. Returns a *NotSingularError when exactly one ThingConnection entity is not found. Returns a *NotFoundError when no ThingConnection entities are found.

func (*ThingConnectionQuery) OnlyID

func (tcq *ThingConnectionQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID is like Only, but returns the only ThingConnection ID in the query. Returns a *NotSingularError when exactly one ThingConnection ID is not found. Returns a *NotFoundError when no entities are found.

func (*ThingConnectionQuery) OnlyIDX

func (tcq *ThingConnectionQuery) OnlyIDX(ctx context.Context) int

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*ThingConnectionQuery) OnlyX

OnlyX is like Only, but panics if an error occurs.

func (*ThingConnectionQuery) Order

Order adds an order step to the query.

func (*ThingConnectionQuery) QueryThing

func (tcq *ThingConnectionQuery) QueryThing() *ThingQuery

QueryThing chains the current query on the "thing" edge.

func (*ThingConnectionQuery) QueryUser

func (tcq *ThingConnectionQuery) QueryUser() *UserQuery

QueryUser chains the current query on the "user" edge.

func (*ThingConnectionQuery) Select

func (tcq *ThingConnectionQuery) Select(fields ...string) *ThingConnectionSelect

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 {
	StartTime string `json:"start_time,omitempty"`
}

client.ThingConnection.Query().
	Select(thingconnection.FieldStartTime).
	Scan(ctx, &v)

func (*ThingConnectionQuery) Unique

func (tcq *ThingConnectionQuery) Unique(unique bool) *ThingConnectionQuery

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 (*ThingConnectionQuery) Where

Where adds a new predicate for the ThingConnectionQuery builder.

func (*ThingConnectionQuery) WithThing

func (tcq *ThingConnectionQuery) WithThing(opts ...func(*ThingQuery)) *ThingConnectionQuery

WithThing tells the query-builder to eager-load the nodes that are connected to the "thing" edge. The optional arguments are used to configure the query builder of the edge.

func (*ThingConnectionQuery) WithUser

func (tcq *ThingConnectionQuery) WithUser(opts ...func(*UserQuery)) *ThingConnectionQuery

WithUser tells the query-builder to eager-load the nodes that are connected to the "user" edge. The optional arguments are used to configure the query builder of the edge.

type ThingConnectionSelect

type ThingConnectionSelect struct {
	*ThingConnectionQuery
	// contains filtered or unexported fields
}

ThingConnectionSelect is the builder for selecting fields of ThingConnection entities.

func (*ThingConnectionSelect) Bool

func (tcs *ThingConnectionSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*ThingConnectionSelect) BoolX

func (tcs *ThingConnectionSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*ThingConnectionSelect) Bools

func (tcs *ThingConnectionSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*ThingConnectionSelect) BoolsX

func (tcs *ThingConnectionSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*ThingConnectionSelect) Float64

func (tcs *ThingConnectionSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*ThingConnectionSelect) Float64X

func (tcs *ThingConnectionSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*ThingConnectionSelect) Float64s

func (tcs *ThingConnectionSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*ThingConnectionSelect) Float64sX

func (tcs *ThingConnectionSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*ThingConnectionSelect) Int

func (tcs *ThingConnectionSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*ThingConnectionSelect) IntX

func (tcs *ThingConnectionSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*ThingConnectionSelect) Ints

func (tcs *ThingConnectionSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*ThingConnectionSelect) IntsX

func (tcs *ThingConnectionSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*ThingConnectionSelect) Scan

func (tcs *ThingConnectionSelect) Scan(ctx context.Context, v interface{}) error

Scan applies the selector query and scans the result into the given value.

func (*ThingConnectionSelect) ScanX

func (tcs *ThingConnectionSelect) ScanX(ctx context.Context, v interface{})

ScanX is like Scan, but panics if an error occurs.

func (*ThingConnectionSelect) String

func (tcs *ThingConnectionSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*ThingConnectionSelect) StringX

func (tcs *ThingConnectionSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*ThingConnectionSelect) Strings

func (tcs *ThingConnectionSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*ThingConnectionSelect) StringsX

func (tcs *ThingConnectionSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type ThingConnectionUpdate

type ThingConnectionUpdate struct {
	// contains filtered or unexported fields
}

ThingConnectionUpdate is the builder for updating ThingConnection entities.

func (*ThingConnectionUpdate) ClearThing

func (tcu *ThingConnectionUpdate) ClearThing() *ThingConnectionUpdate

ClearThing clears the "thing" edge to the Thing entity.

func (*ThingConnectionUpdate) ClearUser

func (tcu *ThingConnectionUpdate) ClearUser() *ThingConnectionUpdate

ClearUser clears the "user" edge to the User entity.

func (*ThingConnectionUpdate) Exec

func (tcu *ThingConnectionUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*ThingConnectionUpdate) ExecX

func (tcu *ThingConnectionUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ThingConnectionUpdate) Mutation

Mutation returns the ThingConnectionMutation object of the builder.

func (*ThingConnectionUpdate) Save

func (tcu *ThingConnectionUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*ThingConnectionUpdate) SaveX

func (tcu *ThingConnectionUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*ThingConnectionUpdate) SetEndTime

SetEndTime sets the "end_time" field.

func (*ThingConnectionUpdate) SetNillableEndTime

func (tcu *ThingConnectionUpdate) SetNillableEndTime(s *string) *ThingConnectionUpdate

SetNillableEndTime sets the "end_time" field if the given value is not nil.

func (*ThingConnectionUpdate) SetNillableStartTime

func (tcu *ThingConnectionUpdate) SetNillableStartTime(s *string) *ThingConnectionUpdate

SetNillableStartTime sets the "start_time" field if the given value is not nil.

func (*ThingConnectionUpdate) SetStartTime

func (tcu *ThingConnectionUpdate) SetStartTime(s string) *ThingConnectionUpdate

SetStartTime sets the "start_time" field.

func (*ThingConnectionUpdate) SetThing

SetThing sets the "thing" edge to the Thing entity.

func (*ThingConnectionUpdate) SetThingID

func (tcu *ThingConnectionUpdate) SetThingID(id int) *ThingConnectionUpdate

SetThingID sets the "thing" edge to the Thing entity by ID.

func (*ThingConnectionUpdate) SetUser

SetUser sets the "user" edge to the User entity.

func (*ThingConnectionUpdate) SetUserID

func (tcu *ThingConnectionUpdate) SetUserID(id int) *ThingConnectionUpdate

SetUserID sets the "user" edge to the User entity by ID.

func (*ThingConnectionUpdate) Where

Where appends a list predicates to the ThingConnectionUpdate builder.

type ThingConnectionUpdateOne

type ThingConnectionUpdateOne struct {
	// contains filtered or unexported fields
}

ThingConnectionUpdateOne is the builder for updating a single ThingConnection entity.

func (*ThingConnectionUpdateOne) ClearThing

ClearThing clears the "thing" edge to the Thing entity.

func (*ThingConnectionUpdateOne) ClearUser

ClearUser clears the "user" edge to the User entity.

func (*ThingConnectionUpdateOne) Exec

Exec executes the query on the entity.

func (*ThingConnectionUpdateOne) ExecX

func (tcuo *ThingConnectionUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ThingConnectionUpdateOne) Mutation

Mutation returns the ThingConnectionMutation object of the builder.

func (*ThingConnectionUpdateOne) Save

Save executes the query and returns the updated ThingConnection entity.

func (*ThingConnectionUpdateOne) SaveX

SaveX is like Save, but panics if an error occurs.

func (*ThingConnectionUpdateOne) Select

func (tcuo *ThingConnectionUpdateOne) Select(field string, fields ...string) *ThingConnectionUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*ThingConnectionUpdateOne) SetEndTime

SetEndTime sets the "end_time" field.

func (*ThingConnectionUpdateOne) SetNillableEndTime

func (tcuo *ThingConnectionUpdateOne) SetNillableEndTime(s *string) *ThingConnectionUpdateOne

SetNillableEndTime sets the "end_time" field if the given value is not nil.

func (*ThingConnectionUpdateOne) SetNillableStartTime

func (tcuo *ThingConnectionUpdateOne) SetNillableStartTime(s *string) *ThingConnectionUpdateOne

SetNillableStartTime sets the "start_time" field if the given value is not nil.

func (*ThingConnectionUpdateOne) SetStartTime

SetStartTime sets the "start_time" field.

func (*ThingConnectionUpdateOne) SetThing

SetThing sets the "thing" edge to the Thing entity.

func (*ThingConnectionUpdateOne) SetThingID

SetThingID sets the "thing" edge to the Thing entity by ID.

func (*ThingConnectionUpdateOne) SetUser

SetUser sets the "user" edge to the User entity.

func (*ThingConnectionUpdateOne) SetUserID

SetUserID sets the "user" edge to the User entity by ID.

type ThingConnections

type ThingConnections []*ThingConnection

ThingConnections is a parsable slice of ThingConnection.

type ThingCreate

type ThingCreate struct {
	// contains filtered or unexported fields
}

ThingCreate is the builder for creating a Thing entity.

func (*ThingCreate) Exec

func (tc *ThingCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*ThingCreate) ExecX

func (tc *ThingCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ThingCreate) Mutation

func (tc *ThingCreate) Mutation() *ThingMutation

Mutation returns the ThingMutation object of the builder.

func (*ThingCreate) Save

func (tc *ThingCreate) Save(ctx context.Context) (*Thing, error)

Save creates the Thing in the database.

func (*ThingCreate) SaveX

func (tc *ThingCreate) SaveX(ctx context.Context) *Thing

SaveX calls Save and panics if Save returns an error.

func (*ThingCreate) SetName

func (tc *ThingCreate) SetName(s string) *ThingCreate

SetName sets the "name" field.

func (*ThingCreate) SetRoom

func (tc *ThingCreate) SetRoom(r *Room) *ThingCreate

SetRoom sets the "room" edge to the Room entity.

func (*ThingCreate) SetRoomID

func (tc *ThingCreate) SetRoomID(id int) *ThingCreate

SetRoomID sets the "room" edge to the Room entity by ID.

func (*ThingCreate) SetSecretKey

func (tc *ThingCreate) SetSecretKey(u uuid.UUID) *ThingCreate

SetSecretKey sets the "secret_key" field.

func (*ThingCreate) SetUUID

func (tc *ThingCreate) SetUUID(u uuid.UUID) *ThingCreate

SetUUID sets the "uuid" field.

type ThingCreateBulk

type ThingCreateBulk struct {
	// contains filtered or unexported fields
}

ThingCreateBulk is the builder for creating many Thing entities in bulk.

func (*ThingCreateBulk) Exec

func (tcb *ThingCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*ThingCreateBulk) ExecX

func (tcb *ThingCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ThingCreateBulk) Save

func (tcb *ThingCreateBulk) Save(ctx context.Context) ([]*Thing, error)

Save creates the Thing entities in the database.

func (*ThingCreateBulk) SaveX

func (tcb *ThingCreateBulk) SaveX(ctx context.Context) []*Thing

SaveX is like Save, but panics if an error occurs.

type ThingDelete

type ThingDelete struct {
	// contains filtered or unexported fields
}

ThingDelete is the builder for deleting a Thing entity.

func (*ThingDelete) Exec

func (td *ThingDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*ThingDelete) ExecX

func (td *ThingDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*ThingDelete) Where

func (td *ThingDelete) Where(ps ...predicate.Thing) *ThingDelete

Where appends a list predicates to the ThingDelete builder.

type ThingDeleteOne

type ThingDeleteOne struct {
	// contains filtered or unexported fields
}

ThingDeleteOne is the builder for deleting a single Thing entity.

func (*ThingDeleteOne) Exec

func (tdo *ThingDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*ThingDeleteOne) ExecX

func (tdo *ThingDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

type ThingEdges

type ThingEdges struct {
	// Room holds the value of the room edge.
	Room *Room `json:"room,omitempty"`
	// contains filtered or unexported fields
}

ThingEdges holds the relations/edges for other nodes in the graph.

func (ThingEdges) RoomOrErr

func (e ThingEdges) RoomOrErr() (*Room, error)

RoomOrErr returns the Room value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

type ThingGroupBy

type ThingGroupBy struct {
	// contains filtered or unexported fields
}

ThingGroupBy is the group-by builder for Thing entities.

func (*ThingGroupBy) Aggregate

func (tgb *ThingGroupBy) Aggregate(fns ...AggregateFunc) *ThingGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*ThingGroupBy) Bool

func (tgb *ThingGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a group-by query. It is only allowed when executing a group-by query with one field.

func (*ThingGroupBy) BoolX

func (tgb *ThingGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*ThingGroupBy) Bools

func (tgb *ThingGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from group-by. It is only allowed when executing a group-by query with one field.

func (*ThingGroupBy) BoolsX

func (tgb *ThingGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*ThingGroupBy) Float64

func (tgb *ThingGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a group-by query. It is only allowed when executing a group-by query with one field.

func (*ThingGroupBy) Float64X

func (tgb *ThingGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*ThingGroupBy) Float64s

func (tgb *ThingGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from group-by. It is only allowed when executing a group-by query with one field.

func (*ThingGroupBy) Float64sX

func (tgb *ThingGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*ThingGroupBy) Int

func (tgb *ThingGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a group-by query. It is only allowed when executing a group-by query with one field.

func (*ThingGroupBy) IntX

func (tgb *ThingGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*ThingGroupBy) Ints

func (tgb *ThingGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from group-by. It is only allowed when executing a group-by query with one field.

func (*ThingGroupBy) IntsX

func (tgb *ThingGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*ThingGroupBy) Scan

func (tgb *ThingGroupBy) Scan(ctx context.Context, v interface{}) error

Scan applies the group-by query and scans the result into the given value.

func (*ThingGroupBy) ScanX

func (tgb *ThingGroupBy) ScanX(ctx context.Context, v interface{})

ScanX is like Scan, but panics if an error occurs.

func (*ThingGroupBy) String

func (tgb *ThingGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a group-by query. It is only allowed when executing a group-by query with one field.

func (*ThingGroupBy) StringX

func (tgb *ThingGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*ThingGroupBy) Strings

func (tgb *ThingGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from group-by. It is only allowed when executing a group-by query with one field.

func (*ThingGroupBy) StringsX

func (tgb *ThingGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type ThingMutation

type ThingMutation struct {
	// contains filtered or unexported fields
}

ThingMutation represents an operation that mutates the Thing nodes in the graph.

func (*ThingMutation) AddField

func (m *ThingMutation) 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 (*ThingMutation) AddedEdges

func (m *ThingMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*ThingMutation) AddedField

func (m *ThingMutation) 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 (*ThingMutation) AddedFields

func (m *ThingMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*ThingMutation) AddedIDs

func (m *ThingMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*ThingMutation) ClearEdge

func (m *ThingMutation) 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 (*ThingMutation) ClearField

func (m *ThingMutation) 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 (*ThingMutation) ClearRoom

func (m *ThingMutation) ClearRoom()

ClearRoom clears the "room" edge to the Room entity.

func (*ThingMutation) ClearedEdges

func (m *ThingMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*ThingMutation) ClearedFields

func (m *ThingMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (ThingMutation) Client

func (m ThingMutation) 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 (*ThingMutation) EdgeCleared

func (m *ThingMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*ThingMutation) Field

func (m *ThingMutation) 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 (*ThingMutation) FieldCleared

func (m *ThingMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*ThingMutation) Fields

func (m *ThingMutation) 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 (*ThingMutation) ID

func (m *ThingMutation) 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 (*ThingMutation) Name

func (m *ThingMutation) Name() (r string, exists bool)

Name returns the value of the "name" field in the mutation.

func (*ThingMutation) OldField

func (m *ThingMutation) OldField(ctx context.Context, name string) (ent.Value, error)

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 (*ThingMutation) OldName

func (m *ThingMutation) OldName(ctx context.Context) (v string, err error)

OldName returns the old "name" field's value of the Thing entity. If the Thing 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 (*ThingMutation) OldSecretKey

func (m *ThingMutation) OldSecretKey(ctx context.Context) (v uuid.UUID, err error)

OldSecretKey returns the old "secret_key" field's value of the Thing entity. If the Thing 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 (*ThingMutation) OldUUID

func (m *ThingMutation) OldUUID(ctx context.Context) (v uuid.UUID, err error)

OldUUID returns the old "uuid" field's value of the Thing entity. If the Thing 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 (*ThingMutation) Op

func (m *ThingMutation) Op() Op

Op returns the operation name.

func (*ThingMutation) RemovedEdges

func (m *ThingMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*ThingMutation) RemovedIDs

func (m *ThingMutation) 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 (*ThingMutation) ResetEdge

func (m *ThingMutation) 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 (*ThingMutation) ResetField

func (m *ThingMutation) 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 (*ThingMutation) ResetName

func (m *ThingMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*ThingMutation) ResetRoom

func (m *ThingMutation) ResetRoom()

ResetRoom resets all changes to the "room" edge.

func (*ThingMutation) ResetSecretKey

func (m *ThingMutation) ResetSecretKey()

ResetSecretKey resets all changes to the "secret_key" field.

func (*ThingMutation) ResetUUID

func (m *ThingMutation) ResetUUID()

ResetUUID resets all changes to the "uuid" field.

func (*ThingMutation) RoomCleared

func (m *ThingMutation) RoomCleared() bool

RoomCleared reports if the "room" edge to the Room entity was cleared.

func (*ThingMutation) RoomID

func (m *ThingMutation) RoomID() (id int, exists bool)

RoomID returns the "room" edge ID in the mutation.

func (*ThingMutation) RoomIDs

func (m *ThingMutation) RoomIDs() (ids []int)

RoomIDs returns the "room" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use RoomID instead. It exists only for internal usage by the builders.

func (*ThingMutation) SecretKey

func (m *ThingMutation) SecretKey() (r uuid.UUID, exists bool)

SecretKey returns the value of the "secret_key" field in the mutation.

func (*ThingMutation) SetField

func (m *ThingMutation) 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 (*ThingMutation) SetName

func (m *ThingMutation) SetName(s string)

SetName sets the "name" field.

func (*ThingMutation) SetRoomID

func (m *ThingMutation) SetRoomID(id int)

SetRoomID sets the "room" edge to the Room entity by id.

func (*ThingMutation) SetSecretKey

func (m *ThingMutation) SetSecretKey(u uuid.UUID)

SetSecretKey sets the "secret_key" field.

func (*ThingMutation) SetUUID

func (m *ThingMutation) SetUUID(u uuid.UUID)

SetUUID sets the "uuid" field.

func (ThingMutation) Tx

func (m ThingMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*ThingMutation) Type

func (m *ThingMutation) Type() string

Type returns the node type of this mutation (Thing).

func (*ThingMutation) UUID

func (m *ThingMutation) UUID() (r uuid.UUID, exists bool)

UUID returns the value of the "uuid" field in the mutation.

func (*ThingMutation) Where

func (m *ThingMutation) Where(ps ...predicate.Thing)

Where appends a list predicates to the ThingMutation builder.

type ThingQuery

type ThingQuery struct {
	// contains filtered or unexported fields
}

ThingQuery is the builder for querying Thing entities.

func (*ThingQuery) All

func (tq *ThingQuery) All(ctx context.Context) ([]*Thing, error)

All executes the query and returns a list of Things.

func (*ThingQuery) AllX

func (tq *ThingQuery) AllX(ctx context.Context) []*Thing

AllX is like All, but panics if an error occurs.

func (*ThingQuery) Clone

func (tq *ThingQuery) Clone() *ThingQuery

Clone returns a duplicate of the ThingQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*ThingQuery) Count

func (tq *ThingQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*ThingQuery) CountX

func (tq *ThingQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*ThingQuery) Exist

func (tq *ThingQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*ThingQuery) ExistX

func (tq *ThingQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*ThingQuery) First

func (tq *ThingQuery) First(ctx context.Context) (*Thing, error)

First returns the first Thing entity from the query. Returns a *NotFoundError when no Thing was found.

func (*ThingQuery) FirstID

func (tq *ThingQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first Thing ID from the query. Returns a *NotFoundError when no Thing ID was found.

func (*ThingQuery) FirstIDX

func (tq *ThingQuery) FirstIDX(ctx context.Context) int

FirstIDX is like FirstID, but panics if an error occurs.

func (*ThingQuery) FirstX

func (tq *ThingQuery) FirstX(ctx context.Context) *Thing

FirstX is like First, but panics if an error occurs.

func (*ThingQuery) GroupBy

func (tq *ThingQuery) GroupBy(field string, fields ...string) *ThingGroupBy

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 {
	UUID uuid.UUID `json:"uuid,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Thing.Query().
	GroupBy(thing.FieldUUID).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*ThingQuery) IDs

func (tq *ThingQuery) IDs(ctx context.Context) ([]int, error)

IDs executes the query and returns a list of Thing IDs.

func (*ThingQuery) IDsX

func (tq *ThingQuery) IDsX(ctx context.Context) []int

IDsX is like IDs, but panics if an error occurs.

func (*ThingQuery) Limit

func (tq *ThingQuery) Limit(limit int) *ThingQuery

Limit adds a limit step to the query.

func (*ThingQuery) Offset

func (tq *ThingQuery) Offset(offset int) *ThingQuery

Offset adds an offset step to the query.

func (*ThingQuery) Only

func (tq *ThingQuery) Only(ctx context.Context) (*Thing, error)

Only returns a single Thing entity found by the query, ensuring it only returns one. Returns a *NotSingularError when exactly one Thing entity is not found. Returns a *NotFoundError when no Thing entities are found.

func (*ThingQuery) OnlyID

func (tq *ThingQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID is like Only, but returns the only Thing ID in the query. Returns a *NotSingularError when exactly one Thing ID is not found. Returns a *NotFoundError when no entities are found.

func (*ThingQuery) OnlyIDX

func (tq *ThingQuery) OnlyIDX(ctx context.Context) int

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*ThingQuery) OnlyX

func (tq *ThingQuery) OnlyX(ctx context.Context) *Thing

OnlyX is like Only, but panics if an error occurs.

func (*ThingQuery) Order

func (tq *ThingQuery) Order(o ...OrderFunc) *ThingQuery

Order adds an order step to the query.

func (*ThingQuery) QueryRoom

func (tq *ThingQuery) QueryRoom() *RoomQuery

QueryRoom chains the current query on the "room" edge.

func (*ThingQuery) Select

func (tq *ThingQuery) Select(fields ...string) *ThingSelect

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 {
	UUID uuid.UUID `json:"uuid,omitempty"`
}

client.Thing.Query().
	Select(thing.FieldUUID).
	Scan(ctx, &v)

func (*ThingQuery) Unique

func (tq *ThingQuery) Unique(unique bool) *ThingQuery

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 (*ThingQuery) Where

func (tq *ThingQuery) Where(ps ...predicate.Thing) *ThingQuery

Where adds a new predicate for the ThingQuery builder.

func (*ThingQuery) WithRoom

func (tq *ThingQuery) WithRoom(opts ...func(*RoomQuery)) *ThingQuery

WithRoom tells the query-builder to eager-load the nodes that are connected to the "room" edge. The optional arguments are used to configure the query builder of the edge.

type ThingSelect

type ThingSelect struct {
	*ThingQuery
	// contains filtered or unexported fields
}

ThingSelect is the builder for selecting fields of Thing entities.

func (*ThingSelect) Bool

func (ts *ThingSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*ThingSelect) BoolX

func (ts *ThingSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*ThingSelect) Bools

func (ts *ThingSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*ThingSelect) BoolsX

func (ts *ThingSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*ThingSelect) Float64

func (ts *ThingSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*ThingSelect) Float64X

func (ts *ThingSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*ThingSelect) Float64s

func (ts *ThingSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*ThingSelect) Float64sX

func (ts *ThingSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*ThingSelect) Int

func (ts *ThingSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*ThingSelect) IntX

func (ts *ThingSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*ThingSelect) Ints

func (ts *ThingSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*ThingSelect) IntsX

func (ts *ThingSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*ThingSelect) Scan

func (ts *ThingSelect) Scan(ctx context.Context, v interface{}) error

Scan applies the selector query and scans the result into the given value.

func (*ThingSelect) ScanX

func (ts *ThingSelect) ScanX(ctx context.Context, v interface{})

ScanX is like Scan, but panics if an error occurs.

func (*ThingSelect) String

func (ts *ThingSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*ThingSelect) StringX

func (ts *ThingSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*ThingSelect) Strings

func (ts *ThingSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*ThingSelect) StringsX

func (ts *ThingSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type ThingUpdate

type ThingUpdate struct {
	// contains filtered or unexported fields
}

ThingUpdate is the builder for updating Thing entities.

func (*ThingUpdate) ClearRoom

func (tu *ThingUpdate) ClearRoom() *ThingUpdate

ClearRoom clears the "room" edge to the Room entity.

func (*ThingUpdate) Exec

func (tu *ThingUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*ThingUpdate) ExecX

func (tu *ThingUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ThingUpdate) Mutation

func (tu *ThingUpdate) Mutation() *ThingMutation

Mutation returns the ThingMutation object of the builder.

func (*ThingUpdate) Save

func (tu *ThingUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*ThingUpdate) SaveX

func (tu *ThingUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*ThingUpdate) SetName

func (tu *ThingUpdate) SetName(s string) *ThingUpdate

SetName sets the "name" field.

func (*ThingUpdate) SetRoom

func (tu *ThingUpdate) SetRoom(r *Room) *ThingUpdate

SetRoom sets the "room" edge to the Room entity.

func (*ThingUpdate) SetRoomID

func (tu *ThingUpdate) SetRoomID(id int) *ThingUpdate

SetRoomID sets the "room" edge to the Room entity by ID.

func (*ThingUpdate) SetSecretKey

func (tu *ThingUpdate) SetSecretKey(u uuid.UUID) *ThingUpdate

SetSecretKey sets the "secret_key" field.

func (*ThingUpdate) Where

func (tu *ThingUpdate) Where(ps ...predicate.Thing) *ThingUpdate

Where appends a list predicates to the ThingUpdate builder.

type ThingUpdateOne

type ThingUpdateOne struct {
	// contains filtered or unexported fields
}

ThingUpdateOne is the builder for updating a single Thing entity.

func (*ThingUpdateOne) ClearRoom

func (tuo *ThingUpdateOne) ClearRoom() *ThingUpdateOne

ClearRoom clears the "room" edge to the Room entity.

func (*ThingUpdateOne) Exec

func (tuo *ThingUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*ThingUpdateOne) ExecX

func (tuo *ThingUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ThingUpdateOne) Mutation

func (tuo *ThingUpdateOne) Mutation() *ThingMutation

Mutation returns the ThingMutation object of the builder.

func (*ThingUpdateOne) Save

func (tuo *ThingUpdateOne) Save(ctx context.Context) (*Thing, error)

Save executes the query and returns the updated Thing entity.

func (*ThingUpdateOne) SaveX

func (tuo *ThingUpdateOne) SaveX(ctx context.Context) *Thing

SaveX is like Save, but panics if an error occurs.

func (*ThingUpdateOne) Select

func (tuo *ThingUpdateOne) Select(field string, fields ...string) *ThingUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*ThingUpdateOne) SetName

func (tuo *ThingUpdateOne) SetName(s string) *ThingUpdateOne

SetName sets the "name" field.

func (*ThingUpdateOne) SetRoom

func (tuo *ThingUpdateOne) SetRoom(r *Room) *ThingUpdateOne

SetRoom sets the "room" edge to the Room entity.

func (*ThingUpdateOne) SetRoomID

func (tuo *ThingUpdateOne) SetRoomID(id int) *ThingUpdateOne

SetRoomID sets the "room" edge to the Room entity by ID.

func (*ThingUpdateOne) SetSecretKey

func (tuo *ThingUpdateOne) SetSecretKey(u uuid.UUID) *ThingUpdateOne

SetSecretKey sets the "secret_key" field.

type Things

type Things []*Thing

Things is a parsable slice of Thing.

type Tx

type Tx struct {

	// App is the client for interacting with the App builders.
	App *AppClient
	// Home is the client for interacting with the Home builders.
	Home *HomeClient
	// HomeConnection is the client for interacting with the HomeConnection builders.
	HomeConnection *HomeConnectionClient
	// Room is the client for interacting with the Room builders.
	Room *RoomClient
	// RoomConnection is the client for interacting with the RoomConnection builders.
	RoomConnection *RoomConnectionClient
	// Thing is the client for interacting with the Thing builders.
	Thing *ThingClient
	// ThingConnection is the client for interacting with the ThingConnection builders.
	ThingConnection *ThingConnectionClient
	// User is the client for interacting with the User builders.
	User *UserClient
	// contains filtered or unexported fields
}

Tx is a transactional client that is created by calling Client.Tx().

func TxFromContext

func TxFromContext(ctx context.Context) *Tx

TxFromContext returns a Tx stored inside a context, or nil if there isn't one.

func (*Tx) Client

func (tx *Tx) Client() *Client

Client returns a Client that binds to current transaction.

func (*Tx) Commit

func (tx *Tx) Commit() error

Commit commits the transaction.

func (*Tx) OnCommit

func (tx *Tx) OnCommit(f CommitHook)

OnCommit adds a hook to call on commit.

func (*Tx) OnRollback

func (tx *Tx) OnRollback(f RollbackHook)

OnRollback adds a hook to call on rollback.

func (*Tx) Rollback

func (tx *Tx) Rollback() error

Rollback rollbacks the transaction.

type User

type User struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// UUID holds the value of the "uuid" field.
	UUID uuid.UUID `json:"uuid,omitempty"`
	// Name holds the value of the "name" field.
	Name string `json:"name,omitempty"`
	// Password holds the value of the "password" field.
	Password string `json:"password,omitempty"`
	// AccessKey holds the value of the "access_key" field.
	AccessKey uuid.UUID `json:"access_key,omitempty"`
	// SecretKey holds the value of the "secret_key" field.
	SecretKey uuid.UUID `json:"secret_key,omitempty"`
	// SuperUser holds the value of the "super_user" field.
	SuperUser bool `json:"super_user,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the UserQuery when eager-loading is set.
	Edges UserEdges `json:"edges"`
	// contains filtered or unexported fields
}

User is the model entity for the User schema.

func (*User) QueryApps

func (u *User) QueryApps() *AppQuery

QueryApps queries the "apps" edge of the User entity.

func (*User) String

func (u *User) String() string

String implements the fmt.Stringer.

func (*User) Unwrap

func (u *User) Unwrap() *User

Unwrap unwraps the User 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 (*User) Update

func (u *User) Update() *UserUpdateOne

Update returns a builder for updating this User. Note that you need to call User.Unwrap() before calling this method if this User was returned from a transaction, and the transaction was committed or rolled back.

type UserClient

type UserClient struct {
	// contains filtered or unexported fields
}

UserClient is a client for the User schema.

func NewUserClient

func NewUserClient(c config) *UserClient

NewUserClient returns a client for the User from the given config.

func (*UserClient) Create

func (c *UserClient) Create() *UserCreate

Create returns a create builder for User.

func (*UserClient) CreateBulk

func (c *UserClient) CreateBulk(builders ...*UserCreate) *UserCreateBulk

CreateBulk returns a builder for creating a bulk of User entities.

func (*UserClient) Delete

func (c *UserClient) Delete() *UserDelete

Delete returns a delete builder for User.

func (*UserClient) DeleteOne

func (c *UserClient) DeleteOne(u *User) *UserDeleteOne

DeleteOne returns a delete builder for the given entity.

func (*UserClient) DeleteOneID

func (c *UserClient) DeleteOneID(id int) *UserDeleteOne

DeleteOneID returns a delete builder for the given id.

func (*UserClient) Get

func (c *UserClient) Get(ctx context.Context, id int) (*User, error)

Get returns a User entity by its id.

func (*UserClient) GetX

func (c *UserClient) GetX(ctx context.Context, id int) *User

GetX is like Get, but panics if an error occurs.

func (*UserClient) Hooks

func (c *UserClient) Hooks() []Hook

Hooks returns the client hooks.

func (*UserClient) Query

func (c *UserClient) Query() *UserQuery

Query returns a query builder for User.

func (*UserClient) QueryApps

func (c *UserClient) QueryApps(u *User) *AppQuery

QueryApps queries the apps edge of a User.

func (*UserClient) Update

func (c *UserClient) Update() *UserUpdate

Update returns an update builder for User.

func (*UserClient) UpdateOne

func (c *UserClient) UpdateOne(u *User) *UserUpdateOne

UpdateOne returns an update builder for the given entity.

func (*UserClient) UpdateOneID

func (c *UserClient) UpdateOneID(id int) *UserUpdateOne

UpdateOneID returns an update builder for the given id.

func (*UserClient) Use

func (c *UserClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `user.Hooks(f(g(h())))`.

type UserCreate

type UserCreate struct {
	// contains filtered or unexported fields
}

UserCreate is the builder for creating a User entity.

func (*UserCreate) AddAppIDs

func (uc *UserCreate) AddAppIDs(ids ...int) *UserCreate

AddAppIDs adds the "apps" edge to the App entity by IDs.

func (*UserCreate) AddApps

func (uc *UserCreate) AddApps(a ...*App) *UserCreate

AddApps adds the "apps" edges to the App entity.

func (*UserCreate) Exec

func (uc *UserCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*UserCreate) ExecX

func (uc *UserCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserCreate) Mutation

func (uc *UserCreate) Mutation() *UserMutation

Mutation returns the UserMutation object of the builder.

func (*UserCreate) Save

func (uc *UserCreate) Save(ctx context.Context) (*User, error)

Save creates the User in the database.

func (*UserCreate) SaveX

func (uc *UserCreate) SaveX(ctx context.Context) *User

SaveX calls Save and panics if Save returns an error.

func (*UserCreate) SetAccessKey

func (uc *UserCreate) SetAccessKey(u uuid.UUID) *UserCreate

SetAccessKey sets the "access_key" field.

func (*UserCreate) SetName

func (uc *UserCreate) SetName(s string) *UserCreate

SetName sets the "name" field.

func (*UserCreate) SetPassword

func (uc *UserCreate) SetPassword(s string) *UserCreate

SetPassword sets the "password" field.

func (*UserCreate) SetSecretKey

func (uc *UserCreate) SetSecretKey(u uuid.UUID) *UserCreate

SetSecretKey sets the "secret_key" field.

func (*UserCreate) SetSuperUser

func (uc *UserCreate) SetSuperUser(b bool) *UserCreate

SetSuperUser sets the "super_user" field.

func (*UserCreate) SetUUID

func (uc *UserCreate) SetUUID(u uuid.UUID) *UserCreate

SetUUID sets the "uuid" field.

type UserCreateBulk

type UserCreateBulk struct {
	// contains filtered or unexported fields
}

UserCreateBulk is the builder for creating many User entities in bulk.

func (*UserCreateBulk) Exec

func (ucb *UserCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*UserCreateBulk) ExecX

func (ucb *UserCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserCreateBulk) Save

func (ucb *UserCreateBulk) Save(ctx context.Context) ([]*User, error)

Save creates the User entities in the database.

func (*UserCreateBulk) SaveX

func (ucb *UserCreateBulk) SaveX(ctx context.Context) []*User

SaveX is like Save, but panics if an error occurs.

type UserDelete

type UserDelete struct {
	// contains filtered or unexported fields
}

UserDelete is the builder for deleting a User entity.

func (*UserDelete) Exec

func (ud *UserDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*UserDelete) ExecX

func (ud *UserDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*UserDelete) Where

func (ud *UserDelete) Where(ps ...predicate.User) *UserDelete

Where appends a list predicates to the UserDelete builder.

type UserDeleteOne

type UserDeleteOne struct {
	// contains filtered or unexported fields
}

UserDeleteOne is the builder for deleting a single User entity.

func (*UserDeleteOne) Exec

func (udo *UserDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*UserDeleteOne) ExecX

func (udo *UserDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

type UserEdges

type UserEdges struct {
	// Apps holds the value of the apps edge.
	Apps []*App `json:"apps,omitempty"`
	// contains filtered or unexported fields
}

UserEdges holds the relations/edges for other nodes in the graph.

func (UserEdges) AppsOrErr

func (e UserEdges) AppsOrErr() ([]*App, error)

AppsOrErr returns the Apps value or an error if the edge was not loaded in eager-loading.

type UserGroupBy

type UserGroupBy struct {
	// contains filtered or unexported fields
}

UserGroupBy is the group-by builder for User entities.

func (*UserGroupBy) Aggregate

func (ugb *UserGroupBy) Aggregate(fns ...AggregateFunc) *UserGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*UserGroupBy) Bool

func (ugb *UserGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a group-by query. It is only allowed when executing a group-by query with one field.

func (*UserGroupBy) BoolX

func (ugb *UserGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*UserGroupBy) Bools

func (ugb *UserGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from group-by. It is only allowed when executing a group-by query with one field.

func (*UserGroupBy) BoolsX

func (ugb *UserGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*UserGroupBy) Float64

func (ugb *UserGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a group-by query. It is only allowed when executing a group-by query with one field.

func (*UserGroupBy) Float64X

func (ugb *UserGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*UserGroupBy) Float64s

func (ugb *UserGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from group-by. It is only allowed when executing a group-by query with one field.

func (*UserGroupBy) Float64sX

func (ugb *UserGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*UserGroupBy) Int

func (ugb *UserGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a group-by query. It is only allowed when executing a group-by query with one field.

func (*UserGroupBy) IntX

func (ugb *UserGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*UserGroupBy) Ints

func (ugb *UserGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from group-by. It is only allowed when executing a group-by query with one field.

func (*UserGroupBy) IntsX

func (ugb *UserGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*UserGroupBy) Scan

func (ugb *UserGroupBy) Scan(ctx context.Context, v interface{}) error

Scan applies the group-by query and scans the result into the given value.

func (*UserGroupBy) ScanX

func (ugb *UserGroupBy) ScanX(ctx context.Context, v interface{})

ScanX is like Scan, but panics if an error occurs.

func (*UserGroupBy) String

func (ugb *UserGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a group-by query. It is only allowed when executing a group-by query with one field.

func (*UserGroupBy) StringX

func (ugb *UserGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*UserGroupBy) Strings

func (ugb *UserGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from group-by. It is only allowed when executing a group-by query with one field.

func (*UserGroupBy) StringsX

func (ugb *UserGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type UserMutation

type UserMutation struct {
	// contains filtered or unexported fields
}

UserMutation represents an operation that mutates the User nodes in the graph.

func (*UserMutation) AccessKey

func (m *UserMutation) AccessKey() (r uuid.UUID, exists bool)

AccessKey returns the value of the "access_key" field in the mutation.

func (*UserMutation) AddAppIDs

func (m *UserMutation) AddAppIDs(ids ...int)

AddAppIDs adds the "apps" edge to the App entity by ids.

func (*UserMutation) AddField

func (m *UserMutation) 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 (*UserMutation) AddedEdges

func (m *UserMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*UserMutation) AddedField

func (m *UserMutation) 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 (*UserMutation) AddedFields

func (m *UserMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*UserMutation) AddedIDs

func (m *UserMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*UserMutation) AppsCleared

func (m *UserMutation) AppsCleared() bool

AppsCleared reports if the "apps" edge to the App entity was cleared.

func (*UserMutation) AppsIDs

func (m *UserMutation) AppsIDs() (ids []int)

AppsIDs returns the "apps" edge IDs in the mutation.

func (*UserMutation) ClearApps

func (m *UserMutation) ClearApps()

ClearApps clears the "apps" edge to the App entity.

func (*UserMutation) ClearEdge

func (m *UserMutation) 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 (*UserMutation) ClearField

func (m *UserMutation) 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 (*UserMutation) ClearedEdges

func (m *UserMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*UserMutation) ClearedFields

func (m *UserMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (UserMutation) Client

func (m UserMutation) 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 (*UserMutation) EdgeCleared

func (m *UserMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*UserMutation) Field

func (m *UserMutation) 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 (*UserMutation) FieldCleared

func (m *UserMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*UserMutation) Fields

func (m *UserMutation) 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 (*UserMutation) ID

func (m *UserMutation) 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 (*UserMutation) Name

func (m *UserMutation) Name() (r string, exists bool)

Name returns the value of the "name" field in the mutation.

func (*UserMutation) OldAccessKey

func (m *UserMutation) OldAccessKey(ctx context.Context) (v uuid.UUID, err error)

OldAccessKey returns the old "access_key" field's value of the User entity. If the User 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 (*UserMutation) OldField

func (m *UserMutation) OldField(ctx context.Context, name string) (ent.Value, error)

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 (*UserMutation) OldName

func (m *UserMutation) OldName(ctx context.Context) (v string, err error)

OldName returns the old "name" field's value of the User entity. If the User 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 (*UserMutation) OldPassword

func (m *UserMutation) OldPassword(ctx context.Context) (v string, err error)

OldPassword returns the old "password" field's value of the User entity. If the User 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 (*UserMutation) OldSecretKey

func (m *UserMutation) OldSecretKey(ctx context.Context) (v uuid.UUID, err error)

OldSecretKey returns the old "secret_key" field's value of the User entity. If the User 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 (*UserMutation) OldSuperUser

func (m *UserMutation) OldSuperUser(ctx context.Context) (v bool, err error)

OldSuperUser returns the old "super_user" field's value of the User entity. If the User 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 (*UserMutation) OldUUID

func (m *UserMutation) OldUUID(ctx context.Context) (v uuid.UUID, err error)

OldUUID returns the old "uuid" field's value of the User entity. If the User 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 (*UserMutation) Op

func (m *UserMutation) Op() Op

Op returns the operation name.

func (*UserMutation) Password

func (m *UserMutation) Password() (r string, exists bool)

Password returns the value of the "password" field in the mutation.

func (*UserMutation) RemoveAppIDs

func (m *UserMutation) RemoveAppIDs(ids ...int)

RemoveAppIDs removes the "apps" edge to the App entity by IDs.

func (*UserMutation) RemovedAppsIDs

func (m *UserMutation) RemovedAppsIDs() (ids []int)

RemovedApps returns the removed IDs of the "apps" edge to the App entity.

func (*UserMutation) RemovedEdges

func (m *UserMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*UserMutation) RemovedIDs

func (m *UserMutation) 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 (*UserMutation) ResetAccessKey

func (m *UserMutation) ResetAccessKey()

ResetAccessKey resets all changes to the "access_key" field.

func (*UserMutation) ResetApps

func (m *UserMutation) ResetApps()

ResetApps resets all changes to the "apps" edge.

func (*UserMutation) ResetEdge

func (m *UserMutation) 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 (*UserMutation) ResetField

func (m *UserMutation) 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 (*UserMutation) ResetName

func (m *UserMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*UserMutation) ResetPassword

func (m *UserMutation) ResetPassword()

ResetPassword resets all changes to the "password" field.

func (*UserMutation) ResetSecretKey

func (m *UserMutation) ResetSecretKey()

ResetSecretKey resets all changes to the "secret_key" field.

func (*UserMutation) ResetSuperUser

func (m *UserMutation) ResetSuperUser()

ResetSuperUser resets all changes to the "super_user" field.

func (*UserMutation) ResetUUID

func (m *UserMutation) ResetUUID()

ResetUUID resets all changes to the "uuid" field.

func (*UserMutation) SecretKey

func (m *UserMutation) SecretKey() (r uuid.UUID, exists bool)

SecretKey returns the value of the "secret_key" field in the mutation.

func (*UserMutation) SetAccessKey

func (m *UserMutation) SetAccessKey(u uuid.UUID)

SetAccessKey sets the "access_key" field.

func (*UserMutation) SetField

func (m *UserMutation) 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 (*UserMutation) SetName

func (m *UserMutation) SetName(s string)

SetName sets the "name" field.

func (*UserMutation) SetPassword

func (m *UserMutation) SetPassword(s string)

SetPassword sets the "password" field.

func (*UserMutation) SetSecretKey

func (m *UserMutation) SetSecretKey(u uuid.UUID)

SetSecretKey sets the "secret_key" field.

func (*UserMutation) SetSuperUser

func (m *UserMutation) SetSuperUser(b bool)

SetSuperUser sets the "super_user" field.

func (*UserMutation) SetUUID

func (m *UserMutation) SetUUID(u uuid.UUID)

SetUUID sets the "uuid" field.

func (*UserMutation) SuperUser

func (m *UserMutation) SuperUser() (r bool, exists bool)

SuperUser returns the value of the "super_user" field in the mutation.

func (UserMutation) Tx

func (m UserMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*UserMutation) Type

func (m *UserMutation) Type() string

Type returns the node type of this mutation (User).

func (*UserMutation) UUID

func (m *UserMutation) UUID() (r uuid.UUID, exists bool)

UUID returns the value of the "uuid" field in the mutation.

func (*UserMutation) Where

func (m *UserMutation) Where(ps ...predicate.User)

Where appends a list predicates to the UserMutation builder.

type UserQuery

type UserQuery struct {
	// contains filtered or unexported fields
}

UserQuery is the builder for querying User entities.

func (*UserQuery) All

func (uq *UserQuery) All(ctx context.Context) ([]*User, error)

All executes the query and returns a list of Users.

func (*UserQuery) AllX

func (uq *UserQuery) AllX(ctx context.Context) []*User

AllX is like All, but panics if an error occurs.

func (*UserQuery) Clone

func (uq *UserQuery) Clone() *UserQuery

Clone returns a duplicate of the UserQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*UserQuery) Count

func (uq *UserQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*UserQuery) CountX

func (uq *UserQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*UserQuery) Exist

func (uq *UserQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*UserQuery) ExistX

func (uq *UserQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*UserQuery) First

func (uq *UserQuery) First(ctx context.Context) (*User, error)

First returns the first User entity from the query. Returns a *NotFoundError when no User was found.

func (*UserQuery) FirstID

func (uq *UserQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first User ID from the query. Returns a *NotFoundError when no User ID was found.

func (*UserQuery) FirstIDX

func (uq *UserQuery) FirstIDX(ctx context.Context) int

FirstIDX is like FirstID, but panics if an error occurs.

func (*UserQuery) FirstX

func (uq *UserQuery) FirstX(ctx context.Context) *User

FirstX is like First, but panics if an error occurs.

func (*UserQuery) GroupBy

func (uq *UserQuery) GroupBy(field string, fields ...string) *UserGroupBy

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 {
	UUID uuid.UUID `json:"uuid,omitempty"`
	Count int `json:"count,omitempty"`
}

client.User.Query().
	GroupBy(user.FieldUUID).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*UserQuery) IDs

func (uq *UserQuery) IDs(ctx context.Context) ([]int, error)

IDs executes the query and returns a list of User IDs.

func (*UserQuery) IDsX

func (uq *UserQuery) IDsX(ctx context.Context) []int

IDsX is like IDs, but panics if an error occurs.

func (*UserQuery) Limit

func (uq *UserQuery) Limit(limit int) *UserQuery

Limit adds a limit step to the query.

func (*UserQuery) Offset

func (uq *UserQuery) Offset(offset int) *UserQuery

Offset adds an offset step to the query.

func (*UserQuery) Only

func (uq *UserQuery) Only(ctx context.Context) (*User, error)

Only returns a single User entity found by the query, ensuring it only returns one. Returns a *NotSingularError when exactly one User entity is not found. Returns a *NotFoundError when no User entities are found.

func (*UserQuery) OnlyID

func (uq *UserQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID is like Only, but returns the only User ID in the query. Returns a *NotSingularError when exactly one User ID is not found. Returns a *NotFoundError when no entities are found.

func (*UserQuery) OnlyIDX

func (uq *UserQuery) OnlyIDX(ctx context.Context) int

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*UserQuery) OnlyX

func (uq *UserQuery) OnlyX(ctx context.Context) *User

OnlyX is like Only, but panics if an error occurs.

func (*UserQuery) Order

func (uq *UserQuery) Order(o ...OrderFunc) *UserQuery

Order adds an order step to the query.

func (*UserQuery) QueryApps

func (uq *UserQuery) QueryApps() *AppQuery

QueryApps chains the current query on the "apps" edge.

func (*UserQuery) Select

func (uq *UserQuery) Select(fields ...string) *UserSelect

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 {
	UUID uuid.UUID `json:"uuid,omitempty"`
}

client.User.Query().
	Select(user.FieldUUID).
	Scan(ctx, &v)

func (*UserQuery) Unique

func (uq *UserQuery) Unique(unique bool) *UserQuery

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 (*UserQuery) Where

func (uq *UserQuery) Where(ps ...predicate.User) *UserQuery

Where adds a new predicate for the UserQuery builder.

func (*UserQuery) WithApps

func (uq *UserQuery) WithApps(opts ...func(*AppQuery)) *UserQuery

WithApps tells the query-builder to eager-load the nodes that are connected to the "apps" edge. The optional arguments are used to configure the query builder of the edge.

type UserSelect

type UserSelect struct {
	*UserQuery
	// contains filtered or unexported fields
}

UserSelect is the builder for selecting fields of User entities.

func (*UserSelect) Bool

func (us *UserSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*UserSelect) BoolX

func (us *UserSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*UserSelect) Bools

func (us *UserSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*UserSelect) BoolsX

func (us *UserSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*UserSelect) Float64

func (us *UserSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*UserSelect) Float64X

func (us *UserSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*UserSelect) Float64s

func (us *UserSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*UserSelect) Float64sX

func (us *UserSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*UserSelect) Int

func (us *UserSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*UserSelect) IntX

func (us *UserSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*UserSelect) Ints

func (us *UserSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*UserSelect) IntsX

func (us *UserSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*UserSelect) Scan

func (us *UserSelect) Scan(ctx context.Context, v interface{}) error

Scan applies the selector query and scans the result into the given value.

func (*UserSelect) ScanX

func (us *UserSelect) ScanX(ctx context.Context, v interface{})

ScanX is like Scan, but panics if an error occurs.

func (*UserSelect) String

func (us *UserSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*UserSelect) StringX

func (us *UserSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*UserSelect) Strings

func (us *UserSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*UserSelect) StringsX

func (us *UserSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type UserUpdate

type UserUpdate struct {
	// contains filtered or unexported fields
}

UserUpdate is the builder for updating User entities.

func (*UserUpdate) AddAppIDs

func (uu *UserUpdate) AddAppIDs(ids ...int) *UserUpdate

AddAppIDs adds the "apps" edge to the App entity by IDs.

func (*UserUpdate) AddApps

func (uu *UserUpdate) AddApps(a ...*App) *UserUpdate

AddApps adds the "apps" edges to the App entity.

func (*UserUpdate) ClearApps

func (uu *UserUpdate) ClearApps() *UserUpdate

ClearApps clears all "apps" edges to the App entity.

func (*UserUpdate) Exec

func (uu *UserUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*UserUpdate) ExecX

func (uu *UserUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserUpdate) Mutation

func (uu *UserUpdate) Mutation() *UserMutation

Mutation returns the UserMutation object of the builder.

func (*UserUpdate) RemoveAppIDs

func (uu *UserUpdate) RemoveAppIDs(ids ...int) *UserUpdate

RemoveAppIDs removes the "apps" edge to App entities by IDs.

func (*UserUpdate) RemoveApps

func (uu *UserUpdate) RemoveApps(a ...*App) *UserUpdate

RemoveApps removes "apps" edges to App entities.

func (*UserUpdate) Save

func (uu *UserUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*UserUpdate) SaveX

func (uu *UserUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*UserUpdate) SetAccessKey

func (uu *UserUpdate) SetAccessKey(u uuid.UUID) *UserUpdate

SetAccessKey sets the "access_key" field.

func (*UserUpdate) SetPassword

func (uu *UserUpdate) SetPassword(s string) *UserUpdate

SetPassword sets the "password" field.

func (*UserUpdate) SetSecretKey

func (uu *UserUpdate) SetSecretKey(u uuid.UUID) *UserUpdate

SetSecretKey sets the "secret_key" field.

func (*UserUpdate) SetSuperUser

func (uu *UserUpdate) SetSuperUser(b bool) *UserUpdate

SetSuperUser sets the "super_user" field.

func (*UserUpdate) Where

func (uu *UserUpdate) Where(ps ...predicate.User) *UserUpdate

Where appends a list predicates to the UserUpdate builder.

type UserUpdateOne

type UserUpdateOne struct {
	// contains filtered or unexported fields
}

UserUpdateOne is the builder for updating a single User entity.

func (*UserUpdateOne) AddAppIDs

func (uuo *UserUpdateOne) AddAppIDs(ids ...int) *UserUpdateOne

AddAppIDs adds the "apps" edge to the App entity by IDs.

func (*UserUpdateOne) AddApps

func (uuo *UserUpdateOne) AddApps(a ...*App) *UserUpdateOne

AddApps adds the "apps" edges to the App entity.

func (*UserUpdateOne) ClearApps

func (uuo *UserUpdateOne) ClearApps() *UserUpdateOne

ClearApps clears all "apps" edges to the App entity.

func (*UserUpdateOne) Exec

func (uuo *UserUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*UserUpdateOne) ExecX

func (uuo *UserUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserUpdateOne) Mutation

func (uuo *UserUpdateOne) Mutation() *UserMutation

Mutation returns the UserMutation object of the builder.

func (*UserUpdateOne) RemoveAppIDs

func (uuo *UserUpdateOne) RemoveAppIDs(ids ...int) *UserUpdateOne

RemoveAppIDs removes the "apps" edge to App entities by IDs.

func (*UserUpdateOne) RemoveApps

func (uuo *UserUpdateOne) RemoveApps(a ...*App) *UserUpdateOne

RemoveApps removes "apps" edges to App entities.

func (*UserUpdateOne) Save

func (uuo *UserUpdateOne) Save(ctx context.Context) (*User, error)

Save executes the query and returns the updated User entity.

func (*UserUpdateOne) SaveX

func (uuo *UserUpdateOne) SaveX(ctx context.Context) *User

SaveX is like Save, but panics if an error occurs.

func (*UserUpdateOne) Select

func (uuo *UserUpdateOne) Select(field string, fields ...string) *UserUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*UserUpdateOne) SetAccessKey

func (uuo *UserUpdateOne) SetAccessKey(u uuid.UUID) *UserUpdateOne

SetAccessKey sets the "access_key" field.

func (*UserUpdateOne) SetPassword

func (uuo *UserUpdateOne) SetPassword(s string) *UserUpdateOne

SetPassword sets the "password" field.

func (*UserUpdateOne) SetSecretKey

func (uuo *UserUpdateOne) SetSecretKey(u uuid.UUID) *UserUpdateOne

SetSecretKey sets the "secret_key" field.

func (*UserUpdateOne) SetSuperUser

func (uuo *UserUpdateOne) SetSuperUser(b bool) *UserUpdateOne

SetSuperUser sets the "super_user" field.

type Users

type Users []*User

Users is a parsable slice of User.

type ValidationError

type ValidationError struct {
	Name string // Field or edge name.
	// contains filtered or unexported fields
}

ValidationError returns when validating a field 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.

type Value

type Value = ent.Value

ent aliases to avoid import conflicts in user's code.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL