ent

package
v0.0.0-...-3da28a4 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2023 License: MIT Imports: 28 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.
	TypeBiography      = "Biography"
	TypeCategory       = "Category"
	TypeContact        = "Contact"
	TypeContactDefault = "ContactDefault"
	TypeLink           = "Link"
	TypeLocation       = "Location"
	TypeNotice         = "Notice"
	TypeProduct        = "Product"
	TypeSession        = "Session"
	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 Biographies

type Biographies []*Biography

Biographies is a parsable slice of Biography.

type Biography

type Biography struct {

	// ID of the ent.
	ID uint32 `json:"id,omitempty"`
	// UserID holds the value of the "user_id" field.
	UserID uint32 `json:"user_id,omitempty"`
	// IsPublic holds the value of the "is_public" field.
	IsPublic bool `json:"is_public,omitempty"`
	// LocationID holds the value of the "location_id" field.
	LocationID uint32 `json:"location_id,omitempty"`
	// Position holds the value of the "position" field.
	Position string `json:"position,omitempty"`
	// PositionJa holds the value of the "position_ja" field.
	PositionJa string `json:"position_ja,omitempty"`
	// Join holds the value of the "join" field.
	Join time.Time `json:"join,omitempty"`
	// Leave holds the value of the "leave" field.
	Leave time.Time `json:"leave,omitempty"`
	// Created holds the value of the "created" field.
	Created time.Time `json:"created,omitempty"`
	// Modified holds the value of the "modified" field.
	Modified time.Time `json:"modified,omitempty"`
	// contains filtered or unexported fields
}

Biography is the model entity for the Biography schema.

func (*Biography) String

func (b *Biography) String() string

String implements the fmt.Stringer.

func (*Biography) Unwrap

func (b *Biography) Unwrap() *Biography

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

func (b *Biography) Update() *BiographyUpdateOne

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

type BiographyClient

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

BiographyClient is a client for the Biography schema.

func NewBiographyClient

func NewBiographyClient(c config) *BiographyClient

NewBiographyClient returns a client for the Biography from the given config.

func (*BiographyClient) Create

func (c *BiographyClient) Create() *BiographyCreate

Create returns a builder for creating a Biography entity.

func (*BiographyClient) CreateBulk

func (c *BiographyClient) CreateBulk(builders ...*BiographyCreate) *BiographyCreateBulk

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

func (*BiographyClient) Delete

func (c *BiographyClient) Delete() *BiographyDelete

Delete returns a delete builder for Biography.

func (*BiographyClient) DeleteOne

func (c *BiographyClient) DeleteOne(b *Biography) *BiographyDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*BiographyClient) DeleteOneID

func (c *BiographyClient) DeleteOneID(id uint32) *BiographyDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*BiographyClient) Get

func (c *BiographyClient) Get(ctx context.Context, id uint32) (*Biography, error)

Get returns a Biography entity by its id.

func (*BiographyClient) GetX

func (c *BiographyClient) GetX(ctx context.Context, id uint32) *Biography

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

func (*BiographyClient) Hooks

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

Hooks returns the client hooks.

func (*BiographyClient) Intercept

func (c *BiographyClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `biography.Intercept(f(g(h())))`.

func (*BiographyClient) Interceptors

func (c *BiographyClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*BiographyClient) Query

func (c *BiographyClient) Query() *BiographyQuery

Query returns a query builder for Biography.

func (*BiographyClient) Update

func (c *BiographyClient) Update() *BiographyUpdate

Update returns an update builder for Biography.

func (*BiographyClient) UpdateOne

func (c *BiographyClient) UpdateOne(b *Biography) *BiographyUpdateOne

UpdateOne returns an update builder for the given entity.

func (*BiographyClient) UpdateOneID

func (c *BiographyClient) UpdateOneID(id uint32) *BiographyUpdateOne

UpdateOneID returns an update builder for the given id.

func (*BiographyClient) Use

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

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

type BiographyCreate

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

BiographyCreate is the builder for creating a Biography entity.

func (*BiographyCreate) Exec

func (bc *BiographyCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*BiographyCreate) ExecX

func (bc *BiographyCreate) ExecX(ctx context.Context)

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

func (*BiographyCreate) Mutation

func (bc *BiographyCreate) Mutation() *BiographyMutation

Mutation returns the BiographyMutation object of the builder.

func (*BiographyCreate) Save

func (bc *BiographyCreate) Save(ctx context.Context) (*Biography, error)

Save creates the Biography in the database.

func (*BiographyCreate) SaveX

func (bc *BiographyCreate) SaveX(ctx context.Context) *Biography

SaveX calls Save and panics if Save returns an error.

func (*BiographyCreate) SetCreated

func (bc *BiographyCreate) SetCreated(t time.Time) *BiographyCreate

SetCreated sets the "created" field.

func (*BiographyCreate) SetID

func (bc *BiographyCreate) SetID(u uint32) *BiographyCreate

SetID sets the "id" field.

func (*BiographyCreate) SetIsPublic

func (bc *BiographyCreate) SetIsPublic(b bool) *BiographyCreate

SetIsPublic sets the "is_public" field.

func (*BiographyCreate) SetJoin

func (bc *BiographyCreate) SetJoin(t time.Time) *BiographyCreate

SetJoin sets the "join" field.

func (*BiographyCreate) SetLeave

func (bc *BiographyCreate) SetLeave(t time.Time) *BiographyCreate

SetLeave sets the "leave" field.

func (*BiographyCreate) SetLocationID

func (bc *BiographyCreate) SetLocationID(u uint32) *BiographyCreate

SetLocationID sets the "location_id" field.

func (*BiographyCreate) SetModified

func (bc *BiographyCreate) SetModified(t time.Time) *BiographyCreate

SetModified sets the "modified" field.

func (*BiographyCreate) SetNillableCreated

func (bc *BiographyCreate) SetNillableCreated(t *time.Time) *BiographyCreate

SetNillableCreated sets the "created" field if the given value is not nil.

func (*BiographyCreate) SetNillableIsPublic

func (bc *BiographyCreate) SetNillableIsPublic(b *bool) *BiographyCreate

SetNillableIsPublic sets the "is_public" field if the given value is not nil.

func (*BiographyCreate) SetNillableLeave

func (bc *BiographyCreate) SetNillableLeave(t *time.Time) *BiographyCreate

SetNillableLeave sets the "leave" field if the given value is not nil.

func (*BiographyCreate) SetNillableModified

func (bc *BiographyCreate) SetNillableModified(t *time.Time) *BiographyCreate

SetNillableModified sets the "modified" field if the given value is not nil.

func (*BiographyCreate) SetPosition

func (bc *BiographyCreate) SetPosition(s string) *BiographyCreate

SetPosition sets the "position" field.

func (*BiographyCreate) SetPositionJa

func (bc *BiographyCreate) SetPositionJa(s string) *BiographyCreate

SetPositionJa sets the "position_ja" field.

func (*BiographyCreate) SetUserID

func (bc *BiographyCreate) SetUserID(u uint32) *BiographyCreate

SetUserID sets the "user_id" field.

type BiographyCreateBulk

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

BiographyCreateBulk is the builder for creating many Biography entities in bulk.

func (*BiographyCreateBulk) Exec

func (bcb *BiographyCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*BiographyCreateBulk) ExecX

func (bcb *BiographyCreateBulk) ExecX(ctx context.Context)

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

func (*BiographyCreateBulk) Save

func (bcb *BiographyCreateBulk) Save(ctx context.Context) ([]*Biography, error)

Save creates the Biography entities in the database.

func (*BiographyCreateBulk) SaveX

func (bcb *BiographyCreateBulk) SaveX(ctx context.Context) []*Biography

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

type BiographyDelete

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

BiographyDelete is the builder for deleting a Biography entity.

func (*BiographyDelete) Exec

func (bd *BiographyDelete) Exec(ctx context.Context) (int, error)

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

func (*BiographyDelete) ExecX

func (bd *BiographyDelete) ExecX(ctx context.Context) int

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

func (*BiographyDelete) Where

Where appends a list predicates to the BiographyDelete builder.

type BiographyDeleteOne

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

BiographyDeleteOne is the builder for deleting a single Biography entity.

func (*BiographyDeleteOne) Exec

func (bdo *BiographyDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*BiographyDeleteOne) ExecX

func (bdo *BiographyDeleteOne) ExecX(ctx context.Context)

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

func (*BiographyDeleteOne) Where

Where appends a list predicates to the BiographyDelete builder.

type BiographyGroupBy

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

BiographyGroupBy is the group-by builder for Biography entities.

func (*BiographyGroupBy) Aggregate

func (bgb *BiographyGroupBy) Aggregate(fns ...AggregateFunc) *BiographyGroupBy

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

func (*BiographyGroupBy) Bool

func (s *BiographyGroupBy) Bool(ctx context.Context) (_ bool, err error)

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

func (*BiographyGroupBy) BoolX

func (s *BiographyGroupBy) BoolX(ctx context.Context) bool

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

func (*BiographyGroupBy) Bools

func (s *BiographyGroupBy) Bools(ctx context.Context) ([]bool, error)

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

func (*BiographyGroupBy) BoolsX

func (s *BiographyGroupBy) BoolsX(ctx context.Context) []bool

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

func (*BiographyGroupBy) Float64

func (s *BiographyGroupBy) Float64(ctx context.Context) (_ float64, err error)

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

func (*BiographyGroupBy) Float64X

func (s *BiographyGroupBy) Float64X(ctx context.Context) float64

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

func (*BiographyGroupBy) Float64s

func (s *BiographyGroupBy) Float64s(ctx context.Context) ([]float64, error)

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

func (*BiographyGroupBy) Float64sX

func (s *BiographyGroupBy) Float64sX(ctx context.Context) []float64

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

func (*BiographyGroupBy) Int

func (s *BiographyGroupBy) Int(ctx context.Context) (_ int, err error)

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

func (*BiographyGroupBy) IntX

func (s *BiographyGroupBy) IntX(ctx context.Context) int

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

func (*BiographyGroupBy) Ints

func (s *BiographyGroupBy) Ints(ctx context.Context) ([]int, error)

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

func (*BiographyGroupBy) IntsX

func (s *BiographyGroupBy) IntsX(ctx context.Context) []int

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

func (*BiographyGroupBy) Scan

func (bgb *BiographyGroupBy) Scan(ctx context.Context, v any) error

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

func (*BiographyGroupBy) ScanX

func (s *BiographyGroupBy) ScanX(ctx context.Context, v any)

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

func (*BiographyGroupBy) String

func (s *BiographyGroupBy) String(ctx context.Context) (_ string, err error)

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

func (*BiographyGroupBy) StringX

func (s *BiographyGroupBy) StringX(ctx context.Context) string

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

func (*BiographyGroupBy) Strings

func (s *BiographyGroupBy) Strings(ctx context.Context) ([]string, error)

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

func (*BiographyGroupBy) StringsX

func (s *BiographyGroupBy) StringsX(ctx context.Context) []string

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

type BiographyMutation

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

BiographyMutation represents an operation that mutates the Biography nodes in the graph.

func (*BiographyMutation) AddField

func (m *BiographyMutation) 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 (*BiographyMutation) AddLocationID

func (m *BiographyMutation) AddLocationID(u int32)

AddLocationID adds u to the "location_id" field.

func (*BiographyMutation) AddUserID

func (m *BiographyMutation) AddUserID(u int32)

AddUserID adds u to the "user_id" field.

func (*BiographyMutation) AddedEdges

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

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

func (*BiographyMutation) AddedField

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

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

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

func (*BiographyMutation) AddedIDs

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

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

func (*BiographyMutation) AddedLocationID

func (m *BiographyMutation) AddedLocationID() (r int32, exists bool)

AddedLocationID returns the value that was added to the "location_id" field in this mutation.

func (*BiographyMutation) AddedUserID

func (m *BiographyMutation) AddedUserID() (r int32, exists bool)

AddedUserID returns the value that was added to the "user_id" field in this mutation.

func (*BiographyMutation) ClearEdge

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

func (m *BiographyMutation) 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 (*BiographyMutation) ClearLeave

func (m *BiographyMutation) ClearLeave()

ClearLeave clears the value of the "leave" field.

func (*BiographyMutation) ClearedEdges

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

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

func (*BiographyMutation) ClearedFields

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

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

func (BiographyMutation) Client

func (m BiographyMutation) 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 (*BiographyMutation) Created

func (m *BiographyMutation) Created() (r time.Time, exists bool)

Created returns the value of the "created" field in the mutation.

func (*BiographyMutation) EdgeCleared

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

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

func (*BiographyMutation) Field

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

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

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

func (*BiographyMutation) Fields

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

func (m *BiographyMutation) ID() (id uint32, 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 (*BiographyMutation) IDs

func (m *BiographyMutation) IDs(ctx context.Context) ([]uint32, error)

IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.

func (*BiographyMutation) IsPublic

func (m *BiographyMutation) IsPublic() (r bool, exists bool)

IsPublic returns the value of the "is_public" field in the mutation.

func (*BiographyMutation) Join

func (m *BiographyMutation) Join() (r time.Time, exists bool)

Join returns the value of the "join" field in the mutation.

func (*BiographyMutation) Leave

func (m *BiographyMutation) Leave() (r time.Time, exists bool)

Leave returns the value of the "leave" field in the mutation.

func (*BiographyMutation) LeaveCleared

func (m *BiographyMutation) LeaveCleared() bool

LeaveCleared returns if the "leave" field was cleared in this mutation.

func (*BiographyMutation) LocationID

func (m *BiographyMutation) LocationID() (r uint32, exists bool)

LocationID returns the value of the "location_id" field in the mutation.

func (*BiographyMutation) Modified

func (m *BiographyMutation) Modified() (r time.Time, exists bool)

Modified returns the value of the "modified" field in the mutation.

func (*BiographyMutation) OldCreated

func (m *BiographyMutation) OldCreated(ctx context.Context) (v time.Time, err error)

OldCreated returns the old "created" field's value of the Biography entity. If the Biography 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 (*BiographyMutation) OldField

func (m *BiographyMutation) 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 (*BiographyMutation) OldIsPublic

func (m *BiographyMutation) OldIsPublic(ctx context.Context) (v bool, err error)

OldIsPublic returns the old "is_public" field's value of the Biography entity. If the Biography 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 (*BiographyMutation) OldJoin

func (m *BiographyMutation) OldJoin(ctx context.Context) (v time.Time, err error)

OldJoin returns the old "join" field's value of the Biography entity. If the Biography 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 (*BiographyMutation) OldLeave

func (m *BiographyMutation) OldLeave(ctx context.Context) (v time.Time, err error)

OldLeave returns the old "leave" field's value of the Biography entity. If the Biography 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 (*BiographyMutation) OldLocationID

func (m *BiographyMutation) OldLocationID(ctx context.Context) (v uint32, err error)

OldLocationID returns the old "location_id" field's value of the Biography entity. If the Biography 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 (*BiographyMutation) OldModified

func (m *BiographyMutation) OldModified(ctx context.Context) (v time.Time, err error)

OldModified returns the old "modified" field's value of the Biography entity. If the Biography 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 (*BiographyMutation) OldPosition

func (m *BiographyMutation) OldPosition(ctx context.Context) (v string, err error)

OldPosition returns the old "position" field's value of the Biography entity. If the Biography 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 (*BiographyMutation) OldPositionJa

func (m *BiographyMutation) OldPositionJa(ctx context.Context) (v string, err error)

OldPositionJa returns the old "position_ja" field's value of the Biography entity. If the Biography 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 (*BiographyMutation) OldUserID

func (m *BiographyMutation) OldUserID(ctx context.Context) (v uint32, err error)

OldUserID returns the old "user_id" field's value of the Biography entity. If the Biography 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 (*BiographyMutation) Op

func (m *BiographyMutation) Op() Op

Op returns the operation name.

func (*BiographyMutation) Position

func (m *BiographyMutation) Position() (r string, exists bool)

Position returns the value of the "position" field in the mutation.

func (*BiographyMutation) PositionJa

func (m *BiographyMutation) PositionJa() (r string, exists bool)

PositionJa returns the value of the "position_ja" field in the mutation.

func (*BiographyMutation) RemovedEdges

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

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

func (*BiographyMutation) RemovedIDs

func (m *BiographyMutation) 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 (*BiographyMutation) ResetCreated

func (m *BiographyMutation) ResetCreated()

ResetCreated resets all changes to the "created" field.

func (*BiographyMutation) ResetEdge

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

func (m *BiographyMutation) 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 (*BiographyMutation) ResetIsPublic

func (m *BiographyMutation) ResetIsPublic()

ResetIsPublic resets all changes to the "is_public" field.

func (*BiographyMutation) ResetJoin

func (m *BiographyMutation) ResetJoin()

ResetJoin resets all changes to the "join" field.

func (*BiographyMutation) ResetLeave

func (m *BiographyMutation) ResetLeave()

ResetLeave resets all changes to the "leave" field.

func (*BiographyMutation) ResetLocationID

func (m *BiographyMutation) ResetLocationID()

ResetLocationID resets all changes to the "location_id" field.

func (*BiographyMutation) ResetModified

func (m *BiographyMutation) ResetModified()

ResetModified resets all changes to the "modified" field.

func (*BiographyMutation) ResetPosition

func (m *BiographyMutation) ResetPosition()

ResetPosition resets all changes to the "position" field.

func (*BiographyMutation) ResetPositionJa

func (m *BiographyMutation) ResetPositionJa()

ResetPositionJa resets all changes to the "position_ja" field.

func (*BiographyMutation) ResetUserID

func (m *BiographyMutation) ResetUserID()

ResetUserID resets all changes to the "user_id" field.

func (*BiographyMutation) SetCreated

func (m *BiographyMutation) SetCreated(t time.Time)

SetCreated sets the "created" field.

func (*BiographyMutation) SetField

func (m *BiographyMutation) 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 (*BiographyMutation) SetID

func (m *BiographyMutation) SetID(id uint32)

SetID sets the value of the id field. Note that this operation is only accepted on creation of Biography entities.

func (*BiographyMutation) SetIsPublic

func (m *BiographyMutation) SetIsPublic(b bool)

SetIsPublic sets the "is_public" field.

func (*BiographyMutation) SetJoin

func (m *BiographyMutation) SetJoin(t time.Time)

SetJoin sets the "join" field.

func (*BiographyMutation) SetLeave

func (m *BiographyMutation) SetLeave(t time.Time)

SetLeave sets the "leave" field.

func (*BiographyMutation) SetLocationID

func (m *BiographyMutation) SetLocationID(u uint32)

SetLocationID sets the "location_id" field.

func (*BiographyMutation) SetModified

func (m *BiographyMutation) SetModified(t time.Time)

SetModified sets the "modified" field.

func (*BiographyMutation) SetOp

func (m *BiographyMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*BiographyMutation) SetPosition

func (m *BiographyMutation) SetPosition(s string)

SetPosition sets the "position" field.

func (*BiographyMutation) SetPositionJa

func (m *BiographyMutation) SetPositionJa(s string)

SetPositionJa sets the "position_ja" field.

func (*BiographyMutation) SetUserID

func (m *BiographyMutation) SetUserID(u uint32)

SetUserID sets the "user_id" field.

func (BiographyMutation) Tx

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

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

func (*BiographyMutation) Type

func (m *BiographyMutation) Type() string

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

func (*BiographyMutation) UserID

func (m *BiographyMutation) UserID() (r uint32, exists bool)

UserID returns the value of the "user_id" field in the mutation.

func (*BiographyMutation) Where

func (m *BiographyMutation) Where(ps ...predicate.Biography)

Where appends a list predicates to the BiographyMutation builder.

func (*BiographyMutation) WhereP

func (m *BiographyMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the BiographyMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type BiographyQuery

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

BiographyQuery is the builder for querying Biography entities.

func (*BiographyQuery) Aggregate

func (bq *BiographyQuery) Aggregate(fns ...AggregateFunc) *BiographySelect

Aggregate returns a BiographySelect configured with the given aggregations.

func (*BiographyQuery) All

func (bq *BiographyQuery) All(ctx context.Context) ([]*Biography, error)

All executes the query and returns a list of Biographies.

func (*BiographyQuery) AllX

func (bq *BiographyQuery) AllX(ctx context.Context) []*Biography

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

func (*BiographyQuery) Clone

func (bq *BiographyQuery) Clone() *BiographyQuery

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

func (*BiographyQuery) Count

func (bq *BiographyQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*BiographyQuery) CountX

func (bq *BiographyQuery) CountX(ctx context.Context) int

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

func (*BiographyQuery) Exist

func (bq *BiographyQuery) Exist(ctx context.Context) (bool, error)

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

func (*BiographyQuery) ExistX

func (bq *BiographyQuery) ExistX(ctx context.Context) bool

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

func (*BiographyQuery) First

func (bq *BiographyQuery) First(ctx context.Context) (*Biography, error)

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

func (*BiographyQuery) FirstID

func (bq *BiographyQuery) FirstID(ctx context.Context) (id uint32, err error)

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

func (*BiographyQuery) FirstIDX

func (bq *BiographyQuery) FirstIDX(ctx context.Context) uint32

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

func (*BiographyQuery) FirstX

func (bq *BiographyQuery) FirstX(ctx context.Context) *Biography

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

func (*BiographyQuery) GroupBy

func (bq *BiographyQuery) GroupBy(field string, fields ...string) *BiographyGroupBy

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 {
	UserID uint32 `json:"user_id,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Biography.Query().
	GroupBy(biography.FieldUserID).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*BiographyQuery) IDs

func (bq *BiographyQuery) IDs(ctx context.Context) (ids []uint32, err error)

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

func (*BiographyQuery) IDsX

func (bq *BiographyQuery) IDsX(ctx context.Context) []uint32

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

func (*BiographyQuery) Limit

func (bq *BiographyQuery) Limit(limit int) *BiographyQuery

Limit the number of records to be returned by this query.

func (*BiographyQuery) Offset

func (bq *BiographyQuery) Offset(offset int) *BiographyQuery

Offset to start from.

func (*BiographyQuery) Only

func (bq *BiographyQuery) Only(ctx context.Context) (*Biography, error)

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

func (*BiographyQuery) OnlyID

func (bq *BiographyQuery) OnlyID(ctx context.Context) (id uint32, err error)

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

func (*BiographyQuery) OnlyIDX

func (bq *BiographyQuery) OnlyIDX(ctx context.Context) uint32

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

func (*BiographyQuery) OnlyX

func (bq *BiographyQuery) OnlyX(ctx context.Context) *Biography

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

func (*BiographyQuery) Order

func (bq *BiographyQuery) Order(o ...OrderFunc) *BiographyQuery

Order specifies how the records should be ordered.

func (*BiographyQuery) Select

func (bq *BiographyQuery) Select(fields ...string) *BiographySelect

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 {
	UserID uint32 `json:"user_id,omitempty"`
}

client.Biography.Query().
	Select(biography.FieldUserID).
	Scan(ctx, &v)

func (*BiographyQuery) Unique

func (bq *BiographyQuery) Unique(unique bool) *BiographyQuery

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

Where adds a new predicate for the BiographyQuery builder.

type BiographySelect

type BiographySelect struct {
	*BiographyQuery
	// contains filtered or unexported fields
}

BiographySelect is the builder for selecting fields of Biography entities.

func (*BiographySelect) Aggregate

func (bs *BiographySelect) Aggregate(fns ...AggregateFunc) *BiographySelect

Aggregate adds the given aggregation functions to the selector query.

func (*BiographySelect) Bool

func (s *BiographySelect) Bool(ctx context.Context) (_ bool, err error)

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

func (*BiographySelect) BoolX

func (s *BiographySelect) BoolX(ctx context.Context) bool

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

func (*BiographySelect) Bools

func (s *BiographySelect) Bools(ctx context.Context) ([]bool, error)

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

func (*BiographySelect) BoolsX

func (s *BiographySelect) BoolsX(ctx context.Context) []bool

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

func (*BiographySelect) Float64

func (s *BiographySelect) Float64(ctx context.Context) (_ float64, err error)

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

func (*BiographySelect) Float64X

func (s *BiographySelect) Float64X(ctx context.Context) float64

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

func (*BiographySelect) Float64s

func (s *BiographySelect) Float64s(ctx context.Context) ([]float64, error)

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

func (*BiographySelect) Float64sX

func (s *BiographySelect) Float64sX(ctx context.Context) []float64

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

func (*BiographySelect) Int

func (s *BiographySelect) Int(ctx context.Context) (_ int, err error)

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

func (*BiographySelect) IntX

func (s *BiographySelect) IntX(ctx context.Context) int

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

func (*BiographySelect) Ints

func (s *BiographySelect) Ints(ctx context.Context) ([]int, error)

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

func (*BiographySelect) IntsX

func (s *BiographySelect) IntsX(ctx context.Context) []int

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

func (*BiographySelect) Scan

func (bs *BiographySelect) Scan(ctx context.Context, v any) error

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

func (*BiographySelect) ScanX

func (s *BiographySelect) ScanX(ctx context.Context, v any)

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

func (*BiographySelect) String

func (s *BiographySelect) String(ctx context.Context) (_ string, err error)

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

func (*BiographySelect) StringX

func (s *BiographySelect) StringX(ctx context.Context) string

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

func (*BiographySelect) Strings

func (s *BiographySelect) Strings(ctx context.Context) ([]string, error)

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

func (*BiographySelect) StringsX

func (s *BiographySelect) StringsX(ctx context.Context) []string

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

type BiographyUpdate

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

BiographyUpdate is the builder for updating Biography entities.

func (*BiographyUpdate) AddLocationID

func (bu *BiographyUpdate) AddLocationID(u int32) *BiographyUpdate

AddLocationID adds u to the "location_id" field.

func (*BiographyUpdate) AddUserID

func (bu *BiographyUpdate) AddUserID(u int32) *BiographyUpdate

AddUserID adds u to the "user_id" field.

func (*BiographyUpdate) ClearLeave

func (bu *BiographyUpdate) ClearLeave() *BiographyUpdate

ClearLeave clears the value of the "leave" field.

func (*BiographyUpdate) Exec

func (bu *BiographyUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*BiographyUpdate) ExecX

func (bu *BiographyUpdate) ExecX(ctx context.Context)

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

func (*BiographyUpdate) Mutation

func (bu *BiographyUpdate) Mutation() *BiographyMutation

Mutation returns the BiographyMutation object of the builder.

func (*BiographyUpdate) Save

func (bu *BiographyUpdate) Save(ctx context.Context) (int, error)

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

func (*BiographyUpdate) SaveX

func (bu *BiographyUpdate) SaveX(ctx context.Context) int

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

func (*BiographyUpdate) SetCreated

func (bu *BiographyUpdate) SetCreated(t time.Time) *BiographyUpdate

SetCreated sets the "created" field.

func (*BiographyUpdate) SetIsPublic

func (bu *BiographyUpdate) SetIsPublic(b bool) *BiographyUpdate

SetIsPublic sets the "is_public" field.

func (*BiographyUpdate) SetJoin

func (bu *BiographyUpdate) SetJoin(t time.Time) *BiographyUpdate

SetJoin sets the "join" field.

func (*BiographyUpdate) SetLeave

func (bu *BiographyUpdate) SetLeave(t time.Time) *BiographyUpdate

SetLeave sets the "leave" field.

func (*BiographyUpdate) SetLocationID

func (bu *BiographyUpdate) SetLocationID(u uint32) *BiographyUpdate

SetLocationID sets the "location_id" field.

func (*BiographyUpdate) SetModified

func (bu *BiographyUpdate) SetModified(t time.Time) *BiographyUpdate

SetModified sets the "modified" field.

func (*BiographyUpdate) SetNillableCreated

func (bu *BiographyUpdate) SetNillableCreated(t *time.Time) *BiographyUpdate

SetNillableCreated sets the "created" field if the given value is not nil.

func (*BiographyUpdate) SetNillableIsPublic

func (bu *BiographyUpdate) SetNillableIsPublic(b *bool) *BiographyUpdate

SetNillableIsPublic sets the "is_public" field if the given value is not nil.

func (*BiographyUpdate) SetNillableLeave

func (bu *BiographyUpdate) SetNillableLeave(t *time.Time) *BiographyUpdate

SetNillableLeave sets the "leave" field if the given value is not nil.

func (*BiographyUpdate) SetPosition

func (bu *BiographyUpdate) SetPosition(s string) *BiographyUpdate

SetPosition sets the "position" field.

func (*BiographyUpdate) SetPositionJa

func (bu *BiographyUpdate) SetPositionJa(s string) *BiographyUpdate

SetPositionJa sets the "position_ja" field.

func (*BiographyUpdate) SetUserID

func (bu *BiographyUpdate) SetUserID(u uint32) *BiographyUpdate

SetUserID sets the "user_id" field.

func (*BiographyUpdate) Where

Where appends a list predicates to the BiographyUpdate builder.

type BiographyUpdateOne

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

BiographyUpdateOne is the builder for updating a single Biography entity.

func (*BiographyUpdateOne) AddLocationID

func (buo *BiographyUpdateOne) AddLocationID(u int32) *BiographyUpdateOne

AddLocationID adds u to the "location_id" field.

func (*BiographyUpdateOne) AddUserID

func (buo *BiographyUpdateOne) AddUserID(u int32) *BiographyUpdateOne

AddUserID adds u to the "user_id" field.

func (*BiographyUpdateOne) ClearLeave

func (buo *BiographyUpdateOne) ClearLeave() *BiographyUpdateOne

ClearLeave clears the value of the "leave" field.

func (*BiographyUpdateOne) Exec

func (buo *BiographyUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*BiographyUpdateOne) ExecX

func (buo *BiographyUpdateOne) ExecX(ctx context.Context)

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

func (*BiographyUpdateOne) Mutation

func (buo *BiographyUpdateOne) Mutation() *BiographyMutation

Mutation returns the BiographyMutation object of the builder.

func (*BiographyUpdateOne) Save

func (buo *BiographyUpdateOne) Save(ctx context.Context) (*Biography, error)

Save executes the query and returns the updated Biography entity.

func (*BiographyUpdateOne) SaveX

func (buo *BiographyUpdateOne) SaveX(ctx context.Context) *Biography

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

func (*BiographyUpdateOne) Select

func (buo *BiographyUpdateOne) Select(field string, fields ...string) *BiographyUpdateOne

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

func (*BiographyUpdateOne) SetCreated

func (buo *BiographyUpdateOne) SetCreated(t time.Time) *BiographyUpdateOne

SetCreated sets the "created" field.

func (*BiographyUpdateOne) SetIsPublic

func (buo *BiographyUpdateOne) SetIsPublic(b bool) *BiographyUpdateOne

SetIsPublic sets the "is_public" field.

func (*BiographyUpdateOne) SetJoin

SetJoin sets the "join" field.

func (*BiographyUpdateOne) SetLeave

func (buo *BiographyUpdateOne) SetLeave(t time.Time) *BiographyUpdateOne

SetLeave sets the "leave" field.

func (*BiographyUpdateOne) SetLocationID

func (buo *BiographyUpdateOne) SetLocationID(u uint32) *BiographyUpdateOne

SetLocationID sets the "location_id" field.

func (*BiographyUpdateOne) SetModified

func (buo *BiographyUpdateOne) SetModified(t time.Time) *BiographyUpdateOne

SetModified sets the "modified" field.

func (*BiographyUpdateOne) SetNillableCreated

func (buo *BiographyUpdateOne) SetNillableCreated(t *time.Time) *BiographyUpdateOne

SetNillableCreated sets the "created" field if the given value is not nil.

func (*BiographyUpdateOne) SetNillableIsPublic

func (buo *BiographyUpdateOne) SetNillableIsPublic(b *bool) *BiographyUpdateOne

SetNillableIsPublic sets the "is_public" field if the given value is not nil.

func (*BiographyUpdateOne) SetNillableLeave

func (buo *BiographyUpdateOne) SetNillableLeave(t *time.Time) *BiographyUpdateOne

SetNillableLeave sets the "leave" field if the given value is not nil.

func (*BiographyUpdateOne) SetPosition

func (buo *BiographyUpdateOne) SetPosition(s string) *BiographyUpdateOne

SetPosition sets the "position" field.

func (*BiographyUpdateOne) SetPositionJa

func (buo *BiographyUpdateOne) SetPositionJa(s string) *BiographyUpdateOne

SetPositionJa sets the "position_ja" field.

func (*BiographyUpdateOne) SetUserID

func (buo *BiographyUpdateOne) SetUserID(u uint32) *BiographyUpdateOne

SetUserID sets the "user_id" field.

func (*BiographyUpdateOne) Where

Where appends a list predicates to the BiographyUpdate builder.

type Categories

type Categories []*Category

Categories is a parsable slice of Category.

type Category

type Category struct {

	// ID of the ent.
	ID uint32 `json:"id,omitempty"`
	// Name holds the value of the "name" field.
	Name string `json:"name,omitempty"`
	// NameJa holds the value of the "name_ja" field.
	NameJa string `json:"name_ja,omitempty"`
	// Emoji holds the value of the "emoji" field.
	Emoji string `json:"emoji,omitempty"`
	// Created holds the value of the "created" field.
	Created time.Time `json:"created,omitempty"`
	// Modified holds the value of the "modified" field.
	Modified time.Time `json:"modified,omitempty"`
	// contains filtered or unexported fields
}

Category is the model entity for the Category schema.

func (*Category) String

func (c *Category) String() string

String implements the fmt.Stringer.

func (*Category) Unwrap

func (c *Category) Unwrap() *Category

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

func (c *Category) Update() *CategoryUpdateOne

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

type CategoryClient

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

CategoryClient is a client for the Category schema.

func NewCategoryClient

func NewCategoryClient(c config) *CategoryClient

NewCategoryClient returns a client for the Category from the given config.

func (*CategoryClient) Create

func (c *CategoryClient) Create() *CategoryCreate

Create returns a builder for creating a Category entity.

func (*CategoryClient) CreateBulk

func (c *CategoryClient) CreateBulk(builders ...*CategoryCreate) *CategoryCreateBulk

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

func (*CategoryClient) Delete

func (c *CategoryClient) Delete() *CategoryDelete

Delete returns a delete builder for Category.

func (*CategoryClient) DeleteOne

func (c *CategoryClient) DeleteOne(ca *Category) *CategoryDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*CategoryClient) DeleteOneID

func (c *CategoryClient) DeleteOneID(id uint32) *CategoryDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*CategoryClient) Get

func (c *CategoryClient) Get(ctx context.Context, id uint32) (*Category, error)

Get returns a Category entity by its id.

func (*CategoryClient) GetX

func (c *CategoryClient) GetX(ctx context.Context, id uint32) *Category

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

func (*CategoryClient) Hooks

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

Hooks returns the client hooks.

func (*CategoryClient) Intercept

func (c *CategoryClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `category.Intercept(f(g(h())))`.

func (*CategoryClient) Interceptors

func (c *CategoryClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*CategoryClient) Query

func (c *CategoryClient) Query() *CategoryQuery

Query returns a query builder for Category.

func (*CategoryClient) Update

func (c *CategoryClient) Update() *CategoryUpdate

Update returns an update builder for Category.

func (*CategoryClient) UpdateOne

func (c *CategoryClient) UpdateOne(ca *Category) *CategoryUpdateOne

UpdateOne returns an update builder for the given entity.

func (*CategoryClient) UpdateOneID

func (c *CategoryClient) UpdateOneID(id uint32) *CategoryUpdateOne

UpdateOneID returns an update builder for the given id.

func (*CategoryClient) Use

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

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

type CategoryCreate

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

CategoryCreate is the builder for creating a Category entity.

func (*CategoryCreate) Exec

func (cc *CategoryCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*CategoryCreate) ExecX

func (cc *CategoryCreate) ExecX(ctx context.Context)

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

func (*CategoryCreate) Mutation

func (cc *CategoryCreate) Mutation() *CategoryMutation

Mutation returns the CategoryMutation object of the builder.

func (*CategoryCreate) Save

func (cc *CategoryCreate) Save(ctx context.Context) (*Category, error)

Save creates the Category in the database.

func (*CategoryCreate) SaveX

func (cc *CategoryCreate) SaveX(ctx context.Context) *Category

SaveX calls Save and panics if Save returns an error.

func (*CategoryCreate) SetCreated

func (cc *CategoryCreate) SetCreated(t time.Time) *CategoryCreate

SetCreated sets the "created" field.

func (*CategoryCreate) SetEmoji

func (cc *CategoryCreate) SetEmoji(s string) *CategoryCreate

SetEmoji sets the "emoji" field.

func (*CategoryCreate) SetID

func (cc *CategoryCreate) SetID(u uint32) *CategoryCreate

SetID sets the "id" field.

func (*CategoryCreate) SetModified

func (cc *CategoryCreate) SetModified(t time.Time) *CategoryCreate

SetModified sets the "modified" field.

func (*CategoryCreate) SetName

func (cc *CategoryCreate) SetName(s string) *CategoryCreate

SetName sets the "name" field.

func (*CategoryCreate) SetNameJa

func (cc *CategoryCreate) SetNameJa(s string) *CategoryCreate

SetNameJa sets the "name_ja" field.

func (*CategoryCreate) SetNillableCreated

func (cc *CategoryCreate) SetNillableCreated(t *time.Time) *CategoryCreate

SetNillableCreated sets the "created" field if the given value is not nil.

func (*CategoryCreate) SetNillableModified

func (cc *CategoryCreate) SetNillableModified(t *time.Time) *CategoryCreate

SetNillableModified sets the "modified" field if the given value is not nil.

type CategoryCreateBulk

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

CategoryCreateBulk is the builder for creating many Category entities in bulk.

func (*CategoryCreateBulk) Exec

func (ccb *CategoryCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*CategoryCreateBulk) ExecX

func (ccb *CategoryCreateBulk) ExecX(ctx context.Context)

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

func (*CategoryCreateBulk) Save

func (ccb *CategoryCreateBulk) Save(ctx context.Context) ([]*Category, error)

Save creates the Category entities in the database.

func (*CategoryCreateBulk) SaveX

func (ccb *CategoryCreateBulk) SaveX(ctx context.Context) []*Category

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

type CategoryDelete

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

CategoryDelete is the builder for deleting a Category entity.

func (*CategoryDelete) Exec

func (cd *CategoryDelete) Exec(ctx context.Context) (int, error)

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

func (*CategoryDelete) ExecX

func (cd *CategoryDelete) ExecX(ctx context.Context) int

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

func (*CategoryDelete) Where

func (cd *CategoryDelete) Where(ps ...predicate.Category) *CategoryDelete

Where appends a list predicates to the CategoryDelete builder.

type CategoryDeleteOne

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

CategoryDeleteOne is the builder for deleting a single Category entity.

func (*CategoryDeleteOne) Exec

func (cdo *CategoryDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*CategoryDeleteOne) ExecX

func (cdo *CategoryDeleteOne) ExecX(ctx context.Context)

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

func (*CategoryDeleteOne) Where

Where appends a list predicates to the CategoryDelete builder.

type CategoryGroupBy

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

CategoryGroupBy is the group-by builder for Category entities.

func (*CategoryGroupBy) Aggregate

func (cgb *CategoryGroupBy) Aggregate(fns ...AggregateFunc) *CategoryGroupBy

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

func (*CategoryGroupBy) Bool

func (s *CategoryGroupBy) Bool(ctx context.Context) (_ bool, err error)

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

func (*CategoryGroupBy) BoolX

func (s *CategoryGroupBy) BoolX(ctx context.Context) bool

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

func (*CategoryGroupBy) Bools

func (s *CategoryGroupBy) Bools(ctx context.Context) ([]bool, error)

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

func (*CategoryGroupBy) BoolsX

func (s *CategoryGroupBy) BoolsX(ctx context.Context) []bool

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

func (*CategoryGroupBy) Float64

func (s *CategoryGroupBy) Float64(ctx context.Context) (_ float64, err error)

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

func (*CategoryGroupBy) Float64X

func (s *CategoryGroupBy) Float64X(ctx context.Context) float64

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

func (*CategoryGroupBy) Float64s

func (s *CategoryGroupBy) Float64s(ctx context.Context) ([]float64, error)

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

func (*CategoryGroupBy) Float64sX

func (s *CategoryGroupBy) Float64sX(ctx context.Context) []float64

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

func (*CategoryGroupBy) Int

func (s *CategoryGroupBy) Int(ctx context.Context) (_ int, err error)

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

func (*CategoryGroupBy) IntX

func (s *CategoryGroupBy) IntX(ctx context.Context) int

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

func (*CategoryGroupBy) Ints

func (s *CategoryGroupBy) Ints(ctx context.Context) ([]int, error)

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

func (*CategoryGroupBy) IntsX

func (s *CategoryGroupBy) IntsX(ctx context.Context) []int

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

func (*CategoryGroupBy) Scan

func (cgb *CategoryGroupBy) Scan(ctx context.Context, v any) error

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

func (*CategoryGroupBy) ScanX

func (s *CategoryGroupBy) ScanX(ctx context.Context, v any)

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

func (*CategoryGroupBy) String

func (s *CategoryGroupBy) String(ctx context.Context) (_ string, err error)

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

func (*CategoryGroupBy) StringX

func (s *CategoryGroupBy) StringX(ctx context.Context) string

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

func (*CategoryGroupBy) Strings

func (s *CategoryGroupBy) Strings(ctx context.Context) ([]string, error)

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

func (*CategoryGroupBy) StringsX

func (s *CategoryGroupBy) StringsX(ctx context.Context) []string

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

type CategoryMutation

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

CategoryMutation represents an operation that mutates the Category nodes in the graph.

func (*CategoryMutation) AddField

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

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

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

func (*CategoryMutation) AddedField

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

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

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

func (*CategoryMutation) AddedIDs

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

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

func (*CategoryMutation) ClearEdge

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

func (m *CategoryMutation) 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 (*CategoryMutation) ClearedEdges

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

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

func (*CategoryMutation) ClearedFields

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

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

func (CategoryMutation) Client

func (m CategoryMutation) 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 (*CategoryMutation) Created

func (m *CategoryMutation) Created() (r time.Time, exists bool)

Created returns the value of the "created" field in the mutation.

func (*CategoryMutation) EdgeCleared

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

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

func (*CategoryMutation) Emoji

func (m *CategoryMutation) Emoji() (r string, exists bool)

Emoji returns the value of the "emoji" field in the mutation.

func (*CategoryMutation) Field

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

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

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

func (*CategoryMutation) Fields

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

func (m *CategoryMutation) ID() (id uint32, 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 (*CategoryMutation) IDs

func (m *CategoryMutation) IDs(ctx context.Context) ([]uint32, error)

IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.

func (*CategoryMutation) Modified

func (m *CategoryMutation) Modified() (r time.Time, exists bool)

Modified returns the value of the "modified" field in the mutation.

func (*CategoryMutation) Name

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

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

func (*CategoryMutation) NameJa

func (m *CategoryMutation) NameJa() (r string, exists bool)

NameJa returns the value of the "name_ja" field in the mutation.

func (*CategoryMutation) OldCreated

func (m *CategoryMutation) OldCreated(ctx context.Context) (v time.Time, err error)

OldCreated returns the old "created" field's value of the Category entity. If the Category 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 (*CategoryMutation) OldEmoji

func (m *CategoryMutation) OldEmoji(ctx context.Context) (v string, err error)

OldEmoji returns the old "emoji" field's value of the Category entity. If the Category 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 (*CategoryMutation) OldField

func (m *CategoryMutation) 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 (*CategoryMutation) OldModified

func (m *CategoryMutation) OldModified(ctx context.Context) (v time.Time, err error)

OldModified returns the old "modified" field's value of the Category entity. If the Category 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 (*CategoryMutation) OldName

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

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

func (m *CategoryMutation) OldNameJa(ctx context.Context) (v string, err error)

OldNameJa returns the old "name_ja" field's value of the Category entity. If the Category 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 (*CategoryMutation) Op

func (m *CategoryMutation) Op() Op

Op returns the operation name.

func (*CategoryMutation) RemovedEdges

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

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

func (*CategoryMutation) RemovedIDs

func (m *CategoryMutation) 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 (*CategoryMutation) ResetCreated

func (m *CategoryMutation) ResetCreated()

ResetCreated resets all changes to the "created" field.

func (*CategoryMutation) ResetEdge

func (m *CategoryMutation) 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 (*CategoryMutation) ResetEmoji

func (m *CategoryMutation) ResetEmoji()

ResetEmoji resets all changes to the "emoji" field.

func (*CategoryMutation) ResetField

func (m *CategoryMutation) 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 (*CategoryMutation) ResetModified

func (m *CategoryMutation) ResetModified()

ResetModified resets all changes to the "modified" field.

func (*CategoryMutation) ResetName

func (m *CategoryMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*CategoryMutation) ResetNameJa

func (m *CategoryMutation) ResetNameJa()

ResetNameJa resets all changes to the "name_ja" field.

func (*CategoryMutation) SetCreated

func (m *CategoryMutation) SetCreated(t time.Time)

SetCreated sets the "created" field.

func (*CategoryMutation) SetEmoji

func (m *CategoryMutation) SetEmoji(s string)

SetEmoji sets the "emoji" field.

func (*CategoryMutation) SetField

func (m *CategoryMutation) 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 (*CategoryMutation) SetID

func (m *CategoryMutation) SetID(id uint32)

SetID sets the value of the id field. Note that this operation is only accepted on creation of Category entities.

func (*CategoryMutation) SetModified

func (m *CategoryMutation) SetModified(t time.Time)

SetModified sets the "modified" field.

func (*CategoryMutation) SetName

func (m *CategoryMutation) SetName(s string)

SetName sets the "name" field.

func (*CategoryMutation) SetNameJa

func (m *CategoryMutation) SetNameJa(s string)

SetNameJa sets the "name_ja" field.

func (*CategoryMutation) SetOp

func (m *CategoryMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (CategoryMutation) Tx

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

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

func (*CategoryMutation) Type

func (m *CategoryMutation) Type() string

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

func (*CategoryMutation) Where

func (m *CategoryMutation) Where(ps ...predicate.Category)

Where appends a list predicates to the CategoryMutation builder.

func (*CategoryMutation) WhereP

func (m *CategoryMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the CategoryMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type CategoryQuery

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

CategoryQuery is the builder for querying Category entities.

func (*CategoryQuery) Aggregate

func (cq *CategoryQuery) Aggregate(fns ...AggregateFunc) *CategorySelect

Aggregate returns a CategorySelect configured with the given aggregations.

func (*CategoryQuery) All

func (cq *CategoryQuery) All(ctx context.Context) ([]*Category, error)

All executes the query and returns a list of Categories.

func (*CategoryQuery) AllX

func (cq *CategoryQuery) AllX(ctx context.Context) []*Category

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

func (*CategoryQuery) Clone

func (cq *CategoryQuery) Clone() *CategoryQuery

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

func (*CategoryQuery) Count

func (cq *CategoryQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*CategoryQuery) CountX

func (cq *CategoryQuery) CountX(ctx context.Context) int

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

func (*CategoryQuery) Exist

func (cq *CategoryQuery) Exist(ctx context.Context) (bool, error)

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

func (*CategoryQuery) ExistX

func (cq *CategoryQuery) ExistX(ctx context.Context) bool

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

func (*CategoryQuery) First

func (cq *CategoryQuery) First(ctx context.Context) (*Category, error)

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

func (*CategoryQuery) FirstID

func (cq *CategoryQuery) FirstID(ctx context.Context) (id uint32, err error)

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

func (*CategoryQuery) FirstIDX

func (cq *CategoryQuery) FirstIDX(ctx context.Context) uint32

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

func (*CategoryQuery) FirstX

func (cq *CategoryQuery) FirstX(ctx context.Context) *Category

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

func (*CategoryQuery) GroupBy

func (cq *CategoryQuery) GroupBy(field string, fields ...string) *CategoryGroupBy

GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.

Example:

var v []struct {
	Name string `json:"name,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Category.Query().
	GroupBy(category.FieldName).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*CategoryQuery) IDs

func (cq *CategoryQuery) IDs(ctx context.Context) (ids []uint32, err error)

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

func (*CategoryQuery) IDsX

func (cq *CategoryQuery) IDsX(ctx context.Context) []uint32

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

func (*CategoryQuery) Limit

func (cq *CategoryQuery) Limit(limit int) *CategoryQuery

Limit the number of records to be returned by this query.

func (*CategoryQuery) Offset

func (cq *CategoryQuery) Offset(offset int) *CategoryQuery

Offset to start from.

func (*CategoryQuery) Only

func (cq *CategoryQuery) Only(ctx context.Context) (*Category, error)

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

func (*CategoryQuery) OnlyID

func (cq *CategoryQuery) OnlyID(ctx context.Context) (id uint32, err error)

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

func (*CategoryQuery) OnlyIDX

func (cq *CategoryQuery) OnlyIDX(ctx context.Context) uint32

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

func (*CategoryQuery) OnlyX

func (cq *CategoryQuery) OnlyX(ctx context.Context) *Category

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

func (*CategoryQuery) Order

func (cq *CategoryQuery) Order(o ...OrderFunc) *CategoryQuery

Order specifies how the records should be ordered.

func (*CategoryQuery) Select

func (cq *CategoryQuery) Select(fields ...string) *CategorySelect

Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.

Example:

var v []struct {
	Name string `json:"name,omitempty"`
}

client.Category.Query().
	Select(category.FieldName).
	Scan(ctx, &v)

func (*CategoryQuery) Unique

func (cq *CategoryQuery) Unique(unique bool) *CategoryQuery

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

func (cq *CategoryQuery) Where(ps ...predicate.Category) *CategoryQuery

Where adds a new predicate for the CategoryQuery builder.

type CategorySelect

type CategorySelect struct {
	*CategoryQuery
	// contains filtered or unexported fields
}

CategorySelect is the builder for selecting fields of Category entities.

func (*CategorySelect) Aggregate

func (cs *CategorySelect) Aggregate(fns ...AggregateFunc) *CategorySelect

Aggregate adds the given aggregation functions to the selector query.

func (*CategorySelect) Bool

func (s *CategorySelect) Bool(ctx context.Context) (_ bool, err error)

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

func (*CategorySelect) BoolX

func (s *CategorySelect) BoolX(ctx context.Context) bool

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

func (*CategorySelect) Bools

func (s *CategorySelect) Bools(ctx context.Context) ([]bool, error)

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

func (*CategorySelect) BoolsX

func (s *CategorySelect) BoolsX(ctx context.Context) []bool

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

func (*CategorySelect) Float64

func (s *CategorySelect) Float64(ctx context.Context) (_ float64, err error)

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

func (*CategorySelect) Float64X

func (s *CategorySelect) Float64X(ctx context.Context) float64

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

func (*CategorySelect) Float64s

func (s *CategorySelect) Float64s(ctx context.Context) ([]float64, error)

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

func (*CategorySelect) Float64sX

func (s *CategorySelect) Float64sX(ctx context.Context) []float64

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

func (*CategorySelect) Int

func (s *CategorySelect) Int(ctx context.Context) (_ int, err error)

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

func (*CategorySelect) IntX

func (s *CategorySelect) IntX(ctx context.Context) int

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

func (*CategorySelect) Ints

func (s *CategorySelect) Ints(ctx context.Context) ([]int, error)

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

func (*CategorySelect) IntsX

func (s *CategorySelect) IntsX(ctx context.Context) []int

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

func (*CategorySelect) Scan

func (cs *CategorySelect) Scan(ctx context.Context, v any) error

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

func (*CategorySelect) ScanX

func (s *CategorySelect) ScanX(ctx context.Context, v any)

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

func (*CategorySelect) String

func (s *CategorySelect) String(ctx context.Context) (_ string, err error)

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

func (*CategorySelect) StringX

func (s *CategorySelect) StringX(ctx context.Context) string

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

func (*CategorySelect) Strings

func (s *CategorySelect) Strings(ctx context.Context) ([]string, error)

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

func (*CategorySelect) StringsX

func (s *CategorySelect) StringsX(ctx context.Context) []string

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

type CategoryUpdate

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

CategoryUpdate is the builder for updating Category entities.

func (*CategoryUpdate) Exec

func (cu *CategoryUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*CategoryUpdate) ExecX

func (cu *CategoryUpdate) ExecX(ctx context.Context)

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

func (*CategoryUpdate) Mutation

func (cu *CategoryUpdate) Mutation() *CategoryMutation

Mutation returns the CategoryMutation object of the builder.

func (*CategoryUpdate) Save

func (cu *CategoryUpdate) Save(ctx context.Context) (int, error)

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

func (*CategoryUpdate) SaveX

func (cu *CategoryUpdate) SaveX(ctx context.Context) int

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

func (*CategoryUpdate) SetCreated

func (cu *CategoryUpdate) SetCreated(t time.Time) *CategoryUpdate

SetCreated sets the "created" field.

func (*CategoryUpdate) SetEmoji

func (cu *CategoryUpdate) SetEmoji(s string) *CategoryUpdate

SetEmoji sets the "emoji" field.

func (*CategoryUpdate) SetModified

func (cu *CategoryUpdate) SetModified(t time.Time) *CategoryUpdate

SetModified sets the "modified" field.

func (*CategoryUpdate) SetName

func (cu *CategoryUpdate) SetName(s string) *CategoryUpdate

SetName sets the "name" field.

func (*CategoryUpdate) SetNameJa

func (cu *CategoryUpdate) SetNameJa(s string) *CategoryUpdate

SetNameJa sets the "name_ja" field.

func (*CategoryUpdate) SetNillableCreated

func (cu *CategoryUpdate) SetNillableCreated(t *time.Time) *CategoryUpdate

SetNillableCreated sets the "created" field if the given value is not nil.

func (*CategoryUpdate) Where

func (cu *CategoryUpdate) Where(ps ...predicate.Category) *CategoryUpdate

Where appends a list predicates to the CategoryUpdate builder.

type CategoryUpdateOne

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

CategoryUpdateOne is the builder for updating a single Category entity.

func (*CategoryUpdateOne) Exec

func (cuo *CategoryUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*CategoryUpdateOne) ExecX

func (cuo *CategoryUpdateOne) ExecX(ctx context.Context)

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

func (*CategoryUpdateOne) Mutation

func (cuo *CategoryUpdateOne) Mutation() *CategoryMutation

Mutation returns the CategoryMutation object of the builder.

func (*CategoryUpdateOne) Save

func (cuo *CategoryUpdateOne) Save(ctx context.Context) (*Category, error)

Save executes the query and returns the updated Category entity.

func (*CategoryUpdateOne) SaveX

func (cuo *CategoryUpdateOne) SaveX(ctx context.Context) *Category

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

func (*CategoryUpdateOne) Select

func (cuo *CategoryUpdateOne) Select(field string, fields ...string) *CategoryUpdateOne

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

func (*CategoryUpdateOne) SetCreated

func (cuo *CategoryUpdateOne) SetCreated(t time.Time) *CategoryUpdateOne

SetCreated sets the "created" field.

func (*CategoryUpdateOne) SetEmoji

func (cuo *CategoryUpdateOne) SetEmoji(s string) *CategoryUpdateOne

SetEmoji sets the "emoji" field.

func (*CategoryUpdateOne) SetModified

func (cuo *CategoryUpdateOne) SetModified(t time.Time) *CategoryUpdateOne

SetModified sets the "modified" field.

func (*CategoryUpdateOne) SetName

func (cuo *CategoryUpdateOne) SetName(s string) *CategoryUpdateOne

SetName sets the "name" field.

func (*CategoryUpdateOne) SetNameJa

func (cuo *CategoryUpdateOne) SetNameJa(s string) *CategoryUpdateOne

SetNameJa sets the "name_ja" field.

func (*CategoryUpdateOne) SetNillableCreated

func (cuo *CategoryUpdateOne) SetNillableCreated(t *time.Time) *CategoryUpdateOne

SetNillableCreated sets the "created" field if the given value is not nil.

func (*CategoryUpdateOne) Where

Where appends a list predicates to the CategoryUpdate builder.

type Client

type Client struct {

	// Schema is the client for creating, migrating and dropping schema.
	Schema *migrate.Schema
	// Biography is the client for interacting with the Biography builders.
	Biography *BiographyClient
	// Category is the client for interacting with the Category builders.
	Category *CategoryClient
	// Contact is the client for interacting with the Contact builders.
	Contact *ContactClient
	// ContactDefault is the client for interacting with the ContactDefault builders.
	ContactDefault *ContactDefaultClient
	// Link is the client for interacting with the Link builders.
	Link *LinkClient
	// Location is the client for interacting with the Location builders.
	Location *LocationClient
	// Notice is the client for interacting with the Notice builders.
	Notice *NoticeClient
	// Product is the client for interacting with the Product builders.
	Product *ProductClient
	// Session is the client for interacting with the Session builders.
	Session *SessionClient
	// 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().
	Biography.
	Query().
	Count(ctx)

func (*Client) Intercept

func (c *Client) Intercept(interceptors ...Interceptor)

Intercept adds the query interceptors to all the entity clients. In order to add interceptors to a specific client, call: `client.Node.Intercept(...)`.

func (*Client) Mutate

func (c *Client) Mutate(ctx context.Context, m Mutation) (Value, error)

Mutate implements the ent.Mutator interface.

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(ctx context.Context, tx *ent.Tx) error {
		// Do some stuff before.
		if err := next.Commit(ctx, tx); err != nil {
			return err
		}
		// Do some stuff after.
		return nil
	})
}

type Committer

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

Committer is the interface that wraps the Commit 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 Contact

type Contact struct {

	// ID of the ent.
	ID uint32 `json:"id,omitempty"`
	// ToUserID holds the value of the "to_user_id" field.
	ToUserID uint32 `json:"to_user_id,omitempty"`
	// Name holds the value of the "name" field.
	Name string `json:"name,omitempty"`
	// Title holds the value of the "title" field.
	Title string `json:"title,omitempty"`
	// Detail holds the value of the "detail" field.
	Detail string `json:"detail,omitempty"`
	// Mail holds the value of the "mail" field.
	Mail string `json:"mail,omitempty"`
	// IP holds the value of the "ip" field.
	IP string `json:"ip,omitempty"`
	// Lang holds the value of the "lang" field.
	Lang string `json:"lang,omitempty"`
	// URL holds the value of the "url" field.
	URL string `json:"url,omitempty"`
	// Category holds the value of the "category" field.
	Category string `json:"category,omitempty"`
	// CustomTitle holds the value of the "custom_title" field.
	CustomTitle string `json:"custom_title,omitempty"`
	// CustomValue holds the value of the "custom_value" field.
	CustomValue string `json:"custom_value,omitempty"`
	// DeviceName holds the value of the "device_name" field.
	DeviceName string `json:"device_name,omitempty"`
	// Os holds the value of the "os" field.
	Os string `json:"os,omitempty"`
	// BrowserName holds the value of the "browser_name" field.
	BrowserName string `json:"browser_name,omitempty"`
	// IsMobile holds the value of the "is_mobile" field.
	IsMobile bool `json:"is_mobile,omitempty"`
	// Created holds the value of the "created" field.
	Created time.Time `json:"created,omitempty"`
	// Modified holds the value of the "modified" field.
	Modified time.Time `json:"modified,omitempty"`
	// contains filtered or unexported fields
}

Contact is the model entity for the Contact schema.

func (*Contact) String

func (c *Contact) String() string

String implements the fmt.Stringer.

func (*Contact) Unwrap

func (c *Contact) Unwrap() *Contact

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

func (c *Contact) Update() *ContactUpdateOne

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

type ContactClient

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

ContactClient is a client for the Contact schema.

func NewContactClient

func NewContactClient(c config) *ContactClient

NewContactClient returns a client for the Contact from the given config.

func (*ContactClient) Create

func (c *ContactClient) Create() *ContactCreate

Create returns a builder for creating a Contact entity.

func (*ContactClient) CreateBulk

func (c *ContactClient) CreateBulk(builders ...*ContactCreate) *ContactCreateBulk

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

func (*ContactClient) Delete

func (c *ContactClient) Delete() *ContactDelete

Delete returns a delete builder for Contact.

func (*ContactClient) DeleteOne

func (c *ContactClient) DeleteOne(co *Contact) *ContactDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*ContactClient) DeleteOneID

func (c *ContactClient) DeleteOneID(id uint32) *ContactDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*ContactClient) Get

func (c *ContactClient) Get(ctx context.Context, id uint32) (*Contact, error)

Get returns a Contact entity by its id.

func (*ContactClient) GetX

func (c *ContactClient) GetX(ctx context.Context, id uint32) *Contact

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

func (*ContactClient) Hooks

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

Hooks returns the client hooks.

func (*ContactClient) Intercept

func (c *ContactClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `contact.Intercept(f(g(h())))`.

func (*ContactClient) Interceptors

func (c *ContactClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*ContactClient) Query

func (c *ContactClient) Query() *ContactQuery

Query returns a query builder for Contact.

func (*ContactClient) Update

func (c *ContactClient) Update() *ContactUpdate

Update returns an update builder for Contact.

func (*ContactClient) UpdateOne

func (c *ContactClient) UpdateOne(co *Contact) *ContactUpdateOne

UpdateOne returns an update builder for the given entity.

func (*ContactClient) UpdateOneID

func (c *ContactClient) UpdateOneID(id uint32) *ContactUpdateOne

UpdateOneID returns an update builder for the given id.

func (*ContactClient) Use

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

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

type ContactCreate

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

ContactCreate is the builder for creating a Contact entity.

func (*ContactCreate) Exec

func (cc *ContactCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*ContactCreate) ExecX

func (cc *ContactCreate) ExecX(ctx context.Context)

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

func (*ContactCreate) Mutation

func (cc *ContactCreate) Mutation() *ContactMutation

Mutation returns the ContactMutation object of the builder.

func (*ContactCreate) Save

func (cc *ContactCreate) Save(ctx context.Context) (*Contact, error)

Save creates the Contact in the database.

func (*ContactCreate) SaveX

func (cc *ContactCreate) SaveX(ctx context.Context) *Contact

SaveX calls Save and panics if Save returns an error.

func (*ContactCreate) SetBrowserName

func (cc *ContactCreate) SetBrowserName(s string) *ContactCreate

SetBrowserName sets the "browser_name" field.

func (*ContactCreate) SetCategory

func (cc *ContactCreate) SetCategory(s string) *ContactCreate

SetCategory sets the "category" field.

func (*ContactCreate) SetCreated

func (cc *ContactCreate) SetCreated(t time.Time) *ContactCreate

SetCreated sets the "created" field.

func (*ContactCreate) SetCustomTitle

func (cc *ContactCreate) SetCustomTitle(s string) *ContactCreate

SetCustomTitle sets the "custom_title" field.

func (*ContactCreate) SetCustomValue

func (cc *ContactCreate) SetCustomValue(s string) *ContactCreate

SetCustomValue sets the "custom_value" field.

func (*ContactCreate) SetDetail

func (cc *ContactCreate) SetDetail(s string) *ContactCreate

SetDetail sets the "detail" field.

func (*ContactCreate) SetDeviceName

func (cc *ContactCreate) SetDeviceName(s string) *ContactCreate

SetDeviceName sets the "device_name" field.

func (*ContactCreate) SetID

func (cc *ContactCreate) SetID(u uint32) *ContactCreate

SetID sets the "id" field.

func (*ContactCreate) SetIP

func (cc *ContactCreate) SetIP(s string) *ContactCreate

SetIP sets the "ip" field.

func (*ContactCreate) SetIsMobile

func (cc *ContactCreate) SetIsMobile(b bool) *ContactCreate

SetIsMobile sets the "is_mobile" field.

func (*ContactCreate) SetLang

func (cc *ContactCreate) SetLang(s string) *ContactCreate

SetLang sets the "lang" field.

func (*ContactCreate) SetMail

func (cc *ContactCreate) SetMail(s string) *ContactCreate

SetMail sets the "mail" field.

func (*ContactCreate) SetModified

func (cc *ContactCreate) SetModified(t time.Time) *ContactCreate

SetModified sets the "modified" field.

func (*ContactCreate) SetName

func (cc *ContactCreate) SetName(s string) *ContactCreate

SetName sets the "name" field.

func (*ContactCreate) SetNillableBrowserName

func (cc *ContactCreate) SetNillableBrowserName(s *string) *ContactCreate

SetNillableBrowserName sets the "browser_name" field if the given value is not nil.

func (*ContactCreate) SetNillableCategory

func (cc *ContactCreate) SetNillableCategory(s *string) *ContactCreate

SetNillableCategory sets the "category" field if the given value is not nil.

func (*ContactCreate) SetNillableCreated

func (cc *ContactCreate) SetNillableCreated(t *time.Time) *ContactCreate

SetNillableCreated sets the "created" field if the given value is not nil.

func (*ContactCreate) SetNillableCustomTitle

func (cc *ContactCreate) SetNillableCustomTitle(s *string) *ContactCreate

SetNillableCustomTitle sets the "custom_title" field if the given value is not nil.

func (*ContactCreate) SetNillableCustomValue

func (cc *ContactCreate) SetNillableCustomValue(s *string) *ContactCreate

SetNillableCustomValue sets the "custom_value" field if the given value is not nil.

func (*ContactCreate) SetNillableDeviceName

func (cc *ContactCreate) SetNillableDeviceName(s *string) *ContactCreate

SetNillableDeviceName sets the "device_name" field if the given value is not nil.

func (*ContactCreate) SetNillableIsMobile

func (cc *ContactCreate) SetNillableIsMobile(b *bool) *ContactCreate

SetNillableIsMobile sets the "is_mobile" field if the given value is not nil.

func (*ContactCreate) SetNillableModified

func (cc *ContactCreate) SetNillableModified(t *time.Time) *ContactCreate

SetNillableModified sets the "modified" field if the given value is not nil.

func (*ContactCreate) SetNillableOs

func (cc *ContactCreate) SetNillableOs(s *string) *ContactCreate

SetNillableOs sets the "os" field if the given value is not nil.

func (*ContactCreate) SetNillableURL

func (cc *ContactCreate) SetNillableURL(s *string) *ContactCreate

SetNillableURL sets the "url" field if the given value is not nil.

func (*ContactCreate) SetOs

func (cc *ContactCreate) SetOs(s string) *ContactCreate

SetOs sets the "os" field.

func (*ContactCreate) SetTitle

func (cc *ContactCreate) SetTitle(s string) *ContactCreate

SetTitle sets the "title" field.

func (*ContactCreate) SetToUserID

func (cc *ContactCreate) SetToUserID(u uint32) *ContactCreate

SetToUserID sets the "to_user_id" field.

func (*ContactCreate) SetURL

func (cc *ContactCreate) SetURL(s string) *ContactCreate

SetURL sets the "url" field.

type ContactCreateBulk

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

ContactCreateBulk is the builder for creating many Contact entities in bulk.

func (*ContactCreateBulk) Exec

func (ccb *ContactCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*ContactCreateBulk) ExecX

func (ccb *ContactCreateBulk) ExecX(ctx context.Context)

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

func (*ContactCreateBulk) Save

func (ccb *ContactCreateBulk) Save(ctx context.Context) ([]*Contact, error)

Save creates the Contact entities in the database.

func (*ContactCreateBulk) SaveX

func (ccb *ContactCreateBulk) SaveX(ctx context.Context) []*Contact

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

type ContactDefault

type ContactDefault struct {

	// ID of the ent.
	ID uint32 `json:"id,omitempty"`
	// Name holds the value of the "name" field.
	Name *string `json:"name,omitempty"`
	// Email holds the value of the "email" field.
	Email *string `json:"email,omitempty"`
	// URL holds the value of the "url" field.
	URL *string `json:"url,omitempty"`
	// Category holds the value of the "category" field.
	Category *string `json:"category,omitempty"`
	// CustomTitle holds the value of the "custom_title" field.
	CustomTitle *string `json:"custom_title,omitempty"`
	// Description holds the value of the "description" field.
	Description *string `json:"description,omitempty"`
	// Created holds the value of the "created" field.
	Created time.Time `json:"created,omitempty"`
	// Modified holds the value of the "modified" field.
	Modified time.Time `json:"modified,omitempty"`
	// contains filtered or unexported fields
}

ContactDefault is the model entity for the ContactDefault schema.

func (*ContactDefault) String

func (cd *ContactDefault) String() string

String implements the fmt.Stringer.

func (*ContactDefault) Unwrap

func (cd *ContactDefault) Unwrap() *ContactDefault

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

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

type ContactDefaultClient

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

ContactDefaultClient is a client for the ContactDefault schema.

func NewContactDefaultClient

func NewContactDefaultClient(c config) *ContactDefaultClient

NewContactDefaultClient returns a client for the ContactDefault from the given config.

func (*ContactDefaultClient) Create

Create returns a builder for creating a ContactDefault entity.

func (*ContactDefaultClient) CreateBulk

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

func (*ContactDefaultClient) Delete

Delete returns a delete builder for ContactDefault.

func (*ContactDefaultClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*ContactDefaultClient) DeleteOneID

DeleteOneID returns a builder for deleting the given entity by its id.

func (*ContactDefaultClient) Get

Get returns a ContactDefault entity by its id.

func (*ContactDefaultClient) GetX

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

func (*ContactDefaultClient) Hooks

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

Hooks returns the client hooks.

func (*ContactDefaultClient) Intercept

func (c *ContactDefaultClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `contactdefault.Intercept(f(g(h())))`.

func (*ContactDefaultClient) Interceptors

func (c *ContactDefaultClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*ContactDefaultClient) Query

Query returns a query builder for ContactDefault.

func (*ContactDefaultClient) Update

Update returns an update builder for ContactDefault.

func (*ContactDefaultClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*ContactDefaultClient) UpdateOneID

UpdateOneID returns an update builder for the given id.

func (*ContactDefaultClient) Use

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

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

type ContactDefaultCreate

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

ContactDefaultCreate is the builder for creating a ContactDefault entity.

func (*ContactDefaultCreate) Exec

func (cdc *ContactDefaultCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*ContactDefaultCreate) ExecX

func (cdc *ContactDefaultCreate) ExecX(ctx context.Context)

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

func (*ContactDefaultCreate) Mutation

Mutation returns the ContactDefaultMutation object of the builder.

func (*ContactDefaultCreate) Save

Save creates the ContactDefault in the database.

func (*ContactDefaultCreate) SaveX

SaveX calls Save and panics if Save returns an error.

func (*ContactDefaultCreate) SetCategory

func (cdc *ContactDefaultCreate) SetCategory(s string) *ContactDefaultCreate

SetCategory sets the "category" field.

func (*ContactDefaultCreate) SetCreated

func (cdc *ContactDefaultCreate) SetCreated(t time.Time) *ContactDefaultCreate

SetCreated sets the "created" field.

func (*ContactDefaultCreate) SetCustomTitle

func (cdc *ContactDefaultCreate) SetCustomTitle(s string) *ContactDefaultCreate

SetCustomTitle sets the "custom_title" field.

func (*ContactDefaultCreate) SetDescription

func (cdc *ContactDefaultCreate) SetDescription(s string) *ContactDefaultCreate

SetDescription sets the "description" field.

func (*ContactDefaultCreate) SetEmail

SetEmail sets the "email" field.

func (*ContactDefaultCreate) SetID

SetID sets the "id" field.

func (*ContactDefaultCreate) SetModified

func (cdc *ContactDefaultCreate) SetModified(t time.Time) *ContactDefaultCreate

SetModified sets the "modified" field.

func (*ContactDefaultCreate) SetName

SetName sets the "name" field.

func (*ContactDefaultCreate) SetNillableCategory

func (cdc *ContactDefaultCreate) SetNillableCategory(s *string) *ContactDefaultCreate

SetNillableCategory sets the "category" field if the given value is not nil.

func (*ContactDefaultCreate) SetNillableCreated

func (cdc *ContactDefaultCreate) SetNillableCreated(t *time.Time) *ContactDefaultCreate

SetNillableCreated sets the "created" field if the given value is not nil.

func (*ContactDefaultCreate) SetNillableCustomTitle

func (cdc *ContactDefaultCreate) SetNillableCustomTitle(s *string) *ContactDefaultCreate

SetNillableCustomTitle sets the "custom_title" field if the given value is not nil.

func (*ContactDefaultCreate) SetNillableDescription

func (cdc *ContactDefaultCreate) SetNillableDescription(s *string) *ContactDefaultCreate

SetNillableDescription sets the "description" field if the given value is not nil.

func (*ContactDefaultCreate) SetNillableEmail

func (cdc *ContactDefaultCreate) SetNillableEmail(s *string) *ContactDefaultCreate

SetNillableEmail sets the "email" field if the given value is not nil.

func (*ContactDefaultCreate) SetNillableModified

func (cdc *ContactDefaultCreate) SetNillableModified(t *time.Time) *ContactDefaultCreate

SetNillableModified sets the "modified" field if the given value is not nil.

func (*ContactDefaultCreate) SetNillableName

func (cdc *ContactDefaultCreate) SetNillableName(s *string) *ContactDefaultCreate

SetNillableName sets the "name" field if the given value is not nil.

func (*ContactDefaultCreate) SetNillableURL

func (cdc *ContactDefaultCreate) SetNillableURL(s *string) *ContactDefaultCreate

SetNillableURL sets the "url" field if the given value is not nil.

func (*ContactDefaultCreate) SetURL

SetURL sets the "url" field.

type ContactDefaultCreateBulk

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

ContactDefaultCreateBulk is the builder for creating many ContactDefault entities in bulk.

func (*ContactDefaultCreateBulk) Exec

Exec executes the query.

func (*ContactDefaultCreateBulk) ExecX

func (cdcb *ContactDefaultCreateBulk) ExecX(ctx context.Context)

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

func (*ContactDefaultCreateBulk) Save

Save creates the ContactDefault entities in the database.

func (*ContactDefaultCreateBulk) SaveX

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

type ContactDefaultDelete

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

ContactDefaultDelete is the builder for deleting a ContactDefault entity.

func (*ContactDefaultDelete) Exec

func (cdd *ContactDefaultDelete) Exec(ctx context.Context) (int, error)

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

func (*ContactDefaultDelete) ExecX

func (cdd *ContactDefaultDelete) ExecX(ctx context.Context) int

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

func (*ContactDefaultDelete) Where

Where appends a list predicates to the ContactDefaultDelete builder.

type ContactDefaultDeleteOne

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

ContactDefaultDeleteOne is the builder for deleting a single ContactDefault entity.

func (*ContactDefaultDeleteOne) Exec

func (cddo *ContactDefaultDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*ContactDefaultDeleteOne) ExecX

func (cddo *ContactDefaultDeleteOne) ExecX(ctx context.Context)

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

func (*ContactDefaultDeleteOne) Where

Where appends a list predicates to the ContactDefaultDelete builder.

type ContactDefaultGroupBy

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

ContactDefaultGroupBy is the group-by builder for ContactDefault entities.

func (*ContactDefaultGroupBy) Aggregate

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

func (*ContactDefaultGroupBy) Bool

func (s *ContactDefaultGroupBy) Bool(ctx context.Context) (_ bool, err error)

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

func (*ContactDefaultGroupBy) BoolX

func (s *ContactDefaultGroupBy) BoolX(ctx context.Context) bool

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

func (*ContactDefaultGroupBy) Bools

func (s *ContactDefaultGroupBy) Bools(ctx context.Context) ([]bool, error)

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

func (*ContactDefaultGroupBy) BoolsX

func (s *ContactDefaultGroupBy) BoolsX(ctx context.Context) []bool

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

func (*ContactDefaultGroupBy) Float64

func (s *ContactDefaultGroupBy) Float64(ctx context.Context) (_ float64, err error)

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

func (*ContactDefaultGroupBy) Float64X

func (s *ContactDefaultGroupBy) Float64X(ctx context.Context) float64

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

func (*ContactDefaultGroupBy) Float64s

func (s *ContactDefaultGroupBy) Float64s(ctx context.Context) ([]float64, error)

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

func (*ContactDefaultGroupBy) Float64sX

func (s *ContactDefaultGroupBy) Float64sX(ctx context.Context) []float64

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

func (*ContactDefaultGroupBy) Int

func (s *ContactDefaultGroupBy) Int(ctx context.Context) (_ int, err error)

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

func (*ContactDefaultGroupBy) IntX

func (s *ContactDefaultGroupBy) IntX(ctx context.Context) int

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

func (*ContactDefaultGroupBy) Ints

func (s *ContactDefaultGroupBy) Ints(ctx context.Context) ([]int, error)

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

func (*ContactDefaultGroupBy) IntsX

func (s *ContactDefaultGroupBy) IntsX(ctx context.Context) []int

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

func (*ContactDefaultGroupBy) Scan

func (cdgb *ContactDefaultGroupBy) Scan(ctx context.Context, v any) error

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

func (*ContactDefaultGroupBy) ScanX

func (s *ContactDefaultGroupBy) ScanX(ctx context.Context, v any)

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

func (*ContactDefaultGroupBy) String

func (s *ContactDefaultGroupBy) String(ctx context.Context) (_ string, err error)

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

func (*ContactDefaultGroupBy) StringX

func (s *ContactDefaultGroupBy) StringX(ctx context.Context) string

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

func (*ContactDefaultGroupBy) Strings

func (s *ContactDefaultGroupBy) Strings(ctx context.Context) ([]string, error)

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

func (*ContactDefaultGroupBy) StringsX

func (s *ContactDefaultGroupBy) StringsX(ctx context.Context) []string

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

type ContactDefaultMutation

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

ContactDefaultMutation represents an operation that mutates the ContactDefault nodes in the graph.

func (*ContactDefaultMutation) AddField

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

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

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

func (*ContactDefaultMutation) AddedField

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

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

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

func (*ContactDefaultMutation) AddedIDs

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

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

func (*ContactDefaultMutation) Category

func (m *ContactDefaultMutation) Category() (r string, exists bool)

Category returns the value of the "category" field in the mutation.

func (*ContactDefaultMutation) CategoryCleared

func (m *ContactDefaultMutation) CategoryCleared() bool

CategoryCleared returns if the "category" field was cleared in this mutation.

func (*ContactDefaultMutation) ClearCategory

func (m *ContactDefaultMutation) ClearCategory()

ClearCategory clears the value of the "category" field.

func (*ContactDefaultMutation) ClearCustomTitle

func (m *ContactDefaultMutation) ClearCustomTitle()

ClearCustomTitle clears the value of the "custom_title" field.

func (*ContactDefaultMutation) ClearDescription

func (m *ContactDefaultMutation) ClearDescription()

ClearDescription clears the value of the "description" field.

func (*ContactDefaultMutation) ClearEdge

func (m *ContactDefaultMutation) 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 (*ContactDefaultMutation) ClearEmail

func (m *ContactDefaultMutation) ClearEmail()

ClearEmail clears the value of the "email" field.

func (*ContactDefaultMutation) ClearField

func (m *ContactDefaultMutation) 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 (*ContactDefaultMutation) ClearName

func (m *ContactDefaultMutation) ClearName()

ClearName clears the value of the "name" field.

func (*ContactDefaultMutation) ClearURL

func (m *ContactDefaultMutation) ClearURL()

ClearURL clears the value of the "url" field.

func (*ContactDefaultMutation) ClearedEdges

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

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

func (*ContactDefaultMutation) ClearedFields

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

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

func (ContactDefaultMutation) Client

func (m ContactDefaultMutation) 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 (*ContactDefaultMutation) Created

func (m *ContactDefaultMutation) Created() (r time.Time, exists bool)

Created returns the value of the "created" field in the mutation.

func (*ContactDefaultMutation) CustomTitle

func (m *ContactDefaultMutation) CustomTitle() (r string, exists bool)

CustomTitle returns the value of the "custom_title" field in the mutation.

func (*ContactDefaultMutation) CustomTitleCleared

func (m *ContactDefaultMutation) CustomTitleCleared() bool

CustomTitleCleared returns if the "custom_title" field was cleared in this mutation.

func (*ContactDefaultMutation) Description

func (m *ContactDefaultMutation) Description() (r string, exists bool)

Description returns the value of the "description" field in the mutation.

func (*ContactDefaultMutation) DescriptionCleared

func (m *ContactDefaultMutation) DescriptionCleared() bool

DescriptionCleared returns if the "description" field was cleared in this mutation.

func (*ContactDefaultMutation) EdgeCleared

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

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

func (*ContactDefaultMutation) Email

func (m *ContactDefaultMutation) Email() (r string, exists bool)

Email returns the value of the "email" field in the mutation.

func (*ContactDefaultMutation) EmailCleared

func (m *ContactDefaultMutation) EmailCleared() bool

EmailCleared returns if the "email" field was cleared in this mutation.

func (*ContactDefaultMutation) Field

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

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

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

func (*ContactDefaultMutation) Fields

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

func (m *ContactDefaultMutation) ID() (id uint32, 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 (*ContactDefaultMutation) IDs

IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.

func (*ContactDefaultMutation) Modified

func (m *ContactDefaultMutation) Modified() (r time.Time, exists bool)

Modified returns the value of the "modified" field in the mutation.

func (*ContactDefaultMutation) Name

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

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

func (*ContactDefaultMutation) NameCleared

func (m *ContactDefaultMutation) NameCleared() bool

NameCleared returns if the "name" field was cleared in this mutation.

func (*ContactDefaultMutation) OldCategory

func (m *ContactDefaultMutation) OldCategory(ctx context.Context) (v *string, err error)

OldCategory returns the old "category" field's value of the ContactDefault entity. If the ContactDefault 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 (*ContactDefaultMutation) OldCreated

func (m *ContactDefaultMutation) OldCreated(ctx context.Context) (v time.Time, err error)

OldCreated returns the old "created" field's value of the ContactDefault entity. If the ContactDefault 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 (*ContactDefaultMutation) OldCustomTitle

func (m *ContactDefaultMutation) OldCustomTitle(ctx context.Context) (v *string, err error)

OldCustomTitle returns the old "custom_title" field's value of the ContactDefault entity. If the ContactDefault 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 (*ContactDefaultMutation) OldDescription

func (m *ContactDefaultMutation) OldDescription(ctx context.Context) (v *string, err error)

OldDescription returns the old "description" field's value of the ContactDefault entity. If the ContactDefault 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 (*ContactDefaultMutation) OldEmail

func (m *ContactDefaultMutation) OldEmail(ctx context.Context) (v *string, err error)

OldEmail returns the old "email" field's value of the ContactDefault entity. If the ContactDefault 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 (*ContactDefaultMutation) OldField

func (m *ContactDefaultMutation) 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 (*ContactDefaultMutation) OldModified

func (m *ContactDefaultMutation) OldModified(ctx context.Context) (v time.Time, err error)

OldModified returns the old "modified" field's value of the ContactDefault entity. If the ContactDefault 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 (*ContactDefaultMutation) OldName

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

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

func (m *ContactDefaultMutation) OldURL(ctx context.Context) (v *string, err error)

OldURL returns the old "url" field's value of the ContactDefault entity. If the ContactDefault 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 (*ContactDefaultMutation) Op

func (m *ContactDefaultMutation) Op() Op

Op returns the operation name.

func (*ContactDefaultMutation) RemovedEdges

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

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

func (*ContactDefaultMutation) RemovedIDs

func (m *ContactDefaultMutation) 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 (*ContactDefaultMutation) ResetCategory

func (m *ContactDefaultMutation) ResetCategory()

ResetCategory resets all changes to the "category" field.

func (*ContactDefaultMutation) ResetCreated

func (m *ContactDefaultMutation) ResetCreated()

ResetCreated resets all changes to the "created" field.

func (*ContactDefaultMutation) ResetCustomTitle

func (m *ContactDefaultMutation) ResetCustomTitle()

ResetCustomTitle resets all changes to the "custom_title" field.

func (*ContactDefaultMutation) ResetDescription

func (m *ContactDefaultMutation) ResetDescription()

ResetDescription resets all changes to the "description" field.

func (*ContactDefaultMutation) ResetEdge

func (m *ContactDefaultMutation) 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 (*ContactDefaultMutation) ResetEmail

func (m *ContactDefaultMutation) ResetEmail()

ResetEmail resets all changes to the "email" field.

func (*ContactDefaultMutation) ResetField

func (m *ContactDefaultMutation) 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 (*ContactDefaultMutation) ResetModified

func (m *ContactDefaultMutation) ResetModified()

ResetModified resets all changes to the "modified" field.

func (*ContactDefaultMutation) ResetName

func (m *ContactDefaultMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*ContactDefaultMutation) ResetURL

func (m *ContactDefaultMutation) ResetURL()

ResetURL resets all changes to the "url" field.

func (*ContactDefaultMutation) SetCategory

func (m *ContactDefaultMutation) SetCategory(s string)

SetCategory sets the "category" field.

func (*ContactDefaultMutation) SetCreated

func (m *ContactDefaultMutation) SetCreated(t time.Time)

SetCreated sets the "created" field.

func (*ContactDefaultMutation) SetCustomTitle

func (m *ContactDefaultMutation) SetCustomTitle(s string)

SetCustomTitle sets the "custom_title" field.

func (*ContactDefaultMutation) SetDescription

func (m *ContactDefaultMutation) SetDescription(s string)

SetDescription sets the "description" field.

func (*ContactDefaultMutation) SetEmail

func (m *ContactDefaultMutation) SetEmail(s string)

SetEmail sets the "email" field.

func (*ContactDefaultMutation) SetField

func (m *ContactDefaultMutation) 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 (*ContactDefaultMutation) SetID

func (m *ContactDefaultMutation) SetID(id uint32)

SetID sets the value of the id field. Note that this operation is only accepted on creation of ContactDefault entities.

func (*ContactDefaultMutation) SetModified

func (m *ContactDefaultMutation) SetModified(t time.Time)

SetModified sets the "modified" field.

func (*ContactDefaultMutation) SetName

func (m *ContactDefaultMutation) SetName(s string)

SetName sets the "name" field.

func (*ContactDefaultMutation) SetOp

func (m *ContactDefaultMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*ContactDefaultMutation) SetURL

func (m *ContactDefaultMutation) SetURL(s string)

SetURL sets the "url" field.

func (ContactDefaultMutation) Tx

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

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

func (*ContactDefaultMutation) Type

func (m *ContactDefaultMutation) Type() string

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

func (*ContactDefaultMutation) URL

func (m *ContactDefaultMutation) URL() (r string, exists bool)

URL returns the value of the "url" field in the mutation.

func (*ContactDefaultMutation) URLCleared

func (m *ContactDefaultMutation) URLCleared() bool

URLCleared returns if the "url" field was cleared in this mutation.

func (*ContactDefaultMutation) Where

Where appends a list predicates to the ContactDefaultMutation builder.

func (*ContactDefaultMutation) WhereP

func (m *ContactDefaultMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the ContactDefaultMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type ContactDefaultQuery

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

ContactDefaultQuery is the builder for querying ContactDefault entities.

func (*ContactDefaultQuery) Aggregate

func (cdq *ContactDefaultQuery) Aggregate(fns ...AggregateFunc) *ContactDefaultSelect

Aggregate returns a ContactDefaultSelect configured with the given aggregations.

func (*ContactDefaultQuery) All

All executes the query and returns a list of ContactDefaults.

func (*ContactDefaultQuery) AllX

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

func (*ContactDefaultQuery) Clone

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

func (*ContactDefaultQuery) Count

func (cdq *ContactDefaultQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*ContactDefaultQuery) CountX

func (cdq *ContactDefaultQuery) CountX(ctx context.Context) int

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

func (*ContactDefaultQuery) Exist

func (cdq *ContactDefaultQuery) Exist(ctx context.Context) (bool, error)

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

func (*ContactDefaultQuery) ExistX

func (cdq *ContactDefaultQuery) ExistX(ctx context.Context) bool

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

func (*ContactDefaultQuery) First

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

func (*ContactDefaultQuery) FirstID

func (cdq *ContactDefaultQuery) FirstID(ctx context.Context) (id uint32, err error)

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

func (*ContactDefaultQuery) FirstIDX

func (cdq *ContactDefaultQuery) FirstIDX(ctx context.Context) uint32

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

func (*ContactDefaultQuery) FirstX

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

func (*ContactDefaultQuery) GroupBy

func (cdq *ContactDefaultQuery) GroupBy(field string, fields ...string) *ContactDefaultGroupBy

GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.

Example:

var v []struct {
	Name string `json:"name,omitempty"`
	Count int `json:"count,omitempty"`
}

client.ContactDefault.Query().
	GroupBy(contactdefault.FieldName).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*ContactDefaultQuery) IDs

func (cdq *ContactDefaultQuery) IDs(ctx context.Context) (ids []uint32, err error)

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

func (*ContactDefaultQuery) IDsX

func (cdq *ContactDefaultQuery) IDsX(ctx context.Context) []uint32

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

func (*ContactDefaultQuery) Limit

func (cdq *ContactDefaultQuery) Limit(limit int) *ContactDefaultQuery

Limit the number of records to be returned by this query.

func (*ContactDefaultQuery) Offset

func (cdq *ContactDefaultQuery) Offset(offset int) *ContactDefaultQuery

Offset to start from.

func (*ContactDefaultQuery) Only

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

func (*ContactDefaultQuery) OnlyID

func (cdq *ContactDefaultQuery) OnlyID(ctx context.Context) (id uint32, err error)

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

func (*ContactDefaultQuery) OnlyIDX

func (cdq *ContactDefaultQuery) OnlyIDX(ctx context.Context) uint32

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

func (*ContactDefaultQuery) OnlyX

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

func (*ContactDefaultQuery) Order

Order specifies how the records should be ordered.

func (*ContactDefaultQuery) Select

func (cdq *ContactDefaultQuery) Select(fields ...string) *ContactDefaultSelect

Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.

Example:

var v []struct {
	Name string `json:"name,omitempty"`
}

client.ContactDefault.Query().
	Select(contactdefault.FieldName).
	Scan(ctx, &v)

func (*ContactDefaultQuery) Unique

func (cdq *ContactDefaultQuery) Unique(unique bool) *ContactDefaultQuery

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

Where adds a new predicate for the ContactDefaultQuery builder.

type ContactDefaultSelect

type ContactDefaultSelect struct {
	*ContactDefaultQuery
	// contains filtered or unexported fields
}

ContactDefaultSelect is the builder for selecting fields of ContactDefault entities.

func (*ContactDefaultSelect) Aggregate

Aggregate adds the given aggregation functions to the selector query.

func (*ContactDefaultSelect) Bool

func (s *ContactDefaultSelect) Bool(ctx context.Context) (_ bool, err error)

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

func (*ContactDefaultSelect) BoolX

func (s *ContactDefaultSelect) BoolX(ctx context.Context) bool

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

func (*ContactDefaultSelect) Bools

func (s *ContactDefaultSelect) Bools(ctx context.Context) ([]bool, error)

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

func (*ContactDefaultSelect) BoolsX

func (s *ContactDefaultSelect) BoolsX(ctx context.Context) []bool

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

func (*ContactDefaultSelect) Float64

func (s *ContactDefaultSelect) Float64(ctx context.Context) (_ float64, err error)

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

func (*ContactDefaultSelect) Float64X

func (s *ContactDefaultSelect) Float64X(ctx context.Context) float64

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

func (*ContactDefaultSelect) Float64s

func (s *ContactDefaultSelect) Float64s(ctx context.Context) ([]float64, error)

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

func (*ContactDefaultSelect) Float64sX

func (s *ContactDefaultSelect) Float64sX(ctx context.Context) []float64

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

func (*ContactDefaultSelect) Int

func (s *ContactDefaultSelect) Int(ctx context.Context) (_ int, err error)

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

func (*ContactDefaultSelect) IntX

func (s *ContactDefaultSelect) IntX(ctx context.Context) int

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

func (*ContactDefaultSelect) Ints

func (s *ContactDefaultSelect) Ints(ctx context.Context) ([]int, error)

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

func (*ContactDefaultSelect) IntsX

func (s *ContactDefaultSelect) IntsX(ctx context.Context) []int

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

func (*ContactDefaultSelect) Scan

func (cds *ContactDefaultSelect) Scan(ctx context.Context, v any) error

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

func (*ContactDefaultSelect) ScanX

func (s *ContactDefaultSelect) ScanX(ctx context.Context, v any)

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

func (*ContactDefaultSelect) String

func (s *ContactDefaultSelect) String(ctx context.Context) (_ string, err error)

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

func (*ContactDefaultSelect) StringX

func (s *ContactDefaultSelect) StringX(ctx context.Context) string

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

func (*ContactDefaultSelect) Strings

func (s *ContactDefaultSelect) Strings(ctx context.Context) ([]string, error)

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

func (*ContactDefaultSelect) StringsX

func (s *ContactDefaultSelect) StringsX(ctx context.Context) []string

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

type ContactDefaultUpdate

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

ContactDefaultUpdate is the builder for updating ContactDefault entities.

func (*ContactDefaultUpdate) ClearCategory

func (cdu *ContactDefaultUpdate) ClearCategory() *ContactDefaultUpdate

ClearCategory clears the value of the "category" field.

func (*ContactDefaultUpdate) ClearCustomTitle

func (cdu *ContactDefaultUpdate) ClearCustomTitle() *ContactDefaultUpdate

ClearCustomTitle clears the value of the "custom_title" field.

func (*ContactDefaultUpdate) ClearDescription

func (cdu *ContactDefaultUpdate) ClearDescription() *ContactDefaultUpdate

ClearDescription clears the value of the "description" field.

func (*ContactDefaultUpdate) ClearEmail

func (cdu *ContactDefaultUpdate) ClearEmail() *ContactDefaultUpdate

ClearEmail clears the value of the "email" field.

func (*ContactDefaultUpdate) ClearName

func (cdu *ContactDefaultUpdate) ClearName() *ContactDefaultUpdate

ClearName clears the value of the "name" field.

func (*ContactDefaultUpdate) ClearURL

func (cdu *ContactDefaultUpdate) ClearURL() *ContactDefaultUpdate

ClearURL clears the value of the "url" field.

func (*ContactDefaultUpdate) Exec

func (cdu *ContactDefaultUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*ContactDefaultUpdate) ExecX

func (cdu *ContactDefaultUpdate) ExecX(ctx context.Context)

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

func (*ContactDefaultUpdate) Mutation

Mutation returns the ContactDefaultMutation object of the builder.

func (*ContactDefaultUpdate) Save

func (cdu *ContactDefaultUpdate) Save(ctx context.Context) (int, error)

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

func (*ContactDefaultUpdate) SaveX

func (cdu *ContactDefaultUpdate) SaveX(ctx context.Context) int

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

func (*ContactDefaultUpdate) SetCategory

func (cdu *ContactDefaultUpdate) SetCategory(s string) *ContactDefaultUpdate

SetCategory sets the "category" field.

func (*ContactDefaultUpdate) SetCreated

func (cdu *ContactDefaultUpdate) SetCreated(t time.Time) *ContactDefaultUpdate

SetCreated sets the "created" field.

func (*ContactDefaultUpdate) SetCustomTitle

func (cdu *ContactDefaultUpdate) SetCustomTitle(s string) *ContactDefaultUpdate

SetCustomTitle sets the "custom_title" field.

func (*ContactDefaultUpdate) SetDescription

func (cdu *ContactDefaultUpdate) SetDescription(s string) *ContactDefaultUpdate

SetDescription sets the "description" field.

func (*ContactDefaultUpdate) SetEmail

SetEmail sets the "email" field.

func (*ContactDefaultUpdate) SetModified

func (cdu *ContactDefaultUpdate) SetModified(t time.Time) *ContactDefaultUpdate

SetModified sets the "modified" field.

func (*ContactDefaultUpdate) SetName

SetName sets the "name" field.

func (*ContactDefaultUpdate) SetNillableCategory

func (cdu *ContactDefaultUpdate) SetNillableCategory(s *string) *ContactDefaultUpdate

SetNillableCategory sets the "category" field if the given value is not nil.

func (*ContactDefaultUpdate) SetNillableCreated

func (cdu *ContactDefaultUpdate) SetNillableCreated(t *time.Time) *ContactDefaultUpdate

SetNillableCreated sets the "created" field if the given value is not nil.

func (*ContactDefaultUpdate) SetNillableCustomTitle

func (cdu *ContactDefaultUpdate) SetNillableCustomTitle(s *string) *ContactDefaultUpdate

SetNillableCustomTitle sets the "custom_title" field if the given value is not nil.

func (*ContactDefaultUpdate) SetNillableDescription

func (cdu *ContactDefaultUpdate) SetNillableDescription(s *string) *ContactDefaultUpdate

SetNillableDescription sets the "description" field if the given value is not nil.

func (*ContactDefaultUpdate) SetNillableEmail

func (cdu *ContactDefaultUpdate) SetNillableEmail(s *string) *ContactDefaultUpdate

SetNillableEmail sets the "email" field if the given value is not nil.

func (*ContactDefaultUpdate) SetNillableName

func (cdu *ContactDefaultUpdate) SetNillableName(s *string) *ContactDefaultUpdate

SetNillableName sets the "name" field if the given value is not nil.

func (*ContactDefaultUpdate) SetNillableURL

func (cdu *ContactDefaultUpdate) SetNillableURL(s *string) *ContactDefaultUpdate

SetNillableURL sets the "url" field if the given value is not nil.

func (*ContactDefaultUpdate) SetURL

SetURL sets the "url" field.

func (*ContactDefaultUpdate) Where

Where appends a list predicates to the ContactDefaultUpdate builder.

type ContactDefaultUpdateOne

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

ContactDefaultUpdateOne is the builder for updating a single ContactDefault entity.

func (*ContactDefaultUpdateOne) ClearCategory

func (cduo *ContactDefaultUpdateOne) ClearCategory() *ContactDefaultUpdateOne

ClearCategory clears the value of the "category" field.

func (*ContactDefaultUpdateOne) ClearCustomTitle

func (cduo *ContactDefaultUpdateOne) ClearCustomTitle() *ContactDefaultUpdateOne

ClearCustomTitle clears the value of the "custom_title" field.

func (*ContactDefaultUpdateOne) ClearDescription

func (cduo *ContactDefaultUpdateOne) ClearDescription() *ContactDefaultUpdateOne

ClearDescription clears the value of the "description" field.

func (*ContactDefaultUpdateOne) ClearEmail

ClearEmail clears the value of the "email" field.

func (*ContactDefaultUpdateOne) ClearName

ClearName clears the value of the "name" field.

func (*ContactDefaultUpdateOne) ClearURL

ClearURL clears the value of the "url" field.

func (*ContactDefaultUpdateOne) Exec

func (cduo *ContactDefaultUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*ContactDefaultUpdateOne) ExecX

func (cduo *ContactDefaultUpdateOne) ExecX(ctx context.Context)

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

func (*ContactDefaultUpdateOne) Mutation

Mutation returns the ContactDefaultMutation object of the builder.

func (*ContactDefaultUpdateOne) Save

Save executes the query and returns the updated ContactDefault entity.

func (*ContactDefaultUpdateOne) SaveX

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

func (*ContactDefaultUpdateOne) Select

func (cduo *ContactDefaultUpdateOne) Select(field string, fields ...string) *ContactDefaultUpdateOne

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

func (*ContactDefaultUpdateOne) SetCategory

SetCategory sets the "category" field.

func (*ContactDefaultUpdateOne) SetCreated

SetCreated sets the "created" field.

func (*ContactDefaultUpdateOne) SetCustomTitle

func (cduo *ContactDefaultUpdateOne) SetCustomTitle(s string) *ContactDefaultUpdateOne

SetCustomTitle sets the "custom_title" field.

func (*ContactDefaultUpdateOne) SetDescription

func (cduo *ContactDefaultUpdateOne) SetDescription(s string) *ContactDefaultUpdateOne

SetDescription sets the "description" field.

func (*ContactDefaultUpdateOne) SetEmail

SetEmail sets the "email" field.

func (*ContactDefaultUpdateOne) SetModified

SetModified sets the "modified" field.

func (*ContactDefaultUpdateOne) SetName

SetName sets the "name" field.

func (*ContactDefaultUpdateOne) SetNillableCategory

func (cduo *ContactDefaultUpdateOne) SetNillableCategory(s *string) *ContactDefaultUpdateOne

SetNillableCategory sets the "category" field if the given value is not nil.

func (*ContactDefaultUpdateOne) SetNillableCreated

func (cduo *ContactDefaultUpdateOne) SetNillableCreated(t *time.Time) *ContactDefaultUpdateOne

SetNillableCreated sets the "created" field if the given value is not nil.

func (*ContactDefaultUpdateOne) SetNillableCustomTitle

func (cduo *ContactDefaultUpdateOne) SetNillableCustomTitle(s *string) *ContactDefaultUpdateOne

SetNillableCustomTitle sets the "custom_title" field if the given value is not nil.

func (*ContactDefaultUpdateOne) SetNillableDescription

func (cduo *ContactDefaultUpdateOne) SetNillableDescription(s *string) *ContactDefaultUpdateOne

SetNillableDescription sets the "description" field if the given value is not nil.

func (*ContactDefaultUpdateOne) SetNillableEmail

func (cduo *ContactDefaultUpdateOne) SetNillableEmail(s *string) *ContactDefaultUpdateOne

SetNillableEmail sets the "email" field if the given value is not nil.

func (*ContactDefaultUpdateOne) SetNillableName

func (cduo *ContactDefaultUpdateOne) SetNillableName(s *string) *ContactDefaultUpdateOne

SetNillableName sets the "name" field if the given value is not nil.

func (*ContactDefaultUpdateOne) SetNillableURL

func (cduo *ContactDefaultUpdateOne) SetNillableURL(s *string) *ContactDefaultUpdateOne

SetNillableURL sets the "url" field if the given value is not nil.

func (*ContactDefaultUpdateOne) SetURL

SetURL sets the "url" field.

func (*ContactDefaultUpdateOne) Where

Where appends a list predicates to the ContactDefaultUpdate builder.

type ContactDefaults

type ContactDefaults []*ContactDefault

ContactDefaults is a parsable slice of ContactDefault.

type ContactDelete

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

ContactDelete is the builder for deleting a Contact entity.

func (*ContactDelete) Exec

func (cd *ContactDelete) Exec(ctx context.Context) (int, error)

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

func (*ContactDelete) ExecX

func (cd *ContactDelete) ExecX(ctx context.Context) int

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

func (*ContactDelete) Where

func (cd *ContactDelete) Where(ps ...predicate.Contact) *ContactDelete

Where appends a list predicates to the ContactDelete builder.

type ContactDeleteOne

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

ContactDeleteOne is the builder for deleting a single Contact entity.

func (*ContactDeleteOne) Exec

func (cdo *ContactDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*ContactDeleteOne) ExecX

func (cdo *ContactDeleteOne) ExecX(ctx context.Context)

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

func (*ContactDeleteOne) Where

Where appends a list predicates to the ContactDelete builder.

type ContactGroupBy

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

ContactGroupBy is the group-by builder for Contact entities.

func (*ContactGroupBy) Aggregate

func (cgb *ContactGroupBy) Aggregate(fns ...AggregateFunc) *ContactGroupBy

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

func (*ContactGroupBy) Bool

func (s *ContactGroupBy) Bool(ctx context.Context) (_ bool, err error)

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

func (*ContactGroupBy) BoolX

func (s *ContactGroupBy) BoolX(ctx context.Context) bool

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

func (*ContactGroupBy) Bools

func (s *ContactGroupBy) Bools(ctx context.Context) ([]bool, error)

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

func (*ContactGroupBy) BoolsX

func (s *ContactGroupBy) BoolsX(ctx context.Context) []bool

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

func (*ContactGroupBy) Float64

func (s *ContactGroupBy) Float64(ctx context.Context) (_ float64, err error)

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

func (*ContactGroupBy) Float64X

func (s *ContactGroupBy) Float64X(ctx context.Context) float64

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

func (*ContactGroupBy) Float64s

func (s *ContactGroupBy) Float64s(ctx context.Context) ([]float64, error)

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

func (*ContactGroupBy) Float64sX

func (s *ContactGroupBy) Float64sX(ctx context.Context) []float64

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

func (*ContactGroupBy) Int

func (s *ContactGroupBy) Int(ctx context.Context) (_ int, err error)

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

func (*ContactGroupBy) IntX

func (s *ContactGroupBy) IntX(ctx context.Context) int

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

func (*ContactGroupBy) Ints

func (s *ContactGroupBy) Ints(ctx context.Context) ([]int, error)

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

func (*ContactGroupBy) IntsX

func (s *ContactGroupBy) IntsX(ctx context.Context) []int

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

func (*ContactGroupBy) Scan

func (cgb *ContactGroupBy) Scan(ctx context.Context, v any) error

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

func (*ContactGroupBy) ScanX

func (s *ContactGroupBy) ScanX(ctx context.Context, v any)

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

func (*ContactGroupBy) String

func (s *ContactGroupBy) String(ctx context.Context) (_ string, err error)

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

func (*ContactGroupBy) StringX

func (s *ContactGroupBy) StringX(ctx context.Context) string

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

func (*ContactGroupBy) Strings

func (s *ContactGroupBy) Strings(ctx context.Context) ([]string, error)

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

func (*ContactGroupBy) StringsX

func (s *ContactGroupBy) StringsX(ctx context.Context) []string

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

type ContactMutation

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

ContactMutation represents an operation that mutates the Contact nodes in the graph.

func (*ContactMutation) AddField

func (m *ContactMutation) 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 (*ContactMutation) AddToUserID

func (m *ContactMutation) AddToUserID(u int32)

AddToUserID adds u to the "to_user_id" field.

func (*ContactMutation) AddedEdges

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

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

func (*ContactMutation) AddedField

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

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

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

func (*ContactMutation) AddedIDs

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

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

func (*ContactMutation) AddedToUserID

func (m *ContactMutation) AddedToUserID() (r int32, exists bool)

AddedToUserID returns the value that was added to the "to_user_id" field in this mutation.

func (*ContactMutation) BrowserName

func (m *ContactMutation) BrowserName() (r string, exists bool)

BrowserName returns the value of the "browser_name" field in the mutation.

func (*ContactMutation) BrowserNameCleared

func (m *ContactMutation) BrowserNameCleared() bool

BrowserNameCleared returns if the "browser_name" field was cleared in this mutation.

func (*ContactMutation) Category

func (m *ContactMutation) Category() (r string, exists bool)

Category returns the value of the "category" field in the mutation.

func (*ContactMutation) CategoryCleared

func (m *ContactMutation) CategoryCleared() bool

CategoryCleared returns if the "category" field was cleared in this mutation.

func (*ContactMutation) ClearBrowserName

func (m *ContactMutation) ClearBrowserName()

ClearBrowserName clears the value of the "browser_name" field.

func (*ContactMutation) ClearCategory

func (m *ContactMutation) ClearCategory()

ClearCategory clears the value of the "category" field.

func (*ContactMutation) ClearCustomTitle

func (m *ContactMutation) ClearCustomTitle()

ClearCustomTitle clears the value of the "custom_title" field.

func (*ContactMutation) ClearCustomValue

func (m *ContactMutation) ClearCustomValue()

ClearCustomValue clears the value of the "custom_value" field.

func (*ContactMutation) ClearDeviceName

func (m *ContactMutation) ClearDeviceName()

ClearDeviceName clears the value of the "device_name" field.

func (*ContactMutation) ClearEdge

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

func (m *ContactMutation) 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 (*ContactMutation) ClearIsMobile

func (m *ContactMutation) ClearIsMobile()

ClearIsMobile clears the value of the "is_mobile" field.

func (*ContactMutation) ClearOs

func (m *ContactMutation) ClearOs()

ClearOs clears the value of the "os" field.

func (*ContactMutation) ClearURL

func (m *ContactMutation) ClearURL()

ClearURL clears the value of the "url" field.

func (*ContactMutation) ClearedEdges

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

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

func (*ContactMutation) ClearedFields

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

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

func (ContactMutation) Client

func (m ContactMutation) 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 (*ContactMutation) Created

func (m *ContactMutation) Created() (r time.Time, exists bool)

Created returns the value of the "created" field in the mutation.

func (*ContactMutation) CustomTitle

func (m *ContactMutation) CustomTitle() (r string, exists bool)

CustomTitle returns the value of the "custom_title" field in the mutation.

func (*ContactMutation) CustomTitleCleared

func (m *ContactMutation) CustomTitleCleared() bool

CustomTitleCleared returns if the "custom_title" field was cleared in this mutation.

func (*ContactMutation) CustomValue

func (m *ContactMutation) CustomValue() (r string, exists bool)

CustomValue returns the value of the "custom_value" field in the mutation.

func (*ContactMutation) CustomValueCleared

func (m *ContactMutation) CustomValueCleared() bool

CustomValueCleared returns if the "custom_value" field was cleared in this mutation.

func (*ContactMutation) Detail

func (m *ContactMutation) Detail() (r string, exists bool)

Detail returns the value of the "detail" field in the mutation.

func (*ContactMutation) DeviceName

func (m *ContactMutation) DeviceName() (r string, exists bool)

DeviceName returns the value of the "device_name" field in the mutation.

func (*ContactMutation) DeviceNameCleared

func (m *ContactMutation) DeviceNameCleared() bool

DeviceNameCleared returns if the "device_name" field was cleared in this mutation.

func (*ContactMutation) EdgeCleared

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

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

func (*ContactMutation) Field

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

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

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

func (*ContactMutation) Fields

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

func (m *ContactMutation) ID() (id uint32, 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 (*ContactMutation) IDs

func (m *ContactMutation) IDs(ctx context.Context) ([]uint32, error)

IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.

func (*ContactMutation) IP

func (m *ContactMutation) IP() (r string, exists bool)

IP returns the value of the "ip" field in the mutation.

func (*ContactMutation) IsMobile

func (m *ContactMutation) IsMobile() (r bool, exists bool)

IsMobile returns the value of the "is_mobile" field in the mutation.

func (*ContactMutation) IsMobileCleared

func (m *ContactMutation) IsMobileCleared() bool

IsMobileCleared returns if the "is_mobile" field was cleared in this mutation.

func (*ContactMutation) Lang

func (m *ContactMutation) Lang() (r string, exists bool)

Lang returns the value of the "lang" field in the mutation.

func (*ContactMutation) Mail

func (m *ContactMutation) Mail() (r string, exists bool)

Mail returns the value of the "mail" field in the mutation.

func (*ContactMutation) Modified

func (m *ContactMutation) Modified() (r time.Time, exists bool)

Modified returns the value of the "modified" field in the mutation.

func (*ContactMutation) Name

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

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

func (*ContactMutation) OldBrowserName

func (m *ContactMutation) OldBrowserName(ctx context.Context) (v string, err error)

OldBrowserName returns the old "browser_name" field's value of the Contact entity. If the Contact 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 (*ContactMutation) OldCategory

func (m *ContactMutation) OldCategory(ctx context.Context) (v string, err error)

OldCategory returns the old "category" field's value of the Contact entity. If the Contact 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 (*ContactMutation) OldCreated

func (m *ContactMutation) OldCreated(ctx context.Context) (v time.Time, err error)

OldCreated returns the old "created" field's value of the Contact entity. If the Contact 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 (*ContactMutation) OldCustomTitle

func (m *ContactMutation) OldCustomTitle(ctx context.Context) (v string, err error)

OldCustomTitle returns the old "custom_title" field's value of the Contact entity. If the Contact 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 (*ContactMutation) OldCustomValue

func (m *ContactMutation) OldCustomValue(ctx context.Context) (v string, err error)

OldCustomValue returns the old "custom_value" field's value of the Contact entity. If the Contact 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 (*ContactMutation) OldDetail

func (m *ContactMutation) OldDetail(ctx context.Context) (v string, err error)

OldDetail returns the old "detail" field's value of the Contact entity. If the Contact 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 (*ContactMutation) OldDeviceName

func (m *ContactMutation) OldDeviceName(ctx context.Context) (v string, err error)

OldDeviceName returns the old "device_name" field's value of the Contact entity. If the Contact 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 (*ContactMutation) OldField

func (m *ContactMutation) 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 (*ContactMutation) OldIP

func (m *ContactMutation) OldIP(ctx context.Context) (v string, err error)

OldIP returns the old "ip" field's value of the Contact entity. If the Contact 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 (*ContactMutation) OldIsMobile

func (m *ContactMutation) OldIsMobile(ctx context.Context) (v bool, err error)

OldIsMobile returns the old "is_mobile" field's value of the Contact entity. If the Contact 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 (*ContactMutation) OldLang

func (m *ContactMutation) OldLang(ctx context.Context) (v string, err error)

OldLang returns the old "lang" field's value of the Contact entity. If the Contact 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 (*ContactMutation) OldMail

func (m *ContactMutation) OldMail(ctx context.Context) (v string, err error)

OldMail returns the old "mail" field's value of the Contact entity. If the Contact 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 (*ContactMutation) OldModified

func (m *ContactMutation) OldModified(ctx context.Context) (v time.Time, err error)

OldModified returns the old "modified" field's value of the Contact entity. If the Contact 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 (*ContactMutation) OldName

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

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

func (m *ContactMutation) OldOs(ctx context.Context) (v string, err error)

OldOs returns the old "os" field's value of the Contact entity. If the Contact 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 (*ContactMutation) OldTitle

func (m *ContactMutation) OldTitle(ctx context.Context) (v string, err error)

OldTitle returns the old "title" field's value of the Contact entity. If the Contact 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 (*ContactMutation) OldToUserID

func (m *ContactMutation) OldToUserID(ctx context.Context) (v uint32, err error)

OldToUserID returns the old "to_user_id" field's value of the Contact entity. If the Contact 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 (*ContactMutation) OldURL

func (m *ContactMutation) OldURL(ctx context.Context) (v string, err error)

OldURL returns the old "url" field's value of the Contact entity. If the Contact 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 (*ContactMutation) Op

func (m *ContactMutation) Op() Op

Op returns the operation name.

func (*ContactMutation) Os

func (m *ContactMutation) Os() (r string, exists bool)

Os returns the value of the "os" field in the mutation.

func (*ContactMutation) OsCleared

func (m *ContactMutation) OsCleared() bool

OsCleared returns if the "os" field was cleared in this mutation.

func (*ContactMutation) RemovedEdges

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

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

func (*ContactMutation) RemovedIDs

func (m *ContactMutation) 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 (*ContactMutation) ResetBrowserName

func (m *ContactMutation) ResetBrowserName()

ResetBrowserName resets all changes to the "browser_name" field.

func (*ContactMutation) ResetCategory

func (m *ContactMutation) ResetCategory()

ResetCategory resets all changes to the "category" field.

func (*ContactMutation) ResetCreated

func (m *ContactMutation) ResetCreated()

ResetCreated resets all changes to the "created" field.

func (*ContactMutation) ResetCustomTitle

func (m *ContactMutation) ResetCustomTitle()

ResetCustomTitle resets all changes to the "custom_title" field.

func (*ContactMutation) ResetCustomValue

func (m *ContactMutation) ResetCustomValue()

ResetCustomValue resets all changes to the "custom_value" field.

func (*ContactMutation) ResetDetail

func (m *ContactMutation) ResetDetail()

ResetDetail resets all changes to the "detail" field.

func (*ContactMutation) ResetDeviceName

func (m *ContactMutation) ResetDeviceName()

ResetDeviceName resets all changes to the "device_name" field.

func (*ContactMutation) ResetEdge

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

func (m *ContactMutation) 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 (*ContactMutation) ResetIP

func (m *ContactMutation) ResetIP()

ResetIP resets all changes to the "ip" field.

func (*ContactMutation) ResetIsMobile

func (m *ContactMutation) ResetIsMobile()

ResetIsMobile resets all changes to the "is_mobile" field.

func (*ContactMutation) ResetLang

func (m *ContactMutation) ResetLang()

ResetLang resets all changes to the "lang" field.

func (*ContactMutation) ResetMail

func (m *ContactMutation) ResetMail()

ResetMail resets all changes to the "mail" field.

func (*ContactMutation) ResetModified

func (m *ContactMutation) ResetModified()

ResetModified resets all changes to the "modified" field.

func (*ContactMutation) ResetName

func (m *ContactMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*ContactMutation) ResetOs

func (m *ContactMutation) ResetOs()

ResetOs resets all changes to the "os" field.

func (*ContactMutation) ResetTitle

func (m *ContactMutation) ResetTitle()

ResetTitle resets all changes to the "title" field.

func (*ContactMutation) ResetToUserID

func (m *ContactMutation) ResetToUserID()

ResetToUserID resets all changes to the "to_user_id" field.

func (*ContactMutation) ResetURL

func (m *ContactMutation) ResetURL()

ResetURL resets all changes to the "url" field.

func (*ContactMutation) SetBrowserName

func (m *ContactMutation) SetBrowserName(s string)

SetBrowserName sets the "browser_name" field.

func (*ContactMutation) SetCategory

func (m *ContactMutation) SetCategory(s string)

SetCategory sets the "category" field.

func (*ContactMutation) SetCreated

func (m *ContactMutation) SetCreated(t time.Time)

SetCreated sets the "created" field.

func (*ContactMutation) SetCustomTitle

func (m *ContactMutation) SetCustomTitle(s string)

SetCustomTitle sets the "custom_title" field.

func (*ContactMutation) SetCustomValue

func (m *ContactMutation) SetCustomValue(s string)

SetCustomValue sets the "custom_value" field.

func (*ContactMutation) SetDetail

func (m *ContactMutation) SetDetail(s string)

SetDetail sets the "detail" field.

func (*ContactMutation) SetDeviceName

func (m *ContactMutation) SetDeviceName(s string)

SetDeviceName sets the "device_name" field.

func (*ContactMutation) SetField

func (m *ContactMutation) 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 (*ContactMutation) SetID

func (m *ContactMutation) SetID(id uint32)

SetID sets the value of the id field. Note that this operation is only accepted on creation of Contact entities.

func (*ContactMutation) SetIP

func (m *ContactMutation) SetIP(s string)

SetIP sets the "ip" field.

func (*ContactMutation) SetIsMobile

func (m *ContactMutation) SetIsMobile(b bool)

SetIsMobile sets the "is_mobile" field.

func (*ContactMutation) SetLang

func (m *ContactMutation) SetLang(s string)

SetLang sets the "lang" field.

func (*ContactMutation) SetMail

func (m *ContactMutation) SetMail(s string)

SetMail sets the "mail" field.

func (*ContactMutation) SetModified

func (m *ContactMutation) SetModified(t time.Time)

SetModified sets the "modified" field.

func (*ContactMutation) SetName

func (m *ContactMutation) SetName(s string)

SetName sets the "name" field.

func (*ContactMutation) SetOp

func (m *ContactMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*ContactMutation) SetOs

func (m *ContactMutation) SetOs(s string)

SetOs sets the "os" field.

func (*ContactMutation) SetTitle

func (m *ContactMutation) SetTitle(s string)

SetTitle sets the "title" field.

func (*ContactMutation) SetToUserID

func (m *ContactMutation) SetToUserID(u uint32)

SetToUserID sets the "to_user_id" field.

func (*ContactMutation) SetURL

func (m *ContactMutation) SetURL(s string)

SetURL sets the "url" field.

func (*ContactMutation) Title

func (m *ContactMutation) Title() (r string, exists bool)

Title returns the value of the "title" field in the mutation.

func (*ContactMutation) ToUserID

func (m *ContactMutation) ToUserID() (r uint32, exists bool)

ToUserID returns the value of the "to_user_id" field in the mutation.

func (ContactMutation) Tx

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

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

func (*ContactMutation) Type

func (m *ContactMutation) Type() string

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

func (*ContactMutation) URL

func (m *ContactMutation) URL() (r string, exists bool)

URL returns the value of the "url" field in the mutation.

func (*ContactMutation) URLCleared

func (m *ContactMutation) URLCleared() bool

URLCleared returns if the "url" field was cleared in this mutation.

func (*ContactMutation) Where

func (m *ContactMutation) Where(ps ...predicate.Contact)

Where appends a list predicates to the ContactMutation builder.

func (*ContactMutation) WhereP

func (m *ContactMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the ContactMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type ContactQuery

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

ContactQuery is the builder for querying Contact entities.

func (*ContactQuery) Aggregate

func (cq *ContactQuery) Aggregate(fns ...AggregateFunc) *ContactSelect

Aggregate returns a ContactSelect configured with the given aggregations.

func (*ContactQuery) All

func (cq *ContactQuery) All(ctx context.Context) ([]*Contact, error)

All executes the query and returns a list of Contacts.

func (*ContactQuery) AllX

func (cq *ContactQuery) AllX(ctx context.Context) []*Contact

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

func (*ContactQuery) Clone

func (cq *ContactQuery) Clone() *ContactQuery

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

func (*ContactQuery) Count

func (cq *ContactQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*ContactQuery) CountX

func (cq *ContactQuery) CountX(ctx context.Context) int

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

func (*ContactQuery) Exist

func (cq *ContactQuery) Exist(ctx context.Context) (bool, error)

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

func (*ContactQuery) ExistX

func (cq *ContactQuery) ExistX(ctx context.Context) bool

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

func (*ContactQuery) First

func (cq *ContactQuery) First(ctx context.Context) (*Contact, error)

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

func (*ContactQuery) FirstID

func (cq *ContactQuery) FirstID(ctx context.Context) (id uint32, err error)

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

func (*ContactQuery) FirstIDX

func (cq *ContactQuery) FirstIDX(ctx context.Context) uint32

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

func (*ContactQuery) FirstX

func (cq *ContactQuery) FirstX(ctx context.Context) *Contact

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

func (*ContactQuery) GroupBy

func (cq *ContactQuery) GroupBy(field string, fields ...string) *ContactGroupBy

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 {
	ToUserID uint32 `json:"to_user_id,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Contact.Query().
	GroupBy(contact.FieldToUserID).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*ContactQuery) IDs

func (cq *ContactQuery) IDs(ctx context.Context) (ids []uint32, err error)

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

func (*ContactQuery) IDsX

func (cq *ContactQuery) IDsX(ctx context.Context) []uint32

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

func (*ContactQuery) Limit

func (cq *ContactQuery) Limit(limit int) *ContactQuery

Limit the number of records to be returned by this query.

func (*ContactQuery) Offset

func (cq *ContactQuery) Offset(offset int) *ContactQuery

Offset to start from.

func (*ContactQuery) Only

func (cq *ContactQuery) Only(ctx context.Context) (*Contact, error)

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

func (*ContactQuery) OnlyID

func (cq *ContactQuery) OnlyID(ctx context.Context) (id uint32, err error)

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

func (*ContactQuery) OnlyIDX

func (cq *ContactQuery) OnlyIDX(ctx context.Context) uint32

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

func (*ContactQuery) OnlyX

func (cq *ContactQuery) OnlyX(ctx context.Context) *Contact

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

func (*ContactQuery) Order

func (cq *ContactQuery) Order(o ...OrderFunc) *ContactQuery

Order specifies how the records should be ordered.

func (*ContactQuery) Select

func (cq *ContactQuery) Select(fields ...string) *ContactSelect

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 {
	ToUserID uint32 `json:"to_user_id,omitempty"`
}

client.Contact.Query().
	Select(contact.FieldToUserID).
	Scan(ctx, &v)

func (*ContactQuery) Unique

func (cq *ContactQuery) Unique(unique bool) *ContactQuery

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

func (cq *ContactQuery) Where(ps ...predicate.Contact) *ContactQuery

Where adds a new predicate for the ContactQuery builder.

type ContactSelect

type ContactSelect struct {
	*ContactQuery
	// contains filtered or unexported fields
}

ContactSelect is the builder for selecting fields of Contact entities.

func (*ContactSelect) Aggregate

func (cs *ContactSelect) Aggregate(fns ...AggregateFunc) *ContactSelect

Aggregate adds the given aggregation functions to the selector query.

func (*ContactSelect) Bool

func (s *ContactSelect) Bool(ctx context.Context) (_ bool, err error)

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

func (*ContactSelect) BoolX

func (s *ContactSelect) BoolX(ctx context.Context) bool

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

func (*ContactSelect) Bools

func (s *ContactSelect) Bools(ctx context.Context) ([]bool, error)

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

func (*ContactSelect) BoolsX

func (s *ContactSelect) BoolsX(ctx context.Context) []bool

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

func (*ContactSelect) Float64

func (s *ContactSelect) Float64(ctx context.Context) (_ float64, err error)

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

func (*ContactSelect) Float64X

func (s *ContactSelect) Float64X(ctx context.Context) float64

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

func (*ContactSelect) Float64s

func (s *ContactSelect) Float64s(ctx context.Context) ([]float64, error)

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

func (*ContactSelect) Float64sX

func (s *ContactSelect) Float64sX(ctx context.Context) []float64

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

func (*ContactSelect) Int

func (s *ContactSelect) Int(ctx context.Context) (_ int, err error)

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

func (*ContactSelect) IntX

func (s *ContactSelect) IntX(ctx context.Context) int

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

func (*ContactSelect) Ints

func (s *ContactSelect) Ints(ctx context.Context) ([]int, error)

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

func (*ContactSelect) IntsX

func (s *ContactSelect) IntsX(ctx context.Context) []int

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

func (*ContactSelect) Scan

func (cs *ContactSelect) Scan(ctx context.Context, v any) error

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

func (*ContactSelect) ScanX

func (s *ContactSelect) ScanX(ctx context.Context, v any)

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

func (*ContactSelect) String

func (s *ContactSelect) String(ctx context.Context) (_ string, err error)

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

func (*ContactSelect) StringX

func (s *ContactSelect) StringX(ctx context.Context) string

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

func (*ContactSelect) Strings

func (s *ContactSelect) Strings(ctx context.Context) ([]string, error)

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

func (*ContactSelect) StringsX

func (s *ContactSelect) StringsX(ctx context.Context) []string

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

type ContactUpdate

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

ContactUpdate is the builder for updating Contact entities.

func (*ContactUpdate) AddToUserID

func (cu *ContactUpdate) AddToUserID(u int32) *ContactUpdate

AddToUserID adds u to the "to_user_id" field.

func (*ContactUpdate) ClearBrowserName

func (cu *ContactUpdate) ClearBrowserName() *ContactUpdate

ClearBrowserName clears the value of the "browser_name" field.

func (*ContactUpdate) ClearCategory

func (cu *ContactUpdate) ClearCategory() *ContactUpdate

ClearCategory clears the value of the "category" field.

func (*ContactUpdate) ClearCustomTitle

func (cu *ContactUpdate) ClearCustomTitle() *ContactUpdate

ClearCustomTitle clears the value of the "custom_title" field.

func (*ContactUpdate) ClearCustomValue

func (cu *ContactUpdate) ClearCustomValue() *ContactUpdate

ClearCustomValue clears the value of the "custom_value" field.

func (*ContactUpdate) ClearDeviceName

func (cu *ContactUpdate) ClearDeviceName() *ContactUpdate

ClearDeviceName clears the value of the "device_name" field.

func (*ContactUpdate) ClearIsMobile

func (cu *ContactUpdate) ClearIsMobile() *ContactUpdate

ClearIsMobile clears the value of the "is_mobile" field.

func (*ContactUpdate) ClearOs

func (cu *ContactUpdate) ClearOs() *ContactUpdate

ClearOs clears the value of the "os" field.

func (*ContactUpdate) ClearURL

func (cu *ContactUpdate) ClearURL() *ContactUpdate

ClearURL clears the value of the "url" field.

func (*ContactUpdate) Exec

func (cu *ContactUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*ContactUpdate) ExecX

func (cu *ContactUpdate) ExecX(ctx context.Context)

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

func (*ContactUpdate) Mutation

func (cu *ContactUpdate) Mutation() *ContactMutation

Mutation returns the ContactMutation object of the builder.

func (*ContactUpdate) Save

func (cu *ContactUpdate) Save(ctx context.Context) (int, error)

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

func (*ContactUpdate) SaveX

func (cu *ContactUpdate) SaveX(ctx context.Context) int

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

func (*ContactUpdate) SetBrowserName

func (cu *ContactUpdate) SetBrowserName(s string) *ContactUpdate

SetBrowserName sets the "browser_name" field.

func (*ContactUpdate) SetCategory

func (cu *ContactUpdate) SetCategory(s string) *ContactUpdate

SetCategory sets the "category" field.

func (*ContactUpdate) SetCreated

func (cu *ContactUpdate) SetCreated(t time.Time) *ContactUpdate

SetCreated sets the "created" field.

func (*ContactUpdate) SetCustomTitle

func (cu *ContactUpdate) SetCustomTitle(s string) *ContactUpdate

SetCustomTitle sets the "custom_title" field.

func (*ContactUpdate) SetCustomValue

func (cu *ContactUpdate) SetCustomValue(s string) *ContactUpdate

SetCustomValue sets the "custom_value" field.

func (*ContactUpdate) SetDetail

func (cu *ContactUpdate) SetDetail(s string) *ContactUpdate

SetDetail sets the "detail" field.

func (*ContactUpdate) SetDeviceName

func (cu *ContactUpdate) SetDeviceName(s string) *ContactUpdate

SetDeviceName sets the "device_name" field.

func (*ContactUpdate) SetIP

func (cu *ContactUpdate) SetIP(s string) *ContactUpdate

SetIP sets the "ip" field.

func (*ContactUpdate) SetIsMobile

func (cu *ContactUpdate) SetIsMobile(b bool) *ContactUpdate

SetIsMobile sets the "is_mobile" field.

func (*ContactUpdate) SetLang

func (cu *ContactUpdate) SetLang(s string) *ContactUpdate

SetLang sets the "lang" field.

func (*ContactUpdate) SetMail

func (cu *ContactUpdate) SetMail(s string) *ContactUpdate

SetMail sets the "mail" field.

func (*ContactUpdate) SetModified

func (cu *ContactUpdate) SetModified(t time.Time) *ContactUpdate

SetModified sets the "modified" field.

func (*ContactUpdate) SetName

func (cu *ContactUpdate) SetName(s string) *ContactUpdate

SetName sets the "name" field.

func (*ContactUpdate) SetNillableBrowserName

func (cu *ContactUpdate) SetNillableBrowserName(s *string) *ContactUpdate

SetNillableBrowserName sets the "browser_name" field if the given value is not nil.

func (*ContactUpdate) SetNillableCategory

func (cu *ContactUpdate) SetNillableCategory(s *string) *ContactUpdate

SetNillableCategory sets the "category" field if the given value is not nil.

func (*ContactUpdate) SetNillableCreated

func (cu *ContactUpdate) SetNillableCreated(t *time.Time) *ContactUpdate

SetNillableCreated sets the "created" field if the given value is not nil.

func (*ContactUpdate) SetNillableCustomTitle

func (cu *ContactUpdate) SetNillableCustomTitle(s *string) *ContactUpdate

SetNillableCustomTitle sets the "custom_title" field if the given value is not nil.

func (*ContactUpdate) SetNillableCustomValue

func (cu *ContactUpdate) SetNillableCustomValue(s *string) *ContactUpdate

SetNillableCustomValue sets the "custom_value" field if the given value is not nil.

func (*ContactUpdate) SetNillableDeviceName

func (cu *ContactUpdate) SetNillableDeviceName(s *string) *ContactUpdate

SetNillableDeviceName sets the "device_name" field if the given value is not nil.

func (*ContactUpdate) SetNillableIsMobile

func (cu *ContactUpdate) SetNillableIsMobile(b *bool) *ContactUpdate

SetNillableIsMobile sets the "is_mobile" field if the given value is not nil.

func (*ContactUpdate) SetNillableOs

func (cu *ContactUpdate) SetNillableOs(s *string) *ContactUpdate

SetNillableOs sets the "os" field if the given value is not nil.

func (*ContactUpdate) SetNillableURL

func (cu *ContactUpdate) SetNillableURL(s *string) *ContactUpdate

SetNillableURL sets the "url" field if the given value is not nil.

func (*ContactUpdate) SetOs

func (cu *ContactUpdate) SetOs(s string) *ContactUpdate

SetOs sets the "os" field.

func (*ContactUpdate) SetTitle

func (cu *ContactUpdate) SetTitle(s string) *ContactUpdate

SetTitle sets the "title" field.

func (*ContactUpdate) SetToUserID

func (cu *ContactUpdate) SetToUserID(u uint32) *ContactUpdate

SetToUserID sets the "to_user_id" field.

func (*ContactUpdate) SetURL

func (cu *ContactUpdate) SetURL(s string) *ContactUpdate

SetURL sets the "url" field.

func (*ContactUpdate) Where

func (cu *ContactUpdate) Where(ps ...predicate.Contact) *ContactUpdate

Where appends a list predicates to the ContactUpdate builder.

type ContactUpdateOne

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

ContactUpdateOne is the builder for updating a single Contact entity.

func (*ContactUpdateOne) AddToUserID

func (cuo *ContactUpdateOne) AddToUserID(u int32) *ContactUpdateOne

AddToUserID adds u to the "to_user_id" field.

func (*ContactUpdateOne) ClearBrowserName

func (cuo *ContactUpdateOne) ClearBrowserName() *ContactUpdateOne

ClearBrowserName clears the value of the "browser_name" field.

func (*ContactUpdateOne) ClearCategory

func (cuo *ContactUpdateOne) ClearCategory() *ContactUpdateOne

ClearCategory clears the value of the "category" field.

func (*ContactUpdateOne) ClearCustomTitle

func (cuo *ContactUpdateOne) ClearCustomTitle() *ContactUpdateOne

ClearCustomTitle clears the value of the "custom_title" field.

func (*ContactUpdateOne) ClearCustomValue

func (cuo *ContactUpdateOne) ClearCustomValue() *ContactUpdateOne

ClearCustomValue clears the value of the "custom_value" field.

func (*ContactUpdateOne) ClearDeviceName

func (cuo *ContactUpdateOne) ClearDeviceName() *ContactUpdateOne

ClearDeviceName clears the value of the "device_name" field.

func (*ContactUpdateOne) ClearIsMobile

func (cuo *ContactUpdateOne) ClearIsMobile() *ContactUpdateOne

ClearIsMobile clears the value of the "is_mobile" field.

func (*ContactUpdateOne) ClearOs

func (cuo *ContactUpdateOne) ClearOs() *ContactUpdateOne

ClearOs clears the value of the "os" field.

func (*ContactUpdateOne) ClearURL

func (cuo *ContactUpdateOne) ClearURL() *ContactUpdateOne

ClearURL clears the value of the "url" field.

func (*ContactUpdateOne) Exec

func (cuo *ContactUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*ContactUpdateOne) ExecX

func (cuo *ContactUpdateOne) ExecX(ctx context.Context)

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

func (*ContactUpdateOne) Mutation

func (cuo *ContactUpdateOne) Mutation() *ContactMutation

Mutation returns the ContactMutation object of the builder.

func (*ContactUpdateOne) Save

func (cuo *ContactUpdateOne) Save(ctx context.Context) (*Contact, error)

Save executes the query and returns the updated Contact entity.

func (*ContactUpdateOne) SaveX

func (cuo *ContactUpdateOne) SaveX(ctx context.Context) *Contact

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

func (*ContactUpdateOne) Select

func (cuo *ContactUpdateOne) Select(field string, fields ...string) *ContactUpdateOne

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

func (*ContactUpdateOne) SetBrowserName

func (cuo *ContactUpdateOne) SetBrowserName(s string) *ContactUpdateOne

SetBrowserName sets the "browser_name" field.

func (*ContactUpdateOne) SetCategory

func (cuo *ContactUpdateOne) SetCategory(s string) *ContactUpdateOne

SetCategory sets the "category" field.

func (*ContactUpdateOne) SetCreated

func (cuo *ContactUpdateOne) SetCreated(t time.Time) *ContactUpdateOne

SetCreated sets the "created" field.

func (*ContactUpdateOne) SetCustomTitle

func (cuo *ContactUpdateOne) SetCustomTitle(s string) *ContactUpdateOne

SetCustomTitle sets the "custom_title" field.

func (*ContactUpdateOne) SetCustomValue

func (cuo *ContactUpdateOne) SetCustomValue(s string) *ContactUpdateOne

SetCustomValue sets the "custom_value" field.

func (*ContactUpdateOne) SetDetail

func (cuo *ContactUpdateOne) SetDetail(s string) *ContactUpdateOne

SetDetail sets the "detail" field.

func (*ContactUpdateOne) SetDeviceName

func (cuo *ContactUpdateOne) SetDeviceName(s string) *ContactUpdateOne

SetDeviceName sets the "device_name" field.

func (*ContactUpdateOne) SetIP

func (cuo *ContactUpdateOne) SetIP(s string) *ContactUpdateOne

SetIP sets the "ip" field.

func (*ContactUpdateOne) SetIsMobile

func (cuo *ContactUpdateOne) SetIsMobile(b bool) *ContactUpdateOne

SetIsMobile sets the "is_mobile" field.

func (*ContactUpdateOne) SetLang

func (cuo *ContactUpdateOne) SetLang(s string) *ContactUpdateOne

SetLang sets the "lang" field.

func (*ContactUpdateOne) SetMail

func (cuo *ContactUpdateOne) SetMail(s string) *ContactUpdateOne

SetMail sets the "mail" field.

func (*ContactUpdateOne) SetModified

func (cuo *ContactUpdateOne) SetModified(t time.Time) *ContactUpdateOne

SetModified sets the "modified" field.

func (*ContactUpdateOne) SetName

func (cuo *ContactUpdateOne) SetName(s string) *ContactUpdateOne

SetName sets the "name" field.

func (*ContactUpdateOne) SetNillableBrowserName

func (cuo *ContactUpdateOne) SetNillableBrowserName(s *string) *ContactUpdateOne

SetNillableBrowserName sets the "browser_name" field if the given value is not nil.

func (*ContactUpdateOne) SetNillableCategory

func (cuo *ContactUpdateOne) SetNillableCategory(s *string) *ContactUpdateOne

SetNillableCategory sets the "category" field if the given value is not nil.

func (*ContactUpdateOne) SetNillableCreated

func (cuo *ContactUpdateOne) SetNillableCreated(t *time.Time) *ContactUpdateOne

SetNillableCreated sets the "created" field if the given value is not nil.

func (*ContactUpdateOne) SetNillableCustomTitle

func (cuo *ContactUpdateOne) SetNillableCustomTitle(s *string) *ContactUpdateOne

SetNillableCustomTitle sets the "custom_title" field if the given value is not nil.

func (*ContactUpdateOne) SetNillableCustomValue

func (cuo *ContactUpdateOne) SetNillableCustomValue(s *string) *ContactUpdateOne

SetNillableCustomValue sets the "custom_value" field if the given value is not nil.

func (*ContactUpdateOne) SetNillableDeviceName

func (cuo *ContactUpdateOne) SetNillableDeviceName(s *string) *ContactUpdateOne

SetNillableDeviceName sets the "device_name" field if the given value is not nil.

func (*ContactUpdateOne) SetNillableIsMobile

func (cuo *ContactUpdateOne) SetNillableIsMobile(b *bool) *ContactUpdateOne

SetNillableIsMobile sets the "is_mobile" field if the given value is not nil.

func (*ContactUpdateOne) SetNillableOs

func (cuo *ContactUpdateOne) SetNillableOs(s *string) *ContactUpdateOne

SetNillableOs sets the "os" field if the given value is not nil.

func (*ContactUpdateOne) SetNillableURL

func (cuo *ContactUpdateOne) SetNillableURL(s *string) *ContactUpdateOne

SetNillableURL sets the "url" field if the given value is not nil.

func (*ContactUpdateOne) SetOs

func (cuo *ContactUpdateOne) SetOs(s string) *ContactUpdateOne

SetOs sets the "os" field.

func (*ContactUpdateOne) SetTitle

func (cuo *ContactUpdateOne) SetTitle(s string) *ContactUpdateOne

SetTitle sets the "title" field.

func (*ContactUpdateOne) SetToUserID

func (cuo *ContactUpdateOne) SetToUserID(u uint32) *ContactUpdateOne

SetToUserID sets the "to_user_id" field.

func (*ContactUpdateOne) SetURL

func (cuo *ContactUpdateOne) SetURL(s string) *ContactUpdateOne

SetURL sets the "url" field.

func (*ContactUpdateOne) Where

Where appends a list predicates to the ContactUpdate builder.

type Contacts

type Contacts []*Contact

Contacts is a parsable slice of Contact.

type Hook

type Hook = ent.Hook

ent aliases to avoid import conflicts in user's code.

type InterceptFunc

type InterceptFunc = ent.InterceptFunc

ent aliases to avoid import conflicts in user's code.

type Interceptor

type Interceptor = ent.Interceptor

ent aliases to avoid import conflicts in user's code.

type Link struct {

	// ID of the ent.
	ID uint32 `json:"id,omitempty"`
	// UserID holds the value of the "user_id" field.
	UserID uint32 `json:"user_id,omitempty"`
	// Name holds the value of the "name" field.
	Name string `json:"name,omitempty"`
	// NameJa holds the value of the "name_ja" field.
	NameJa string `json:"name_ja,omitempty"`
	// SiteURL holds the value of the "site_url" field.
	SiteURL string `json:"site_url,omitempty"`
	// FaviconURL holds the value of the "favicon_url" field.
	FaviconURL string `json:"favicon_url,omitempty"`
	// CategoryID holds the value of the "category_id" field.
	CategoryID uint32 `json:"category_id,omitempty"`
	// Created holds the value of the "created" field.
	Created time.Time `json:"created,omitempty"`
	// Modified holds the value of the "modified" field.
	Modified time.Time `json:"modified,omitempty"`
	// contains filtered or unexported fields
}

Link is the model entity for the Link schema.

func (*Link) String

func (l *Link) String() string

String implements the fmt.Stringer.

func (*Link) Unwrap

func (l *Link) Unwrap() *Link

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

func (l *Link) Update() *LinkUpdateOne

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

type LinkClient

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

LinkClient is a client for the Link schema.

func NewLinkClient

func NewLinkClient(c config) *LinkClient

NewLinkClient returns a client for the Link from the given config.

func (*LinkClient) Create

func (c *LinkClient) Create() *LinkCreate

Create returns a builder for creating a Link entity.

func (*LinkClient) CreateBulk

func (c *LinkClient) CreateBulk(builders ...*LinkCreate) *LinkCreateBulk

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

func (*LinkClient) Delete

func (c *LinkClient) Delete() *LinkDelete

Delete returns a delete builder for Link.

func (*LinkClient) DeleteOne

func (c *LinkClient) DeleteOne(l *Link) *LinkDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*LinkClient) DeleteOneID

func (c *LinkClient) DeleteOneID(id uint32) *LinkDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*LinkClient) Get

func (c *LinkClient) Get(ctx context.Context, id uint32) (*Link, error)

Get returns a Link entity by its id.

func (*LinkClient) GetX

func (c *LinkClient) GetX(ctx context.Context, id uint32) *Link

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

func (*LinkClient) Hooks

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

Hooks returns the client hooks.

func (*LinkClient) Intercept

func (c *LinkClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `link.Intercept(f(g(h())))`.

func (*LinkClient) Interceptors

func (c *LinkClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*LinkClient) Query

func (c *LinkClient) Query() *LinkQuery

Query returns a query builder for Link.

func (*LinkClient) Update

func (c *LinkClient) Update() *LinkUpdate

Update returns an update builder for Link.

func (*LinkClient) UpdateOne

func (c *LinkClient) UpdateOne(l *Link) *LinkUpdateOne

UpdateOne returns an update builder for the given entity.

func (*LinkClient) UpdateOneID

func (c *LinkClient) UpdateOneID(id uint32) *LinkUpdateOne

UpdateOneID returns an update builder for the given id.

func (*LinkClient) Use

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

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

type LinkCreate

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

LinkCreate is the builder for creating a Link entity.

func (*LinkCreate) Exec

func (lc *LinkCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*LinkCreate) ExecX

func (lc *LinkCreate) ExecX(ctx context.Context)

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

func (*LinkCreate) Mutation

func (lc *LinkCreate) Mutation() *LinkMutation

Mutation returns the LinkMutation object of the builder.

func (*LinkCreate) Save

func (lc *LinkCreate) Save(ctx context.Context) (*Link, error)

Save creates the Link in the database.

func (*LinkCreate) SaveX

func (lc *LinkCreate) SaveX(ctx context.Context) *Link

SaveX calls Save and panics if Save returns an error.

func (*LinkCreate) SetCategoryID

func (lc *LinkCreate) SetCategoryID(u uint32) *LinkCreate

SetCategoryID sets the "category_id" field.

func (*LinkCreate) SetCreated

func (lc *LinkCreate) SetCreated(t time.Time) *LinkCreate

SetCreated sets the "created" field.

func (*LinkCreate) SetFaviconURL

func (lc *LinkCreate) SetFaviconURL(s string) *LinkCreate

SetFaviconURL sets the "favicon_url" field.

func (*LinkCreate) SetID

func (lc *LinkCreate) SetID(u uint32) *LinkCreate

SetID sets the "id" field.

func (*LinkCreate) SetModified

func (lc *LinkCreate) SetModified(t time.Time) *LinkCreate

SetModified sets the "modified" field.

func (*LinkCreate) SetName

func (lc *LinkCreate) SetName(s string) *LinkCreate

SetName sets the "name" field.

func (*LinkCreate) SetNameJa

func (lc *LinkCreate) SetNameJa(s string) *LinkCreate

SetNameJa sets the "name_ja" field.

func (*LinkCreate) SetNillableCreated

func (lc *LinkCreate) SetNillableCreated(t *time.Time) *LinkCreate

SetNillableCreated sets the "created" field if the given value is not nil.

func (*LinkCreate) SetNillableFaviconURL

func (lc *LinkCreate) SetNillableFaviconURL(s *string) *LinkCreate

SetNillableFaviconURL sets the "favicon_url" field if the given value is not nil.

func (*LinkCreate) SetNillableModified

func (lc *LinkCreate) SetNillableModified(t *time.Time) *LinkCreate

SetNillableModified sets the "modified" field if the given value is not nil.

func (*LinkCreate) SetSiteURL

func (lc *LinkCreate) SetSiteURL(s string) *LinkCreate

SetSiteURL sets the "site_url" field.

func (*LinkCreate) SetUserID

func (lc *LinkCreate) SetUserID(u uint32) *LinkCreate

SetUserID sets the "user_id" field.

type LinkCreateBulk

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

LinkCreateBulk is the builder for creating many Link entities in bulk.

func (*LinkCreateBulk) Exec

func (lcb *LinkCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*LinkCreateBulk) ExecX

func (lcb *LinkCreateBulk) ExecX(ctx context.Context)

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

func (*LinkCreateBulk) Save

func (lcb *LinkCreateBulk) Save(ctx context.Context) ([]*Link, error)

Save creates the Link entities in the database.

func (*LinkCreateBulk) SaveX

func (lcb *LinkCreateBulk) SaveX(ctx context.Context) []*Link

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

type LinkDelete

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

LinkDelete is the builder for deleting a Link entity.

func (*LinkDelete) Exec

func (ld *LinkDelete) Exec(ctx context.Context) (int, error)

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

func (*LinkDelete) ExecX

func (ld *LinkDelete) ExecX(ctx context.Context) int

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

func (*LinkDelete) Where

func (ld *LinkDelete) Where(ps ...predicate.Link) *LinkDelete

Where appends a list predicates to the LinkDelete builder.

type LinkDeleteOne

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

LinkDeleteOne is the builder for deleting a single Link entity.

func (*LinkDeleteOne) Exec

func (ldo *LinkDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*LinkDeleteOne) ExecX

func (ldo *LinkDeleteOne) ExecX(ctx context.Context)

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

func (*LinkDeleteOne) Where

func (ldo *LinkDeleteOne) Where(ps ...predicate.Link) *LinkDeleteOne

Where appends a list predicates to the LinkDelete builder.

type LinkGroupBy

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

LinkGroupBy is the group-by builder for Link entities.

func (*LinkGroupBy) Aggregate

func (lgb *LinkGroupBy) Aggregate(fns ...AggregateFunc) *LinkGroupBy

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

func (*LinkGroupBy) Bool

func (s *LinkGroupBy) Bool(ctx context.Context) (_ bool, err error)

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

func (*LinkGroupBy) BoolX

func (s *LinkGroupBy) BoolX(ctx context.Context) bool

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

func (*LinkGroupBy) Bools

func (s *LinkGroupBy) Bools(ctx context.Context) ([]bool, error)

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

func (*LinkGroupBy) BoolsX

func (s *LinkGroupBy) BoolsX(ctx context.Context) []bool

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

func (*LinkGroupBy) Float64

func (s *LinkGroupBy) Float64(ctx context.Context) (_ float64, err error)

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

func (*LinkGroupBy) Float64X

func (s *LinkGroupBy) Float64X(ctx context.Context) float64

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

func (*LinkGroupBy) Float64s

func (s *LinkGroupBy) Float64s(ctx context.Context) ([]float64, error)

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

func (*LinkGroupBy) Float64sX

func (s *LinkGroupBy) Float64sX(ctx context.Context) []float64

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

func (*LinkGroupBy) Int

func (s *LinkGroupBy) Int(ctx context.Context) (_ int, err error)

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

func (*LinkGroupBy) IntX

func (s *LinkGroupBy) IntX(ctx context.Context) int

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

func (*LinkGroupBy) Ints

func (s *LinkGroupBy) Ints(ctx context.Context) ([]int, error)

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

func (*LinkGroupBy) IntsX

func (s *LinkGroupBy) IntsX(ctx context.Context) []int

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

func (*LinkGroupBy) Scan

func (lgb *LinkGroupBy) Scan(ctx context.Context, v any) error

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

func (*LinkGroupBy) ScanX

func (s *LinkGroupBy) ScanX(ctx context.Context, v any)

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

func (*LinkGroupBy) String

func (s *LinkGroupBy) String(ctx context.Context) (_ string, err error)

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

func (*LinkGroupBy) StringX

func (s *LinkGroupBy) StringX(ctx context.Context) string

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

func (*LinkGroupBy) Strings

func (s *LinkGroupBy) Strings(ctx context.Context) ([]string, error)

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

func (*LinkGroupBy) StringsX

func (s *LinkGroupBy) StringsX(ctx context.Context) []string

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

type LinkMutation

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

LinkMutation represents an operation that mutates the Link nodes in the graph.

func (*LinkMutation) AddCategoryID

func (m *LinkMutation) AddCategoryID(u int32)

AddCategoryID adds u to the "category_id" field.

func (*LinkMutation) AddField

func (m *LinkMutation) 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 (*LinkMutation) AddUserID

func (m *LinkMutation) AddUserID(u int32)

AddUserID adds u to the "user_id" field.

func (*LinkMutation) AddedCategoryID

func (m *LinkMutation) AddedCategoryID() (r int32, exists bool)

AddedCategoryID returns the value that was added to the "category_id" field in this mutation.

func (*LinkMutation) AddedEdges

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

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

func (*LinkMutation) AddedField

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

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

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

func (*LinkMutation) AddedIDs

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

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

func (*LinkMutation) AddedUserID

func (m *LinkMutation) AddedUserID() (r int32, exists bool)

AddedUserID returns the value that was added to the "user_id" field in this mutation.

func (*LinkMutation) CategoryID

func (m *LinkMutation) CategoryID() (r uint32, exists bool)

CategoryID returns the value of the "category_id" field in the mutation.

func (*LinkMutation) ClearEdge

func (m *LinkMutation) 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 (*LinkMutation) ClearFaviconURL

func (m *LinkMutation) ClearFaviconURL()

ClearFaviconURL clears the value of the "favicon_url" field.

func (*LinkMutation) ClearField

func (m *LinkMutation) 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 (*LinkMutation) ClearedEdges

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

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

func (*LinkMutation) ClearedFields

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

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

func (LinkMutation) Client

func (m LinkMutation) 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 (*LinkMutation) Created

func (m *LinkMutation) Created() (r time.Time, exists bool)

Created returns the value of the "created" field in the mutation.

func (*LinkMutation) EdgeCleared

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

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

func (*LinkMutation) FaviconURL

func (m *LinkMutation) FaviconURL() (r string, exists bool)

FaviconURL returns the value of the "favicon_url" field in the mutation.

func (*LinkMutation) FaviconURLCleared

func (m *LinkMutation) FaviconURLCleared() bool

FaviconURLCleared returns if the "favicon_url" field was cleared in this mutation.

func (*LinkMutation) Field

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

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

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

func (*LinkMutation) Fields

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

func (m *LinkMutation) ID() (id uint32, 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 (*LinkMutation) IDs

func (m *LinkMutation) IDs(ctx context.Context) ([]uint32, error)

IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.

func (*LinkMutation) Modified

func (m *LinkMutation) Modified() (r time.Time, exists bool)

Modified returns the value of the "modified" field in the mutation.

func (*LinkMutation) Name

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

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

func (*LinkMutation) NameJa

func (m *LinkMutation) NameJa() (r string, exists bool)

NameJa returns the value of the "name_ja" field in the mutation.

func (*LinkMutation) OldCategoryID

func (m *LinkMutation) OldCategoryID(ctx context.Context) (v uint32, err error)

OldCategoryID returns the old "category_id" field's value of the Link entity. If the Link 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 (*LinkMutation) OldCreated

func (m *LinkMutation) OldCreated(ctx context.Context) (v time.Time, err error)

OldCreated returns the old "created" field's value of the Link entity. If the Link 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 (*LinkMutation) OldFaviconURL

func (m *LinkMutation) OldFaviconURL(ctx context.Context) (v string, err error)

OldFaviconURL returns the old "favicon_url" field's value of the Link entity. If the Link 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 (*LinkMutation) OldField

func (m *LinkMutation) 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 (*LinkMutation) OldModified

func (m *LinkMutation) OldModified(ctx context.Context) (v time.Time, err error)

OldModified returns the old "modified" field's value of the Link entity. If the Link 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 (*LinkMutation) OldName

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

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

func (m *LinkMutation) OldNameJa(ctx context.Context) (v string, err error)

OldNameJa returns the old "name_ja" field's value of the Link entity. If the Link 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 (*LinkMutation) OldSiteURL

func (m *LinkMutation) OldSiteURL(ctx context.Context) (v string, err error)

OldSiteURL returns the old "site_url" field's value of the Link entity. If the Link 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 (*LinkMutation) OldUserID

func (m *LinkMutation) OldUserID(ctx context.Context) (v uint32, err error)

OldUserID returns the old "user_id" field's value of the Link entity. If the Link 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 (*LinkMutation) Op

func (m *LinkMutation) Op() Op

Op returns the operation name.

func (*LinkMutation) RemovedEdges

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

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

func (*LinkMutation) RemovedIDs

func (m *LinkMutation) 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 (*LinkMutation) ResetCategoryID

func (m *LinkMutation) ResetCategoryID()

ResetCategoryID resets all changes to the "category_id" field.

func (*LinkMutation) ResetCreated

func (m *LinkMutation) ResetCreated()

ResetCreated resets all changes to the "created" field.

func (*LinkMutation) ResetEdge

func (m *LinkMutation) 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 (*LinkMutation) ResetFaviconURL

func (m *LinkMutation) ResetFaviconURL()

ResetFaviconURL resets all changes to the "favicon_url" field.

func (*LinkMutation) ResetField

func (m *LinkMutation) 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 (*LinkMutation) ResetModified

func (m *LinkMutation) ResetModified()

ResetModified resets all changes to the "modified" field.

func (*LinkMutation) ResetName

func (m *LinkMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*LinkMutation) ResetNameJa

func (m *LinkMutation) ResetNameJa()

ResetNameJa resets all changes to the "name_ja" field.

func (*LinkMutation) ResetSiteURL

func (m *LinkMutation) ResetSiteURL()

ResetSiteURL resets all changes to the "site_url" field.

func (*LinkMutation) ResetUserID

func (m *LinkMutation) ResetUserID()

ResetUserID resets all changes to the "user_id" field.

func (*LinkMutation) SetCategoryID

func (m *LinkMutation) SetCategoryID(u uint32)

SetCategoryID sets the "category_id" field.

func (*LinkMutation) SetCreated

func (m *LinkMutation) SetCreated(t time.Time)

SetCreated sets the "created" field.

func (*LinkMutation) SetFaviconURL

func (m *LinkMutation) SetFaviconURL(s string)

SetFaviconURL sets the "favicon_url" field.

func (*LinkMutation) SetField

func (m *LinkMutation) 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 (*LinkMutation) SetID

func (m *LinkMutation) SetID(id uint32)

SetID sets the value of the id field. Note that this operation is only accepted on creation of Link entities.

func (*LinkMutation) SetModified

func (m *LinkMutation) SetModified(t time.Time)

SetModified sets the "modified" field.

func (*LinkMutation) SetName

func (m *LinkMutation) SetName(s string)

SetName sets the "name" field.

func (*LinkMutation) SetNameJa

func (m *LinkMutation) SetNameJa(s string)

SetNameJa sets the "name_ja" field.

func (*LinkMutation) SetOp

func (m *LinkMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*LinkMutation) SetSiteURL

func (m *LinkMutation) SetSiteURL(s string)

SetSiteURL sets the "site_url" field.

func (*LinkMutation) SetUserID

func (m *LinkMutation) SetUserID(u uint32)

SetUserID sets the "user_id" field.

func (*LinkMutation) SiteURL

func (m *LinkMutation) SiteURL() (r string, exists bool)

SiteURL returns the value of the "site_url" field in the mutation.

func (LinkMutation) Tx

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

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

func (*LinkMutation) Type

func (m *LinkMutation) Type() string

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

func (*LinkMutation) UserID

func (m *LinkMutation) UserID() (r uint32, exists bool)

UserID returns the value of the "user_id" field in the mutation.

func (*LinkMutation) Where

func (m *LinkMutation) Where(ps ...predicate.Link)

Where appends a list predicates to the LinkMutation builder.

func (*LinkMutation) WhereP

func (m *LinkMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the LinkMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type LinkQuery

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

LinkQuery is the builder for querying Link entities.

func (*LinkQuery) Aggregate

func (lq *LinkQuery) Aggregate(fns ...AggregateFunc) *LinkSelect

Aggregate returns a LinkSelect configured with the given aggregations.

func (*LinkQuery) All

func (lq *LinkQuery) All(ctx context.Context) ([]*Link, error)

All executes the query and returns a list of Links.

func (*LinkQuery) AllX

func (lq *LinkQuery) AllX(ctx context.Context) []*Link

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

func (*LinkQuery) Clone

func (lq *LinkQuery) Clone() *LinkQuery

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

func (*LinkQuery) Count

func (lq *LinkQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*LinkQuery) CountX

func (lq *LinkQuery) CountX(ctx context.Context) int

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

func (*LinkQuery) Exist

func (lq *LinkQuery) Exist(ctx context.Context) (bool, error)

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

func (*LinkQuery) ExistX

func (lq *LinkQuery) ExistX(ctx context.Context) bool

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

func (*LinkQuery) First

func (lq *LinkQuery) First(ctx context.Context) (*Link, error)

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

func (*LinkQuery) FirstID

func (lq *LinkQuery) FirstID(ctx context.Context) (id uint32, err error)

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

func (*LinkQuery) FirstIDX

func (lq *LinkQuery) FirstIDX(ctx context.Context) uint32

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

func (*LinkQuery) FirstX

func (lq *LinkQuery) FirstX(ctx context.Context) *Link

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

func (*LinkQuery) GroupBy

func (lq *LinkQuery) GroupBy(field string, fields ...string) *LinkGroupBy

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 {
	UserID uint32 `json:"user_id,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Link.Query().
	GroupBy(link.FieldUserID).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*LinkQuery) IDs

func (lq *LinkQuery) IDs(ctx context.Context) (ids []uint32, err error)

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

func (*LinkQuery) IDsX

func (lq *LinkQuery) IDsX(ctx context.Context) []uint32

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

func (*LinkQuery) Limit

func (lq *LinkQuery) Limit(limit int) *LinkQuery

Limit the number of records to be returned by this query.

func (*LinkQuery) Offset

func (lq *LinkQuery) Offset(offset int) *LinkQuery

Offset to start from.

func (*LinkQuery) Only

func (lq *LinkQuery) Only(ctx context.Context) (*Link, error)

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

func (*LinkQuery) OnlyID

func (lq *LinkQuery) OnlyID(ctx context.Context) (id uint32, err error)

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

func (*LinkQuery) OnlyIDX

func (lq *LinkQuery) OnlyIDX(ctx context.Context) uint32

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

func (*LinkQuery) OnlyX

func (lq *LinkQuery) OnlyX(ctx context.Context) *Link

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

func (*LinkQuery) Order

func (lq *LinkQuery) Order(o ...OrderFunc) *LinkQuery

Order specifies how the records should be ordered.

func (*LinkQuery) Select

func (lq *LinkQuery) Select(fields ...string) *LinkSelect

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 {
	UserID uint32 `json:"user_id,omitempty"`
}

client.Link.Query().
	Select(link.FieldUserID).
	Scan(ctx, &v)

func (*LinkQuery) Unique

func (lq *LinkQuery) Unique(unique bool) *LinkQuery

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

func (lq *LinkQuery) Where(ps ...predicate.Link) *LinkQuery

Where adds a new predicate for the LinkQuery builder.

type LinkSelect

type LinkSelect struct {
	*LinkQuery
	// contains filtered or unexported fields
}

LinkSelect is the builder for selecting fields of Link entities.

func (*LinkSelect) Aggregate

func (ls *LinkSelect) Aggregate(fns ...AggregateFunc) *LinkSelect

Aggregate adds the given aggregation functions to the selector query.

func (*LinkSelect) Bool

func (s *LinkSelect) Bool(ctx context.Context) (_ bool, err error)

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

func (*LinkSelect) BoolX

func (s *LinkSelect) BoolX(ctx context.Context) bool

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

func (*LinkSelect) Bools

func (s *LinkSelect) Bools(ctx context.Context) ([]bool, error)

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

func (*LinkSelect) BoolsX

func (s *LinkSelect) BoolsX(ctx context.Context) []bool

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

func (*LinkSelect) Float64

func (s *LinkSelect) Float64(ctx context.Context) (_ float64, err error)

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

func (*LinkSelect) Float64X

func (s *LinkSelect) Float64X(ctx context.Context) float64

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

func (*LinkSelect) Float64s

func (s *LinkSelect) Float64s(ctx context.Context) ([]float64, error)

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

func (*LinkSelect) Float64sX

func (s *LinkSelect) Float64sX(ctx context.Context) []float64

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

func (*LinkSelect) Int

func (s *LinkSelect) Int(ctx context.Context) (_ int, err error)

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

func (*LinkSelect) IntX

func (s *LinkSelect) IntX(ctx context.Context) int

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

func (*LinkSelect) Ints

func (s *LinkSelect) Ints(ctx context.Context) ([]int, error)

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

func (*LinkSelect) IntsX

func (s *LinkSelect) IntsX(ctx context.Context) []int

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

func (*LinkSelect) Scan

func (ls *LinkSelect) Scan(ctx context.Context, v any) error

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

func (*LinkSelect) ScanX

func (s *LinkSelect) ScanX(ctx context.Context, v any)

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

func (*LinkSelect) String

func (s *LinkSelect) String(ctx context.Context) (_ string, err error)

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

func (*LinkSelect) StringX

func (s *LinkSelect) StringX(ctx context.Context) string

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

func (*LinkSelect) Strings

func (s *LinkSelect) Strings(ctx context.Context) ([]string, error)

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

func (*LinkSelect) StringsX

func (s *LinkSelect) StringsX(ctx context.Context) []string

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

type LinkUpdate

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

LinkUpdate is the builder for updating Link entities.

func (*LinkUpdate) AddCategoryID

func (lu *LinkUpdate) AddCategoryID(u int32) *LinkUpdate

AddCategoryID adds u to the "category_id" field.

func (*LinkUpdate) AddUserID

func (lu *LinkUpdate) AddUserID(u int32) *LinkUpdate

AddUserID adds u to the "user_id" field.

func (*LinkUpdate) ClearFaviconURL

func (lu *LinkUpdate) ClearFaviconURL() *LinkUpdate

ClearFaviconURL clears the value of the "favicon_url" field.

func (*LinkUpdate) Exec

func (lu *LinkUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*LinkUpdate) ExecX

func (lu *LinkUpdate) ExecX(ctx context.Context)

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

func (*LinkUpdate) Mutation

func (lu *LinkUpdate) Mutation() *LinkMutation

Mutation returns the LinkMutation object of the builder.

func (*LinkUpdate) Save

func (lu *LinkUpdate) Save(ctx context.Context) (int, error)

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

func (*LinkUpdate) SaveX

func (lu *LinkUpdate) SaveX(ctx context.Context) int

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

func (*LinkUpdate) SetCategoryID

func (lu *LinkUpdate) SetCategoryID(u uint32) *LinkUpdate

SetCategoryID sets the "category_id" field.

func (*LinkUpdate) SetCreated

func (lu *LinkUpdate) SetCreated(t time.Time) *LinkUpdate

SetCreated sets the "created" field.

func (*LinkUpdate) SetFaviconURL

func (lu *LinkUpdate) SetFaviconURL(s string) *LinkUpdate

SetFaviconURL sets the "favicon_url" field.

func (*LinkUpdate) SetModified

func (lu *LinkUpdate) SetModified(t time.Time) *LinkUpdate

SetModified sets the "modified" field.

func (*LinkUpdate) SetName

func (lu *LinkUpdate) SetName(s string) *LinkUpdate

SetName sets the "name" field.

func (*LinkUpdate) SetNameJa

func (lu *LinkUpdate) SetNameJa(s string) *LinkUpdate

SetNameJa sets the "name_ja" field.

func (*LinkUpdate) SetNillableCreated

func (lu *LinkUpdate) SetNillableCreated(t *time.Time) *LinkUpdate

SetNillableCreated sets the "created" field if the given value is not nil.

func (*LinkUpdate) SetNillableFaviconURL

func (lu *LinkUpdate) SetNillableFaviconURL(s *string) *LinkUpdate

SetNillableFaviconURL sets the "favicon_url" field if the given value is not nil.

func (*LinkUpdate) SetSiteURL

func (lu *LinkUpdate) SetSiteURL(s string) *LinkUpdate

SetSiteURL sets the "site_url" field.

func (*LinkUpdate) SetUserID

func (lu *LinkUpdate) SetUserID(u uint32) *LinkUpdate

SetUserID sets the "user_id" field.

func (*LinkUpdate) Where

func (lu *LinkUpdate) Where(ps ...predicate.Link) *LinkUpdate

Where appends a list predicates to the LinkUpdate builder.

type LinkUpdateOne

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

LinkUpdateOne is the builder for updating a single Link entity.

func (*LinkUpdateOne) AddCategoryID

func (luo *LinkUpdateOne) AddCategoryID(u int32) *LinkUpdateOne

AddCategoryID adds u to the "category_id" field.

func (*LinkUpdateOne) AddUserID

func (luo *LinkUpdateOne) AddUserID(u int32) *LinkUpdateOne

AddUserID adds u to the "user_id" field.

func (*LinkUpdateOne) ClearFaviconURL

func (luo *LinkUpdateOne) ClearFaviconURL() *LinkUpdateOne

ClearFaviconURL clears the value of the "favicon_url" field.

func (*LinkUpdateOne) Exec

func (luo *LinkUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*LinkUpdateOne) ExecX

func (luo *LinkUpdateOne) ExecX(ctx context.Context)

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

func (*LinkUpdateOne) Mutation

func (luo *LinkUpdateOne) Mutation() *LinkMutation

Mutation returns the LinkMutation object of the builder.

func (*LinkUpdateOne) Save

func (luo *LinkUpdateOne) Save(ctx context.Context) (*Link, error)

Save executes the query and returns the updated Link entity.

func (*LinkUpdateOne) SaveX

func (luo *LinkUpdateOne) SaveX(ctx context.Context) *Link

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

func (*LinkUpdateOne) Select

func (luo *LinkUpdateOne) Select(field string, fields ...string) *LinkUpdateOne

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

func (*LinkUpdateOne) SetCategoryID

func (luo *LinkUpdateOne) SetCategoryID(u uint32) *LinkUpdateOne

SetCategoryID sets the "category_id" field.

func (*LinkUpdateOne) SetCreated

func (luo *LinkUpdateOne) SetCreated(t time.Time) *LinkUpdateOne

SetCreated sets the "created" field.

func (*LinkUpdateOne) SetFaviconURL

func (luo *LinkUpdateOne) SetFaviconURL(s string) *LinkUpdateOne

SetFaviconURL sets the "favicon_url" field.

func (*LinkUpdateOne) SetModified

func (luo *LinkUpdateOne) SetModified(t time.Time) *LinkUpdateOne

SetModified sets the "modified" field.

func (*LinkUpdateOne) SetName

func (luo *LinkUpdateOne) SetName(s string) *LinkUpdateOne

SetName sets the "name" field.

func (*LinkUpdateOne) SetNameJa

func (luo *LinkUpdateOne) SetNameJa(s string) *LinkUpdateOne

SetNameJa sets the "name_ja" field.

func (*LinkUpdateOne) SetNillableCreated

func (luo *LinkUpdateOne) SetNillableCreated(t *time.Time) *LinkUpdateOne

SetNillableCreated sets the "created" field if the given value is not nil.

func (*LinkUpdateOne) SetNillableFaviconURL

func (luo *LinkUpdateOne) SetNillableFaviconURL(s *string) *LinkUpdateOne

SetNillableFaviconURL sets the "favicon_url" field if the given value is not nil.

func (*LinkUpdateOne) SetSiteURL

func (luo *LinkUpdateOne) SetSiteURL(s string) *LinkUpdateOne

SetSiteURL sets the "site_url" field.

func (*LinkUpdateOne) SetUserID

func (luo *LinkUpdateOne) SetUserID(u uint32) *LinkUpdateOne

SetUserID sets the "user_id" field.

func (*LinkUpdateOne) Where

func (luo *LinkUpdateOne) Where(ps ...predicate.Link) *LinkUpdateOne

Where appends a list predicates to the LinkUpdate builder.

type Links []*Link

Links is a parsable slice of Link.

type Location

type Location struct {

	// ID of the ent.
	ID uint32 `json:"id,omitempty"`
	// Type holds the value of the "type" field.
	Type location.Type `json:"type,omitempty"`
	// Name holds the value of the "name" field.
	Name string `json:"name,omitempty"`
	// NameJa holds the value of the "name_ja" field.
	NameJa string `json:"name_ja,omitempty"`
	// Address holds the value of the "address" field.
	Address string `json:"address,omitempty"`
	// AddressJa holds the value of the "address_ja" field.
	AddressJa string `json:"address_ja,omitempty"`
	// Created holds the value of the "created" field.
	Created time.Time `json:"created,omitempty"`
	// Modified holds the value of the "modified" field.
	Modified time.Time `json:"modified,omitempty"`
	// contains filtered or unexported fields
}

Location is the model entity for the Location schema.

func (*Location) String

func (l *Location) String() string

String implements the fmt.Stringer.

func (*Location) Unwrap

func (l *Location) Unwrap() *Location

Unwrap unwraps the Location entity that was returned from a transaction after it was closed, so that all future queries will be executed through the driver which created the transaction.

func (*Location) Update

func (l *Location) Update() *LocationUpdateOne

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

type LocationClient

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

LocationClient is a client for the Location schema.

func NewLocationClient

func NewLocationClient(c config) *LocationClient

NewLocationClient returns a client for the Location from the given config.

func (*LocationClient) Create

func (c *LocationClient) Create() *LocationCreate

Create returns a builder for creating a Location entity.

func (*LocationClient) CreateBulk

func (c *LocationClient) CreateBulk(builders ...*LocationCreate) *LocationCreateBulk

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

func (*LocationClient) Delete

func (c *LocationClient) Delete() *LocationDelete

Delete returns a delete builder for Location.

func (*LocationClient) DeleteOne

func (c *LocationClient) DeleteOne(l *Location) *LocationDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*LocationClient) DeleteOneID

func (c *LocationClient) DeleteOneID(id uint32) *LocationDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*LocationClient) Get

func (c *LocationClient) Get(ctx context.Context, id uint32) (*Location, error)

Get returns a Location entity by its id.

func (*LocationClient) GetX

func (c *LocationClient) GetX(ctx context.Context, id uint32) *Location

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

func (*LocationClient) Hooks

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

Hooks returns the client hooks.

func (*LocationClient) Intercept

func (c *LocationClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `location.Intercept(f(g(h())))`.

func (*LocationClient) Interceptors

func (c *LocationClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*LocationClient) Query

func (c *LocationClient) Query() *LocationQuery

Query returns a query builder for Location.

func (*LocationClient) Update

func (c *LocationClient) Update() *LocationUpdate

Update returns an update builder for Location.

func (*LocationClient) UpdateOne

func (c *LocationClient) UpdateOne(l *Location) *LocationUpdateOne

UpdateOne returns an update builder for the given entity.

func (*LocationClient) UpdateOneID

func (c *LocationClient) UpdateOneID(id uint32) *LocationUpdateOne

UpdateOneID returns an update builder for the given id.

func (*LocationClient) Use

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

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

type LocationCreate

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

LocationCreate is the builder for creating a Location entity.

func (*LocationCreate) Exec

func (lc *LocationCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*LocationCreate) ExecX

func (lc *LocationCreate) ExecX(ctx context.Context)

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

func (*LocationCreate) Mutation

func (lc *LocationCreate) Mutation() *LocationMutation

Mutation returns the LocationMutation object of the builder.

func (*LocationCreate) Save

func (lc *LocationCreate) Save(ctx context.Context) (*Location, error)

Save creates the Location in the database.

func (*LocationCreate) SaveX

func (lc *LocationCreate) SaveX(ctx context.Context) *Location

SaveX calls Save and panics if Save returns an error.

func (*LocationCreate) SetAddress

func (lc *LocationCreate) SetAddress(s string) *LocationCreate

SetAddress sets the "address" field.

func (*LocationCreate) SetAddressJa

func (lc *LocationCreate) SetAddressJa(s string) *LocationCreate

SetAddressJa sets the "address_ja" field.

func (*LocationCreate) SetCreated

func (lc *LocationCreate) SetCreated(t time.Time) *LocationCreate

SetCreated sets the "created" field.

func (*LocationCreate) SetID

func (lc *LocationCreate) SetID(u uint32) *LocationCreate

SetID sets the "id" field.

func (*LocationCreate) SetModified

func (lc *LocationCreate) SetModified(t time.Time) *LocationCreate

SetModified sets the "modified" field.

func (*LocationCreate) SetName

func (lc *LocationCreate) SetName(s string) *LocationCreate

SetName sets the "name" field.

func (*LocationCreate) SetNameJa

func (lc *LocationCreate) SetNameJa(s string) *LocationCreate

SetNameJa sets the "name_ja" field.

func (*LocationCreate) SetNillableCreated

func (lc *LocationCreate) SetNillableCreated(t *time.Time) *LocationCreate

SetNillableCreated sets the "created" field if the given value is not nil.

func (*LocationCreate) SetNillableModified

func (lc *LocationCreate) SetNillableModified(t *time.Time) *LocationCreate

SetNillableModified sets the "modified" field if the given value is not nil.

func (*LocationCreate) SetType

func (lc *LocationCreate) SetType(l location.Type) *LocationCreate

SetType sets the "type" field.

type LocationCreateBulk

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

LocationCreateBulk is the builder for creating many Location entities in bulk.

func (*LocationCreateBulk) Exec

func (lcb *LocationCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*LocationCreateBulk) ExecX

func (lcb *LocationCreateBulk) ExecX(ctx context.Context)

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

func (*LocationCreateBulk) Save

func (lcb *LocationCreateBulk) Save(ctx context.Context) ([]*Location, error)

Save creates the Location entities in the database.

func (*LocationCreateBulk) SaveX

func (lcb *LocationCreateBulk) SaveX(ctx context.Context) []*Location

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

type LocationDelete

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

LocationDelete is the builder for deleting a Location entity.

func (*LocationDelete) Exec

func (ld *LocationDelete) Exec(ctx context.Context) (int, error)

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

func (*LocationDelete) ExecX

func (ld *LocationDelete) ExecX(ctx context.Context) int

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

func (*LocationDelete) Where

func (ld *LocationDelete) Where(ps ...predicate.Location) *LocationDelete

Where appends a list predicates to the LocationDelete builder.

type LocationDeleteOne

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

LocationDeleteOne is the builder for deleting a single Location entity.

func (*LocationDeleteOne) Exec

func (ldo *LocationDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*LocationDeleteOne) ExecX

func (ldo *LocationDeleteOne) ExecX(ctx context.Context)

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

func (*LocationDeleteOne) Where

Where appends a list predicates to the LocationDelete builder.

type LocationGroupBy

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

LocationGroupBy is the group-by builder for Location entities.

func (*LocationGroupBy) Aggregate

func (lgb *LocationGroupBy) Aggregate(fns ...AggregateFunc) *LocationGroupBy

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

func (*LocationGroupBy) Bool

func (s *LocationGroupBy) Bool(ctx context.Context) (_ bool, err error)

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

func (*LocationGroupBy) BoolX

func (s *LocationGroupBy) BoolX(ctx context.Context) bool

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

func (*LocationGroupBy) Bools

func (s *LocationGroupBy) Bools(ctx context.Context) ([]bool, error)

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

func (*LocationGroupBy) BoolsX

func (s *LocationGroupBy) BoolsX(ctx context.Context) []bool

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

func (*LocationGroupBy) Float64

func (s *LocationGroupBy) Float64(ctx context.Context) (_ float64, err error)

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

func (*LocationGroupBy) Float64X

func (s *LocationGroupBy) Float64X(ctx context.Context) float64

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

func (*LocationGroupBy) Float64s

func (s *LocationGroupBy) Float64s(ctx context.Context) ([]float64, error)

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

func (*LocationGroupBy) Float64sX

func (s *LocationGroupBy) Float64sX(ctx context.Context) []float64

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

func (*LocationGroupBy) Int

func (s *LocationGroupBy) Int(ctx context.Context) (_ int, err error)

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

func (*LocationGroupBy) IntX

func (s *LocationGroupBy) IntX(ctx context.Context) int

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

func (*LocationGroupBy) Ints

func (s *LocationGroupBy) Ints(ctx context.Context) ([]int, error)

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

func (*LocationGroupBy) IntsX

func (s *LocationGroupBy) IntsX(ctx context.Context) []int

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

func (*LocationGroupBy) Scan

func (lgb *LocationGroupBy) Scan(ctx context.Context, v any) error

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

func (*LocationGroupBy) ScanX

func (s *LocationGroupBy) ScanX(ctx context.Context, v any)

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

func (*LocationGroupBy) String

func (s *LocationGroupBy) String(ctx context.Context) (_ string, err error)

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

func (*LocationGroupBy) StringX

func (s *LocationGroupBy) StringX(ctx context.Context) string

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

func (*LocationGroupBy) Strings

func (s *LocationGroupBy) Strings(ctx context.Context) ([]string, error)

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

func (*LocationGroupBy) StringsX

func (s *LocationGroupBy) StringsX(ctx context.Context) []string

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

type LocationMutation

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

LocationMutation represents an operation that mutates the Location nodes in the graph.

func (*LocationMutation) AddField

func (m *LocationMutation) AddField(name string, value ent.Value) error

AddField adds the value to the field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*LocationMutation) AddedEdges

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

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

func (*LocationMutation) AddedField

func (m *LocationMutation) AddedField(name string) (ent.Value, bool)

AddedField returns the numeric value that was incremented/decremented on a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*LocationMutation) AddedFields

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

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

func (*LocationMutation) AddedIDs

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

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

func (*LocationMutation) Address

func (m *LocationMutation) Address() (r string, exists bool)

Address returns the value of the "address" field in the mutation.

func (*LocationMutation) AddressJa

func (m *LocationMutation) AddressJa() (r string, exists bool)

AddressJa returns the value of the "address_ja" field in the mutation.

func (*LocationMutation) ClearEdge

func (m *LocationMutation) ClearEdge(name string) error

ClearEdge clears the value of the edge with the given name. It returns an error if that edge is not defined in the schema.

func (*LocationMutation) ClearField

func (m *LocationMutation) ClearField(name string) error

ClearField clears the value of the field with the given name. It returns an error if the field is not defined in the schema.

func (*LocationMutation) ClearedEdges

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

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

func (*LocationMutation) ClearedFields

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

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

func (LocationMutation) Client

func (m LocationMutation) Client() *Client

Client returns a new `ent.Client` from the mutation. If the mutation was executed in a transaction (ent.Tx), a transactional client is returned.

func (*LocationMutation) Created

func (m *LocationMutation) Created() (r time.Time, exists bool)

Created returns the value of the "created" field in the mutation.

func (*LocationMutation) EdgeCleared

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

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

func (*LocationMutation) Field

func (m *LocationMutation) Field(name string) (ent.Value, bool)

Field returns the value of a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*LocationMutation) FieldCleared

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

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

func (*LocationMutation) Fields

func (m *LocationMutation) Fields() []string

Fields returns all fields that were changed during this mutation. Note that in order to get all numeric fields that were incremented/decremented, call AddedFields().

func (*LocationMutation) GetType

func (m *LocationMutation) GetType() (r location.Type, exists bool)

GetType returns the value of the "type" field in the mutation.

func (*LocationMutation) ID

func (m *LocationMutation) ID() (id uint32, exists bool)

ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.

func (*LocationMutation) IDs

func (m *LocationMutation) IDs(ctx context.Context) ([]uint32, error)

IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.

func (*LocationMutation) Modified

func (m *LocationMutation) Modified() (r time.Time, exists bool)

Modified returns the value of the "modified" field in the mutation.

func (*LocationMutation) Name

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

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

func (*LocationMutation) NameJa

func (m *LocationMutation) NameJa() (r string, exists bool)

NameJa returns the value of the "name_ja" field in the mutation.

func (*LocationMutation) OldAddress

func (m *LocationMutation) OldAddress(ctx context.Context) (v string, err error)

OldAddress returns the old "address" field's value of the Location entity. If the Location object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*LocationMutation) OldAddressJa

func (m *LocationMutation) OldAddressJa(ctx context.Context) (v string, err error)

OldAddressJa returns the old "address_ja" field's value of the Location entity. If the Location object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*LocationMutation) OldCreated

func (m *LocationMutation) OldCreated(ctx context.Context) (v time.Time, err error)

OldCreated returns the old "created" field's value of the Location entity. If the Location object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*LocationMutation) OldField

func (m *LocationMutation) 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 (*LocationMutation) OldModified

func (m *LocationMutation) OldModified(ctx context.Context) (v time.Time, err error)

OldModified returns the old "modified" field's value of the Location entity. If the Location object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*LocationMutation) OldName

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

OldName returns the old "name" field's value of the Location entity. If the Location object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*LocationMutation) OldNameJa

func (m *LocationMutation) OldNameJa(ctx context.Context) (v string, err error)

OldNameJa returns the old "name_ja" field's value of the Location entity. If the Location object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*LocationMutation) OldType

func (m *LocationMutation) OldType(ctx context.Context) (v location.Type, err error)

OldType returns the old "type" field's value of the Location entity. If the Location object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*LocationMutation) Op

func (m *LocationMutation) Op() Op

Op returns the operation name.

func (*LocationMutation) RemovedEdges

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

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

func (*LocationMutation) RemovedIDs

func (m *LocationMutation) RemovedIDs(name string) []ent.Value

RemovedIDs returns all IDs (to other nodes) that were removed for the edge with the given name in this mutation.

func (*LocationMutation) ResetAddress

func (m *LocationMutation) ResetAddress()

ResetAddress resets all changes to the "address" field.

func (*LocationMutation) ResetAddressJa

func (m *LocationMutation) ResetAddressJa()

ResetAddressJa resets all changes to the "address_ja" field.

func (*LocationMutation) ResetCreated

func (m *LocationMutation) ResetCreated()

ResetCreated resets all changes to the "created" field.

func (*LocationMutation) ResetEdge

func (m *LocationMutation) ResetEdge(name string) error

ResetEdge resets all changes to the edge with the given name in this mutation. It returns an error if the edge is not defined in the schema.

func (*LocationMutation) ResetField

func (m *LocationMutation) ResetField(name string) error

ResetField resets all changes in the mutation for the field with the given name. It returns an error if the field is not defined in the schema.

func (*LocationMutation) ResetModified

func (m *LocationMutation) ResetModified()

ResetModified resets all changes to the "modified" field.

func (*LocationMutation) ResetName

func (m *LocationMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*LocationMutation) ResetNameJa

func (m *LocationMutation) ResetNameJa()

ResetNameJa resets all changes to the "name_ja" field.

func (*LocationMutation) ResetType

func (m *LocationMutation) ResetType()

ResetType resets all changes to the "type" field.

func (*LocationMutation) SetAddress

func (m *LocationMutation) SetAddress(s string)

SetAddress sets the "address" field.

func (*LocationMutation) SetAddressJa

func (m *LocationMutation) SetAddressJa(s string)

SetAddressJa sets the "address_ja" field.

func (*LocationMutation) SetCreated

func (m *LocationMutation) SetCreated(t time.Time)

SetCreated sets the "created" field.

func (*LocationMutation) SetField

func (m *LocationMutation) SetField(name string, value ent.Value) error

SetField sets the value of a field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*LocationMutation) SetID

func (m *LocationMutation) SetID(id uint32)

SetID sets the value of the id field. Note that this operation is only accepted on creation of Location entities.

func (*LocationMutation) SetModified

func (m *LocationMutation) SetModified(t time.Time)

SetModified sets the "modified" field.

func (*LocationMutation) SetName

func (m *LocationMutation) SetName(s string)

SetName sets the "name" field.

func (*LocationMutation) SetNameJa

func (m *LocationMutation) SetNameJa(s string)

SetNameJa sets the "name_ja" field.

func (*LocationMutation) SetOp

func (m *LocationMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*LocationMutation) SetType

func (m *LocationMutation) SetType(l location.Type)

SetType sets the "type" field.

func (LocationMutation) Tx

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

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

func (*LocationMutation) Type

func (m *LocationMutation) Type() string

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

func (*LocationMutation) Where

func (m *LocationMutation) Where(ps ...predicate.Location)

Where appends a list predicates to the LocationMutation builder.

func (*LocationMutation) WhereP

func (m *LocationMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the LocationMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type LocationQuery

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

LocationQuery is the builder for querying Location entities.

func (*LocationQuery) Aggregate

func (lq *LocationQuery) Aggregate(fns ...AggregateFunc) *LocationSelect

Aggregate returns a LocationSelect configured with the given aggregations.

func (*LocationQuery) All

func (lq *LocationQuery) All(ctx context.Context) ([]*Location, error)

All executes the query and returns a list of Locations.

func (*LocationQuery) AllX

func (lq *LocationQuery) AllX(ctx context.Context) []*Location

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

func (*LocationQuery) Clone

func (lq *LocationQuery) Clone() *LocationQuery

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

func (*LocationQuery) Count

func (lq *LocationQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*LocationQuery) CountX

func (lq *LocationQuery) CountX(ctx context.Context) int

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

func (*LocationQuery) Exist

func (lq *LocationQuery) Exist(ctx context.Context) (bool, error)

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

func (*LocationQuery) ExistX

func (lq *LocationQuery) ExistX(ctx context.Context) bool

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

func (*LocationQuery) First

func (lq *LocationQuery) First(ctx context.Context) (*Location, error)

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

func (*LocationQuery) FirstID

func (lq *LocationQuery) FirstID(ctx context.Context) (id uint32, err error)

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

func (*LocationQuery) FirstIDX

func (lq *LocationQuery) FirstIDX(ctx context.Context) uint32

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

func (*LocationQuery) FirstX

func (lq *LocationQuery) FirstX(ctx context.Context) *Location

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

func (*LocationQuery) GroupBy

func (lq *LocationQuery) GroupBy(field string, fields ...string) *LocationGroupBy

GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.

Example:

var v []struct {
	Type location.Type `json:"type,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Location.Query().
	GroupBy(location.FieldType).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*LocationQuery) IDs

func (lq *LocationQuery) IDs(ctx context.Context) (ids []uint32, err error)

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

func (*LocationQuery) IDsX

func (lq *LocationQuery) IDsX(ctx context.Context) []uint32

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

func (*LocationQuery) Limit

func (lq *LocationQuery) Limit(limit int) *LocationQuery

Limit the number of records to be returned by this query.

func (*LocationQuery) Offset

func (lq *LocationQuery) Offset(offset int) *LocationQuery

Offset to start from.

func (*LocationQuery) Only

func (lq *LocationQuery) Only(ctx context.Context) (*Location, error)

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

func (*LocationQuery) OnlyID

func (lq *LocationQuery) OnlyID(ctx context.Context) (id uint32, err error)

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

func (*LocationQuery) OnlyIDX

func (lq *LocationQuery) OnlyIDX(ctx context.Context) uint32

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

func (*LocationQuery) OnlyX

func (lq *LocationQuery) OnlyX(ctx context.Context) *Location

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

func (*LocationQuery) Order

func (lq *LocationQuery) Order(o ...OrderFunc) *LocationQuery

Order specifies how the records should be ordered.

func (*LocationQuery) Select

func (lq *LocationQuery) Select(fields ...string) *LocationSelect

Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.

Example:

var v []struct {
	Type location.Type `json:"type,omitempty"`
}

client.Location.Query().
	Select(location.FieldType).
	Scan(ctx, &v)

func (*LocationQuery) Unique

func (lq *LocationQuery) Unique(unique bool) *LocationQuery

Unique configures the query builder to filter duplicate records on query. By default, unique is set to true, and can be disabled using this method.

func (*LocationQuery) Where

func (lq *LocationQuery) Where(ps ...predicate.Location) *LocationQuery

Where adds a new predicate for the LocationQuery builder.

type LocationSelect

type LocationSelect struct {
	*LocationQuery
	// contains filtered or unexported fields
}

LocationSelect is the builder for selecting fields of Location entities.

func (*LocationSelect) Aggregate

func (ls *LocationSelect) Aggregate(fns ...AggregateFunc) *LocationSelect

Aggregate adds the given aggregation functions to the selector query.

func (*LocationSelect) Bool

func (s *LocationSelect) Bool(ctx context.Context) (_ bool, err error)

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

func (*LocationSelect) BoolX

func (s *LocationSelect) BoolX(ctx context.Context) bool

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

func (*LocationSelect) Bools

func (s *LocationSelect) Bools(ctx context.Context) ([]bool, error)

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

func (*LocationSelect) BoolsX

func (s *LocationSelect) BoolsX(ctx context.Context) []bool

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

func (*LocationSelect) Float64

func (s *LocationSelect) Float64(ctx context.Context) (_ float64, err error)

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

func (*LocationSelect) Float64X

func (s *LocationSelect) Float64X(ctx context.Context) float64

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

func (*LocationSelect) Float64s

func (s *LocationSelect) Float64s(ctx context.Context) ([]float64, error)

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

func (*LocationSelect) Float64sX

func (s *LocationSelect) Float64sX(ctx context.Context) []float64

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

func (*LocationSelect) Int

func (s *LocationSelect) Int(ctx context.Context) (_ int, err error)

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

func (*LocationSelect) IntX

func (s *LocationSelect) IntX(ctx context.Context) int

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

func (*LocationSelect) Ints

func (s *LocationSelect) Ints(ctx context.Context) ([]int, error)

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

func (*LocationSelect) IntsX

func (s *LocationSelect) IntsX(ctx context.Context) []int

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

func (*LocationSelect) Scan

func (ls *LocationSelect) Scan(ctx context.Context, v any) error

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

func (*LocationSelect) ScanX

func (s *LocationSelect) ScanX(ctx context.Context, v any)

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

func (*LocationSelect) String

func (s *LocationSelect) String(ctx context.Context) (_ string, err error)

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

func (*LocationSelect) StringX

func (s *LocationSelect) StringX(ctx context.Context) string

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

func (*LocationSelect) Strings

func (s *LocationSelect) Strings(ctx context.Context) ([]string, error)

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

func (*LocationSelect) StringsX

func (s *LocationSelect) StringsX(ctx context.Context) []string

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

type LocationUpdate

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

LocationUpdate is the builder for updating Location entities.

func (*LocationUpdate) Exec

func (lu *LocationUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*LocationUpdate) ExecX

func (lu *LocationUpdate) ExecX(ctx context.Context)

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

func (*LocationUpdate) Mutation

func (lu *LocationUpdate) Mutation() *LocationMutation

Mutation returns the LocationMutation object of the builder.

func (*LocationUpdate) Save

func (lu *LocationUpdate) Save(ctx context.Context) (int, error)

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

func (*LocationUpdate) SaveX

func (lu *LocationUpdate) SaveX(ctx context.Context) int

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

func (*LocationUpdate) SetAddress

func (lu *LocationUpdate) SetAddress(s string) *LocationUpdate

SetAddress sets the "address" field.

func (*LocationUpdate) SetAddressJa

func (lu *LocationUpdate) SetAddressJa(s string) *LocationUpdate

SetAddressJa sets the "address_ja" field.

func (*LocationUpdate) SetCreated

func (lu *LocationUpdate) SetCreated(t time.Time) *LocationUpdate

SetCreated sets the "created" field.

func (*LocationUpdate) SetModified

func (lu *LocationUpdate) SetModified(t time.Time) *LocationUpdate

SetModified sets the "modified" field.

func (*LocationUpdate) SetName

func (lu *LocationUpdate) SetName(s string) *LocationUpdate

SetName sets the "name" field.

func (*LocationUpdate) SetNameJa

func (lu *LocationUpdate) SetNameJa(s string) *LocationUpdate

SetNameJa sets the "name_ja" field.

func (*LocationUpdate) SetNillableCreated

func (lu *LocationUpdate) SetNillableCreated(t *time.Time) *LocationUpdate

SetNillableCreated sets the "created" field if the given value is not nil.

func (*LocationUpdate) SetType

func (lu *LocationUpdate) SetType(l location.Type) *LocationUpdate

SetType sets the "type" field.

func (*LocationUpdate) Where

func (lu *LocationUpdate) Where(ps ...predicate.Location) *LocationUpdate

Where appends a list predicates to the LocationUpdate builder.

type LocationUpdateOne

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

LocationUpdateOne is the builder for updating a single Location entity.

func (*LocationUpdateOne) Exec

func (luo *LocationUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*LocationUpdateOne) ExecX

func (luo *LocationUpdateOne) ExecX(ctx context.Context)

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

func (*LocationUpdateOne) Mutation

func (luo *LocationUpdateOne) Mutation() *LocationMutation

Mutation returns the LocationMutation object of the builder.

func (*LocationUpdateOne) Save

func (luo *LocationUpdateOne) Save(ctx context.Context) (*Location, error)

Save executes the query and returns the updated Location entity.

func (*LocationUpdateOne) SaveX

func (luo *LocationUpdateOne) SaveX(ctx context.Context) *Location

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

func (*LocationUpdateOne) Select

func (luo *LocationUpdateOne) Select(field string, fields ...string) *LocationUpdateOne

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

func (*LocationUpdateOne) SetAddress

func (luo *LocationUpdateOne) SetAddress(s string) *LocationUpdateOne

SetAddress sets the "address" field.

func (*LocationUpdateOne) SetAddressJa

func (luo *LocationUpdateOne) SetAddressJa(s string) *LocationUpdateOne

SetAddressJa sets the "address_ja" field.

func (*LocationUpdateOne) SetCreated

func (luo *LocationUpdateOne) SetCreated(t time.Time) *LocationUpdateOne

SetCreated sets the "created" field.

func (*LocationUpdateOne) SetModified

func (luo *LocationUpdateOne) SetModified(t time.Time) *LocationUpdateOne

SetModified sets the "modified" field.

func (*LocationUpdateOne) SetName

func (luo *LocationUpdateOne) SetName(s string) *LocationUpdateOne

SetName sets the "name" field.

func (*LocationUpdateOne) SetNameJa

func (luo *LocationUpdateOne) SetNameJa(s string) *LocationUpdateOne

SetNameJa sets the "name_ja" field.

func (*LocationUpdateOne) SetNillableCreated

func (luo *LocationUpdateOne) SetNillableCreated(t *time.Time) *LocationUpdateOne

SetNillableCreated sets the "created" field if the given value is not nil.

func (*LocationUpdateOne) SetType

SetType sets the "type" field.

func (*LocationUpdateOne) Where

Where appends a list predicates to the LocationUpdate builder.

type Locations

type Locations []*Location

Locations is a parsable slice of Location.

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 Notice

type Notice struct {

	// ID of the ent.
	ID uint32 `json:"id,omitempty"`
	// UserID holds the value of the "user_id" field.
	UserID uint32 `json:"user_id,omitempty"`
	// DiscordWebhook holds the value of the "discord_webhook" field.
	DiscordWebhook string `json:"discord_webhook,omitempty"`
	// SlackWebhook holds the value of the "slack_webhook" field.
	SlackWebhook string `json:"slack_webhook,omitempty"`
	// Mail holds the value of the "mail" field.
	Mail string `json:"mail,omitempty"`
	// Created holds the value of the "created" field.
	Created time.Time `json:"created,omitempty"`
	// Modified holds the value of the "modified" field.
	Modified time.Time `json:"modified,omitempty"`
	// contains filtered or unexported fields
}

Notice is the model entity for the Notice schema.

func (*Notice) String

func (n *Notice) String() string

String implements the fmt.Stringer.

func (*Notice) Unwrap

func (n *Notice) Unwrap() *Notice

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

func (n *Notice) Update() *NoticeUpdateOne

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

type NoticeClient

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

NoticeClient is a client for the Notice schema.

func NewNoticeClient

func NewNoticeClient(c config) *NoticeClient

NewNoticeClient returns a client for the Notice from the given config.

func (*NoticeClient) Create

func (c *NoticeClient) Create() *NoticeCreate

Create returns a builder for creating a Notice entity.

func (*NoticeClient) CreateBulk

func (c *NoticeClient) CreateBulk(builders ...*NoticeCreate) *NoticeCreateBulk

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

func (*NoticeClient) Delete

func (c *NoticeClient) Delete() *NoticeDelete

Delete returns a delete builder for Notice.

func (*NoticeClient) DeleteOne

func (c *NoticeClient) DeleteOne(n *Notice) *NoticeDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*NoticeClient) DeleteOneID

func (c *NoticeClient) DeleteOneID(id uint32) *NoticeDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*NoticeClient) Get

func (c *NoticeClient) Get(ctx context.Context, id uint32) (*Notice, error)

Get returns a Notice entity by its id.

func (*NoticeClient) GetX

func (c *NoticeClient) GetX(ctx context.Context, id uint32) *Notice

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

func (*NoticeClient) Hooks

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

Hooks returns the client hooks.

func (*NoticeClient) Intercept

func (c *NoticeClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `notice.Intercept(f(g(h())))`.

func (*NoticeClient) Interceptors

func (c *NoticeClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*NoticeClient) Query

func (c *NoticeClient) Query() *NoticeQuery

Query returns a query builder for Notice.

func (*NoticeClient) Update

func (c *NoticeClient) Update() *NoticeUpdate

Update returns an update builder for Notice.

func (*NoticeClient) UpdateOne

func (c *NoticeClient) UpdateOne(n *Notice) *NoticeUpdateOne

UpdateOne returns an update builder for the given entity.

func (*NoticeClient) UpdateOneID

func (c *NoticeClient) UpdateOneID(id uint32) *NoticeUpdateOne

UpdateOneID returns an update builder for the given id.

func (*NoticeClient) Use

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

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

type NoticeCreate

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

NoticeCreate is the builder for creating a Notice entity.

func (*NoticeCreate) Exec

func (nc *NoticeCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*NoticeCreate) ExecX

func (nc *NoticeCreate) ExecX(ctx context.Context)

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

func (*NoticeCreate) Mutation

func (nc *NoticeCreate) Mutation() *NoticeMutation

Mutation returns the NoticeMutation object of the builder.

func (*NoticeCreate) Save

func (nc *NoticeCreate) Save(ctx context.Context) (*Notice, error)

Save creates the Notice in the database.

func (*NoticeCreate) SaveX

func (nc *NoticeCreate) SaveX(ctx context.Context) *Notice

SaveX calls Save and panics if Save returns an error.

func (*NoticeCreate) SetCreated

func (nc *NoticeCreate) SetCreated(t time.Time) *NoticeCreate

SetCreated sets the "created" field.

func (*NoticeCreate) SetDiscordWebhook

func (nc *NoticeCreate) SetDiscordWebhook(s string) *NoticeCreate

SetDiscordWebhook sets the "discord_webhook" field.

func (*NoticeCreate) SetID

func (nc *NoticeCreate) SetID(u uint32) *NoticeCreate

SetID sets the "id" field.

func (*NoticeCreate) SetMail

func (nc *NoticeCreate) SetMail(s string) *NoticeCreate

SetMail sets the "mail" field.

func (*NoticeCreate) SetModified

func (nc *NoticeCreate) SetModified(t time.Time) *NoticeCreate

SetModified sets the "modified" field.

func (*NoticeCreate) SetNillableCreated

func (nc *NoticeCreate) SetNillableCreated(t *time.Time) *NoticeCreate

SetNillableCreated sets the "created" field if the given value is not nil.

func (*NoticeCreate) SetNillableDiscordWebhook

func (nc *NoticeCreate) SetNillableDiscordWebhook(s *string) *NoticeCreate

SetNillableDiscordWebhook sets the "discord_webhook" field if the given value is not nil.

func (*NoticeCreate) SetNillableMail

func (nc *NoticeCreate) SetNillableMail(s *string) *NoticeCreate

SetNillableMail sets the "mail" field if the given value is not nil.

func (*NoticeCreate) SetNillableModified

func (nc *NoticeCreate) SetNillableModified(t *time.Time) *NoticeCreate

SetNillableModified sets the "modified" field if the given value is not nil.

func (*NoticeCreate) SetNillableSlackWebhook

func (nc *NoticeCreate) SetNillableSlackWebhook(s *string) *NoticeCreate

SetNillableSlackWebhook sets the "slack_webhook" field if the given value is not nil.

func (*NoticeCreate) SetSlackWebhook

func (nc *NoticeCreate) SetSlackWebhook(s string) *NoticeCreate

SetSlackWebhook sets the "slack_webhook" field.

func (*NoticeCreate) SetUserID

func (nc *NoticeCreate) SetUserID(u uint32) *NoticeCreate

SetUserID sets the "user_id" field.

type NoticeCreateBulk

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

NoticeCreateBulk is the builder for creating many Notice entities in bulk.

func (*NoticeCreateBulk) Exec

func (ncb *NoticeCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*NoticeCreateBulk) ExecX

func (ncb *NoticeCreateBulk) ExecX(ctx context.Context)

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

func (*NoticeCreateBulk) Save

func (ncb *NoticeCreateBulk) Save(ctx context.Context) ([]*Notice, error)

Save creates the Notice entities in the database.

func (*NoticeCreateBulk) SaveX

func (ncb *NoticeCreateBulk) SaveX(ctx context.Context) []*Notice

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

type NoticeDelete

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

NoticeDelete is the builder for deleting a Notice entity.

func (*NoticeDelete) Exec

func (nd *NoticeDelete) Exec(ctx context.Context) (int, error)

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

func (*NoticeDelete) ExecX

func (nd *NoticeDelete) ExecX(ctx context.Context) int

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

func (*NoticeDelete) Where

func (nd *NoticeDelete) Where(ps ...predicate.Notice) *NoticeDelete

Where appends a list predicates to the NoticeDelete builder.

type NoticeDeleteOne

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

NoticeDeleteOne is the builder for deleting a single Notice entity.

func (*NoticeDeleteOne) Exec

func (ndo *NoticeDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*NoticeDeleteOne) ExecX

func (ndo *NoticeDeleteOne) ExecX(ctx context.Context)

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

func (*NoticeDeleteOne) Where

func (ndo *NoticeDeleteOne) Where(ps ...predicate.Notice) *NoticeDeleteOne

Where appends a list predicates to the NoticeDelete builder.

type NoticeGroupBy

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

NoticeGroupBy is the group-by builder for Notice entities.

func (*NoticeGroupBy) Aggregate

func (ngb *NoticeGroupBy) Aggregate(fns ...AggregateFunc) *NoticeGroupBy

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

func (*NoticeGroupBy) Bool

func (s *NoticeGroupBy) Bool(ctx context.Context) (_ bool, err error)

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

func (*NoticeGroupBy) BoolX

func (s *NoticeGroupBy) BoolX(ctx context.Context) bool

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

func (*NoticeGroupBy) Bools

func (s *NoticeGroupBy) Bools(ctx context.Context) ([]bool, error)

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

func (*NoticeGroupBy) BoolsX

func (s *NoticeGroupBy) BoolsX(ctx context.Context) []bool

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

func (*NoticeGroupBy) Float64

func (s *NoticeGroupBy) Float64(ctx context.Context) (_ float64, err error)

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

func (*NoticeGroupBy) Float64X

func (s *NoticeGroupBy) Float64X(ctx context.Context) float64

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

func (*NoticeGroupBy) Float64s

func (s *NoticeGroupBy) Float64s(ctx context.Context) ([]float64, error)

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

func (*NoticeGroupBy) Float64sX

func (s *NoticeGroupBy) Float64sX(ctx context.Context) []float64

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

func (*NoticeGroupBy) Int

func (s *NoticeGroupBy) Int(ctx context.Context) (_ int, err error)

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

func (*NoticeGroupBy) IntX

func (s *NoticeGroupBy) IntX(ctx context.Context) int

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

func (*NoticeGroupBy) Ints

func (s *NoticeGroupBy) Ints(ctx context.Context) ([]int, error)

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

func (*NoticeGroupBy) IntsX

func (s *NoticeGroupBy) IntsX(ctx context.Context) []int

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

func (*NoticeGroupBy) Scan

func (ngb *NoticeGroupBy) Scan(ctx context.Context, v any) error

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

func (*NoticeGroupBy) ScanX

func (s *NoticeGroupBy) ScanX(ctx context.Context, v any)

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

func (*NoticeGroupBy) String

func (s *NoticeGroupBy) String(ctx context.Context) (_ string, err error)

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

func (*NoticeGroupBy) StringX

func (s *NoticeGroupBy) StringX(ctx context.Context) string

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

func (*NoticeGroupBy) Strings

func (s *NoticeGroupBy) Strings(ctx context.Context) ([]string, error)

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

func (*NoticeGroupBy) StringsX

func (s *NoticeGroupBy) StringsX(ctx context.Context) []string

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

type NoticeMutation

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

NoticeMutation represents an operation that mutates the Notice nodes in the graph.

func (*NoticeMutation) AddField

func (m *NoticeMutation) 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 (*NoticeMutation) AddUserID

func (m *NoticeMutation) AddUserID(u int32)

AddUserID adds u to the "user_id" field.

func (*NoticeMutation) AddedEdges

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

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

func (*NoticeMutation) AddedField

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

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

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

func (*NoticeMutation) AddedIDs

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

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

func (*NoticeMutation) AddedUserID

func (m *NoticeMutation) AddedUserID() (r int32, exists bool)

AddedUserID returns the value that was added to the "user_id" field in this mutation.

func (*NoticeMutation) ClearDiscordWebhook

func (m *NoticeMutation) ClearDiscordWebhook()

ClearDiscordWebhook clears the value of the "discord_webhook" field.

func (*NoticeMutation) ClearEdge

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

func (m *NoticeMutation) 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 (*NoticeMutation) ClearMail

func (m *NoticeMutation) ClearMail()

ClearMail clears the value of the "mail" field.

func (*NoticeMutation) ClearSlackWebhook

func (m *NoticeMutation) ClearSlackWebhook()

ClearSlackWebhook clears the value of the "slack_webhook" field.

func (*NoticeMutation) ClearedEdges

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

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

func (*NoticeMutation) ClearedFields

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

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

func (NoticeMutation) Client

func (m NoticeMutation) 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 (*NoticeMutation) Created

func (m *NoticeMutation) Created() (r time.Time, exists bool)

Created returns the value of the "created" field in the mutation.

func (*NoticeMutation) DiscordWebhook

func (m *NoticeMutation) DiscordWebhook() (r string, exists bool)

DiscordWebhook returns the value of the "discord_webhook" field in the mutation.

func (*NoticeMutation) DiscordWebhookCleared

func (m *NoticeMutation) DiscordWebhookCleared() bool

DiscordWebhookCleared returns if the "discord_webhook" field was cleared in this mutation.

func (*NoticeMutation) EdgeCleared

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

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

func (*NoticeMutation) Field

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

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

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

func (*NoticeMutation) Fields

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

func (m *NoticeMutation) ID() (id uint32, 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 (*NoticeMutation) IDs

func (m *NoticeMutation) IDs(ctx context.Context) ([]uint32, error)

IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.

func (*NoticeMutation) Mail

func (m *NoticeMutation) Mail() (r string, exists bool)

Mail returns the value of the "mail" field in the mutation.

func (*NoticeMutation) MailCleared

func (m *NoticeMutation) MailCleared() bool

MailCleared returns if the "mail" field was cleared in this mutation.

func (*NoticeMutation) Modified

func (m *NoticeMutation) Modified() (r time.Time, exists bool)

Modified returns the value of the "modified" field in the mutation.

func (*NoticeMutation) OldCreated

func (m *NoticeMutation) OldCreated(ctx context.Context) (v time.Time, err error)

OldCreated returns the old "created" field's value of the Notice entity. If the Notice 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 (*NoticeMutation) OldDiscordWebhook

func (m *NoticeMutation) OldDiscordWebhook(ctx context.Context) (v string, err error)

OldDiscordWebhook returns the old "discord_webhook" field's value of the Notice entity. If the Notice 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 (*NoticeMutation) OldField

func (m *NoticeMutation) 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 (*NoticeMutation) OldMail

func (m *NoticeMutation) OldMail(ctx context.Context) (v string, err error)

OldMail returns the old "mail" field's value of the Notice entity. If the Notice 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 (*NoticeMutation) OldModified

func (m *NoticeMutation) OldModified(ctx context.Context) (v time.Time, err error)

OldModified returns the old "modified" field's value of the Notice entity. If the Notice 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 (*NoticeMutation) OldSlackWebhook

func (m *NoticeMutation) OldSlackWebhook(ctx context.Context) (v string, err error)

OldSlackWebhook returns the old "slack_webhook" field's value of the Notice entity. If the Notice 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 (*NoticeMutation) OldUserID

func (m *NoticeMutation) OldUserID(ctx context.Context) (v uint32, err error)

OldUserID returns the old "user_id" field's value of the Notice entity. If the Notice 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 (*NoticeMutation) Op

func (m *NoticeMutation) Op() Op

Op returns the operation name.

func (*NoticeMutation) RemovedEdges

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

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

func (*NoticeMutation) RemovedIDs

func (m *NoticeMutation) 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 (*NoticeMutation) ResetCreated

func (m *NoticeMutation) ResetCreated()

ResetCreated resets all changes to the "created" field.

func (*NoticeMutation) ResetDiscordWebhook

func (m *NoticeMutation) ResetDiscordWebhook()

ResetDiscordWebhook resets all changes to the "discord_webhook" field.

func (*NoticeMutation) ResetEdge

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

func (m *NoticeMutation) 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 (*NoticeMutation) ResetMail

func (m *NoticeMutation) ResetMail()

ResetMail resets all changes to the "mail" field.

func (*NoticeMutation) ResetModified

func (m *NoticeMutation) ResetModified()

ResetModified resets all changes to the "modified" field.

func (*NoticeMutation) ResetSlackWebhook

func (m *NoticeMutation) ResetSlackWebhook()

ResetSlackWebhook resets all changes to the "slack_webhook" field.

func (*NoticeMutation) ResetUserID

func (m *NoticeMutation) ResetUserID()

ResetUserID resets all changes to the "user_id" field.

func (*NoticeMutation) SetCreated

func (m *NoticeMutation) SetCreated(t time.Time)

SetCreated sets the "created" field.

func (*NoticeMutation) SetDiscordWebhook

func (m *NoticeMutation) SetDiscordWebhook(s string)

SetDiscordWebhook sets the "discord_webhook" field.

func (*NoticeMutation) SetField

func (m *NoticeMutation) 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 (*NoticeMutation) SetID

func (m *NoticeMutation) SetID(id uint32)

SetID sets the value of the id field. Note that this operation is only accepted on creation of Notice entities.

func (*NoticeMutation) SetMail

func (m *NoticeMutation) SetMail(s string)

SetMail sets the "mail" field.

func (*NoticeMutation) SetModified

func (m *NoticeMutation) SetModified(t time.Time)

SetModified sets the "modified" field.

func (*NoticeMutation) SetOp

func (m *NoticeMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*NoticeMutation) SetSlackWebhook

func (m *NoticeMutation) SetSlackWebhook(s string)

SetSlackWebhook sets the "slack_webhook" field.

func (*NoticeMutation) SetUserID

func (m *NoticeMutation) SetUserID(u uint32)

SetUserID sets the "user_id" field.

func (*NoticeMutation) SlackWebhook

func (m *NoticeMutation) SlackWebhook() (r string, exists bool)

SlackWebhook returns the value of the "slack_webhook" field in the mutation.

func (*NoticeMutation) SlackWebhookCleared

func (m *NoticeMutation) SlackWebhookCleared() bool

SlackWebhookCleared returns if the "slack_webhook" field was cleared in this mutation.

func (NoticeMutation) Tx

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

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

func (*NoticeMutation) Type

func (m *NoticeMutation) Type() string

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

func (*NoticeMutation) UserID

func (m *NoticeMutation) UserID() (r uint32, exists bool)

UserID returns the value of the "user_id" field in the mutation.

func (*NoticeMutation) Where

func (m *NoticeMutation) Where(ps ...predicate.Notice)

Where appends a list predicates to the NoticeMutation builder.

func (*NoticeMutation) WhereP

func (m *NoticeMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the NoticeMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type NoticeQuery

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

NoticeQuery is the builder for querying Notice entities.

func (*NoticeQuery) Aggregate

func (nq *NoticeQuery) Aggregate(fns ...AggregateFunc) *NoticeSelect

Aggregate returns a NoticeSelect configured with the given aggregations.

func (*NoticeQuery) All

func (nq *NoticeQuery) All(ctx context.Context) ([]*Notice, error)

All executes the query and returns a list of Notices.

func (*NoticeQuery) AllX

func (nq *NoticeQuery) AllX(ctx context.Context) []*Notice

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

func (*NoticeQuery) Clone

func (nq *NoticeQuery) Clone() *NoticeQuery

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

func (*NoticeQuery) Count

func (nq *NoticeQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*NoticeQuery) CountX

func (nq *NoticeQuery) CountX(ctx context.Context) int

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

func (*NoticeQuery) Exist

func (nq *NoticeQuery) Exist(ctx context.Context) (bool, error)

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

func (*NoticeQuery) ExistX

func (nq *NoticeQuery) ExistX(ctx context.Context) bool

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

func (*NoticeQuery) First

func (nq *NoticeQuery) First(ctx context.Context) (*Notice, error)

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

func (*NoticeQuery) FirstID

func (nq *NoticeQuery) FirstID(ctx context.Context) (id uint32, err error)

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

func (*NoticeQuery) FirstIDX

func (nq *NoticeQuery) FirstIDX(ctx context.Context) uint32

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

func (*NoticeQuery) FirstX

func (nq *NoticeQuery) FirstX(ctx context.Context) *Notice

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

func (*NoticeQuery) GroupBy

func (nq *NoticeQuery) GroupBy(field string, fields ...string) *NoticeGroupBy

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 {
	UserID uint32 `json:"user_id,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Notice.Query().
	GroupBy(notice.FieldUserID).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*NoticeQuery) IDs

func (nq *NoticeQuery) IDs(ctx context.Context) (ids []uint32, err error)

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

func (*NoticeQuery) IDsX

func (nq *NoticeQuery) IDsX(ctx context.Context) []uint32

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

func (*NoticeQuery) Limit

func (nq *NoticeQuery) Limit(limit int) *NoticeQuery

Limit the number of records to be returned by this query.

func (*NoticeQuery) Offset

func (nq *NoticeQuery) Offset(offset int) *NoticeQuery

Offset to start from.

func (*NoticeQuery) Only

func (nq *NoticeQuery) Only(ctx context.Context) (*Notice, error)

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

func (*NoticeQuery) OnlyID

func (nq *NoticeQuery) OnlyID(ctx context.Context) (id uint32, err error)

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

func (*NoticeQuery) OnlyIDX

func (nq *NoticeQuery) OnlyIDX(ctx context.Context) uint32

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

func (*NoticeQuery) OnlyX

func (nq *NoticeQuery) OnlyX(ctx context.Context) *Notice

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

func (*NoticeQuery) Order

func (nq *NoticeQuery) Order(o ...OrderFunc) *NoticeQuery

Order specifies how the records should be ordered.

func (*NoticeQuery) Select

func (nq *NoticeQuery) Select(fields ...string) *NoticeSelect

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 {
	UserID uint32 `json:"user_id,omitempty"`
}

client.Notice.Query().
	Select(notice.FieldUserID).
	Scan(ctx, &v)

func (*NoticeQuery) Unique

func (nq *NoticeQuery) Unique(unique bool) *NoticeQuery

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

func (nq *NoticeQuery) Where(ps ...predicate.Notice) *NoticeQuery

Where adds a new predicate for the NoticeQuery builder.

type NoticeSelect

type NoticeSelect struct {
	*NoticeQuery
	// contains filtered or unexported fields
}

NoticeSelect is the builder for selecting fields of Notice entities.

func (*NoticeSelect) Aggregate

func (ns *NoticeSelect) Aggregate(fns ...AggregateFunc) *NoticeSelect

Aggregate adds the given aggregation functions to the selector query.

func (*NoticeSelect) Bool

func (s *NoticeSelect) Bool(ctx context.Context) (_ bool, err error)

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

func (*NoticeSelect) BoolX

func (s *NoticeSelect) BoolX(ctx context.Context) bool

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

func (*NoticeSelect) Bools

func (s *NoticeSelect) Bools(ctx context.Context) ([]bool, error)

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

func (*NoticeSelect) BoolsX

func (s *NoticeSelect) BoolsX(ctx context.Context) []bool

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

func (*NoticeSelect) Float64

func (s *NoticeSelect) Float64(ctx context.Context) (_ float64, err error)

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

func (*NoticeSelect) Float64X

func (s *NoticeSelect) Float64X(ctx context.Context) float64

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

func (*NoticeSelect) Float64s

func (s *NoticeSelect) Float64s(ctx context.Context) ([]float64, error)

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

func (*NoticeSelect) Float64sX

func (s *NoticeSelect) Float64sX(ctx context.Context) []float64

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

func (*NoticeSelect) Int

func (s *NoticeSelect) Int(ctx context.Context) (_ int, err error)

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

func (*NoticeSelect) IntX

func (s *NoticeSelect) IntX(ctx context.Context) int

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

func (*NoticeSelect) Ints

func (s *NoticeSelect) Ints(ctx context.Context) ([]int, error)

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

func (*NoticeSelect) IntsX

func (s *NoticeSelect) IntsX(ctx context.Context) []int

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

func (*NoticeSelect) Scan

func (ns *NoticeSelect) Scan(ctx context.Context, v any) error

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

func (*NoticeSelect) ScanX

func (s *NoticeSelect) ScanX(ctx context.Context, v any)

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

func (*NoticeSelect) String

func (s *NoticeSelect) String(ctx context.Context) (_ string, err error)

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

func (*NoticeSelect) StringX

func (s *NoticeSelect) StringX(ctx context.Context) string

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

func (*NoticeSelect) Strings

func (s *NoticeSelect) Strings(ctx context.Context) ([]string, error)

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

func (*NoticeSelect) StringsX

func (s *NoticeSelect) StringsX(ctx context.Context) []string

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

type NoticeUpdate

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

NoticeUpdate is the builder for updating Notice entities.

func (*NoticeUpdate) AddUserID

func (nu *NoticeUpdate) AddUserID(u int32) *NoticeUpdate

AddUserID adds u to the "user_id" field.

func (*NoticeUpdate) ClearDiscordWebhook

func (nu *NoticeUpdate) ClearDiscordWebhook() *NoticeUpdate

ClearDiscordWebhook clears the value of the "discord_webhook" field.

func (*NoticeUpdate) ClearMail

func (nu *NoticeUpdate) ClearMail() *NoticeUpdate

ClearMail clears the value of the "mail" field.

func (*NoticeUpdate) ClearSlackWebhook

func (nu *NoticeUpdate) ClearSlackWebhook() *NoticeUpdate

ClearSlackWebhook clears the value of the "slack_webhook" field.

func (*NoticeUpdate) Exec

func (nu *NoticeUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*NoticeUpdate) ExecX

func (nu *NoticeUpdate) ExecX(ctx context.Context)

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

func (*NoticeUpdate) Mutation

func (nu *NoticeUpdate) Mutation() *NoticeMutation

Mutation returns the NoticeMutation object of the builder.

func (*NoticeUpdate) Save

func (nu *NoticeUpdate) Save(ctx context.Context) (int, error)

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

func (*NoticeUpdate) SaveX

func (nu *NoticeUpdate) SaveX(ctx context.Context) int

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

func (*NoticeUpdate) SetCreated

func (nu *NoticeUpdate) SetCreated(t time.Time) *NoticeUpdate

SetCreated sets the "created" field.

func (*NoticeUpdate) SetDiscordWebhook

func (nu *NoticeUpdate) SetDiscordWebhook(s string) *NoticeUpdate

SetDiscordWebhook sets the "discord_webhook" field.

func (*NoticeUpdate) SetMail

func (nu *NoticeUpdate) SetMail(s string) *NoticeUpdate

SetMail sets the "mail" field.

func (*NoticeUpdate) SetModified

func (nu *NoticeUpdate) SetModified(t time.Time) *NoticeUpdate

SetModified sets the "modified" field.

func (*NoticeUpdate) SetNillableCreated

func (nu *NoticeUpdate) SetNillableCreated(t *time.Time) *NoticeUpdate

SetNillableCreated sets the "created" field if the given value is not nil.

func (*NoticeUpdate) SetNillableDiscordWebhook

func (nu *NoticeUpdate) SetNillableDiscordWebhook(s *string) *NoticeUpdate

SetNillableDiscordWebhook sets the "discord_webhook" field if the given value is not nil.

func (*NoticeUpdate) SetNillableMail

func (nu *NoticeUpdate) SetNillableMail(s *string) *NoticeUpdate

SetNillableMail sets the "mail" field if the given value is not nil.

func (*NoticeUpdate) SetNillableSlackWebhook

func (nu *NoticeUpdate) SetNillableSlackWebhook(s *string) *NoticeUpdate

SetNillableSlackWebhook sets the "slack_webhook" field if the given value is not nil.

func (*NoticeUpdate) SetSlackWebhook

func (nu *NoticeUpdate) SetSlackWebhook(s string) *NoticeUpdate

SetSlackWebhook sets the "slack_webhook" field.

func (*NoticeUpdate) SetUserID

func (nu *NoticeUpdate) SetUserID(u uint32) *NoticeUpdate

SetUserID sets the "user_id" field.

func (*NoticeUpdate) Where

func (nu *NoticeUpdate) Where(ps ...predicate.Notice) *NoticeUpdate

Where appends a list predicates to the NoticeUpdate builder.

type NoticeUpdateOne

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

NoticeUpdateOne is the builder for updating a single Notice entity.

func (*NoticeUpdateOne) AddUserID

func (nuo *NoticeUpdateOne) AddUserID(u int32) *NoticeUpdateOne

AddUserID adds u to the "user_id" field.

func (*NoticeUpdateOne) ClearDiscordWebhook

func (nuo *NoticeUpdateOne) ClearDiscordWebhook() *NoticeUpdateOne

ClearDiscordWebhook clears the value of the "discord_webhook" field.

func (*NoticeUpdateOne) ClearMail

func (nuo *NoticeUpdateOne) ClearMail() *NoticeUpdateOne

ClearMail clears the value of the "mail" field.

func (*NoticeUpdateOne) ClearSlackWebhook

func (nuo *NoticeUpdateOne) ClearSlackWebhook() *NoticeUpdateOne

ClearSlackWebhook clears the value of the "slack_webhook" field.

func (*NoticeUpdateOne) Exec

func (nuo *NoticeUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*NoticeUpdateOne) ExecX

func (nuo *NoticeUpdateOne) ExecX(ctx context.Context)

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

func (*NoticeUpdateOne) Mutation

func (nuo *NoticeUpdateOne) Mutation() *NoticeMutation

Mutation returns the NoticeMutation object of the builder.

func (*NoticeUpdateOne) Save

func (nuo *NoticeUpdateOne) Save(ctx context.Context) (*Notice, error)

Save executes the query and returns the updated Notice entity.

func (*NoticeUpdateOne) SaveX

func (nuo *NoticeUpdateOne) SaveX(ctx context.Context) *Notice

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

func (*NoticeUpdateOne) Select

func (nuo *NoticeUpdateOne) Select(field string, fields ...string) *NoticeUpdateOne

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

func (*NoticeUpdateOne) SetCreated

func (nuo *NoticeUpdateOne) SetCreated(t time.Time) *NoticeUpdateOne

SetCreated sets the "created" field.

func (*NoticeUpdateOne) SetDiscordWebhook

func (nuo *NoticeUpdateOne) SetDiscordWebhook(s string) *NoticeUpdateOne

SetDiscordWebhook sets the "discord_webhook" field.

func (*NoticeUpdateOne) SetMail

func (nuo *NoticeUpdateOne) SetMail(s string) *NoticeUpdateOne

SetMail sets the "mail" field.

func (*NoticeUpdateOne) SetModified

func (nuo *NoticeUpdateOne) SetModified(t time.Time) *NoticeUpdateOne

SetModified sets the "modified" field.

func (*NoticeUpdateOne) SetNillableCreated

func (nuo *NoticeUpdateOne) SetNillableCreated(t *time.Time) *NoticeUpdateOne

SetNillableCreated sets the "created" field if the given value is not nil.

func (*NoticeUpdateOne) SetNillableDiscordWebhook

func (nuo *NoticeUpdateOne) SetNillableDiscordWebhook(s *string) *NoticeUpdateOne

SetNillableDiscordWebhook sets the "discord_webhook" field if the given value is not nil.

func (*NoticeUpdateOne) SetNillableMail

func (nuo *NoticeUpdateOne) SetNillableMail(s *string) *NoticeUpdateOne

SetNillableMail sets the "mail" field if the given value is not nil.

func (*NoticeUpdateOne) SetNillableSlackWebhook

func (nuo *NoticeUpdateOne) SetNillableSlackWebhook(s *string) *NoticeUpdateOne

SetNillableSlackWebhook sets the "slack_webhook" field if the given value is not nil.

func (*NoticeUpdateOne) SetSlackWebhook

func (nuo *NoticeUpdateOne) SetSlackWebhook(s string) *NoticeUpdateOne

SetSlackWebhook sets the "slack_webhook" field.

func (*NoticeUpdateOne) SetUserID

func (nuo *NoticeUpdateOne) SetUserID(u uint32) *NoticeUpdateOne

SetUserID sets the "user_id" field.

func (*NoticeUpdateOne) Where

func (nuo *NoticeUpdateOne) Where(ps ...predicate.Notice) *NoticeUpdateOne

Where appends a list predicates to the NoticeUpdate builder.

type Notices

type Notices []*Notice

Notices is a parsable slice of Notice.

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(...any)) 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 Product

type Product struct {

	// ID of the ent.
	ID uint32 `json:"id,omitempty"`
	// UserID holds the value of the "user_id" field.
	UserID uint32 `json:"user_id,omitempty"`
	// Name holds the value of the "name" field.
	Name string `json:"name,omitempty"`
	// NameJa holds the value of the "name_ja" field.
	NameJa string `json:"name_ja,omitempty"`
	// Detail holds the value of the "detail" field.
	Detail string `json:"detail,omitempty"`
	// DetailJa holds the value of the "detail_ja" field.
	DetailJa string `json:"detail_ja,omitempty"`
	// SiteURL holds the value of the "site_url" field.
	SiteURL string `json:"site_url,omitempty"`
	// GithubURL holds the value of the "github_url" field.
	GithubURL string `json:"github_url,omitempty"`
	// DevTime holds the value of the "dev_time" field.
	DevTime time.Time `json:"dev_time,omitempty"`
	// Thumbnail holds the value of the "thumbnail" field.
	Thumbnail string `json:"thumbnail,omitempty"`
	// Created holds the value of the "created" field.
	Created time.Time `json:"created,omitempty"`
	// Modified holds the value of the "modified" field.
	Modified time.Time `json:"modified,omitempty"`
	// contains filtered or unexported fields
}

Product is the model entity for the Product schema.

func (*Product) String

func (pr *Product) String() string

String implements the fmt.Stringer.

func (*Product) Unwrap

func (pr *Product) Unwrap() *Product

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

func (pr *Product) Update() *ProductUpdateOne

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

type ProductClient

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

ProductClient is a client for the Product schema.

func NewProductClient

func NewProductClient(c config) *ProductClient

NewProductClient returns a client for the Product from the given config.

func (*ProductClient) Create

func (c *ProductClient) Create() *ProductCreate

Create returns a builder for creating a Product entity.

func (*ProductClient) CreateBulk

func (c *ProductClient) CreateBulk(builders ...*ProductCreate) *ProductCreateBulk

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

func (*ProductClient) Delete

func (c *ProductClient) Delete() *ProductDelete

Delete returns a delete builder for Product.

func (*ProductClient) DeleteOne

func (c *ProductClient) DeleteOne(pr *Product) *ProductDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*ProductClient) DeleteOneID

func (c *ProductClient) DeleteOneID(id uint32) *ProductDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*ProductClient) Get

func (c *ProductClient) Get(ctx context.Context, id uint32) (*Product, error)

Get returns a Product entity by its id.

func (*ProductClient) GetX

func (c *ProductClient) GetX(ctx context.Context, id uint32) *Product

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

func (*ProductClient) Hooks

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

Hooks returns the client hooks.

func (*ProductClient) Intercept

func (c *ProductClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `product.Intercept(f(g(h())))`.

func (*ProductClient) Interceptors

func (c *ProductClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*ProductClient) Query

func (c *ProductClient) Query() *ProductQuery

Query returns a query builder for Product.

func (*ProductClient) Update

func (c *ProductClient) Update() *ProductUpdate

Update returns an update builder for Product.

func (*ProductClient) UpdateOne

func (c *ProductClient) UpdateOne(pr *Product) *ProductUpdateOne

UpdateOne returns an update builder for the given entity.

func (*ProductClient) UpdateOneID

func (c *ProductClient) UpdateOneID(id uint32) *ProductUpdateOne

UpdateOneID returns an update builder for the given id.

func (*ProductClient) Use

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

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

type ProductCreate

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

ProductCreate is the builder for creating a Product entity.

func (*ProductCreate) Exec

func (pc *ProductCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*ProductCreate) ExecX

func (pc *ProductCreate) ExecX(ctx context.Context)

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

func (*ProductCreate) Mutation

func (pc *ProductCreate) Mutation() *ProductMutation

Mutation returns the ProductMutation object of the builder.

func (*ProductCreate) Save

func (pc *ProductCreate) Save(ctx context.Context) (*Product, error)

Save creates the Product in the database.

func (*ProductCreate) SaveX

func (pc *ProductCreate) SaveX(ctx context.Context) *Product

SaveX calls Save and panics if Save returns an error.

func (*ProductCreate) SetCreated

func (pc *ProductCreate) SetCreated(t time.Time) *ProductCreate

SetCreated sets the "created" field.

func (*ProductCreate) SetDetail

func (pc *ProductCreate) SetDetail(s string) *ProductCreate

SetDetail sets the "detail" field.

func (*ProductCreate) SetDetailJa

func (pc *ProductCreate) SetDetailJa(s string) *ProductCreate

SetDetailJa sets the "detail_ja" field.

func (*ProductCreate) SetDevTime

func (pc *ProductCreate) SetDevTime(t time.Time) *ProductCreate

SetDevTime sets the "dev_time" field.

func (*ProductCreate) SetGithubURL

func (pc *ProductCreate) SetGithubURL(s string) *ProductCreate

SetGithubURL sets the "github_url" field.

func (*ProductCreate) SetID

func (pc *ProductCreate) SetID(u uint32) *ProductCreate

SetID sets the "id" field.

func (*ProductCreate) SetModified

func (pc *ProductCreate) SetModified(t time.Time) *ProductCreate

SetModified sets the "modified" field.

func (*ProductCreate) SetName

func (pc *ProductCreate) SetName(s string) *ProductCreate

SetName sets the "name" field.

func (*ProductCreate) SetNameJa

func (pc *ProductCreate) SetNameJa(s string) *ProductCreate

SetNameJa sets the "name_ja" field.

func (*ProductCreate) SetNillableCreated

func (pc *ProductCreate) SetNillableCreated(t *time.Time) *ProductCreate

SetNillableCreated sets the "created" field if the given value is not nil.

func (*ProductCreate) SetNillableGithubURL

func (pc *ProductCreate) SetNillableGithubURL(s *string) *ProductCreate

SetNillableGithubURL sets the "github_url" field if the given value is not nil.

func (*ProductCreate) SetNillableModified

func (pc *ProductCreate) SetNillableModified(t *time.Time) *ProductCreate

SetNillableModified sets the "modified" field if the given value is not nil.

func (*ProductCreate) SetNillableThumbnail

func (pc *ProductCreate) SetNillableThumbnail(s *string) *ProductCreate

SetNillableThumbnail sets the "thumbnail" field if the given value is not nil.

func (*ProductCreate) SetSiteURL

func (pc *ProductCreate) SetSiteURL(s string) *ProductCreate

SetSiteURL sets the "site_url" field.

func (*ProductCreate) SetThumbnail

func (pc *ProductCreate) SetThumbnail(s string) *ProductCreate

SetThumbnail sets the "thumbnail" field.

func (*ProductCreate) SetUserID

func (pc *ProductCreate) SetUserID(u uint32) *ProductCreate

SetUserID sets the "user_id" field.

type ProductCreateBulk

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

ProductCreateBulk is the builder for creating many Product entities in bulk.

func (*ProductCreateBulk) Exec

func (pcb *ProductCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*ProductCreateBulk) ExecX

func (pcb *ProductCreateBulk) ExecX(ctx context.Context)

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

func (*ProductCreateBulk) Save

func (pcb *ProductCreateBulk) Save(ctx context.Context) ([]*Product, error)

Save creates the Product entities in the database.

func (*ProductCreateBulk) SaveX

func (pcb *ProductCreateBulk) SaveX(ctx context.Context) []*Product

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

type ProductDelete

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

ProductDelete is the builder for deleting a Product entity.

func (*ProductDelete) Exec

func (pd *ProductDelete) Exec(ctx context.Context) (int, error)

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

func (*ProductDelete) ExecX

func (pd *ProductDelete) ExecX(ctx context.Context) int

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

func (*ProductDelete) Where

func (pd *ProductDelete) Where(ps ...predicate.Product) *ProductDelete

Where appends a list predicates to the ProductDelete builder.

type ProductDeleteOne

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

ProductDeleteOne is the builder for deleting a single Product entity.

func (*ProductDeleteOne) Exec

func (pdo *ProductDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*ProductDeleteOne) ExecX

func (pdo *ProductDeleteOne) ExecX(ctx context.Context)

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

func (*ProductDeleteOne) Where

Where appends a list predicates to the ProductDelete builder.

type ProductGroupBy

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

ProductGroupBy is the group-by builder for Product entities.

func (*ProductGroupBy) Aggregate

func (pgb *ProductGroupBy) Aggregate(fns ...AggregateFunc) *ProductGroupBy

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

func (*ProductGroupBy) Bool

func (s *ProductGroupBy) Bool(ctx context.Context) (_ bool, err error)

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

func (*ProductGroupBy) BoolX

func (s *ProductGroupBy) BoolX(ctx context.Context) bool

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

func (*ProductGroupBy) Bools

func (s *ProductGroupBy) Bools(ctx context.Context) ([]bool, error)

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

func (*ProductGroupBy) BoolsX

func (s *ProductGroupBy) BoolsX(ctx context.Context) []bool

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

func (*ProductGroupBy) Float64

func (s *ProductGroupBy) Float64(ctx context.Context) (_ float64, err error)

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

func (*ProductGroupBy) Float64X

func (s *ProductGroupBy) Float64X(ctx context.Context) float64

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

func (*ProductGroupBy) Float64s

func (s *ProductGroupBy) Float64s(ctx context.Context) ([]float64, error)

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

func (*ProductGroupBy) Float64sX

func (s *ProductGroupBy) Float64sX(ctx context.Context) []float64

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

func (*ProductGroupBy) Int

func (s *ProductGroupBy) Int(ctx context.Context) (_ int, err error)

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

func (*ProductGroupBy) IntX

func (s *ProductGroupBy) IntX(ctx context.Context) int

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

func (*ProductGroupBy) Ints

func (s *ProductGroupBy) Ints(ctx context.Context) ([]int, error)

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

func (*ProductGroupBy) IntsX

func (s *ProductGroupBy) IntsX(ctx context.Context) []int

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

func (*ProductGroupBy) Scan

func (pgb *ProductGroupBy) Scan(ctx context.Context, v any) error

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

func (*ProductGroupBy) ScanX

func (s *ProductGroupBy) ScanX(ctx context.Context, v any)

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

func (*ProductGroupBy) String

func (s *ProductGroupBy) String(ctx context.Context) (_ string, err error)

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

func (*ProductGroupBy) StringX

func (s *ProductGroupBy) StringX(ctx context.Context) string

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

func (*ProductGroupBy) Strings

func (s *ProductGroupBy) Strings(ctx context.Context) ([]string, error)

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

func (*ProductGroupBy) StringsX

func (s *ProductGroupBy) StringsX(ctx context.Context) []string

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

type ProductMutation

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

ProductMutation represents an operation that mutates the Product nodes in the graph.

func (*ProductMutation) AddField

func (m *ProductMutation) 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 (*ProductMutation) AddUserID

func (m *ProductMutation) AddUserID(u int32)

AddUserID adds u to the "user_id" field.

func (*ProductMutation) AddedEdges

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

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

func (*ProductMutation) AddedField

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

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

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

func (*ProductMutation) AddedIDs

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

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

func (*ProductMutation) AddedUserID

func (m *ProductMutation) AddedUserID() (r int32, exists bool)

AddedUserID returns the value that was added to the "user_id" field in this mutation.

func (*ProductMutation) ClearEdge

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

func (m *ProductMutation) 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 (*ProductMutation) ClearGithubURL

func (m *ProductMutation) ClearGithubURL()

ClearGithubURL clears the value of the "github_url" field.

func (*ProductMutation) ClearThumbnail

func (m *ProductMutation) ClearThumbnail()

ClearThumbnail clears the value of the "thumbnail" field.

func (*ProductMutation) ClearedEdges

func (m *ProductMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*ProductMutation) ClearedFields

func (m *ProductMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (ProductMutation) Client

func (m ProductMutation) 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 (*ProductMutation) Created

func (m *ProductMutation) Created() (r time.Time, exists bool)

Created returns the value of the "created" field in the mutation.

func (*ProductMutation) Detail

func (m *ProductMutation) Detail() (r string, exists bool)

Detail returns the value of the "detail" field in the mutation.

func (*ProductMutation) DetailJa

func (m *ProductMutation) DetailJa() (r string, exists bool)

DetailJa returns the value of the "detail_ja" field in the mutation.

func (*ProductMutation) DevTime

func (m *ProductMutation) DevTime() (r time.Time, exists bool)

DevTime returns the value of the "dev_time" field in the mutation.

func (*ProductMutation) EdgeCleared

func (m *ProductMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*ProductMutation) Field

func (m *ProductMutation) 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 (*ProductMutation) FieldCleared

func (m *ProductMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*ProductMutation) Fields

func (m *ProductMutation) 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 (*ProductMutation) GithubURL

func (m *ProductMutation) GithubURL() (r string, exists bool)

GithubURL returns the value of the "github_url" field in the mutation.

func (*ProductMutation) GithubURLCleared

func (m *ProductMutation) GithubURLCleared() bool

GithubURLCleared returns if the "github_url" field was cleared in this mutation.

func (*ProductMutation) ID

func (m *ProductMutation) ID() (id uint32, 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 (*ProductMutation) IDs

func (m *ProductMutation) IDs(ctx context.Context) ([]uint32, error)

IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.

func (*ProductMutation) Modified

func (m *ProductMutation) Modified() (r time.Time, exists bool)

Modified returns the value of the "modified" field in the mutation.

func (*ProductMutation) Name

func (m *ProductMutation) Name() (r string, exists bool)

Name returns the value of the "name" field in the mutation.

func (*ProductMutation) NameJa

func (m *ProductMutation) NameJa() (r string, exists bool)

NameJa returns the value of the "name_ja" field in the mutation.

func (*ProductMutation) OldCreated

func (m *ProductMutation) OldCreated(ctx context.Context) (v time.Time, err error)

OldCreated returns the old "created" field's value of the Product entity. If the Product 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 (*ProductMutation) OldDetail

func (m *ProductMutation) OldDetail(ctx context.Context) (v string, err error)

OldDetail returns the old "detail" field's value of the Product entity. If the Product 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 (*ProductMutation) OldDetailJa

func (m *ProductMutation) OldDetailJa(ctx context.Context) (v string, err error)

OldDetailJa returns the old "detail_ja" field's value of the Product entity. If the Product 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 (*ProductMutation) OldDevTime

func (m *ProductMutation) OldDevTime(ctx context.Context) (v time.Time, err error)

OldDevTime returns the old "dev_time" field's value of the Product entity. If the Product 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 (*ProductMutation) OldField

func (m *ProductMutation) 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 (*ProductMutation) OldGithubURL

func (m *ProductMutation) OldGithubURL(ctx context.Context) (v string, err error)

OldGithubURL returns the old "github_url" field's value of the Product entity. If the Product 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 (*ProductMutation) OldModified

func (m *ProductMutation) OldModified(ctx context.Context) (v time.Time, err error)

OldModified returns the old "modified" field's value of the Product entity. If the Product 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 (*ProductMutation) OldName

func (m *ProductMutation) OldName(ctx context.Context) (v string, err error)

OldName returns the old "name" field's value of the Product entity. If the Product 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 (*ProductMutation) OldNameJa

func (m *ProductMutation) OldNameJa(ctx context.Context) (v string, err error)

OldNameJa returns the old "name_ja" field's value of the Product entity. If the Product 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 (*ProductMutation) OldSiteURL

func (m *ProductMutation) OldSiteURL(ctx context.Context) (v string, err error)

OldSiteURL returns the old "site_url" field's value of the Product entity. If the Product 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 (*ProductMutation) OldThumbnail

func (m *ProductMutation) OldThumbnail(ctx context.Context) (v string, err error)

OldThumbnail returns the old "thumbnail" field's value of the Product entity. If the Product 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 (*ProductMutation) OldUserID

func (m *ProductMutation) OldUserID(ctx context.Context) (v uint32, err error)

OldUserID returns the old "user_id" field's value of the Product entity. If the Product 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 (*ProductMutation) Op

func (m *ProductMutation) Op() Op

Op returns the operation name.

func (*ProductMutation) RemovedEdges

func (m *ProductMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*ProductMutation) RemovedIDs

func (m *ProductMutation) 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 (*ProductMutation) ResetCreated

func (m *ProductMutation) ResetCreated()

ResetCreated resets all changes to the "created" field.

func (*ProductMutation) ResetDetail

func (m *ProductMutation) ResetDetail()

ResetDetail resets all changes to the "detail" field.

func (*ProductMutation) ResetDetailJa

func (m *ProductMutation) ResetDetailJa()

ResetDetailJa resets all changes to the "detail_ja" field.

func (*ProductMutation) ResetDevTime

func (m *ProductMutation) ResetDevTime()

ResetDevTime resets all changes to the "dev_time" field.

func (*ProductMutation) ResetEdge

func (m *ProductMutation) 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 (*ProductMutation) ResetField

func (m *ProductMutation) 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 (*ProductMutation) ResetGithubURL

func (m *ProductMutation) ResetGithubURL()

ResetGithubURL resets all changes to the "github_url" field.

func (*ProductMutation) ResetModified

func (m *ProductMutation) ResetModified()

ResetModified resets all changes to the "modified" field.

func (*ProductMutation) ResetName

func (m *ProductMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*ProductMutation) ResetNameJa

func (m *ProductMutation) ResetNameJa()

ResetNameJa resets all changes to the "name_ja" field.

func (*ProductMutation) ResetSiteURL

func (m *ProductMutation) ResetSiteURL()

ResetSiteURL resets all changes to the "site_url" field.

func (*ProductMutation) ResetThumbnail

func (m *ProductMutation) ResetThumbnail()

ResetThumbnail resets all changes to the "thumbnail" field.

func (*ProductMutation) ResetUserID

func (m *ProductMutation) ResetUserID()

ResetUserID resets all changes to the "user_id" field.

func (*ProductMutation) SetCreated

func (m *ProductMutation) SetCreated(t time.Time)

SetCreated sets the "created" field.

func (*ProductMutation) SetDetail

func (m *ProductMutation) SetDetail(s string)

SetDetail sets the "detail" field.

func (*ProductMutation) SetDetailJa

func (m *ProductMutation) SetDetailJa(s string)

SetDetailJa sets the "detail_ja" field.

func (*ProductMutation) SetDevTime

func (m *ProductMutation) SetDevTime(t time.Time)

SetDevTime sets the "dev_time" field.

func (*ProductMutation) SetField

func (m *ProductMutation) 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 (*ProductMutation) SetGithubURL

func (m *ProductMutation) SetGithubURL(s string)

SetGithubURL sets the "github_url" field.

func (*ProductMutation) SetID

func (m *ProductMutation) SetID(id uint32)

SetID sets the value of the id field. Note that this operation is only accepted on creation of Product entities.

func (*ProductMutation) SetModified

func (m *ProductMutation) SetModified(t time.Time)

SetModified sets the "modified" field.

func (*ProductMutation) SetName

func (m *ProductMutation) SetName(s string)

SetName sets the "name" field.

func (*ProductMutation) SetNameJa

func (m *ProductMutation) SetNameJa(s string)

SetNameJa sets the "name_ja" field.

func (*ProductMutation) SetOp

func (m *ProductMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*ProductMutation) SetSiteURL

func (m *ProductMutation) SetSiteURL(s string)

SetSiteURL sets the "site_url" field.

func (*ProductMutation) SetThumbnail

func (m *ProductMutation) SetThumbnail(s string)

SetThumbnail sets the "thumbnail" field.

func (*ProductMutation) SetUserID

func (m *ProductMutation) SetUserID(u uint32)

SetUserID sets the "user_id" field.

func (*ProductMutation) SiteURL

func (m *ProductMutation) SiteURL() (r string, exists bool)

SiteURL returns the value of the "site_url" field in the mutation.

func (*ProductMutation) Thumbnail

func (m *ProductMutation) Thumbnail() (r string, exists bool)

Thumbnail returns the value of the "thumbnail" field in the mutation.

func (*ProductMutation) ThumbnailCleared

func (m *ProductMutation) ThumbnailCleared() bool

ThumbnailCleared returns if the "thumbnail" field was cleared in this mutation.

func (ProductMutation) Tx

func (m ProductMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*ProductMutation) Type

func (m *ProductMutation) Type() string

Type returns the node type of this mutation (Product).

func (*ProductMutation) UserID

func (m *ProductMutation) UserID() (r uint32, exists bool)

UserID returns the value of the "user_id" field in the mutation.

func (*ProductMutation) Where

func (m *ProductMutation) Where(ps ...predicate.Product)

Where appends a list predicates to the ProductMutation builder.

func (*ProductMutation) WhereP

func (m *ProductMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the ProductMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type ProductQuery

type ProductQuery struct {
	// contains filtered or unexported fields
}

ProductQuery is the builder for querying Product entities.

func (*ProductQuery) Aggregate

func (pq *ProductQuery) Aggregate(fns ...AggregateFunc) *ProductSelect

Aggregate returns a ProductSelect configured with the given aggregations.

func (*ProductQuery) All

func (pq *ProductQuery) All(ctx context.Context) ([]*Product, error)

All executes the query and returns a list of Products.

func (*ProductQuery) AllX

func (pq *ProductQuery) AllX(ctx context.Context) []*Product

AllX is like All, but panics if an error occurs.

func (*ProductQuery) Clone

func (pq *ProductQuery) Clone() *ProductQuery

Clone returns a duplicate of the ProductQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*ProductQuery) Count

func (pq *ProductQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*ProductQuery) CountX

func (pq *ProductQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*ProductQuery) Exist

func (pq *ProductQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*ProductQuery) ExistX

func (pq *ProductQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*ProductQuery) First

func (pq *ProductQuery) First(ctx context.Context) (*Product, error)

First returns the first Product entity from the query. Returns a *NotFoundError when no Product was found.

func (*ProductQuery) FirstID

func (pq *ProductQuery) FirstID(ctx context.Context) (id uint32, err error)

FirstID returns the first Product ID from the query. Returns a *NotFoundError when no Product ID was found.

func (*ProductQuery) FirstIDX

func (pq *ProductQuery) FirstIDX(ctx context.Context) uint32

FirstIDX is like FirstID, but panics if an error occurs.

func (*ProductQuery) FirstX

func (pq *ProductQuery) FirstX(ctx context.Context) *Product

FirstX is like First, but panics if an error occurs.

func (*ProductQuery) GroupBy

func (pq *ProductQuery) GroupBy(field string, fields ...string) *ProductGroupBy

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 {
	UserID uint32 `json:"user_id,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Product.Query().
	GroupBy(product.FieldUserID).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*ProductQuery) IDs

func (pq *ProductQuery) IDs(ctx context.Context) (ids []uint32, err error)

IDs executes the query and returns a list of Product IDs.

func (*ProductQuery) IDsX

func (pq *ProductQuery) IDsX(ctx context.Context) []uint32

IDsX is like IDs, but panics if an error occurs.

func (*ProductQuery) Limit

func (pq *ProductQuery) Limit(limit int) *ProductQuery

Limit the number of records to be returned by this query.

func (*ProductQuery) Offset

func (pq *ProductQuery) Offset(offset int) *ProductQuery

Offset to start from.

func (*ProductQuery) Only

func (pq *ProductQuery) Only(ctx context.Context) (*Product, error)

Only returns a single Product entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Product entity is found. Returns a *NotFoundError when no Product entities are found.

func (*ProductQuery) OnlyID

func (pq *ProductQuery) OnlyID(ctx context.Context) (id uint32, err error)

OnlyID is like Only, but returns the only Product ID in the query. Returns a *NotSingularError when more than one Product ID is found. Returns a *NotFoundError when no entities are found.

func (*ProductQuery) OnlyIDX

func (pq *ProductQuery) OnlyIDX(ctx context.Context) uint32

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*ProductQuery) OnlyX

func (pq *ProductQuery) OnlyX(ctx context.Context) *Product

OnlyX is like Only, but panics if an error occurs.

func (*ProductQuery) Order

func (pq *ProductQuery) Order(o ...OrderFunc) *ProductQuery

Order specifies how the records should be ordered.

func (*ProductQuery) Select

func (pq *ProductQuery) Select(fields ...string) *ProductSelect

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 {
	UserID uint32 `json:"user_id,omitempty"`
}

client.Product.Query().
	Select(product.FieldUserID).
	Scan(ctx, &v)

func (*ProductQuery) Unique

func (pq *ProductQuery) Unique(unique bool) *ProductQuery

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 (*ProductQuery) Where

func (pq *ProductQuery) Where(ps ...predicate.Product) *ProductQuery

Where adds a new predicate for the ProductQuery builder.

type ProductSelect

type ProductSelect struct {
	*ProductQuery
	// contains filtered or unexported fields
}

ProductSelect is the builder for selecting fields of Product entities.

func (*ProductSelect) Aggregate

func (ps *ProductSelect) Aggregate(fns ...AggregateFunc) *ProductSelect

Aggregate adds the given aggregation functions to the selector query.

func (*ProductSelect) Bool

func (s *ProductSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*ProductSelect) BoolX

func (s *ProductSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*ProductSelect) Bools

func (s *ProductSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*ProductSelect) BoolsX

func (s *ProductSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*ProductSelect) Float64

func (s *ProductSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*ProductSelect) Float64X

func (s *ProductSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*ProductSelect) Float64s

func (s *ProductSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*ProductSelect) Float64sX

func (s *ProductSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*ProductSelect) Int

func (s *ProductSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*ProductSelect) IntX

func (s *ProductSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*ProductSelect) Ints

func (s *ProductSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*ProductSelect) IntsX

func (s *ProductSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*ProductSelect) Scan

func (ps *ProductSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*ProductSelect) ScanX

func (s *ProductSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*ProductSelect) String

func (s *ProductSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*ProductSelect) StringX

func (s *ProductSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*ProductSelect) Strings

func (s *ProductSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*ProductSelect) StringsX

func (s *ProductSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type ProductUpdate

type ProductUpdate struct {
	// contains filtered or unexported fields
}

ProductUpdate is the builder for updating Product entities.

func (*ProductUpdate) AddUserID

func (pu *ProductUpdate) AddUserID(u int32) *ProductUpdate

AddUserID adds u to the "user_id" field.

func (*ProductUpdate) ClearGithubURL

func (pu *ProductUpdate) ClearGithubURL() *ProductUpdate

ClearGithubURL clears the value of the "github_url" field.

func (*ProductUpdate) ClearThumbnail

func (pu *ProductUpdate) ClearThumbnail() *ProductUpdate

ClearThumbnail clears the value of the "thumbnail" field.

func (*ProductUpdate) Exec

func (pu *ProductUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*ProductUpdate) ExecX

func (pu *ProductUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ProductUpdate) Mutation

func (pu *ProductUpdate) Mutation() *ProductMutation

Mutation returns the ProductMutation object of the builder.

func (*ProductUpdate) Save

func (pu *ProductUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*ProductUpdate) SaveX

func (pu *ProductUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*ProductUpdate) SetCreated

func (pu *ProductUpdate) SetCreated(t time.Time) *ProductUpdate

SetCreated sets the "created" field.

func (*ProductUpdate) SetDetail

func (pu *ProductUpdate) SetDetail(s string) *ProductUpdate

SetDetail sets the "detail" field.

func (*ProductUpdate) SetDetailJa

func (pu *ProductUpdate) SetDetailJa(s string) *ProductUpdate

SetDetailJa sets the "detail_ja" field.

func (*ProductUpdate) SetDevTime

func (pu *ProductUpdate) SetDevTime(t time.Time) *ProductUpdate

SetDevTime sets the "dev_time" field.

func (*ProductUpdate) SetGithubURL

func (pu *ProductUpdate) SetGithubURL(s string) *ProductUpdate

SetGithubURL sets the "github_url" field.

func (*ProductUpdate) SetModified

func (pu *ProductUpdate) SetModified(t time.Time) *ProductUpdate

SetModified sets the "modified" field.

func (*ProductUpdate) SetName

func (pu *ProductUpdate) SetName(s string) *ProductUpdate

SetName sets the "name" field.

func (*ProductUpdate) SetNameJa

func (pu *ProductUpdate) SetNameJa(s string) *ProductUpdate

SetNameJa sets the "name_ja" field.

func (*ProductUpdate) SetNillableCreated

func (pu *ProductUpdate) SetNillableCreated(t *time.Time) *ProductUpdate

SetNillableCreated sets the "created" field if the given value is not nil.

func (*ProductUpdate) SetNillableGithubURL

func (pu *ProductUpdate) SetNillableGithubURL(s *string) *ProductUpdate

SetNillableGithubURL sets the "github_url" field if the given value is not nil.

func (*ProductUpdate) SetNillableThumbnail

func (pu *ProductUpdate) SetNillableThumbnail(s *string) *ProductUpdate

SetNillableThumbnail sets the "thumbnail" field if the given value is not nil.

func (*ProductUpdate) SetSiteURL

func (pu *ProductUpdate) SetSiteURL(s string) *ProductUpdate

SetSiteURL sets the "site_url" field.

func (*ProductUpdate) SetThumbnail

func (pu *ProductUpdate) SetThumbnail(s string) *ProductUpdate

SetThumbnail sets the "thumbnail" field.

func (*ProductUpdate) SetUserID

func (pu *ProductUpdate) SetUserID(u uint32) *ProductUpdate

SetUserID sets the "user_id" field.

func (*ProductUpdate) Where

func (pu *ProductUpdate) Where(ps ...predicate.Product) *ProductUpdate

Where appends a list predicates to the ProductUpdate builder.

type ProductUpdateOne

type ProductUpdateOne struct {
	// contains filtered or unexported fields
}

ProductUpdateOne is the builder for updating a single Product entity.

func (*ProductUpdateOne) AddUserID

func (puo *ProductUpdateOne) AddUserID(u int32) *ProductUpdateOne

AddUserID adds u to the "user_id" field.

func (*ProductUpdateOne) ClearGithubURL

func (puo *ProductUpdateOne) ClearGithubURL() *ProductUpdateOne

ClearGithubURL clears the value of the "github_url" field.

func (*ProductUpdateOne) ClearThumbnail

func (puo *ProductUpdateOne) ClearThumbnail() *ProductUpdateOne

ClearThumbnail clears the value of the "thumbnail" field.

func (*ProductUpdateOne) Exec

func (puo *ProductUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*ProductUpdateOne) ExecX

func (puo *ProductUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ProductUpdateOne) Mutation

func (puo *ProductUpdateOne) Mutation() *ProductMutation

Mutation returns the ProductMutation object of the builder.

func (*ProductUpdateOne) Save

func (puo *ProductUpdateOne) Save(ctx context.Context) (*Product, error)

Save executes the query and returns the updated Product entity.

func (*ProductUpdateOne) SaveX

func (puo *ProductUpdateOne) SaveX(ctx context.Context) *Product

SaveX is like Save, but panics if an error occurs.

func (*ProductUpdateOne) Select

func (puo *ProductUpdateOne) Select(field string, fields ...string) *ProductUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*ProductUpdateOne) SetCreated

func (puo *ProductUpdateOne) SetCreated(t time.Time) *ProductUpdateOne

SetCreated sets the "created" field.

func (*ProductUpdateOne) SetDetail

func (puo *ProductUpdateOne) SetDetail(s string) *ProductUpdateOne

SetDetail sets the "detail" field.

func (*ProductUpdateOne) SetDetailJa

func (puo *ProductUpdateOne) SetDetailJa(s string) *ProductUpdateOne

SetDetailJa sets the "detail_ja" field.

func (*ProductUpdateOne) SetDevTime

func (puo *ProductUpdateOne) SetDevTime(t time.Time) *ProductUpdateOne

SetDevTime sets the "dev_time" field.

func (*ProductUpdateOne) SetGithubURL

func (puo *ProductUpdateOne) SetGithubURL(s string) *ProductUpdateOne

SetGithubURL sets the "github_url" field.

func (*ProductUpdateOne) SetModified

func (puo *ProductUpdateOne) SetModified(t time.Time) *ProductUpdateOne

SetModified sets the "modified" field.

func (*ProductUpdateOne) SetName

func (puo *ProductUpdateOne) SetName(s string) *ProductUpdateOne

SetName sets the "name" field.

func (*ProductUpdateOne) SetNameJa

func (puo *ProductUpdateOne) SetNameJa(s string) *ProductUpdateOne

SetNameJa sets the "name_ja" field.

func (*ProductUpdateOne) SetNillableCreated

func (puo *ProductUpdateOne) SetNillableCreated(t *time.Time) *ProductUpdateOne

SetNillableCreated sets the "created" field if the given value is not nil.

func (*ProductUpdateOne) SetNillableGithubURL

func (puo *ProductUpdateOne) SetNillableGithubURL(s *string) *ProductUpdateOne

SetNillableGithubURL sets the "github_url" field if the given value is not nil.

func (*ProductUpdateOne) SetNillableThumbnail

func (puo *ProductUpdateOne) SetNillableThumbnail(s *string) *ProductUpdateOne

SetNillableThumbnail sets the "thumbnail" field if the given value is not nil.

func (*ProductUpdateOne) SetSiteURL

func (puo *ProductUpdateOne) SetSiteURL(s string) *ProductUpdateOne

SetSiteURL sets the "site_url" field.

func (*ProductUpdateOne) SetThumbnail

func (puo *ProductUpdateOne) SetThumbnail(s string) *ProductUpdateOne

SetThumbnail sets the "thumbnail" field.

func (*ProductUpdateOne) SetUserID

func (puo *ProductUpdateOne) SetUserID(u uint32) *ProductUpdateOne

SetUserID sets the "user_id" field.

func (*ProductUpdateOne) Where

Where appends a list predicates to the ProductUpdate builder.

type Products

type Products []*Product

Products is a parsable slice of Product.

type Querier

type Querier = ent.Querier

ent aliases to avoid import conflicts in user's code.

type QuerierFunc

type QuerierFunc = ent.QuerierFunc

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 QueryContext

type QueryContext = ent.QueryContext

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(ctx context.Context, tx *ent.Tx) error {
		// Do some stuff before.
		if err := next.Rollback(ctx, tx); err != nil {
			return err
		}
		// Do some stuff after.
		return nil
	})
}

type Rollbacker

type Rollbacker interface {
	Rollback(context.Context, *Tx) error
}

Rollbacker is the interface that wraps the Rollback method.

type Session

type Session struct {

	// ID of the ent.
	ID uuid.UUID `json:"id,omitempty"`
	// UserID holds the value of the "user_id" field.
	UserID uint32 `json:"user_id,omitempty"`
	// Created holds the value of the "created" field.
	Created time.Time `json:"created,omitempty"`
	// Period holds the value of the "period" field.
	Period time.Time `json:"period,omitempty"`
	// contains filtered or unexported fields
}

Session is the model entity for the Session schema.

func (*Session) String

func (s *Session) String() string

String implements the fmt.Stringer.

func (*Session) Unwrap

func (s *Session) Unwrap() *Session

Unwrap unwraps the Session 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 (*Session) Update

func (s *Session) Update() *SessionUpdateOne

Update returns a builder for updating this Session. Note that you need to call Session.Unwrap() before calling this method if this Session was returned from a transaction, and the transaction was committed or rolled back.

type SessionClient

type SessionClient struct {
	// contains filtered or unexported fields
}

SessionClient is a client for the Session schema.

func NewSessionClient

func NewSessionClient(c config) *SessionClient

NewSessionClient returns a client for the Session from the given config.

func (*SessionClient) Create

func (c *SessionClient) Create() *SessionCreate

Create returns a builder for creating a Session entity.

func (*SessionClient) CreateBulk

func (c *SessionClient) CreateBulk(builders ...*SessionCreate) *SessionCreateBulk

CreateBulk returns a builder for creating a bulk of Session entities.

func (*SessionClient) Delete

func (c *SessionClient) Delete() *SessionDelete

Delete returns a delete builder for Session.

func (*SessionClient) DeleteOne

func (c *SessionClient) DeleteOne(s *Session) *SessionDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*SessionClient) DeleteOneID

func (c *SessionClient) DeleteOneID(id uuid.UUID) *SessionDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*SessionClient) Get

func (c *SessionClient) Get(ctx context.Context, id uuid.UUID) (*Session, error)

Get returns a Session entity by its id.

func (*SessionClient) GetX

func (c *SessionClient) GetX(ctx context.Context, id uuid.UUID) *Session

GetX is like Get, but panics if an error occurs.

func (*SessionClient) Hooks

func (c *SessionClient) Hooks() []Hook

Hooks returns the client hooks.

func (*SessionClient) Intercept

func (c *SessionClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `session.Intercept(f(g(h())))`.

func (*SessionClient) Interceptors

func (c *SessionClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*SessionClient) Query

func (c *SessionClient) Query() *SessionQuery

Query returns a query builder for Session.

func (*SessionClient) Update

func (c *SessionClient) Update() *SessionUpdate

Update returns an update builder for Session.

func (*SessionClient) UpdateOne

func (c *SessionClient) UpdateOne(s *Session) *SessionUpdateOne

UpdateOne returns an update builder for the given entity.

func (*SessionClient) UpdateOneID

func (c *SessionClient) UpdateOneID(id uuid.UUID) *SessionUpdateOne

UpdateOneID returns an update builder for the given id.

func (*SessionClient) Use

func (c *SessionClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `session.Hooks(f(g(h())))`.

type SessionCreate

type SessionCreate struct {
	// contains filtered or unexported fields
}

SessionCreate is the builder for creating a Session entity.

func (*SessionCreate) Exec

func (sc *SessionCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*SessionCreate) ExecX

func (sc *SessionCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*SessionCreate) Mutation

func (sc *SessionCreate) Mutation() *SessionMutation

Mutation returns the SessionMutation object of the builder.

func (*SessionCreate) Save

func (sc *SessionCreate) Save(ctx context.Context) (*Session, error)

Save creates the Session in the database.

func (*SessionCreate) SaveX

func (sc *SessionCreate) SaveX(ctx context.Context) *Session

SaveX calls Save and panics if Save returns an error.

func (*SessionCreate) SetCreated

func (sc *SessionCreate) SetCreated(t time.Time) *SessionCreate

SetCreated sets the "created" field.

func (*SessionCreate) SetID

func (sc *SessionCreate) SetID(u uuid.UUID) *SessionCreate

SetID sets the "id" field.

func (*SessionCreate) SetNillableCreated

func (sc *SessionCreate) SetNillableCreated(t *time.Time) *SessionCreate

SetNillableCreated sets the "created" field if the given value is not nil.

func (*SessionCreate) SetNillableID

func (sc *SessionCreate) SetNillableID(u *uuid.UUID) *SessionCreate

SetNillableID sets the "id" field if the given value is not nil.

func (*SessionCreate) SetPeriod

func (sc *SessionCreate) SetPeriod(t time.Time) *SessionCreate

SetPeriod sets the "period" field.

func (*SessionCreate) SetUserID

func (sc *SessionCreate) SetUserID(u uint32) *SessionCreate

SetUserID sets the "user_id" field.

type SessionCreateBulk

type SessionCreateBulk struct {
	// contains filtered or unexported fields
}

SessionCreateBulk is the builder for creating many Session entities in bulk.

func (*SessionCreateBulk) Exec

func (scb *SessionCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*SessionCreateBulk) ExecX

func (scb *SessionCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*SessionCreateBulk) Save

func (scb *SessionCreateBulk) Save(ctx context.Context) ([]*Session, error)

Save creates the Session entities in the database.

func (*SessionCreateBulk) SaveX

func (scb *SessionCreateBulk) SaveX(ctx context.Context) []*Session

SaveX is like Save, but panics if an error occurs.

type SessionDelete

type SessionDelete struct {
	// contains filtered or unexported fields
}

SessionDelete is the builder for deleting a Session entity.

func (*SessionDelete) Exec

func (sd *SessionDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*SessionDelete) ExecX

func (sd *SessionDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*SessionDelete) Where

func (sd *SessionDelete) Where(ps ...predicate.Session) *SessionDelete

Where appends a list predicates to the SessionDelete builder.

type SessionDeleteOne

type SessionDeleteOne struct {
	// contains filtered or unexported fields
}

SessionDeleteOne is the builder for deleting a single Session entity.

func (*SessionDeleteOne) Exec

func (sdo *SessionDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*SessionDeleteOne) ExecX

func (sdo *SessionDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*SessionDeleteOne) Where

Where appends a list predicates to the SessionDelete builder.

type SessionGroupBy

type SessionGroupBy struct {
	// contains filtered or unexported fields
}

SessionGroupBy is the group-by builder for Session entities.

func (*SessionGroupBy) Aggregate

func (sgb *SessionGroupBy) Aggregate(fns ...AggregateFunc) *SessionGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*SessionGroupBy) Bool

func (s *SessionGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*SessionGroupBy) BoolX

func (s *SessionGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*SessionGroupBy) Bools

func (s *SessionGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*SessionGroupBy) BoolsX

func (s *SessionGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*SessionGroupBy) Float64

func (s *SessionGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*SessionGroupBy) Float64X

func (s *SessionGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*SessionGroupBy) Float64s

func (s *SessionGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*SessionGroupBy) Float64sX

func (s *SessionGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*SessionGroupBy) Int

func (s *SessionGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*SessionGroupBy) IntX

func (s *SessionGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*SessionGroupBy) Ints

func (s *SessionGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*SessionGroupBy) IntsX

func (s *SessionGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*SessionGroupBy) Scan

func (sgb *SessionGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*SessionGroupBy) ScanX

func (s *SessionGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*SessionGroupBy) String

func (s *SessionGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*SessionGroupBy) StringX

func (s *SessionGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*SessionGroupBy) Strings

func (s *SessionGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*SessionGroupBy) StringsX

func (s *SessionGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type SessionMutation

type SessionMutation struct {
	// contains filtered or unexported fields
}

SessionMutation represents an operation that mutates the Session nodes in the graph.

func (*SessionMutation) AddField

func (m *SessionMutation) 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 (*SessionMutation) AddUserID

func (m *SessionMutation) AddUserID(u int32)

AddUserID adds u to the "user_id" field.

func (*SessionMutation) AddedEdges

func (m *SessionMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*SessionMutation) AddedField

func (m *SessionMutation) 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 (*SessionMutation) AddedFields

func (m *SessionMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*SessionMutation) AddedIDs

func (m *SessionMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*SessionMutation) AddedUserID

func (m *SessionMutation) AddedUserID() (r int32, exists bool)

AddedUserID returns the value that was added to the "user_id" field in this mutation.

func (*SessionMutation) ClearEdge

func (m *SessionMutation) 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 (*SessionMutation) ClearField

func (m *SessionMutation) 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 (*SessionMutation) ClearedEdges

func (m *SessionMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*SessionMutation) ClearedFields

func (m *SessionMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (SessionMutation) Client

func (m SessionMutation) 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 (*SessionMutation) Created

func (m *SessionMutation) Created() (r time.Time, exists bool)

Created returns the value of the "created" field in the mutation.

func (*SessionMutation) EdgeCleared

func (m *SessionMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*SessionMutation) Field

func (m *SessionMutation) 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 (*SessionMutation) FieldCleared

func (m *SessionMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*SessionMutation) Fields

func (m *SessionMutation) 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 (*SessionMutation) ID

func (m *SessionMutation) ID() (id uuid.UUID, 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 (*SessionMutation) IDs

func (m *SessionMutation) IDs(ctx context.Context) ([]uuid.UUID, error)

IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.

func (*SessionMutation) OldCreated

func (m *SessionMutation) OldCreated(ctx context.Context) (v time.Time, err error)

OldCreated returns the old "created" field's value of the Session entity. If the Session 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 (*SessionMutation) OldField

func (m *SessionMutation) 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 (*SessionMutation) OldPeriod

func (m *SessionMutation) OldPeriod(ctx context.Context) (v time.Time, err error)

OldPeriod returns the old "period" field's value of the Session entity. If the Session 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 (*SessionMutation) OldUserID

func (m *SessionMutation) OldUserID(ctx context.Context) (v uint32, err error)

OldUserID returns the old "user_id" field's value of the Session entity. If the Session 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 (*SessionMutation) Op

func (m *SessionMutation) Op() Op

Op returns the operation name.

func (*SessionMutation) Period

func (m *SessionMutation) Period() (r time.Time, exists bool)

Period returns the value of the "period" field in the mutation.

func (*SessionMutation) RemovedEdges

func (m *SessionMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*SessionMutation) RemovedIDs

func (m *SessionMutation) 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 (*SessionMutation) ResetCreated

func (m *SessionMutation) ResetCreated()

ResetCreated resets all changes to the "created" field.

func (*SessionMutation) ResetEdge

func (m *SessionMutation) 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 (*SessionMutation) ResetField

func (m *SessionMutation) 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 (*SessionMutation) ResetPeriod

func (m *SessionMutation) ResetPeriod()

ResetPeriod resets all changes to the "period" field.

func (*SessionMutation) ResetUserID

func (m *SessionMutation) ResetUserID()

ResetUserID resets all changes to the "user_id" field.

func (*SessionMutation) SetCreated

func (m *SessionMutation) SetCreated(t time.Time)

SetCreated sets the "created" field.

func (*SessionMutation) SetField

func (m *SessionMutation) 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 (*SessionMutation) SetID

func (m *SessionMutation) SetID(id uuid.UUID)

SetID sets the value of the id field. Note that this operation is only accepted on creation of Session entities.

func (*SessionMutation) SetOp

func (m *SessionMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*SessionMutation) SetPeriod

func (m *SessionMutation) SetPeriod(t time.Time)

SetPeriod sets the "period" field.

func (*SessionMutation) SetUserID

func (m *SessionMutation) SetUserID(u uint32)

SetUserID sets the "user_id" field.

func (SessionMutation) Tx

func (m SessionMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*SessionMutation) Type

func (m *SessionMutation) Type() string

Type returns the node type of this mutation (Session).

func (*SessionMutation) UserID

func (m *SessionMutation) UserID() (r uint32, exists bool)

UserID returns the value of the "user_id" field in the mutation.

func (*SessionMutation) Where

func (m *SessionMutation) Where(ps ...predicate.Session)

Where appends a list predicates to the SessionMutation builder.

func (*SessionMutation) WhereP

func (m *SessionMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the SessionMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type SessionQuery

type SessionQuery struct {
	// contains filtered or unexported fields
}

SessionQuery is the builder for querying Session entities.

func (*SessionQuery) Aggregate

func (sq *SessionQuery) Aggregate(fns ...AggregateFunc) *SessionSelect

Aggregate returns a SessionSelect configured with the given aggregations.

func (*SessionQuery) All

func (sq *SessionQuery) All(ctx context.Context) ([]*Session, error)

All executes the query and returns a list of Sessions.

func (*SessionQuery) AllX

func (sq *SessionQuery) AllX(ctx context.Context) []*Session

AllX is like All, but panics if an error occurs.

func (*SessionQuery) Clone

func (sq *SessionQuery) Clone() *SessionQuery

Clone returns a duplicate of the SessionQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*SessionQuery) Count

func (sq *SessionQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*SessionQuery) CountX

func (sq *SessionQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*SessionQuery) Exist

func (sq *SessionQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*SessionQuery) ExistX

func (sq *SessionQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*SessionQuery) First

func (sq *SessionQuery) First(ctx context.Context) (*Session, error)

First returns the first Session entity from the query. Returns a *NotFoundError when no Session was found.

func (*SessionQuery) FirstID

func (sq *SessionQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

FirstID returns the first Session ID from the query. Returns a *NotFoundError when no Session ID was found.

func (*SessionQuery) FirstIDX

func (sq *SessionQuery) FirstIDX(ctx context.Context) uuid.UUID

FirstIDX is like FirstID, but panics if an error occurs.

func (*SessionQuery) FirstX

func (sq *SessionQuery) FirstX(ctx context.Context) *Session

FirstX is like First, but panics if an error occurs.

func (*SessionQuery) GroupBy

func (sq *SessionQuery) GroupBy(field string, fields ...string) *SessionGroupBy

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 {
	UserID uint32 `json:"user_id,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Session.Query().
	GroupBy(session.FieldUserID).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*SessionQuery) IDs

func (sq *SessionQuery) IDs(ctx context.Context) (ids []uuid.UUID, err error)

IDs executes the query and returns a list of Session IDs.

func (*SessionQuery) IDsX

func (sq *SessionQuery) IDsX(ctx context.Context) []uuid.UUID

IDsX is like IDs, but panics if an error occurs.

func (*SessionQuery) Limit

func (sq *SessionQuery) Limit(limit int) *SessionQuery

Limit the number of records to be returned by this query.

func (*SessionQuery) Offset

func (sq *SessionQuery) Offset(offset int) *SessionQuery

Offset to start from.

func (*SessionQuery) Only

func (sq *SessionQuery) Only(ctx context.Context) (*Session, error)

Only returns a single Session entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Session entity is found. Returns a *NotFoundError when no Session entities are found.

func (*SessionQuery) OnlyID

func (sq *SessionQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

OnlyID is like Only, but returns the only Session ID in the query. Returns a *NotSingularError when more than one Session ID is found. Returns a *NotFoundError when no entities are found.

func (*SessionQuery) OnlyIDX

func (sq *SessionQuery) OnlyIDX(ctx context.Context) uuid.UUID

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*SessionQuery) OnlyX

func (sq *SessionQuery) OnlyX(ctx context.Context) *Session

OnlyX is like Only, but panics if an error occurs.

func (*SessionQuery) Order

func (sq *SessionQuery) Order(o ...OrderFunc) *SessionQuery

Order specifies how the records should be ordered.

func (*SessionQuery) Select

func (sq *SessionQuery) Select(fields ...string) *SessionSelect

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 {
	UserID uint32 `json:"user_id,omitempty"`
}

client.Session.Query().
	Select(session.FieldUserID).
	Scan(ctx, &v)

func (*SessionQuery) Unique

func (sq *SessionQuery) Unique(unique bool) *SessionQuery

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 (*SessionQuery) Where

func (sq *SessionQuery) Where(ps ...predicate.Session) *SessionQuery

Where adds a new predicate for the SessionQuery builder.

type SessionSelect

type SessionSelect struct {
	*SessionQuery
	// contains filtered or unexported fields
}

SessionSelect is the builder for selecting fields of Session entities.

func (*SessionSelect) Aggregate

func (ss *SessionSelect) Aggregate(fns ...AggregateFunc) *SessionSelect

Aggregate adds the given aggregation functions to the selector query.

func (*SessionSelect) Bool

func (s *SessionSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*SessionSelect) BoolX

func (s *SessionSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*SessionSelect) Bools

func (s *SessionSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*SessionSelect) BoolsX

func (s *SessionSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*SessionSelect) Float64

func (s *SessionSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*SessionSelect) Float64X

func (s *SessionSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*SessionSelect) Float64s

func (s *SessionSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*SessionSelect) Float64sX

func (s *SessionSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*SessionSelect) Int

func (s *SessionSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*SessionSelect) IntX

func (s *SessionSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*SessionSelect) Ints

func (s *SessionSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*SessionSelect) IntsX

func (s *SessionSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*SessionSelect) Scan

func (ss *SessionSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*SessionSelect) ScanX

func (s *SessionSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*SessionSelect) String

func (s *SessionSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*SessionSelect) StringX

func (s *SessionSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*SessionSelect) Strings

func (s *SessionSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*SessionSelect) StringsX

func (s *SessionSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type SessionUpdate

type SessionUpdate struct {
	// contains filtered or unexported fields
}

SessionUpdate is the builder for updating Session entities.

func (*SessionUpdate) AddUserID

func (su *SessionUpdate) AddUserID(u int32) *SessionUpdate

AddUserID adds u to the "user_id" field.

func (*SessionUpdate) Exec

func (su *SessionUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*SessionUpdate) ExecX

func (su *SessionUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*SessionUpdate) Mutation

func (su *SessionUpdate) Mutation() *SessionMutation

Mutation returns the SessionMutation object of the builder.

func (*SessionUpdate) Save

func (su *SessionUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*SessionUpdate) SaveX

func (su *SessionUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*SessionUpdate) SetCreated

func (su *SessionUpdate) SetCreated(t time.Time) *SessionUpdate

SetCreated sets the "created" field.

func (*SessionUpdate) SetNillableCreated

func (su *SessionUpdate) SetNillableCreated(t *time.Time) *SessionUpdate

SetNillableCreated sets the "created" field if the given value is not nil.

func (*SessionUpdate) SetPeriod

func (su *SessionUpdate) SetPeriod(t time.Time) *SessionUpdate

SetPeriod sets the "period" field.

func (*SessionUpdate) SetUserID

func (su *SessionUpdate) SetUserID(u uint32) *SessionUpdate

SetUserID sets the "user_id" field.

func (*SessionUpdate) Where

func (su *SessionUpdate) Where(ps ...predicate.Session) *SessionUpdate

Where appends a list predicates to the SessionUpdate builder.

type SessionUpdateOne

type SessionUpdateOne struct {
	// contains filtered or unexported fields
}

SessionUpdateOne is the builder for updating a single Session entity.

func (*SessionUpdateOne) AddUserID

func (suo *SessionUpdateOne) AddUserID(u int32) *SessionUpdateOne

AddUserID adds u to the "user_id" field.

func (*SessionUpdateOne) Exec

func (suo *SessionUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*SessionUpdateOne) ExecX

func (suo *SessionUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*SessionUpdateOne) Mutation

func (suo *SessionUpdateOne) Mutation() *SessionMutation

Mutation returns the SessionMutation object of the builder.

func (*SessionUpdateOne) Save

func (suo *SessionUpdateOne) Save(ctx context.Context) (*Session, error)

Save executes the query and returns the updated Session entity.

func (*SessionUpdateOne) SaveX

func (suo *SessionUpdateOne) SaveX(ctx context.Context) *Session

SaveX is like Save, but panics if an error occurs.

func (*SessionUpdateOne) Select

func (suo *SessionUpdateOne) Select(field string, fields ...string) *SessionUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*SessionUpdateOne) SetCreated

func (suo *SessionUpdateOne) SetCreated(t time.Time) *SessionUpdateOne

SetCreated sets the "created" field.

func (*SessionUpdateOne) SetNillableCreated

func (suo *SessionUpdateOne) SetNillableCreated(t *time.Time) *SessionUpdateOne

SetNillableCreated sets the "created" field if the given value is not nil.

func (*SessionUpdateOne) SetPeriod

func (suo *SessionUpdateOne) SetPeriod(t time.Time) *SessionUpdateOne

SetPeriod sets the "period" field.

func (*SessionUpdateOne) SetUserID

func (suo *SessionUpdateOne) SetUserID(u uint32) *SessionUpdateOne

SetUserID sets the "user_id" field.

func (*SessionUpdateOne) Where

Where appends a list predicates to the SessionUpdate builder.

type Sessions

type Sessions []*Session

Sessions is a parsable slice of Session.

type TraverseFunc

type TraverseFunc = ent.TraverseFunc

ent aliases to avoid import conflicts in user's code.

type Traverser

type Traverser = ent.Traverser

ent aliases to avoid import conflicts in user's code.

type Tx

type Tx struct {

	// Biography is the client for interacting with the Biography builders.
	Biography *BiographyClient
	// Category is the client for interacting with the Category builders.
	Category *CategoryClient
	// Contact is the client for interacting with the Contact builders.
	Contact *ContactClient
	// ContactDefault is the client for interacting with the ContactDefault builders.
	ContactDefault *ContactDefaultClient
	// Link is the client for interacting with the Link builders.
	Link *LinkClient
	// Location is the client for interacting with the Location builders.
	Location *LocationClient
	// Notice is the client for interacting with the Notice builders.
	Notice *NoticeClient
	// Product is the client for interacting with the Product builders.
	Product *ProductClient
	// Session is the client for interacting with the Session builders.
	Session *SessionClient
	// 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 uint32 `json:"id,omitempty"`
	// GivenName holds the value of the "given_name" field.
	GivenName string `json:"given_name,omitempty"`
	// FamilyName holds the value of the "family_name" field.
	FamilyName string `json:"family_name,omitempty"`
	// GivenNameJa holds the value of the "given_name_ja" field.
	GivenNameJa string `json:"given_name_ja,omitempty"`
	// FamilyNameJa holds the value of the "family_name_ja" field.
	FamilyNameJa string `json:"family_name_ja,omitempty"`
	// UserID holds the value of the "user_id" field.
	UserID string `json:"user_id,omitempty"`
	// Mail holds the value of the "mail" field.
	Mail string `json:"mail,omitempty"`
	// BirthDate holds the value of the "birth_date" field.
	BirthDate time.Time `json:"birth_date,omitempty"`
	// Location holds the value of the "location" field.
	Location string `json:"location,omitempty"`
	// LocationJa holds the value of the "location_ja" field.
	LocationJa string `json:"location_ja,omitempty"`
	// SSOToken holds the value of the "sso_token" field.
	SSOToken string `json:"sso_token,omitempty"`
	// AvatarURL holds the value of the "avatar_url" field.
	AvatarURL string `json:"avatar_url,omitempty"`
	// Selected holds the value of the "selected" field.
	Selected bool `json:"selected,omitempty"`
	// Created holds the value of the "created" field.
	Created time.Time `json:"created,omitempty"`
	// Modified holds the value of the "modified" field.
	Modified time.Time `json:"modified,omitempty"`
	// contains filtered or unexported fields
}

User is the model entity for the User schema.

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 builder for creating a User entity.

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 builder for deleting the given entity.

func (*UserClient) DeleteOneID

func (c *UserClient) DeleteOneID(id uint32) *UserDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*UserClient) Get

func (c *UserClient) Get(ctx context.Context, id uint32) (*User, error)

Get returns a User entity by its id.

func (*UserClient) GetX

func (c *UserClient) GetX(ctx context.Context, id uint32) *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) Intercept

func (c *UserClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `user.Intercept(f(g(h())))`.

func (*UserClient) Interceptors

func (c *UserClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*UserClient) Query

func (c *UserClient) Query() *UserQuery

Query returns a query builder for 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 uint32) *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) 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) SetAvatarURL

func (uc *UserCreate) SetAvatarURL(s string) *UserCreate

SetAvatarURL sets the "avatar_url" field.

func (*UserCreate) SetBirthDate

func (uc *UserCreate) SetBirthDate(t time.Time) *UserCreate

SetBirthDate sets the "birth_date" field.

func (*UserCreate) SetCreated

func (uc *UserCreate) SetCreated(t time.Time) *UserCreate

SetCreated sets the "created" field.

func (*UserCreate) SetFamilyName

func (uc *UserCreate) SetFamilyName(s string) *UserCreate

SetFamilyName sets the "family_name" field.

func (*UserCreate) SetFamilyNameJa

func (uc *UserCreate) SetFamilyNameJa(s string) *UserCreate

SetFamilyNameJa sets the "family_name_ja" field.

func (*UserCreate) SetGivenName

func (uc *UserCreate) SetGivenName(s string) *UserCreate

SetGivenName sets the "given_name" field.

func (*UserCreate) SetGivenNameJa

func (uc *UserCreate) SetGivenNameJa(s string) *UserCreate

SetGivenNameJa sets the "given_name_ja" field.

func (*UserCreate) SetID

func (uc *UserCreate) SetID(u uint32) *UserCreate

SetID sets the "id" field.

func (*UserCreate) SetLocation

func (uc *UserCreate) SetLocation(s string) *UserCreate

SetLocation sets the "location" field.

func (*UserCreate) SetLocationJa

func (uc *UserCreate) SetLocationJa(s string) *UserCreate

SetLocationJa sets the "location_ja" field.

func (*UserCreate) SetMail

func (uc *UserCreate) SetMail(s string) *UserCreate

SetMail sets the "mail" field.

func (*UserCreate) SetModified

func (uc *UserCreate) SetModified(t time.Time) *UserCreate

SetModified sets the "modified" field.

func (*UserCreate) SetNillableAvatarURL

func (uc *UserCreate) SetNillableAvatarURL(s *string) *UserCreate

SetNillableAvatarURL sets the "avatar_url" field if the given value is not nil.

func (*UserCreate) SetNillableCreated

func (uc *UserCreate) SetNillableCreated(t *time.Time) *UserCreate

SetNillableCreated sets the "created" field if the given value is not nil.

func (*UserCreate) SetNillableModified

func (uc *UserCreate) SetNillableModified(t *time.Time) *UserCreate

SetNillableModified sets the "modified" field if the given value is not nil.

func (*UserCreate) SetNillableSelected

func (uc *UserCreate) SetNillableSelected(b *bool) *UserCreate

SetNillableSelected sets the "selected" field if the given value is not nil.

func (*UserCreate) SetSSOToken

func (uc *UserCreate) SetSSOToken(s string) *UserCreate

SetSSOToken sets the "sso_token" field.

func (*UserCreate) SetSelected

func (uc *UserCreate) SetSelected(b bool) *UserCreate

SetSelected sets the "selected" field.

func (*UserCreate) SetUserID

func (uc *UserCreate) SetUserID(s string) *UserCreate

SetUserID sets the "user_id" 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.

func (*UserDeleteOne) Where

func (udo *UserDeleteOne) Where(ps ...predicate.User) *UserDeleteOne

Where appends a list predicates to the UserDelete builder.

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 (s *UserGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*UserGroupBy) BoolX

func (s *UserGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*UserGroupBy) Bools

func (s *UserGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*UserGroupBy) BoolsX

func (s *UserGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*UserGroupBy) Float64

func (s *UserGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*UserGroupBy) Float64X

func (s *UserGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*UserGroupBy) Float64s

func (s *UserGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*UserGroupBy) Float64sX

func (s *UserGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*UserGroupBy) Int

func (s *UserGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*UserGroupBy) IntX

func (s *UserGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*UserGroupBy) Ints

func (s *UserGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*UserGroupBy) IntsX

func (s *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 any) error

Scan applies the selector query and scans the result into the given value.

func (*UserGroupBy) ScanX

func (s *UserGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*UserGroupBy) String

func (s *UserGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*UserGroupBy) StringX

func (s *UserGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*UserGroupBy) Strings

func (s *UserGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*UserGroupBy) StringsX

func (s *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) 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) AvatarURL

func (m *UserMutation) AvatarURL() (r string, exists bool)

AvatarURL returns the value of the "avatar_url" field in the mutation.

func (*UserMutation) AvatarURLCleared

func (m *UserMutation) AvatarURLCleared() bool

AvatarURLCleared returns if the "avatar_url" field was cleared in this mutation.

func (*UserMutation) BirthDate

func (m *UserMutation) BirthDate() (r time.Time, exists bool)

BirthDate returns the value of the "birth_date" field in the mutation.

func (*UserMutation) ClearAvatarURL

func (m *UserMutation) ClearAvatarURL()

ClearAvatarURL clears the value of the "avatar_url" field.

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) Created

func (m *UserMutation) Created() (r time.Time, exists bool)

Created returns the value of the "created" field in the mutation.

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) FamilyName

func (m *UserMutation) FamilyName() (r string, exists bool)

FamilyName returns the value of the "family_name" field in the mutation.

func (*UserMutation) FamilyNameJa

func (m *UserMutation) FamilyNameJa() (r string, exists bool)

FamilyNameJa returns the value of the "family_name_ja" field in the 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) GivenName

func (m *UserMutation) GivenName() (r string, exists bool)

GivenName returns the value of the "given_name" field in the mutation.

func (*UserMutation) GivenNameJa

func (m *UserMutation) GivenNameJa() (r string, exists bool)

GivenNameJa returns the value of the "given_name_ja" field in the mutation.

func (*UserMutation) ID

func (m *UserMutation) ID() (id uint32, 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) IDs

func (m *UserMutation) IDs(ctx context.Context) ([]uint32, error)

IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.

func (*UserMutation) Location

func (m *UserMutation) Location() (r string, exists bool)

Location returns the value of the "location" field in the mutation.

func (*UserMutation) LocationJa

func (m *UserMutation) LocationJa() (r string, exists bool)

LocationJa returns the value of the "location_ja" field in the mutation.

func (*UserMutation) Mail

func (m *UserMutation) Mail() (r string, exists bool)

Mail returns the value of the "mail" field in the mutation.

func (*UserMutation) Modified

func (m *UserMutation) Modified() (r time.Time, exists bool)

Modified returns the value of the "modified" field in the mutation.

func (*UserMutation) OldAvatarURL

func (m *UserMutation) OldAvatarURL(ctx context.Context) (v string, err error)

OldAvatarURL returns the old "avatar_url" 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) OldBirthDate

func (m *UserMutation) OldBirthDate(ctx context.Context) (v time.Time, err error)

OldBirthDate returns the old "birth_date" 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) OldCreated

func (m *UserMutation) OldCreated(ctx context.Context) (v time.Time, err error)

OldCreated returns the old "created" 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) OldFamilyName

func (m *UserMutation) OldFamilyName(ctx context.Context) (v string, err error)

OldFamilyName returns the old "family_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) OldFamilyNameJa

func (m *UserMutation) OldFamilyNameJa(ctx context.Context) (v string, err error)

OldFamilyNameJa returns the old "family_name_ja" 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) OldGivenName

func (m *UserMutation) OldGivenName(ctx context.Context) (v string, err error)

OldGivenName returns the old "given_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) OldGivenNameJa

func (m *UserMutation) OldGivenNameJa(ctx context.Context) (v string, err error)

OldGivenNameJa returns the old "given_name_ja" 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) OldLocation

func (m *UserMutation) OldLocation(ctx context.Context) (v string, err error)

OldLocation returns the old "location" 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) OldLocationJa

func (m *UserMutation) OldLocationJa(ctx context.Context) (v string, err error)

OldLocationJa returns the old "location_ja" 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) OldMail

func (m *UserMutation) OldMail(ctx context.Context) (v string, err error)

OldMail returns the old "mail" 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) OldModified

func (m *UserMutation) OldModified(ctx context.Context) (v time.Time, err error)

OldModified returns the old "modified" 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) OldSSOToken

func (m *UserMutation) OldSSOToken(ctx context.Context) (v string, err error)

OldSSOToken returns the old "sso_token" 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) OldSelected

func (m *UserMutation) OldSelected(ctx context.Context) (v bool, err error)

OldSelected returns the old "selected" 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) OldUserID

func (m *UserMutation) OldUserID(ctx context.Context) (v string, err error)

OldUserID returns the old "user_id" 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) 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) ResetAvatarURL

func (m *UserMutation) ResetAvatarURL()

ResetAvatarURL resets all changes to the "avatar_url" field.

func (*UserMutation) ResetBirthDate

func (m *UserMutation) ResetBirthDate()

ResetBirthDate resets all changes to the "birth_date" field.

func (*UserMutation) ResetCreated

func (m *UserMutation) ResetCreated()

ResetCreated resets all changes to the "created" field.

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) ResetFamilyName

func (m *UserMutation) ResetFamilyName()

ResetFamilyName resets all changes to the "family_name" field.

func (*UserMutation) ResetFamilyNameJa

func (m *UserMutation) ResetFamilyNameJa()

ResetFamilyNameJa resets all changes to the "family_name_ja" field.

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) ResetGivenName

func (m *UserMutation) ResetGivenName()

ResetGivenName resets all changes to the "given_name" field.

func (*UserMutation) ResetGivenNameJa

func (m *UserMutation) ResetGivenNameJa()

ResetGivenNameJa resets all changes to the "given_name_ja" field.

func (*UserMutation) ResetLocation

func (m *UserMutation) ResetLocation()

ResetLocation resets all changes to the "location" field.

func (*UserMutation) ResetLocationJa

func (m *UserMutation) ResetLocationJa()

ResetLocationJa resets all changes to the "location_ja" field.

func (*UserMutation) ResetMail

func (m *UserMutation) ResetMail()

ResetMail resets all changes to the "mail" field.

func (*UserMutation) ResetModified

func (m *UserMutation) ResetModified()

ResetModified resets all changes to the "modified" field.

func (*UserMutation) ResetSSOToken

func (m *UserMutation) ResetSSOToken()

ResetSSOToken resets all changes to the "sso_token" field.

func (*UserMutation) ResetSelected

func (m *UserMutation) ResetSelected()

ResetSelected resets all changes to the "selected" field.

func (*UserMutation) ResetUserID

func (m *UserMutation) ResetUserID()

ResetUserID resets all changes to the "user_id" field.

func (*UserMutation) SSOToken

func (m *UserMutation) SSOToken() (r string, exists bool)

SSOToken returns the value of the "sso_token" field in the mutation.

func (*UserMutation) Selected

func (m *UserMutation) Selected() (r bool, exists bool)

Selected returns the value of the "selected" field in the mutation.

func (*UserMutation) SetAvatarURL

func (m *UserMutation) SetAvatarURL(s string)

SetAvatarURL sets the "avatar_url" field.

func (*UserMutation) SetBirthDate

func (m *UserMutation) SetBirthDate(t time.Time)

SetBirthDate sets the "birth_date" field.

func (*UserMutation) SetCreated

func (m *UserMutation) SetCreated(t time.Time)

SetCreated sets the "created" field.

func (*UserMutation) SetFamilyName

func (m *UserMutation) SetFamilyName(s string)

SetFamilyName sets the "family_name" field.

func (*UserMutation) SetFamilyNameJa

func (m *UserMutation) SetFamilyNameJa(s string)

SetFamilyNameJa sets the "family_name_ja" 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) SetGivenName

func (m *UserMutation) SetGivenName(s string)

SetGivenName sets the "given_name" field.

func (*UserMutation) SetGivenNameJa

func (m *UserMutation) SetGivenNameJa(s string)

SetGivenNameJa sets the "given_name_ja" field.

func (*UserMutation) SetID

func (m *UserMutation) SetID(id uint32)

SetID sets the value of the id field. Note that this operation is only accepted on creation of User entities.

func (*UserMutation) SetLocation

func (m *UserMutation) SetLocation(s string)

SetLocation sets the "location" field.

func (*UserMutation) SetLocationJa

func (m *UserMutation) SetLocationJa(s string)

SetLocationJa sets the "location_ja" field.

func (*UserMutation) SetMail

func (m *UserMutation) SetMail(s string)

SetMail sets the "mail" field.

func (*UserMutation) SetModified

func (m *UserMutation) SetModified(t time.Time)

SetModified sets the "modified" field.

func (*UserMutation) SetOp

func (m *UserMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*UserMutation) SetSSOToken

func (m *UserMutation) SetSSOToken(s string)

SetSSOToken sets the "sso_token" field.

func (*UserMutation) SetSelected

func (m *UserMutation) SetSelected(b bool)

SetSelected sets the "selected" field.

func (*UserMutation) SetUserID

func (m *UserMutation) SetUserID(s string)

SetUserID sets the "user_id" field.

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) UserID

func (m *UserMutation) UserID() (r string, exists bool)

UserID returns the value of the "user_id" field in the mutation.

func (*UserMutation) Where

func (m *UserMutation) Where(ps ...predicate.User)

Where appends a list predicates to the UserMutation builder.

func (*UserMutation) WhereP

func (m *UserMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the UserMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type UserQuery

type UserQuery struct {
	// contains filtered or unexported fields
}

UserQuery is the builder for querying User entities.

func (*UserQuery) Aggregate

func (uq *UserQuery) Aggregate(fns ...AggregateFunc) *UserSelect

Aggregate returns a UserSelect configured with the given aggregations.

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 uint32, 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) uint32

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 {
	GivenName string `json:"given_name,omitempty"`
	Count int `json:"count,omitempty"`
}

client.User.Query().
	GroupBy(user.FieldGivenName).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*UserQuery) IDs

func (uq *UserQuery) IDs(ctx context.Context) (ids []uint32, err error)

IDs executes the query and returns a list of User IDs.

func (*UserQuery) IDsX

func (uq *UserQuery) IDsX(ctx context.Context) []uint32

IDsX is like IDs, but panics if an error occurs.

func (*UserQuery) Limit

func (uq *UserQuery) Limit(limit int) *UserQuery

Limit the number of records to be returned by this query.

func (*UserQuery) Offset

func (uq *UserQuery) Offset(offset int) *UserQuery

Offset to start from.

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 more than one User entity is found. Returns a *NotFoundError when no User entities are found.

func (*UserQuery) OnlyID

func (uq *UserQuery) OnlyID(ctx context.Context) (id uint32, err error)

OnlyID is like Only, but returns the only User ID in the query. Returns a *NotSingularError when more than one User ID is found. Returns a *NotFoundError when no entities are found.

func (*UserQuery) OnlyIDX

func (uq *UserQuery) OnlyIDX(ctx context.Context) uint32

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 specifies how the records should be ordered.

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 {
	GivenName string `json:"given_name,omitempty"`
}

client.User.Query().
	Select(user.FieldGivenName).
	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.

type UserSelect

type UserSelect struct {
	*UserQuery
	// contains filtered or unexported fields
}

UserSelect is the builder for selecting fields of User entities.

func (*UserSelect) Aggregate

func (us *UserSelect) Aggregate(fns ...AggregateFunc) *UserSelect

Aggregate adds the given aggregation functions to the selector query.

func (*UserSelect) Bool

func (s *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 (s *UserSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*UserSelect) Bools

func (s *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 (s *UserSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*UserSelect) Float64

func (s *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 (s *UserSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*UserSelect) Float64s

func (s *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 (s *UserSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*UserSelect) Int

func (s *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 (s *UserSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*UserSelect) Ints

func (s *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 (s *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 any) error

Scan applies the selector query and scans the result into the given value.

func (*UserSelect) ScanX

func (s *UserSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*UserSelect) String

func (s *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 (s *UserSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*UserSelect) Strings

func (s *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 (s *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) ClearAvatarURL

func (uu *UserUpdate) ClearAvatarURL() *UserUpdate

ClearAvatarURL clears the value of the "avatar_url" field.

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) 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) SetAvatarURL

func (uu *UserUpdate) SetAvatarURL(s string) *UserUpdate

SetAvatarURL sets the "avatar_url" field.

func (*UserUpdate) SetBirthDate

func (uu *UserUpdate) SetBirthDate(t time.Time) *UserUpdate

SetBirthDate sets the "birth_date" field.

func (*UserUpdate) SetCreated

func (uu *UserUpdate) SetCreated(t time.Time) *UserUpdate

SetCreated sets the "created" field.

func (*UserUpdate) SetFamilyName

func (uu *UserUpdate) SetFamilyName(s string) *UserUpdate

SetFamilyName sets the "family_name" field.

func (*UserUpdate) SetFamilyNameJa

func (uu *UserUpdate) SetFamilyNameJa(s string) *UserUpdate

SetFamilyNameJa sets the "family_name_ja" field.

func (*UserUpdate) SetGivenName

func (uu *UserUpdate) SetGivenName(s string) *UserUpdate

SetGivenName sets the "given_name" field.

func (*UserUpdate) SetGivenNameJa

func (uu *UserUpdate) SetGivenNameJa(s string) *UserUpdate

SetGivenNameJa sets the "given_name_ja" field.

func (*UserUpdate) SetLocation

func (uu *UserUpdate) SetLocation(s string) *UserUpdate

SetLocation sets the "location" field.

func (*UserUpdate) SetLocationJa

func (uu *UserUpdate) SetLocationJa(s string) *UserUpdate

SetLocationJa sets the "location_ja" field.

func (*UserUpdate) SetMail

func (uu *UserUpdate) SetMail(s string) *UserUpdate

SetMail sets the "mail" field.

func (*UserUpdate) SetModified

func (uu *UserUpdate) SetModified(t time.Time) *UserUpdate

SetModified sets the "modified" field.

func (*UserUpdate) SetNillableAvatarURL

func (uu *UserUpdate) SetNillableAvatarURL(s *string) *UserUpdate

SetNillableAvatarURL sets the "avatar_url" field if the given value is not nil.

func (*UserUpdate) SetNillableCreated

func (uu *UserUpdate) SetNillableCreated(t *time.Time) *UserUpdate

SetNillableCreated sets the "created" field if the given value is not nil.

func (*UserUpdate) SetNillableSelected

func (uu *UserUpdate) SetNillableSelected(b *bool) *UserUpdate

SetNillableSelected sets the "selected" field if the given value is not nil.

func (*UserUpdate) SetSSOToken

func (uu *UserUpdate) SetSSOToken(s string) *UserUpdate

SetSSOToken sets the "sso_token" field.

func (*UserUpdate) SetSelected

func (uu *UserUpdate) SetSelected(b bool) *UserUpdate

SetSelected sets the "selected" field.

func (*UserUpdate) SetUserID

func (uu *UserUpdate) SetUserID(s string) *UserUpdate

SetUserID sets the "user_id" 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) ClearAvatarURL

func (uuo *UserUpdateOne) ClearAvatarURL() *UserUpdateOne

ClearAvatarURL clears the value of the "avatar_url" field.

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) 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) SetAvatarURL

func (uuo *UserUpdateOne) SetAvatarURL(s string) *UserUpdateOne

SetAvatarURL sets the "avatar_url" field.

func (*UserUpdateOne) SetBirthDate

func (uuo *UserUpdateOne) SetBirthDate(t time.Time) *UserUpdateOne

SetBirthDate sets the "birth_date" field.

func (*UserUpdateOne) SetCreated

func (uuo *UserUpdateOne) SetCreated(t time.Time) *UserUpdateOne

SetCreated sets the "created" field.

func (*UserUpdateOne) SetFamilyName

func (uuo *UserUpdateOne) SetFamilyName(s string) *UserUpdateOne

SetFamilyName sets the "family_name" field.

func (*UserUpdateOne) SetFamilyNameJa

func (uuo *UserUpdateOne) SetFamilyNameJa(s string) *UserUpdateOne

SetFamilyNameJa sets the "family_name_ja" field.

func (*UserUpdateOne) SetGivenName

func (uuo *UserUpdateOne) SetGivenName(s string) *UserUpdateOne

SetGivenName sets the "given_name" field.

func (*UserUpdateOne) SetGivenNameJa

func (uuo *UserUpdateOne) SetGivenNameJa(s string) *UserUpdateOne

SetGivenNameJa sets the "given_name_ja" field.

func (*UserUpdateOne) SetLocation

func (uuo *UserUpdateOne) SetLocation(s string) *UserUpdateOne

SetLocation sets the "location" field.

func (*UserUpdateOne) SetLocationJa

func (uuo *UserUpdateOne) SetLocationJa(s string) *UserUpdateOne

SetLocationJa sets the "location_ja" field.

func (*UserUpdateOne) SetMail

func (uuo *UserUpdateOne) SetMail(s string) *UserUpdateOne

SetMail sets the "mail" field.

func (*UserUpdateOne) SetModified

func (uuo *UserUpdateOne) SetModified(t time.Time) *UserUpdateOne

SetModified sets the "modified" field.

func (*UserUpdateOne) SetNillableAvatarURL

func (uuo *UserUpdateOne) SetNillableAvatarURL(s *string) *UserUpdateOne

SetNillableAvatarURL sets the "avatar_url" field if the given value is not nil.

func (*UserUpdateOne) SetNillableCreated

func (uuo *UserUpdateOne) SetNillableCreated(t *time.Time) *UserUpdateOne

SetNillableCreated sets the "created" field if the given value is not nil.

func (*UserUpdateOne) SetNillableSelected

func (uuo *UserUpdateOne) SetNillableSelected(b *bool) *UserUpdateOne

SetNillableSelected sets the "selected" field if the given value is not nil.

func (*UserUpdateOne) SetSSOToken

func (uuo *UserUpdateOne) SetSSOToken(s string) *UserUpdateOne

SetSSOToken sets the "sso_token" field.

func (*UserUpdateOne) SetSelected

func (uuo *UserUpdateOne) SetSelected(b bool) *UserUpdateOne

SetSelected sets the "selected" field.

func (*UserUpdateOne) SetUserID

func (uuo *UserUpdateOne) SetUserID(s string) *UserUpdateOne

SetUserID sets the "user_id" field.

func (*UserUpdateOne) Where

func (uuo *UserUpdateOne) Where(ps ...predicate.User) *UserUpdateOne

Where appends a list predicates to the UserUpdate builder.

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 or edge fails.

func (*ValidationError) Error

func (e *ValidationError) Error() string

Error implements the error interface.

func (*ValidationError) Unwrap

func (e *ValidationError) Unwrap() error

Unwrap implements the errors.Wrapper interface.

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