data

package
v0.0.0-...-ef1d3fc Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2024 License: GPL-3.0 Imports: 29 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.
	TypeAuthentication = "Authentication"
	TypeAuthorization  = "Authorization"
	TypePerson         = "Person"
)

Variables

View Source
var DefaultAuthenticationOrder = &AuthenticationOrder{
	Direction: entgql.OrderDirectionAsc,
	Field: &AuthenticationOrderField{
		Value: func(a *Authentication) (ent.Value, error) {
			return a.ID, nil
		},
		column: authentication.FieldID,
		toTerm: authentication.ByID,
		toCursor: func(a *Authentication) Cursor {
			return Cursor{ID: a.ID}
		},
	},
}

DefaultAuthenticationOrder is the default ordering of Authentication.

View Source
var DefaultAuthorizationOrder = &AuthorizationOrder{
	Direction: entgql.OrderDirectionAsc,
	Field: &AuthorizationOrderField{
		Value: func(a *Authorization) (ent.Value, error) {
			return a.ID, nil
		},
		column: authorization.FieldID,
		toTerm: authorization.ByID,
		toCursor: func(a *Authorization) Cursor {
			return Cursor{ID: a.ID}
		},
	},
}

DefaultAuthorizationOrder is the default ordering of Authorization.

View Source
var DefaultPersonOrder = &PersonOrder{
	Direction: entgql.OrderDirectionAsc,
	Field: &PersonOrderField{
		Value: func(pe *Person) (ent.Value, error) {
			return pe.ID, nil
		},
		column: person.FieldID,
		toTerm: person.ByID,
		toCursor: func(pe *Person) Cursor {
			return Cursor{ID: pe.ID}
		},
	},
}

DefaultPersonOrder is the default ordering of Person.

View Source
var ErrEmptyAuthenticationWhereInput = errors.New("data: empty predicate AuthenticationWhereInput")

ErrEmptyAuthenticationWhereInput is returned in case the AuthenticationWhereInput is empty.

View Source
var ErrEmptyAuthorizationWhereInput = errors.New("data: empty predicate AuthorizationWhereInput")

ErrEmptyAuthorizationWhereInput is returned in case the AuthorizationWhereInput is empty.

View Source
var ErrEmptyPersonWhereInput = errors.New("data: empty predicate PersonWhereInput")

ErrEmptyPersonWhereInput is returned in case the PersonWhereInput is empty.

View Source
var ErrTxStarted = errors.New("data: cannot start a transaction within a transaction")

ErrTxStarted is returned when trying to start a new transaction from a transactional client.

Functions

func Asc

func Asc(fields ...string) func(*sql.Selector)

Asc applies the given fields in ASC order.

func Desc

func Desc(fields ...string) func(*sql.Selector)

Desc applies the given fields in DESC order.

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.

func OpenTxFromContext

func OpenTxFromContext(ctx context.Context) (context.Context, driver.Tx, error)

OpenTxFromContext open transactions from client stored in context.

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(data.As(data.Sum(field1), "sum_field1"), (data.As(data.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 Authentication

type Authentication struct {

	// ID of the ent.
	ID uuid.UUID `json:"id,omitempty"`
	// PersonID holds the value of the "person_id" field.
	PersonID uuid.UUID `json:"person_id,omitempty"`
	// Token holds the value of the "token" field.
	Token []byte `json:"token,omitempty" fakesize:"64"`
	// CreatedIP holds the value of the "created_ip" field.
	CreatedIP string `json:"created_ip,omitempty" fake:"{ipv6address}"`
	// LastUsedIP holds the value of the "last_used_ip" field.
	LastUsedIP string `json:"last_used_ip,omitempty" fake:"{ipv6address}"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// LastUsedAt holds the value of the "last_used_at" field.
	LastUsedAt time.Time `json:"last_used_at,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the AuthenticationQuery when eager-loading is set.
	Edges AuthenticationEdges `json:"edges"`
	// contains filtered or unexported fields
}

Authentication is the model entity for the Authentication schema.

func (*Authentication) ExecContext

func (c *Authentication) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*Authentication) IsNode

func (n *Authentication) IsNode()

IsNode implements the Node interface check for GQLGen.

func (*Authentication) Person

func (a *Authentication) Person(ctx context.Context) (*Person, error)

func (*Authentication) QueryContext

func (c *Authentication) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*Authentication) QueryPerson

func (a *Authentication) QueryPerson() *PersonQuery

QueryPerson queries the "person" edge of the Authentication entity.

func (*Authentication) String

func (a *Authentication) String() string

String implements the fmt.Stringer.

func (*Authentication) ToEdge

ToEdge converts Authentication into AuthenticationEdge.

func (*Authentication) TokenEncoded

func (a *Authentication) TokenEncoded() string

func (*Authentication) Unwrap

func (a *Authentication) Unwrap() *Authentication

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

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

func (*Authentication) Value

func (a *Authentication) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the Authentication. This includes values selected through modifiers, order, etc.

type AuthenticationClient

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

AuthenticationClient is a client for the Authentication schema.

func NewAuthenticationClient

func NewAuthenticationClient(c config) *AuthenticationClient

NewAuthenticationClient returns a client for the Authentication from the given config.

func (*AuthenticationClient) Create

Create returns a builder for creating a Authentication entity.

func (*AuthenticationClient) CreateBulk

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

func (*AuthenticationClient) Delete

Delete returns a delete builder for Authentication.

func (*AuthenticationClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*AuthenticationClient) DeleteOneID

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

func (*AuthenticationClient) ExecContext

func (c *AuthenticationClient) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*AuthenticationClient) Get

Get returns a Authentication entity by its id.

func (*AuthenticationClient) GetX

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

func (*AuthenticationClient) Hooks

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

Hooks returns the client hooks.

func (*AuthenticationClient) Intercept

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

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

func (*AuthenticationClient) Interceptors

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

Interceptors returns the client interceptors.

func (*AuthenticationClient) MapCreateBulk

func (c *AuthenticationClient) MapCreateBulk(slice any, setFunc func(*AuthenticationCreate, int)) *AuthenticationCreateBulk

MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.

func (*AuthenticationClient) Query

Query returns a query builder for Authentication.

func (*AuthenticationClient) QueryContext

func (c *AuthenticationClient) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*AuthenticationClient) QueryPerson

func (c *AuthenticationClient) QueryPerson(a *Authentication) *PersonQuery

QueryPerson queries the person edge of a Authentication.

func (*AuthenticationClient) Update

Update returns an update builder for Authentication.

func (*AuthenticationClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*AuthenticationClient) UpdateOneID

UpdateOneID returns an update builder for the given id.

func (*AuthenticationClient) Use

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

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

type AuthenticationConnection

type AuthenticationConnection struct {
	Edges      []*AuthenticationEdge `json:"edges"`
	PageInfo   PageInfo              `json:"pageInfo"`
	TotalCount int                   `json:"totalCount"`
}

AuthenticationConnection is the connection containing edges to Authentication.

type AuthenticationCreate

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

AuthenticationCreate is the builder for creating a Authentication entity.

func (*AuthenticationCreate) Exec

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

Exec executes the query.

func (*AuthenticationCreate) ExecContext

func (c *AuthenticationCreate) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*AuthenticationCreate) ExecX

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

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

func (*AuthenticationCreate) Mutation

Mutation returns the AuthenticationMutation object of the builder.

func (*AuthenticationCreate) QueryContext

func (c *AuthenticationCreate) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*AuthenticationCreate) Save

Save creates the Authentication in the database.

func (*AuthenticationCreate) SaveX

SaveX calls Save and panics if Save returns an error.

func (*AuthenticationCreate) SetCreatedAt

func (ac *AuthenticationCreate) SetCreatedAt(t time.Time) *AuthenticationCreate

SetCreatedAt sets the "created_at" field.

func (*AuthenticationCreate) SetCreatedIP

func (ac *AuthenticationCreate) SetCreatedIP(s string) *AuthenticationCreate

SetCreatedIP sets the "created_ip" field.

func (*AuthenticationCreate) SetID

SetID sets the "id" field.

func (*AuthenticationCreate) SetLastUsedAt

func (ac *AuthenticationCreate) SetLastUsedAt(t time.Time) *AuthenticationCreate

SetLastUsedAt sets the "last_used_at" field.

func (*AuthenticationCreate) SetLastUsedIP

func (ac *AuthenticationCreate) SetLastUsedIP(s string) *AuthenticationCreate

SetLastUsedIP sets the "last_used_ip" field.

func (*AuthenticationCreate) SetNillableCreatedAt

func (ac *AuthenticationCreate) SetNillableCreatedAt(t *time.Time) *AuthenticationCreate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*AuthenticationCreate) SetNillableLastUsedAt

func (ac *AuthenticationCreate) SetNillableLastUsedAt(t *time.Time) *AuthenticationCreate

SetNillableLastUsedAt sets the "last_used_at" field if the given value is not nil.

func (*AuthenticationCreate) SetPerson

SetPerson sets the "person" edge to the Person entity.

func (*AuthenticationCreate) SetPersonID

func (ac *AuthenticationCreate) SetPersonID(u uuid.UUID) *AuthenticationCreate

SetPersonID sets the "person_id" field.

func (*AuthenticationCreate) SetToken

func (ac *AuthenticationCreate) SetToken(b []byte) *AuthenticationCreate

SetToken sets the "token" field.

type AuthenticationCreateBulk

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

AuthenticationCreateBulk is the builder for creating many Authentication entities in bulk.

func (*AuthenticationCreateBulk) Exec

Exec executes the query.

func (*AuthenticationCreateBulk) ExecContext

func (c *AuthenticationCreateBulk) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*AuthenticationCreateBulk) ExecX

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

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

func (*AuthenticationCreateBulk) QueryContext

func (c *AuthenticationCreateBulk) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*AuthenticationCreateBulk) Save

Save creates the Authentication entities in the database.

func (*AuthenticationCreateBulk) SaveX

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

type AuthenticationDelete

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

AuthenticationDelete is the builder for deleting a Authentication entity.

func (*AuthenticationDelete) Exec

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

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

func (*AuthenticationDelete) ExecContext

func (c *AuthenticationDelete) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*AuthenticationDelete) ExecX

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

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

func (*AuthenticationDelete) QueryContext

func (c *AuthenticationDelete) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*AuthenticationDelete) Where

Where appends a list predicates to the AuthenticationDelete builder.

type AuthenticationDeleteOne

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

AuthenticationDeleteOne is the builder for deleting a single Authentication entity.

func (*AuthenticationDeleteOne) Exec

Exec executes the deletion query.

func (*AuthenticationDeleteOne) ExecX

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

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

func (*AuthenticationDeleteOne) Where

Where appends a list predicates to the AuthenticationDelete builder.

type AuthenticationEdge

type AuthenticationEdge struct {
	Node   *Authentication `json:"node"`
	Cursor Cursor          `json:"cursor"`
}

AuthenticationEdge is the edge representation of Authentication.

type AuthenticationEdges

type AuthenticationEdges struct {
	// Person holds the value of the person edge.
	Person *Person `json:"person,omitempty"`
	// contains filtered or unexported fields
}

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

func (AuthenticationEdges) PersonOrErr

func (e AuthenticationEdges) PersonOrErr() (*Person, error)

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

type AuthenticationFilter

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

AuthenticationFilter provides a generic filtering capability at runtime for AuthenticationQuery.

func (*AuthenticationFilter) ExecContext

func (c *AuthenticationFilter) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*AuthenticationFilter) QueryContext

func (c *AuthenticationFilter) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*AuthenticationFilter) Where

func (f *AuthenticationFilter) Where(p entql.P)

Where applies the entql predicate on the query filter.

func (*AuthenticationFilter) WhereCreatedAt

func (f *AuthenticationFilter) WhereCreatedAt(p entql.TimeP)

WhereCreatedAt applies the entql time.Time predicate on the created_at field.

func (*AuthenticationFilter) WhereCreatedIP

func (f *AuthenticationFilter) WhereCreatedIP(p entql.StringP)

WhereCreatedIP applies the entql string predicate on the created_ip field.

func (*AuthenticationFilter) WhereHasPerson

func (f *AuthenticationFilter) WhereHasPerson()

WhereHasPerson applies a predicate to check if query has an edge person.

func (*AuthenticationFilter) WhereHasPersonWith

func (f *AuthenticationFilter) WhereHasPersonWith(preds ...predicate.Person)

WhereHasPersonWith applies a predicate to check if query has an edge person with a given conditions (other predicates).

func (*AuthenticationFilter) WhereID

func (f *AuthenticationFilter) WhereID(p entql.ValueP)

WhereID applies the entql [16]byte predicate on the id field.

func (*AuthenticationFilter) WhereLastUsedAt

func (f *AuthenticationFilter) WhereLastUsedAt(p entql.TimeP)

WhereLastUsedAt applies the entql time.Time predicate on the last_used_at field.

func (*AuthenticationFilter) WhereLastUsedIP

func (f *AuthenticationFilter) WhereLastUsedIP(p entql.StringP)

WhereLastUsedIP applies the entql string predicate on the last_used_ip field.

func (*AuthenticationFilter) WherePersonID

func (f *AuthenticationFilter) WherePersonID(p entql.ValueP)

WherePersonID applies the entql [16]byte predicate on the person_id field.

func (*AuthenticationFilter) WhereToken

func (f *AuthenticationFilter) WhereToken(p entql.BytesP)

WhereToken applies the entql []byte predicate on the token field.

type AuthenticationGroupBy

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

AuthenticationGroupBy is the group-by builder for Authentication entities.

func (*AuthenticationGroupBy) Aggregate

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

func (*AuthenticationGroupBy) Bool

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

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

func (*AuthenticationGroupBy) BoolX

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

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

func (*AuthenticationGroupBy) Bools

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

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

func (*AuthenticationGroupBy) BoolsX

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

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

func (*AuthenticationGroupBy) Float64

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

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

func (*AuthenticationGroupBy) Float64X

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

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

func (*AuthenticationGroupBy) Float64s

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

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

func (*AuthenticationGroupBy) Float64sX

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

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

func (*AuthenticationGroupBy) Int

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

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

func (*AuthenticationGroupBy) IntX

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

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

func (*AuthenticationGroupBy) Ints

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

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

func (*AuthenticationGroupBy) IntsX

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

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

func (*AuthenticationGroupBy) Scan

func (agb *AuthenticationGroupBy) Scan(ctx context.Context, v any) error

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

func (*AuthenticationGroupBy) ScanX

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

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

func (*AuthenticationGroupBy) String

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

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

func (*AuthenticationGroupBy) StringX

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

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

func (*AuthenticationGroupBy) Strings

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

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

func (*AuthenticationGroupBy) StringsX

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

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

type AuthenticationMutation

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

AuthenticationMutation represents an operation that mutates the Authentication nodes in the graph.

func (*AuthenticationMutation) AddField

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

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

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

func (*AuthenticationMutation) AddedField

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

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

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

func (*AuthenticationMutation) AddedIDs

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

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

func (*AuthenticationMutation) ClearEdge

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

func (m *AuthenticationMutation) 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 (*AuthenticationMutation) ClearPerson

func (m *AuthenticationMutation) ClearPerson()

ClearPerson clears the "person" edge to the Person entity.

func (*AuthenticationMutation) ClearedEdges

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

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

func (*AuthenticationMutation) ClearedFields

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

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

func (AuthenticationMutation) Client

func (m AuthenticationMutation) 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 (*AuthenticationMutation) CreatedAt

func (m *AuthenticationMutation) CreatedAt() (r time.Time, exists bool)

CreatedAt returns the value of the "created_at" field in the mutation.

func (*AuthenticationMutation) CreatedIP

func (m *AuthenticationMutation) CreatedIP() (r string, exists bool)

CreatedIP returns the value of the "created_ip" field in the mutation.

func (*AuthenticationMutation) EdgeCleared

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

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

func (*AuthenticationMutation) ExecContext

func (c *AuthenticationMutation) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*AuthenticationMutation) Field

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

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

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

func (*AuthenticationMutation) Fields

func (m *AuthenticationMutation) 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 (*AuthenticationMutation) Filter

Filter returns an entql.Where implementation to apply filters on the AuthenticationMutation builder.

func (*AuthenticationMutation) ID

func (m *AuthenticationMutation) 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 (*AuthenticationMutation) 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 (*AuthenticationMutation) LastUsedAt

func (m *AuthenticationMutation) LastUsedAt() (r time.Time, exists bool)

LastUsedAt returns the value of the "last_used_at" field in the mutation.

func (*AuthenticationMutation) LastUsedIP

func (m *AuthenticationMutation) LastUsedIP() (r string, exists bool)

LastUsedIP returns the value of the "last_used_ip" field in the mutation.

func (*AuthenticationMutation) OldCreatedAt

func (m *AuthenticationMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)

OldCreatedAt returns the old "created_at" field's value of the Authentication entity. If the Authentication 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 (*AuthenticationMutation) OldCreatedIP

func (m *AuthenticationMutation) OldCreatedIP(ctx context.Context) (v string, err error)

OldCreatedIP returns the old "created_ip" field's value of the Authentication entity. If the Authentication 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 (*AuthenticationMutation) OldField

func (m *AuthenticationMutation) 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 (*AuthenticationMutation) OldLastUsedAt

func (m *AuthenticationMutation) OldLastUsedAt(ctx context.Context) (v time.Time, err error)

OldLastUsedAt returns the old "last_used_at" field's value of the Authentication entity. If the Authentication 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 (*AuthenticationMutation) OldLastUsedIP

func (m *AuthenticationMutation) OldLastUsedIP(ctx context.Context) (v string, err error)

OldLastUsedIP returns the old "last_used_ip" field's value of the Authentication entity. If the Authentication 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 (*AuthenticationMutation) OldPersonID

func (m *AuthenticationMutation) OldPersonID(ctx context.Context) (v uuid.UUID, err error)

OldPersonID returns the old "person_id" field's value of the Authentication entity. If the Authentication 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 (*AuthenticationMutation) OldToken

func (m *AuthenticationMutation) OldToken(ctx context.Context) (v []byte, err error)

OldToken returns the old "token" field's value of the Authentication entity. If the Authentication 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 (*AuthenticationMutation) Op

func (m *AuthenticationMutation) Op() Op

Op returns the operation name.

func (*AuthenticationMutation) PersonCleared

func (m *AuthenticationMutation) PersonCleared() bool

PersonCleared reports if the "person" edge to the Person entity was cleared.

func (*AuthenticationMutation) PersonID

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

PersonID returns the value of the "person_id" field in the mutation.

func (*AuthenticationMutation) PersonIDs

func (m *AuthenticationMutation) PersonIDs() (ids []uuid.UUID)

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

func (*AuthenticationMutation) QueryContext

func (c *AuthenticationMutation) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*AuthenticationMutation) RemovedEdges

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

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

func (*AuthenticationMutation) RemovedIDs

func (m *AuthenticationMutation) 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 (*AuthenticationMutation) ResetCreatedAt

func (m *AuthenticationMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*AuthenticationMutation) ResetCreatedIP

func (m *AuthenticationMutation) ResetCreatedIP()

ResetCreatedIP resets all changes to the "created_ip" field.

func (*AuthenticationMutation) ResetEdge

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

func (m *AuthenticationMutation) 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 (*AuthenticationMutation) ResetLastUsedAt

func (m *AuthenticationMutation) ResetLastUsedAt()

ResetLastUsedAt resets all changes to the "last_used_at" field.

func (*AuthenticationMutation) ResetLastUsedIP

func (m *AuthenticationMutation) ResetLastUsedIP()

ResetLastUsedIP resets all changes to the "last_used_ip" field.

func (*AuthenticationMutation) ResetPerson

func (m *AuthenticationMutation) ResetPerson()

ResetPerson resets all changes to the "person" edge.

func (*AuthenticationMutation) ResetPersonID

func (m *AuthenticationMutation) ResetPersonID()

ResetPersonID resets all changes to the "person_id" field.

func (*AuthenticationMutation) ResetToken

func (m *AuthenticationMutation) ResetToken()

ResetToken resets all changes to the "token" field.

func (*AuthenticationMutation) SetCreatedAt

func (m *AuthenticationMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" field.

func (*AuthenticationMutation) SetCreatedIP

func (m *AuthenticationMutation) SetCreatedIP(s string)

SetCreatedIP sets the "created_ip" field.

func (*AuthenticationMutation) SetField

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

func (m *AuthenticationMutation) SetID(id uuid.UUID)

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

func (*AuthenticationMutation) SetLastUsedAt

func (m *AuthenticationMutation) SetLastUsedAt(t time.Time)

SetLastUsedAt sets the "last_used_at" field.

func (*AuthenticationMutation) SetLastUsedIP

func (m *AuthenticationMutation) SetLastUsedIP(s string)

SetLastUsedIP sets the "last_used_ip" field.

func (*AuthenticationMutation) SetOp

func (m *AuthenticationMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*AuthenticationMutation) SetPersonID

func (m *AuthenticationMutation) SetPersonID(u uuid.UUID)

SetPersonID sets the "person_id" field.

func (*AuthenticationMutation) SetToken

func (m *AuthenticationMutation) SetToken(b []byte)

SetToken sets the "token" field.

func (*AuthenticationMutation) Token

func (m *AuthenticationMutation) Token() (r []byte, exists bool)

Token returns the value of the "token" field in the mutation.

func (AuthenticationMutation) Tx

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

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

func (*AuthenticationMutation) Type

func (m *AuthenticationMutation) Type() string

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

func (*AuthenticationMutation) Where

Where appends a list predicates to the AuthenticationMutation builder.

func (*AuthenticationMutation) WhereP

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

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

type AuthenticationOrder

type AuthenticationOrder struct {
	Direction OrderDirection            `json:"direction"`
	Field     *AuthenticationOrderField `json:"field"`
}

AuthenticationOrder defines the ordering of Authentication.

type AuthenticationOrderField

type AuthenticationOrderField struct {
	// Value extracts the ordering value from the given Authentication.
	Value func(*Authentication) (ent.Value, error)
	// contains filtered or unexported fields
}

AuthenticationOrderField defines the ordering field of Authentication.

type AuthenticationPaginateOption

type AuthenticationPaginateOption func(*authenticationPager) error

AuthenticationPaginateOption enables pagination customization.

func WithAuthenticationFilter

func WithAuthenticationFilter(filter func(*AuthenticationQuery) (*AuthenticationQuery, error)) AuthenticationPaginateOption

WithAuthenticationFilter configures pagination filter.

func WithAuthenticationOrder

func WithAuthenticationOrder(order *AuthenticationOrder) AuthenticationPaginateOption

WithAuthenticationOrder configures pagination ordering.

type AuthenticationQuery

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

AuthenticationQuery is the builder for querying Authentication entities.

func (*AuthenticationQuery) Aggregate

Aggregate returns a AuthenticationSelect configured with the given aggregations.

func (*AuthenticationQuery) All

All executes the query and returns a list of Authentications.

func (*AuthenticationQuery) AllX

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

func (*AuthenticationQuery) Clone

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

func (*AuthenticationQuery) CollectFields

func (a *AuthenticationQuery) CollectFields(ctx context.Context, satisfies ...string) (*AuthenticationQuery, error)

CollectFields tells the query-builder to eagerly load connected nodes by resolver context.

func (*AuthenticationQuery) Count

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

Count returns the count of the given query.

func (*AuthenticationQuery) CountX

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

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

func (*AuthenticationQuery) ExecContext

func (c *AuthenticationQuery) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*AuthenticationQuery) Exist

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

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

func (*AuthenticationQuery) ExistX

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

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

func (*AuthenticationQuery) Filter

Filter returns a Filter implementation to apply filters on the AuthenticationQuery builder.

func (*AuthenticationQuery) First

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

func (*AuthenticationQuery) FirstID

func (aq *AuthenticationQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

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

func (*AuthenticationQuery) FirstIDX

func (aq *AuthenticationQuery) FirstIDX(ctx context.Context) uuid.UUID

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

func (*AuthenticationQuery) FirstX

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

func (*AuthenticationQuery) GroupBy

func (aq *AuthenticationQuery) GroupBy(field string, fields ...string) *AuthenticationGroupBy

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

client.Authentication.Query().
	GroupBy(authentication.FieldPersonID).
	Aggregate(data.Count()).
	Scan(ctx, &v)

func (*AuthenticationQuery) IDs

func (aq *AuthenticationQuery) IDs(ctx context.Context) (ids []uuid.UUID, err error)

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

func (*AuthenticationQuery) IDsX

func (aq *AuthenticationQuery) IDsX(ctx context.Context) []uuid.UUID

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

func (*AuthenticationQuery) Limit

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

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

func (*AuthenticationQuery) Offset

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

Offset to start from.

func (*AuthenticationQuery) Only

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

func (*AuthenticationQuery) OnlyID

func (aq *AuthenticationQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

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

func (*AuthenticationQuery) OnlyIDX

func (aq *AuthenticationQuery) OnlyIDX(ctx context.Context) uuid.UUID

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

func (*AuthenticationQuery) OnlyX

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

func (*AuthenticationQuery) Order

Order specifies how the records should be ordered.

func (*AuthenticationQuery) Paginate

func (a *AuthenticationQuery) Paginate(
	ctx context.Context, after *Cursor, first *int,
	before *Cursor, last *int, opts ...AuthenticationPaginateOption,
) (*AuthenticationConnection, error)

Paginate executes the query and returns a relay based cursor connection to Authentication.

func (*AuthenticationQuery) QueryContext

func (c *AuthenticationQuery) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*AuthenticationQuery) QueryPerson

func (aq *AuthenticationQuery) QueryPerson() *PersonQuery

QueryPerson chains the current query on the "person" edge.

func (*AuthenticationQuery) Select

func (aq *AuthenticationQuery) Select(fields ...string) *AuthenticationSelect

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

client.Authentication.Query().
	Select(authentication.FieldPersonID).
	Scan(ctx, &v)

func (*AuthenticationQuery) Unique

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

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

Where adds a new predicate for the AuthenticationQuery builder.

func (*AuthenticationQuery) WithPerson

func (aq *AuthenticationQuery) WithPerson(opts ...func(*PersonQuery)) *AuthenticationQuery

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

type AuthenticationSelect

type AuthenticationSelect struct {
	*AuthenticationQuery
	// contains filtered or unexported fields
}

AuthenticationSelect is the builder for selecting fields of Authentication entities.

func (*AuthenticationSelect) Aggregate

Aggregate adds the given aggregation functions to the selector query.

func (*AuthenticationSelect) Bool

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

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

func (*AuthenticationSelect) BoolX

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

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

func (*AuthenticationSelect) Bools

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

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

func (*AuthenticationSelect) BoolsX

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

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

func (AuthenticationSelect) ExecContext

func (c AuthenticationSelect) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*AuthenticationSelect) Float64

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

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

func (*AuthenticationSelect) Float64X

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

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

func (*AuthenticationSelect) Float64s

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

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

func (*AuthenticationSelect) Float64sX

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

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

func (*AuthenticationSelect) Int

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

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

func (*AuthenticationSelect) IntX

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

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

func (*AuthenticationSelect) Ints

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

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

func (*AuthenticationSelect) IntsX

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

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

func (AuthenticationSelect) QueryContext

func (c AuthenticationSelect) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*AuthenticationSelect) Scan

func (as *AuthenticationSelect) Scan(ctx context.Context, v any) error

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

func (*AuthenticationSelect) ScanX

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

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

func (*AuthenticationSelect) String

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

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

func (*AuthenticationSelect) StringX

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

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

func (*AuthenticationSelect) Strings

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

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

func (*AuthenticationSelect) StringsX

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

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

type AuthenticationUpdate

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

AuthenticationUpdate is the builder for updating Authentication entities.

func (*AuthenticationUpdate) Exec

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

Exec executes the query.

func (*AuthenticationUpdate) ExecContext

func (c *AuthenticationUpdate) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*AuthenticationUpdate) ExecX

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

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

func (*AuthenticationUpdate) Mutation

Mutation returns the AuthenticationMutation object of the builder.

func (*AuthenticationUpdate) QueryContext

func (c *AuthenticationUpdate) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*AuthenticationUpdate) Save

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

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

func (*AuthenticationUpdate) SaveX

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

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

func (*AuthenticationUpdate) SetCreatedIP

func (au *AuthenticationUpdate) SetCreatedIP(s string) *AuthenticationUpdate

SetCreatedIP sets the "created_ip" field.

func (*AuthenticationUpdate) SetLastUsedAt

func (au *AuthenticationUpdate) SetLastUsedAt(t time.Time) *AuthenticationUpdate

SetLastUsedAt sets the "last_used_at" field.

func (*AuthenticationUpdate) SetLastUsedIP

func (au *AuthenticationUpdate) SetLastUsedIP(s string) *AuthenticationUpdate

SetLastUsedIP sets the "last_used_ip" field.

func (*AuthenticationUpdate) Where

Where appends a list predicates to the AuthenticationUpdate builder.

type AuthenticationUpdateOne

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

AuthenticationUpdateOne is the builder for updating a single Authentication entity.

func (*AuthenticationUpdateOne) Exec

Exec executes the query on the entity.

func (*AuthenticationUpdateOne) ExecContext

func (c *AuthenticationUpdateOne) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*AuthenticationUpdateOne) ExecX

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

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

func (*AuthenticationUpdateOne) Mutation

Mutation returns the AuthenticationMutation object of the builder.

func (*AuthenticationUpdateOne) QueryContext

func (c *AuthenticationUpdateOne) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*AuthenticationUpdateOne) Save

Save executes the query and returns the updated Authentication entity.

func (*AuthenticationUpdateOne) SaveX

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

func (*AuthenticationUpdateOne) Select

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

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

func (*AuthenticationUpdateOne) SetCreatedIP

SetCreatedIP sets the "created_ip" field.

func (*AuthenticationUpdateOne) SetLastUsedAt

SetLastUsedAt sets the "last_used_at" field.

func (*AuthenticationUpdateOne) SetLastUsedIP

SetLastUsedIP sets the "last_used_ip" field.

func (*AuthenticationUpdateOne) Where

Where appends a list predicates to the AuthenticationUpdate builder.

type AuthenticationWhereInput

type AuthenticationWhereInput struct {
	Predicates []predicate.Authentication  `json:"-"`
	Not        *AuthenticationWhereInput   `json:"not,omitempty"`
	Or         []*AuthenticationWhereInput `json:"or,omitempty"`
	And        []*AuthenticationWhereInput `json:"and,omitempty"`

	// "id" field predicates.
	ID      *uuid.UUID  `json:"id,omitempty"`
	IDNEQ   *uuid.UUID  `json:"idNEQ,omitempty"`
	IDIn    []uuid.UUID `json:"idIn,omitempty"`
	IDNotIn []uuid.UUID `json:"idNotIn,omitempty"`
	IDGT    *uuid.UUID  `json:"idGT,omitempty"`
	IDGTE   *uuid.UUID  `json:"idGTE,omitempty"`
	IDLT    *uuid.UUID  `json:"idLT,omitempty"`
	IDLTE   *uuid.UUID  `json:"idLTE,omitempty"`

	// "person_id" field predicates.
	PersonID      *uuid.UUID  `json:"personID,omitempty"`
	PersonIDNEQ   *uuid.UUID  `json:"personIDNEQ,omitempty"`
	PersonIDIn    []uuid.UUID `json:"personIDIn,omitempty"`
	PersonIDNotIn []uuid.UUID `json:"personIDNotIn,omitempty"`

	// "created_ip" field predicates.
	CreatedIP             *string  `json:"createdIP,omitempty"`
	CreatedIPNEQ          *string  `json:"createdIPNEQ,omitempty"`
	CreatedIPIn           []string `json:"createdIPIn,omitempty"`
	CreatedIPNotIn        []string `json:"createdIPNotIn,omitempty"`
	CreatedIPGT           *string  `json:"createdIPGT,omitempty"`
	CreatedIPGTE          *string  `json:"createdIPGTE,omitempty"`
	CreatedIPLT           *string  `json:"createdIPLT,omitempty"`
	CreatedIPLTE          *string  `json:"createdIPLTE,omitempty"`
	CreatedIPContains     *string  `json:"createdIPContains,omitempty"`
	CreatedIPHasPrefix    *string  `json:"createdIPHasPrefix,omitempty"`
	CreatedIPHasSuffix    *string  `json:"createdIPHasSuffix,omitempty"`
	CreatedIPEqualFold    *string  `json:"createdIPEqualFold,omitempty"`
	CreatedIPContainsFold *string  `json:"createdIPContainsFold,omitempty"`

	// "last_used_ip" field predicates.
	LastUsedIP             *string  `json:"lastUsedIP,omitempty"`
	LastUsedIPNEQ          *string  `json:"lastUsedIPNEQ,omitempty"`
	LastUsedIPIn           []string `json:"lastUsedIPIn,omitempty"`
	LastUsedIPNotIn        []string `json:"lastUsedIPNotIn,omitempty"`
	LastUsedIPGT           *string  `json:"lastUsedIPGT,omitempty"`
	LastUsedIPGTE          *string  `json:"lastUsedIPGTE,omitempty"`
	LastUsedIPLT           *string  `json:"lastUsedIPLT,omitempty"`
	LastUsedIPLTE          *string  `json:"lastUsedIPLTE,omitempty"`
	LastUsedIPContains     *string  `json:"lastUsedIPContains,omitempty"`
	LastUsedIPHasPrefix    *string  `json:"lastUsedIPHasPrefix,omitempty"`
	LastUsedIPHasSuffix    *string  `json:"lastUsedIPHasSuffix,omitempty"`
	LastUsedIPEqualFold    *string  `json:"lastUsedIPEqualFold,omitempty"`
	LastUsedIPContainsFold *string  `json:"lastUsedIPContainsFold,omitempty"`

	// "created_at" field predicates.
	CreatedAt      *time.Time  `json:"createdAt,omitempty"`
	CreatedAtNEQ   *time.Time  `json:"createdAtNEQ,omitempty"`
	CreatedAtIn    []time.Time `json:"createdAtIn,omitempty"`
	CreatedAtNotIn []time.Time `json:"createdAtNotIn,omitempty"`
	CreatedAtGT    *time.Time  `json:"createdAtGT,omitempty"`
	CreatedAtGTE   *time.Time  `json:"createdAtGTE,omitempty"`
	CreatedAtLT    *time.Time  `json:"createdAtLT,omitempty"`
	CreatedAtLTE   *time.Time  `json:"createdAtLTE,omitempty"`

	// "last_used_at" field predicates.
	LastUsedAt      *time.Time  `json:"lastUsedAt,omitempty"`
	LastUsedAtNEQ   *time.Time  `json:"lastUsedAtNEQ,omitempty"`
	LastUsedAtIn    []time.Time `json:"lastUsedAtIn,omitempty"`
	LastUsedAtNotIn []time.Time `json:"lastUsedAtNotIn,omitempty"`
	LastUsedAtGT    *time.Time  `json:"lastUsedAtGT,omitempty"`
	LastUsedAtGTE   *time.Time  `json:"lastUsedAtGTE,omitempty"`
	LastUsedAtLT    *time.Time  `json:"lastUsedAtLT,omitempty"`
	LastUsedAtLTE   *time.Time  `json:"lastUsedAtLTE,omitempty"`

	// "person" edge predicates.
	HasPerson     *bool               `json:"hasPerson,omitempty"`
	HasPersonWith []*PersonWhereInput `json:"hasPersonWith,omitempty"`
}

AuthenticationWhereInput represents a where input for filtering Authentication queries.

func (*AuthenticationWhereInput) AddPredicates

func (i *AuthenticationWhereInput) AddPredicates(predicates ...predicate.Authentication)

AddPredicates adds custom predicates to the where input to be used during the filtering phase.

func (*AuthenticationWhereInput) Filter

Filter applies the AuthenticationWhereInput filter on the AuthenticationQuery builder.

func (*AuthenticationWhereInput) P

P returns a predicate for filtering authentications. An error is returned if the input is empty or invalid.

type Authentications

type Authentications []*Authentication

Authentications is a parsable slice of Authentication.

type Authorization

type Authorization struct {

	// ID of the ent.
	ID uuid.UUID `json:"id,omitempty"`
	// PersonID holds the value of the "person_id" field.
	PersonID uuid.UUID `json:"person_id,omitempty"`
	// Token holds the value of the "token" field.
	Token []byte `json:"token,omitempty" fakesize:"64"`
	// Kind holds the value of the "kind" field.
	Kind authorization.Kind `json:"kind,omitempty" fake:"{randomstring:[email,password]}"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the AuthorizationQuery when eager-loading is set.
	Edges AuthorizationEdges `json:"edges"`
	// contains filtered or unexported fields
}

Authorization is the model entity for the Authorization schema.

func (*Authorization) ExecContext

func (c *Authorization) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*Authorization) IsNode

func (n *Authorization) IsNode()

IsNode implements the Node interface check for GQLGen.

func (*Authorization) Person

func (a *Authorization) Person(ctx context.Context) (*Person, error)

func (*Authorization) QueryContext

func (c *Authorization) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*Authorization) QueryPerson

func (a *Authorization) QueryPerson() *PersonQuery

QueryPerson queries the "person" edge of the Authorization entity.

func (*Authorization) String

func (a *Authorization) String() string

String implements the fmt.Stringer.

func (*Authorization) ToEdge

ToEdge converts Authorization into AuthorizationEdge.

func (*Authorization) TokenEncoded

func (a *Authorization) TokenEncoded() string

func (*Authorization) Unwrap

func (a *Authorization) Unwrap() *Authorization

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

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

func (*Authorization) Value

func (a *Authorization) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the Authorization. This includes values selected through modifiers, order, etc.

type AuthorizationClient

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

AuthorizationClient is a client for the Authorization schema.

func NewAuthorizationClient

func NewAuthorizationClient(c config) *AuthorizationClient

NewAuthorizationClient returns a client for the Authorization from the given config.

func (*AuthorizationClient) Create

Create returns a builder for creating a Authorization entity.

func (*AuthorizationClient) CreateBulk

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

func (*AuthorizationClient) Delete

Delete returns a delete builder for Authorization.

func (*AuthorizationClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*AuthorizationClient) DeleteOneID

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

func (*AuthorizationClient) ExecContext

func (c *AuthorizationClient) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*AuthorizationClient) Get

Get returns a Authorization entity by its id.

func (*AuthorizationClient) GetX

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

func (*AuthorizationClient) Hooks

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

Hooks returns the client hooks.

func (*AuthorizationClient) Intercept

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

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

func (*AuthorizationClient) Interceptors

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

Interceptors returns the client interceptors.

func (*AuthorizationClient) MapCreateBulk

func (c *AuthorizationClient) MapCreateBulk(slice any, setFunc func(*AuthorizationCreate, int)) *AuthorizationCreateBulk

MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.

func (*AuthorizationClient) Query

Query returns a query builder for Authorization.

func (*AuthorizationClient) QueryContext

func (c *AuthorizationClient) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*AuthorizationClient) QueryPerson

func (c *AuthorizationClient) QueryPerson(a *Authorization) *PersonQuery

QueryPerson queries the person edge of a Authorization.

func (*AuthorizationClient) Update

Update returns an update builder for Authorization.

func (*AuthorizationClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*AuthorizationClient) UpdateOneID

UpdateOneID returns an update builder for the given id.

func (*AuthorizationClient) Use

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

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

type AuthorizationConnection

type AuthorizationConnection struct {
	Edges      []*AuthorizationEdge `json:"edges"`
	PageInfo   PageInfo             `json:"pageInfo"`
	TotalCount int                  `json:"totalCount"`
}

AuthorizationConnection is the connection containing edges to Authorization.

type AuthorizationCreate

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

AuthorizationCreate is the builder for creating a Authorization entity.

func (*AuthorizationCreate) Exec

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

Exec executes the query.

func (*AuthorizationCreate) ExecContext

func (c *AuthorizationCreate) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*AuthorizationCreate) ExecX

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

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

func (*AuthorizationCreate) Mutation

Mutation returns the AuthorizationMutation object of the builder.

func (*AuthorizationCreate) QueryContext

func (c *AuthorizationCreate) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*AuthorizationCreate) Save

Save creates the Authorization in the database.

func (*AuthorizationCreate) SaveX

SaveX calls Save and panics if Save returns an error.

func (*AuthorizationCreate) SetCreatedAt

func (ac *AuthorizationCreate) SetCreatedAt(t time.Time) *AuthorizationCreate

SetCreatedAt sets the "created_at" field.

func (*AuthorizationCreate) SetID

SetID sets the "id" field.

func (*AuthorizationCreate) SetKind

SetKind sets the "kind" field.

func (*AuthorizationCreate) SetNillableCreatedAt

func (ac *AuthorizationCreate) SetNillableCreatedAt(t *time.Time) *AuthorizationCreate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*AuthorizationCreate) SetPerson

func (ac *AuthorizationCreate) SetPerson(p *Person) *AuthorizationCreate

SetPerson sets the "person" edge to the Person entity.

func (*AuthorizationCreate) SetPersonID

func (ac *AuthorizationCreate) SetPersonID(u uuid.UUID) *AuthorizationCreate

SetPersonID sets the "person_id" field.

func (*AuthorizationCreate) SetToken

func (ac *AuthorizationCreate) SetToken(b []byte) *AuthorizationCreate

SetToken sets the "token" field.

type AuthorizationCreateBulk

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

AuthorizationCreateBulk is the builder for creating many Authorization entities in bulk.

func (*AuthorizationCreateBulk) Exec

Exec executes the query.

func (*AuthorizationCreateBulk) ExecContext

func (c *AuthorizationCreateBulk) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*AuthorizationCreateBulk) ExecX

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

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

func (*AuthorizationCreateBulk) QueryContext

func (c *AuthorizationCreateBulk) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*AuthorizationCreateBulk) Save

Save creates the Authorization entities in the database.

func (*AuthorizationCreateBulk) SaveX

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

type AuthorizationDelete

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

AuthorizationDelete is the builder for deleting a Authorization entity.

func (*AuthorizationDelete) Exec

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

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

func (*AuthorizationDelete) ExecContext

func (c *AuthorizationDelete) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*AuthorizationDelete) ExecX

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

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

func (*AuthorizationDelete) QueryContext

func (c *AuthorizationDelete) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*AuthorizationDelete) Where

Where appends a list predicates to the AuthorizationDelete builder.

type AuthorizationDeleteOne

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

AuthorizationDeleteOne is the builder for deleting a single Authorization entity.

func (*AuthorizationDeleteOne) Exec

Exec executes the deletion query.

func (*AuthorizationDeleteOne) ExecX

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

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

func (*AuthorizationDeleteOne) Where

Where appends a list predicates to the AuthorizationDelete builder.

type AuthorizationEdge

type AuthorizationEdge struct {
	Node   *Authorization `json:"node"`
	Cursor Cursor         `json:"cursor"`
}

AuthorizationEdge is the edge representation of Authorization.

type AuthorizationEdges

type AuthorizationEdges struct {
	// Person holds the value of the person edge.
	Person *Person `json:"person,omitempty"`
	// contains filtered or unexported fields
}

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

func (AuthorizationEdges) PersonOrErr

func (e AuthorizationEdges) PersonOrErr() (*Person, error)

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

type AuthorizationFilter

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

AuthorizationFilter provides a generic filtering capability at runtime for AuthorizationQuery.

func (*AuthorizationFilter) ExecContext

func (c *AuthorizationFilter) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*AuthorizationFilter) QueryContext

func (c *AuthorizationFilter) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*AuthorizationFilter) Where

func (f *AuthorizationFilter) Where(p entql.P)

Where applies the entql predicate on the query filter.

func (*AuthorizationFilter) WhereCreatedAt

func (f *AuthorizationFilter) WhereCreatedAt(p entql.TimeP)

WhereCreatedAt applies the entql time.Time predicate on the created_at field.

func (*AuthorizationFilter) WhereHasPerson

func (f *AuthorizationFilter) WhereHasPerson()

WhereHasPerson applies a predicate to check if query has an edge person.

func (*AuthorizationFilter) WhereHasPersonWith

func (f *AuthorizationFilter) WhereHasPersonWith(preds ...predicate.Person)

WhereHasPersonWith applies a predicate to check if query has an edge person with a given conditions (other predicates).

func (*AuthorizationFilter) WhereID

func (f *AuthorizationFilter) WhereID(p entql.ValueP)

WhereID applies the entql [16]byte predicate on the id field.

func (*AuthorizationFilter) WhereKind

func (f *AuthorizationFilter) WhereKind(p entql.StringP)

WhereKind applies the entql string predicate on the kind field.

func (*AuthorizationFilter) WherePersonID

func (f *AuthorizationFilter) WherePersonID(p entql.ValueP)

WherePersonID applies the entql [16]byte predicate on the person_id field.

func (*AuthorizationFilter) WhereToken

func (f *AuthorizationFilter) WhereToken(p entql.BytesP)

WhereToken applies the entql []byte predicate on the token field.

type AuthorizationGroupBy

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

AuthorizationGroupBy is the group-by builder for Authorization entities.

func (*AuthorizationGroupBy) Aggregate

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

func (*AuthorizationGroupBy) Bool

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

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

func (*AuthorizationGroupBy) BoolX

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

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

func (*AuthorizationGroupBy) Bools

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

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

func (*AuthorizationGroupBy) BoolsX

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

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

func (*AuthorizationGroupBy) Float64

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

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

func (*AuthorizationGroupBy) Float64X

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

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

func (*AuthorizationGroupBy) Float64s

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

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

func (*AuthorizationGroupBy) Float64sX

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

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

func (*AuthorizationGroupBy) Int

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

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

func (*AuthorizationGroupBy) IntX

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

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

func (*AuthorizationGroupBy) Ints

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

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

func (*AuthorizationGroupBy) IntsX

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

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

func (*AuthorizationGroupBy) Scan

func (agb *AuthorizationGroupBy) Scan(ctx context.Context, v any) error

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

func (*AuthorizationGroupBy) ScanX

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

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

func (*AuthorizationGroupBy) String

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

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

func (*AuthorizationGroupBy) StringX

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

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

func (*AuthorizationGroupBy) Strings

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

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

func (*AuthorizationGroupBy) StringsX

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

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

type AuthorizationMutation

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

AuthorizationMutation represents an operation that mutates the Authorization nodes in the graph.

func (*AuthorizationMutation) AddField

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

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

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

func (*AuthorizationMutation) AddedField

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

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

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

func (*AuthorizationMutation) AddedIDs

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

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

func (*AuthorizationMutation) ClearEdge

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

func (m *AuthorizationMutation) 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 (*AuthorizationMutation) ClearPerson

func (m *AuthorizationMutation) ClearPerson()

ClearPerson clears the "person" edge to the Person entity.

func (*AuthorizationMutation) ClearedEdges

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

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

func (*AuthorizationMutation) ClearedFields

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

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

func (AuthorizationMutation) Client

func (m AuthorizationMutation) 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 (*AuthorizationMutation) CreatedAt

func (m *AuthorizationMutation) CreatedAt() (r time.Time, exists bool)

CreatedAt returns the value of the "created_at" field in the mutation.

func (*AuthorizationMutation) EdgeCleared

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

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

func (*AuthorizationMutation) ExecContext

func (c *AuthorizationMutation) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*AuthorizationMutation) Field

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

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

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

func (*AuthorizationMutation) Fields

func (m *AuthorizationMutation) 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 (*AuthorizationMutation) Filter

Filter returns an entql.Where implementation to apply filters on the AuthorizationMutation builder.

func (*AuthorizationMutation) ID

func (m *AuthorizationMutation) 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 (*AuthorizationMutation) 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 (*AuthorizationMutation) Kind

func (m *AuthorizationMutation) Kind() (r authorization.Kind, exists bool)

Kind returns the value of the "kind" field in the mutation.

func (*AuthorizationMutation) OldCreatedAt

func (m *AuthorizationMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)

OldCreatedAt returns the old "created_at" field's value of the Authorization entity. If the Authorization 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 (*AuthorizationMutation) OldField

func (m *AuthorizationMutation) 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 (*AuthorizationMutation) OldKind

func (m *AuthorizationMutation) OldKind(ctx context.Context) (v authorization.Kind, err error)

OldKind returns the old "kind" field's value of the Authorization entity. If the Authorization 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 (*AuthorizationMutation) OldPersonID

func (m *AuthorizationMutation) OldPersonID(ctx context.Context) (v uuid.UUID, err error)

OldPersonID returns the old "person_id" field's value of the Authorization entity. If the Authorization 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 (*AuthorizationMutation) OldToken

func (m *AuthorizationMutation) OldToken(ctx context.Context) (v []byte, err error)

OldToken returns the old "token" field's value of the Authorization entity. If the Authorization 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 (*AuthorizationMutation) Op

func (m *AuthorizationMutation) Op() Op

Op returns the operation name.

func (*AuthorizationMutation) PersonCleared

func (m *AuthorizationMutation) PersonCleared() bool

PersonCleared reports if the "person" edge to the Person entity was cleared.

func (*AuthorizationMutation) PersonID

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

PersonID returns the value of the "person_id" field in the mutation.

func (*AuthorizationMutation) PersonIDs

func (m *AuthorizationMutation) PersonIDs() (ids []uuid.UUID)

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

func (*AuthorizationMutation) QueryContext

func (c *AuthorizationMutation) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*AuthorizationMutation) RemovedEdges

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

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

func (*AuthorizationMutation) RemovedIDs

func (m *AuthorizationMutation) 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 (*AuthorizationMutation) ResetCreatedAt

func (m *AuthorizationMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*AuthorizationMutation) ResetEdge

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

func (m *AuthorizationMutation) 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 (*AuthorizationMutation) ResetKind

func (m *AuthorizationMutation) ResetKind()

ResetKind resets all changes to the "kind" field.

func (*AuthorizationMutation) ResetPerson

func (m *AuthorizationMutation) ResetPerson()

ResetPerson resets all changes to the "person" edge.

func (*AuthorizationMutation) ResetPersonID

func (m *AuthorizationMutation) ResetPersonID()

ResetPersonID resets all changes to the "person_id" field.

func (*AuthorizationMutation) ResetToken

func (m *AuthorizationMutation) ResetToken()

ResetToken resets all changes to the "token" field.

func (*AuthorizationMutation) SetCreatedAt

func (m *AuthorizationMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" field.

func (*AuthorizationMutation) SetField

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

func (m *AuthorizationMutation) SetID(id uuid.UUID)

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

func (*AuthorizationMutation) SetKind

SetKind sets the "kind" field.

func (*AuthorizationMutation) SetOp

func (m *AuthorizationMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*AuthorizationMutation) SetPersonID

func (m *AuthorizationMutation) SetPersonID(u uuid.UUID)

SetPersonID sets the "person_id" field.

func (*AuthorizationMutation) SetToken

func (m *AuthorizationMutation) SetToken(b []byte)

SetToken sets the "token" field.

func (*AuthorizationMutation) Token

func (m *AuthorizationMutation) Token() (r []byte, exists bool)

Token returns the value of the "token" field in the mutation.

func (AuthorizationMutation) Tx

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

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

func (*AuthorizationMutation) Type

func (m *AuthorizationMutation) Type() string

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

func (*AuthorizationMutation) Where

Where appends a list predicates to the AuthorizationMutation builder.

func (*AuthorizationMutation) WhereP

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

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

type AuthorizationOrder

type AuthorizationOrder struct {
	Direction OrderDirection           `json:"direction"`
	Field     *AuthorizationOrderField `json:"field"`
}

AuthorizationOrder defines the ordering of Authorization.

type AuthorizationOrderField

type AuthorizationOrderField struct {
	// Value extracts the ordering value from the given Authorization.
	Value func(*Authorization) (ent.Value, error)
	// contains filtered or unexported fields
}

AuthorizationOrderField defines the ordering field of Authorization.

type AuthorizationPaginateOption

type AuthorizationPaginateOption func(*authorizationPager) error

AuthorizationPaginateOption enables pagination customization.

func WithAuthorizationFilter

func WithAuthorizationFilter(filter func(*AuthorizationQuery) (*AuthorizationQuery, error)) AuthorizationPaginateOption

WithAuthorizationFilter configures pagination filter.

func WithAuthorizationOrder

func WithAuthorizationOrder(order *AuthorizationOrder) AuthorizationPaginateOption

WithAuthorizationOrder configures pagination ordering.

type AuthorizationQuery

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

AuthorizationQuery is the builder for querying Authorization entities.

func (*AuthorizationQuery) Aggregate

func (aq *AuthorizationQuery) Aggregate(fns ...AggregateFunc) *AuthorizationSelect

Aggregate returns a AuthorizationSelect configured with the given aggregations.

func (*AuthorizationQuery) All

All executes the query and returns a list of Authorizations.

func (*AuthorizationQuery) AllX

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

func (*AuthorizationQuery) Clone

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

func (*AuthorizationQuery) CollectFields

func (a *AuthorizationQuery) CollectFields(ctx context.Context, satisfies ...string) (*AuthorizationQuery, error)

CollectFields tells the query-builder to eagerly load connected nodes by resolver context.

func (*AuthorizationQuery) Count

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

Count returns the count of the given query.

func (*AuthorizationQuery) CountX

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

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

func (*AuthorizationQuery) ExecContext

func (c *AuthorizationQuery) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*AuthorizationQuery) Exist

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

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

func (*AuthorizationQuery) ExistX

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

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

func (*AuthorizationQuery) Filter

Filter returns a Filter implementation to apply filters on the AuthorizationQuery builder.

func (*AuthorizationQuery) First

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

func (*AuthorizationQuery) FirstID

func (aq *AuthorizationQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

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

func (*AuthorizationQuery) FirstIDX

func (aq *AuthorizationQuery) FirstIDX(ctx context.Context) uuid.UUID

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

func (*AuthorizationQuery) FirstX

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

func (*AuthorizationQuery) GroupBy

func (aq *AuthorizationQuery) GroupBy(field string, fields ...string) *AuthorizationGroupBy

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

client.Authorization.Query().
	GroupBy(authorization.FieldPersonID).
	Aggregate(data.Count()).
	Scan(ctx, &v)

func (*AuthorizationQuery) IDs

func (aq *AuthorizationQuery) IDs(ctx context.Context) (ids []uuid.UUID, err error)

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

func (*AuthorizationQuery) IDsX

func (aq *AuthorizationQuery) IDsX(ctx context.Context) []uuid.UUID

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

func (*AuthorizationQuery) Limit

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

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

func (*AuthorizationQuery) Offset

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

Offset to start from.

func (*AuthorizationQuery) Only

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

func (*AuthorizationQuery) OnlyID

func (aq *AuthorizationQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

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

func (*AuthorizationQuery) OnlyIDX

func (aq *AuthorizationQuery) OnlyIDX(ctx context.Context) uuid.UUID

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

func (*AuthorizationQuery) OnlyX

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

func (*AuthorizationQuery) Order

Order specifies how the records should be ordered.

func (*AuthorizationQuery) Paginate

func (a *AuthorizationQuery) Paginate(
	ctx context.Context, after *Cursor, first *int,
	before *Cursor, last *int, opts ...AuthorizationPaginateOption,
) (*AuthorizationConnection, error)

Paginate executes the query and returns a relay based cursor connection to Authorization.

func (*AuthorizationQuery) QueryContext

func (c *AuthorizationQuery) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*AuthorizationQuery) QueryPerson

func (aq *AuthorizationQuery) QueryPerson() *PersonQuery

QueryPerson chains the current query on the "person" edge.

func (*AuthorizationQuery) Select

func (aq *AuthorizationQuery) Select(fields ...string) *AuthorizationSelect

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

client.Authorization.Query().
	Select(authorization.FieldPersonID).
	Scan(ctx, &v)

func (*AuthorizationQuery) Unique

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

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

Where adds a new predicate for the AuthorizationQuery builder.

func (*AuthorizationQuery) WithPerson

func (aq *AuthorizationQuery) WithPerson(opts ...func(*PersonQuery)) *AuthorizationQuery

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

type AuthorizationSelect

type AuthorizationSelect struct {
	*AuthorizationQuery
	// contains filtered or unexported fields
}

AuthorizationSelect is the builder for selecting fields of Authorization entities.

func (*AuthorizationSelect) Aggregate

func (as *AuthorizationSelect) Aggregate(fns ...AggregateFunc) *AuthorizationSelect

Aggregate adds the given aggregation functions to the selector query.

func (*AuthorizationSelect) Bool

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

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

func (*AuthorizationSelect) BoolX

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

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

func (*AuthorizationSelect) Bools

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

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

func (*AuthorizationSelect) BoolsX

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

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

func (AuthorizationSelect) ExecContext

func (c AuthorizationSelect) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*AuthorizationSelect) Float64

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

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

func (*AuthorizationSelect) Float64X

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

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

func (*AuthorizationSelect) Float64s

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

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

func (*AuthorizationSelect) Float64sX

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

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

func (*AuthorizationSelect) Int

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

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

func (*AuthorizationSelect) IntX

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

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

func (*AuthorizationSelect) Ints

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

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

func (*AuthorizationSelect) IntsX

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

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

func (AuthorizationSelect) QueryContext

func (c AuthorizationSelect) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*AuthorizationSelect) Scan

func (as *AuthorizationSelect) Scan(ctx context.Context, v any) error

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

func (*AuthorizationSelect) ScanX

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

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

func (*AuthorizationSelect) String

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

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

func (*AuthorizationSelect) StringX

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

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

func (*AuthorizationSelect) Strings

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

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

func (*AuthorizationSelect) StringsX

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

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

type AuthorizationUpdate

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

AuthorizationUpdate is the builder for updating Authorization entities.

func (*AuthorizationUpdate) Exec

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

Exec executes the query.

func (*AuthorizationUpdate) ExecContext

func (c *AuthorizationUpdate) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*AuthorizationUpdate) ExecX

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

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

func (*AuthorizationUpdate) Mutation

Mutation returns the AuthorizationMutation object of the builder.

func (*AuthorizationUpdate) QueryContext

func (c *AuthorizationUpdate) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*AuthorizationUpdate) Save

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

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

func (*AuthorizationUpdate) SaveX

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

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

func (*AuthorizationUpdate) SetKind

SetKind sets the "kind" field.

func (*AuthorizationUpdate) Where

Where appends a list predicates to the AuthorizationUpdate builder.

type AuthorizationUpdateOne

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

AuthorizationUpdateOne is the builder for updating a single Authorization entity.

func (*AuthorizationUpdateOne) Exec

Exec executes the query on the entity.

func (*AuthorizationUpdateOne) ExecContext

func (c *AuthorizationUpdateOne) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*AuthorizationUpdateOne) ExecX

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

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

func (*AuthorizationUpdateOne) Mutation

Mutation returns the AuthorizationMutation object of the builder.

func (*AuthorizationUpdateOne) QueryContext

func (c *AuthorizationUpdateOne) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*AuthorizationUpdateOne) Save

Save executes the query and returns the updated Authorization entity.

func (*AuthorizationUpdateOne) SaveX

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

func (*AuthorizationUpdateOne) Select

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

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

func (*AuthorizationUpdateOne) SetKind

SetKind sets the "kind" field.

func (*AuthorizationUpdateOne) Where

Where appends a list predicates to the AuthorizationUpdate builder.

type AuthorizationWhereInput

type AuthorizationWhereInput struct {
	Predicates []predicate.Authorization  `json:"-"`
	Not        *AuthorizationWhereInput   `json:"not,omitempty"`
	Or         []*AuthorizationWhereInput `json:"or,omitempty"`
	And        []*AuthorizationWhereInput `json:"and,omitempty"`

	// "id" field predicates.
	ID      *uuid.UUID  `json:"id,omitempty"`
	IDNEQ   *uuid.UUID  `json:"idNEQ,omitempty"`
	IDIn    []uuid.UUID `json:"idIn,omitempty"`
	IDNotIn []uuid.UUID `json:"idNotIn,omitempty"`
	IDGT    *uuid.UUID  `json:"idGT,omitempty"`
	IDGTE   *uuid.UUID  `json:"idGTE,omitempty"`
	IDLT    *uuid.UUID  `json:"idLT,omitempty"`
	IDLTE   *uuid.UUID  `json:"idLTE,omitempty"`

	// "person_id" field predicates.
	PersonID      *uuid.UUID  `json:"personID,omitempty"`
	PersonIDNEQ   *uuid.UUID  `json:"personIDNEQ,omitempty"`
	PersonIDIn    []uuid.UUID `json:"personIDIn,omitempty"`
	PersonIDNotIn []uuid.UUID `json:"personIDNotIn,omitempty"`

	// "kind" field predicates.
	Kind      *authorization.Kind  `json:"kind,omitempty"`
	KindNEQ   *authorization.Kind  `json:"kindNEQ,omitempty"`
	KindIn    []authorization.Kind `json:"kindIn,omitempty"`
	KindNotIn []authorization.Kind `json:"kindNotIn,omitempty"`

	// "created_at" field predicates.
	CreatedAt      *time.Time  `json:"createdAt,omitempty"`
	CreatedAtNEQ   *time.Time  `json:"createdAtNEQ,omitempty"`
	CreatedAtIn    []time.Time `json:"createdAtIn,omitempty"`
	CreatedAtNotIn []time.Time `json:"createdAtNotIn,omitempty"`
	CreatedAtGT    *time.Time  `json:"createdAtGT,omitempty"`
	CreatedAtGTE   *time.Time  `json:"createdAtGTE,omitempty"`
	CreatedAtLT    *time.Time  `json:"createdAtLT,omitempty"`
	CreatedAtLTE   *time.Time  `json:"createdAtLTE,omitempty"`

	// "person" edge predicates.
	HasPerson     *bool               `json:"hasPerson,omitempty"`
	HasPersonWith []*PersonWhereInput `json:"hasPersonWith,omitempty"`
}

AuthorizationWhereInput represents a where input for filtering Authorization queries.

func (*AuthorizationWhereInput) AddPredicates

func (i *AuthorizationWhereInput) AddPredicates(predicates ...predicate.Authorization)

AddPredicates adds custom predicates to the where input to be used during the filtering phase.

func (*AuthorizationWhereInput) Filter

Filter applies the AuthorizationWhereInput filter on the AuthorizationQuery builder.

func (*AuthorizationWhereInput) P

P returns a predicate for filtering authorizations. An error is returned if the input is empty or invalid.

type Authorizations

type Authorizations []*Authorization

Authorizations is a parsable slice of Authorization.

type Client

type Client struct {

	// Schema is the client for creating, migrating and dropping schema.
	Schema *migrate.Schema
	// Authentication is the client for interacting with the Authentication builders.
	Authentication *AuthenticationClient
	// Authorization is the client for interacting with the Authorization builders.
	Authorization *AuthorizationClient
	// Person is the client for interacting with the Person builders.
	Person *PersonClient
	// 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().
	Authentication.
	Query().
	Count(ctx)

func (*Client) ExecContext

func (c *Client) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

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

func (c *Client) Noder(ctx context.Context, id uuid.UUID, opts ...NodeOption) (_ Noder, err error)

Noder returns a Node by its id. If the NodeType was not provided, it will be derived from the id value according to the universal-id configuration.

c.Noder(ctx, id)
c.Noder(ctx, id, ent.WithNodeType(typeResolver))

func (*Client) Noders

func (c *Client) Noders(ctx context.Context, ids []uuid.UUID, opts ...NodeOption) ([]Noder, error)

func (*Client) OpenTx

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

OpenTx opens a transaction and returns a transactional context along with the created transaction.

func (*Client) QueryContext

func (c *Client) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

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 Cursor

type Cursor = entgql.Cursor[uuid.UUID]

Common entgql types.

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 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 NodeOption

type NodeOption func(*nodeOptions)

NodeOption allows configuring the Noder execution using functional options.

func WithFixedNodeType

func WithFixedNodeType(t string) NodeOption

WithFixedNodeType sets the Type of the node to a fixed value.

func WithNodeType

func WithNodeType(f func(context.Context, uuid.UUID) (string, error)) NodeOption

WithNodeType sets the node Type resolver function (i.e. the table to query). If was not provided, the table will be derived from the universal-id configuration as described in: https://entgo.io/docs/migrate/#universal-ids.

type Noder

type Noder interface {
	IsNode()
}

Noder wraps the basic Node method.

type NotFoundError

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

NotFoundError returns when trying to fetch a specific entity and it was not found in the database.

func (*NotFoundError) Error

func (e *NotFoundError) Error() string

Error implements the error interface.

type NotLoadedError

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

NotLoadedError returns when trying to get a node that was not loaded by the query.

func (*NotLoadedError) Error

func (e *NotLoadedError) Error() string

Error implements the error interface.

type NotSingularError

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

NotSingularError returns when trying to fetch a singular entity and more then one was found in the database.

func (*NotSingularError) Error

func (e *NotSingularError) Error() string

Error implements the error interface.

type Op

type Op = ent.Op

ent aliases to avoid import conflicts in user's code.

type Option

type Option func(*config)

Option function to configure the client.

func Debug

func Debug() Option

Debug enables debug logging on the ent.Driver.

func Driver

func Driver(driver dialect.Driver) Option

Driver configures the client driver.

func Log

func Log(fn func(...any)) Option

Log sets the logging function for debug mode.

type OrderDirection

type OrderDirection = entgql.OrderDirection

Common entgql types.

type OrderFunc

type OrderFunc func(*sql.Selector)

OrderFunc applies an ordering on the sql selector. Deprecated: Use Asc/Desc functions or the package builders instead.

type PageInfo

type PageInfo = entgql.PageInfo[uuid.UUID]

Common entgql types.

type Person

type Person struct {

	// ID of the ent.
	ID uuid.UUID `json:"id,omitempty"`
	// StripeID holds the value of the "stripe_id" field.
	StripeID *string `json:"stripe_id,omitempty"`
	// Email holds the value of the "email" field.
	Email string `json:"email,omitempty" fake:"{email}"`
	// EmailVerifiedAt holds the value of the "email_verified_at" field.
	EmailVerifiedAt *time.Time `json:"email_verified_at,omitempty"`
	// Phone holds the value of the "phone" field.
	Phone *string `json:"phone,omitempty" fake:"{phone_e164}"`
	// Password holds the value of the "password" field.
	Password string `fake:"-" json:"-"`
	// TaxID holds the value of the "tax_id" field.
	TaxID string `json:"tax_id,omitempty" fake:"{tax_id}"`
	// FirstName holds the value of the "first_name" field.
	FirstName string `json:"first_name,omitempty" fake:"{firstname}"`
	// LastName holds the value of the "last_name" field.
	LastName *string `json:"last_name,omitempty" fake:"{lastname}"`
	// Language holds the value of the "language" field.
	Language string `json:"language,omitempty" fake:"{randomstring:[ca,es,en]}"`
	// Birthdate holds the value of the "birthdate" field.
	Birthdate *time.Time `json:"birthdate,omitempty" fake:"{date}"`
	// Gender holds the value of the "gender" field.
	Gender *person.Gender `json:"gender,omitempty" fake:"{randomstring:[woman,man,nonbinary]}"`
	// Address holds the value of the "address" field.
	Address *string `json:"address,omitempty" fake:"{street}"`
	// PostalCode holds the value of the "postal_code" field.
	PostalCode *string `json:"postal_code,omitempty" fake:"{zip}"`
	// City holds the value of the "city" field.
	City *string `json:"city,omitempty" fake:"{city}"`
	// Country holds the value of the "country" field.
	Country *string `json:"country,omitempty" fake:"{countryabr}"`
	// Subscribed holds the value of the "subscribed" field.
	Subscribed bool `json:"subscribed,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// UpdatedAt holds the value of the "updated_at" field.
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the PersonQuery when eager-loading is set.
	Edges PersonEdges `json:"edges"`
	// contains filtered or unexported fields
}

Person is the model entity for the Person schema.

func (*Person) Authentications

func (pe *Person) Authentications(ctx context.Context) (result []*Authentication, err error)

func (*Person) Authorizations

func (pe *Person) Authorizations(ctx context.Context) (result []*Authorization, err error)

func (*Person) CanSubscribe

func (pe *Person) CanSubscribe() bool

func (*Person) ExecContext

func (c *Person) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*Person) FullName

func (pe *Person) FullName() string

func (*Person) IsNode

func (n *Person) IsNode()

IsNode implements the Node interface check for GQLGen.

func (*Person) NamedAuthentications

func (pe *Person) NamedAuthentications(name string) ([]*Authentication, error)

NamedAuthentications returns the Authentications named value or an error if the edge was not loaded in eager-loading with this name.

func (*Person) NamedAuthorizations

func (pe *Person) NamedAuthorizations(name string) ([]*Authorization, error)

NamedAuthorizations returns the Authorizations named value or an error if the edge was not loaded in eager-loading with this name.

func (*Person) QueryAuthentications

func (pe *Person) QueryAuthentications() *AuthenticationQuery

QueryAuthentications queries the "authentications" edge of the Person entity.

func (*Person) QueryAuthorizations

func (pe *Person) QueryAuthorizations() *AuthorizationQuery

QueryAuthorizations queries the "authorizations" edge of the Person entity.

func (*Person) QueryContext

func (c *Person) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*Person) String

func (pe *Person) String() string

String implements the fmt.Stringer.

func (*Person) ToEdge

func (pe *Person) ToEdge(order *PersonOrder) *PersonEdge

ToEdge converts Person into PersonEdge.

func (*Person) Unwrap

func (pe *Person) Unwrap() *Person

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

func (pe *Person) Update() *PersonUpdateOne

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

func (*Person) Value

func (pe *Person) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the Person. This includes values selected through modifiers, order, etc.

type PersonClient

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

PersonClient is a client for the Person schema.

func NewPersonClient

func NewPersonClient(c config) *PersonClient

NewPersonClient returns a client for the Person from the given config.

func (*PersonClient) Create

func (c *PersonClient) Create() *PersonCreate

Create returns a builder for creating a Person entity.

func (*PersonClient) CreateBulk

func (c *PersonClient) CreateBulk(builders ...*PersonCreate) *PersonCreateBulk

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

func (*PersonClient) Delete

func (c *PersonClient) Delete() *PersonDelete

Delete returns a delete builder for Person.

func (*PersonClient) DeleteOne

func (c *PersonClient) DeleteOne(pe *Person) *PersonDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*PersonClient) DeleteOneID

func (c *PersonClient) DeleteOneID(id uuid.UUID) *PersonDeleteOne

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

func (*PersonClient) ExecContext

func (c *PersonClient) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*PersonClient) Get

func (c *PersonClient) Get(ctx context.Context, id uuid.UUID) (*Person, error)

Get returns a Person entity by its id.

func (*PersonClient) GetX

func (c *PersonClient) GetX(ctx context.Context, id uuid.UUID) *Person

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

func (*PersonClient) Hooks

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

Hooks returns the client hooks.

func (*PersonClient) Intercept

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

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

func (*PersonClient) Interceptors

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

Interceptors returns the client interceptors.

func (*PersonClient) MapCreateBulk

func (c *PersonClient) MapCreateBulk(slice any, setFunc func(*PersonCreate, int)) *PersonCreateBulk

MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.

func (*PersonClient) Query

func (c *PersonClient) Query() *PersonQuery

Query returns a query builder for Person.

func (*PersonClient) QueryAuthentications

func (c *PersonClient) QueryAuthentications(pe *Person) *AuthenticationQuery

QueryAuthentications queries the authentications edge of a Person.

func (*PersonClient) QueryAuthorizations

func (c *PersonClient) QueryAuthorizations(pe *Person) *AuthorizationQuery

QueryAuthorizations queries the authorizations edge of a Person.

func (*PersonClient) QueryContext

func (c *PersonClient) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*PersonClient) Update

func (c *PersonClient) Update() *PersonUpdate

Update returns an update builder for Person.

func (*PersonClient) UpdateOne

func (c *PersonClient) UpdateOne(pe *Person) *PersonUpdateOne

UpdateOne returns an update builder for the given entity.

func (*PersonClient) UpdateOneID

func (c *PersonClient) UpdateOneID(id uuid.UUID) *PersonUpdateOne

UpdateOneID returns an update builder for the given id.

func (*PersonClient) Use

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

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

type PersonConnection

type PersonConnection struct {
	Edges      []*PersonEdge `json:"edges"`
	PageInfo   PageInfo      `json:"pageInfo"`
	TotalCount int           `json:"totalCount"`
}

PersonConnection is the connection containing edges to Person.

type PersonCreate

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

PersonCreate is the builder for creating a Person entity.

func (*PersonCreate) AddAuthenticationIDs

func (pc *PersonCreate) AddAuthenticationIDs(ids ...uuid.UUID) *PersonCreate

AddAuthenticationIDs adds the "authentications" edge to the Authentication entity by IDs.

func (*PersonCreate) AddAuthentications

func (pc *PersonCreate) AddAuthentications(a ...*Authentication) *PersonCreate

AddAuthentications adds the "authentications" edges to the Authentication entity.

func (*PersonCreate) AddAuthorizationIDs

func (pc *PersonCreate) AddAuthorizationIDs(ids ...uuid.UUID) *PersonCreate

AddAuthorizationIDs adds the "authorizations" edge to the Authorization entity by IDs.

func (*PersonCreate) AddAuthorizations

func (pc *PersonCreate) AddAuthorizations(a ...*Authorization) *PersonCreate

AddAuthorizations adds the "authorizations" edges to the Authorization entity.

func (*PersonCreate) Exec

func (pc *PersonCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*PersonCreate) ExecContext

func (c *PersonCreate) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*PersonCreate) ExecX

func (pc *PersonCreate) ExecX(ctx context.Context)

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

func (*PersonCreate) Mutation

func (pc *PersonCreate) Mutation() *PersonMutation

Mutation returns the PersonMutation object of the builder.

func (*PersonCreate) QueryContext

func (c *PersonCreate) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*PersonCreate) Save

func (pc *PersonCreate) Save(ctx context.Context) (*Person, error)

Save creates the Person in the database.

func (*PersonCreate) SaveX

func (pc *PersonCreate) SaveX(ctx context.Context) *Person

SaveX calls Save and panics if Save returns an error.

func (*PersonCreate) SetAddress

func (pc *PersonCreate) SetAddress(s string) *PersonCreate

SetAddress sets the "address" field.

func (*PersonCreate) SetBirthdate

func (pc *PersonCreate) SetBirthdate(t time.Time) *PersonCreate

SetBirthdate sets the "birthdate" field.

func (*PersonCreate) SetCity

func (pc *PersonCreate) SetCity(s string) *PersonCreate

SetCity sets the "city" field.

func (*PersonCreate) SetCountry

func (pc *PersonCreate) SetCountry(s string) *PersonCreate

SetCountry sets the "country" field.

func (*PersonCreate) SetCreatedAt

func (pc *PersonCreate) SetCreatedAt(t time.Time) *PersonCreate

SetCreatedAt sets the "created_at" field.

func (*PersonCreate) SetEmail

func (pc *PersonCreate) SetEmail(s string) *PersonCreate

SetEmail sets the "email" field.

func (*PersonCreate) SetEmailVerifiedAt

func (pc *PersonCreate) SetEmailVerifiedAt(t time.Time) *PersonCreate

SetEmailVerifiedAt sets the "email_verified_at" field.

func (*PersonCreate) SetFirstName

func (pc *PersonCreate) SetFirstName(s string) *PersonCreate

SetFirstName sets the "first_name" field.

func (*PersonCreate) SetGender

func (pc *PersonCreate) SetGender(pe person.Gender) *PersonCreate

SetGender sets the "gender" field.

func (*PersonCreate) SetID

func (pc *PersonCreate) SetID(u uuid.UUID) *PersonCreate

SetID sets the "id" field.

func (*PersonCreate) SetLanguage

func (pc *PersonCreate) SetLanguage(s string) *PersonCreate

SetLanguage sets the "language" field.

func (*PersonCreate) SetLastName

func (pc *PersonCreate) SetLastName(s string) *PersonCreate

SetLastName sets the "last_name" field.

func (*PersonCreate) SetNillableAddress

func (pc *PersonCreate) SetNillableAddress(s *string) *PersonCreate

SetNillableAddress sets the "address" field if the given value is not nil.

func (*PersonCreate) SetNillableBirthdate

func (pc *PersonCreate) SetNillableBirthdate(t *time.Time) *PersonCreate

SetNillableBirthdate sets the "birthdate" field if the given value is not nil.

func (*PersonCreate) SetNillableCity

func (pc *PersonCreate) SetNillableCity(s *string) *PersonCreate

SetNillableCity sets the "city" field if the given value is not nil.

func (*PersonCreate) SetNillableCountry

func (pc *PersonCreate) SetNillableCountry(s *string) *PersonCreate

SetNillableCountry sets the "country" field if the given value is not nil.

func (*PersonCreate) SetNillableCreatedAt

func (pc *PersonCreate) SetNillableCreatedAt(t *time.Time) *PersonCreate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*PersonCreate) SetNillableEmailVerifiedAt

func (pc *PersonCreate) SetNillableEmailVerifiedAt(t *time.Time) *PersonCreate

SetNillableEmailVerifiedAt sets the "email_verified_at" field if the given value is not nil.

func (*PersonCreate) SetNillableGender

func (pc *PersonCreate) SetNillableGender(pe *person.Gender) *PersonCreate

SetNillableGender sets the "gender" field if the given value is not nil.

func (*PersonCreate) SetNillableLastName

func (pc *PersonCreate) SetNillableLastName(s *string) *PersonCreate

SetNillableLastName sets the "last_name" field if the given value is not nil.

func (*PersonCreate) SetNillablePhone

func (pc *PersonCreate) SetNillablePhone(s *string) *PersonCreate

SetNillablePhone sets the "phone" field if the given value is not nil.

func (*PersonCreate) SetNillablePostalCode

func (pc *PersonCreate) SetNillablePostalCode(s *string) *PersonCreate

SetNillablePostalCode sets the "postal_code" field if the given value is not nil.

func (*PersonCreate) SetNillableStripeID

func (pc *PersonCreate) SetNillableStripeID(s *string) *PersonCreate

SetNillableStripeID sets the "stripe_id" field if the given value is not nil.

func (*PersonCreate) SetNillableSubscribed

func (pc *PersonCreate) SetNillableSubscribed(b *bool) *PersonCreate

SetNillableSubscribed sets the "subscribed" field if the given value is not nil.

func (*PersonCreate) SetNillableUpdatedAt

func (pc *PersonCreate) SetNillableUpdatedAt(t *time.Time) *PersonCreate

SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.

func (*PersonCreate) SetPassword

func (pc *PersonCreate) SetPassword(s string) *PersonCreate

SetPassword sets the "password" field.

func (*PersonCreate) SetPhone

func (pc *PersonCreate) SetPhone(s string) *PersonCreate

SetPhone sets the "phone" field.

func (*PersonCreate) SetPostalCode

func (pc *PersonCreate) SetPostalCode(s string) *PersonCreate

SetPostalCode sets the "postal_code" field.

func (*PersonCreate) SetStripeID

func (pc *PersonCreate) SetStripeID(s string) *PersonCreate

SetStripeID sets the "stripe_id" field.

func (*PersonCreate) SetSubscribed

func (pc *PersonCreate) SetSubscribed(b bool) *PersonCreate

SetSubscribed sets the "subscribed" field.

func (*PersonCreate) SetTaxID

func (pc *PersonCreate) SetTaxID(s string) *PersonCreate

SetTaxID sets the "tax_id" field.

func (*PersonCreate) SetUpdatedAt

func (pc *PersonCreate) SetUpdatedAt(t time.Time) *PersonCreate

SetUpdatedAt sets the "updated_at" field.

type PersonCreateBulk

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

PersonCreateBulk is the builder for creating many Person entities in bulk.

func (*PersonCreateBulk) Exec

func (pcb *PersonCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*PersonCreateBulk) ExecContext

func (c *PersonCreateBulk) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*PersonCreateBulk) ExecX

func (pcb *PersonCreateBulk) ExecX(ctx context.Context)

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

func (*PersonCreateBulk) QueryContext

func (c *PersonCreateBulk) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*PersonCreateBulk) Save

func (pcb *PersonCreateBulk) Save(ctx context.Context) ([]*Person, error)

Save creates the Person entities in the database.

func (*PersonCreateBulk) SaveX

func (pcb *PersonCreateBulk) SaveX(ctx context.Context) []*Person

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

type PersonDelete

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

PersonDelete is the builder for deleting a Person entity.

func (*PersonDelete) Exec

func (pd *PersonDelete) Exec(ctx context.Context) (int, error)

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

func (*PersonDelete) ExecContext

func (c *PersonDelete) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*PersonDelete) ExecX

func (pd *PersonDelete) ExecX(ctx context.Context) int

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

func (*PersonDelete) QueryContext

func (c *PersonDelete) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*PersonDelete) Where

func (pd *PersonDelete) Where(ps ...predicate.Person) *PersonDelete

Where appends a list predicates to the PersonDelete builder.

type PersonDeleteOne

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

PersonDeleteOne is the builder for deleting a single Person entity.

func (*PersonDeleteOne) Exec

func (pdo *PersonDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*PersonDeleteOne) ExecX

func (pdo *PersonDeleteOne) ExecX(ctx context.Context)

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

func (*PersonDeleteOne) Where

func (pdo *PersonDeleteOne) Where(ps ...predicate.Person) *PersonDeleteOne

Where appends a list predicates to the PersonDelete builder.

type PersonEdge

type PersonEdge struct {
	Node   *Person `json:"node"`
	Cursor Cursor  `json:"cursor"`
}

PersonEdge is the edge representation of Person.

type PersonEdges

type PersonEdges struct {
	// Authentications holds the value of the authentications edge.
	Authentications []*Authentication `json:"authentications,omitempty"`
	// Authorizations holds the value of the authorizations edge.
	Authorizations []*Authorization `json:"authorizations,omitempty"`
	// contains filtered or unexported fields
}

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

func (PersonEdges) AuthenticationsOrErr

func (e PersonEdges) AuthenticationsOrErr() ([]*Authentication, error)

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

func (PersonEdges) AuthorizationsOrErr

func (e PersonEdges) AuthorizationsOrErr() ([]*Authorization, error)

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

type PersonFilter

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

PersonFilter provides a generic filtering capability at runtime for PersonQuery.

func (*PersonFilter) ExecContext

func (c *PersonFilter) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*PersonFilter) QueryContext

func (c *PersonFilter) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*PersonFilter) Where

func (f *PersonFilter) Where(p entql.P)

Where applies the entql predicate on the query filter.

func (*PersonFilter) WhereAddress

func (f *PersonFilter) WhereAddress(p entql.StringP)

WhereAddress applies the entql string predicate on the address field.

func (*PersonFilter) WhereBirthdate

func (f *PersonFilter) WhereBirthdate(p entql.TimeP)

WhereBirthdate applies the entql time.Time predicate on the birthdate field.

func (*PersonFilter) WhereCity

func (f *PersonFilter) WhereCity(p entql.StringP)

WhereCity applies the entql string predicate on the city field.

func (*PersonFilter) WhereCountry

func (f *PersonFilter) WhereCountry(p entql.StringP)

WhereCountry applies the entql string predicate on the country field.

func (*PersonFilter) WhereCreatedAt

func (f *PersonFilter) WhereCreatedAt(p entql.TimeP)

WhereCreatedAt applies the entql time.Time predicate on the created_at field.

func (*PersonFilter) WhereEmail

func (f *PersonFilter) WhereEmail(p entql.StringP)

WhereEmail applies the entql string predicate on the email field.

func (*PersonFilter) WhereEmailVerifiedAt

func (f *PersonFilter) WhereEmailVerifiedAt(p entql.TimeP)

WhereEmailVerifiedAt applies the entql time.Time predicate on the email_verified_at field.

func (*PersonFilter) WhereFirstName

func (f *PersonFilter) WhereFirstName(p entql.StringP)

WhereFirstName applies the entql string predicate on the first_name field.

func (*PersonFilter) WhereGender

func (f *PersonFilter) WhereGender(p entql.StringP)

WhereGender applies the entql string predicate on the gender field.

func (*PersonFilter) WhereHasAuthentications

func (f *PersonFilter) WhereHasAuthentications()

WhereHasAuthentications applies a predicate to check if query has an edge authentications.

func (*PersonFilter) WhereHasAuthenticationsWith

func (f *PersonFilter) WhereHasAuthenticationsWith(preds ...predicate.Authentication)

WhereHasAuthenticationsWith applies a predicate to check if query has an edge authentications with a given conditions (other predicates).

func (*PersonFilter) WhereHasAuthorizations

func (f *PersonFilter) WhereHasAuthorizations()

WhereHasAuthorizations applies a predicate to check if query has an edge authorizations.

func (*PersonFilter) WhereHasAuthorizationsWith

func (f *PersonFilter) WhereHasAuthorizationsWith(preds ...predicate.Authorization)

WhereHasAuthorizationsWith applies a predicate to check if query has an edge authorizations with a given conditions (other predicates).

func (*PersonFilter) WhereID

func (f *PersonFilter) WhereID(p entql.ValueP)

WhereID applies the entql [16]byte predicate on the id field.

func (*PersonFilter) WhereLanguage

func (f *PersonFilter) WhereLanguage(p entql.StringP)

WhereLanguage applies the entql string predicate on the language field.

func (*PersonFilter) WhereLastName

func (f *PersonFilter) WhereLastName(p entql.StringP)

WhereLastName applies the entql string predicate on the last_name field.

func (*PersonFilter) WherePassword

func (f *PersonFilter) WherePassword(p entql.StringP)

WherePassword applies the entql string predicate on the password field.

func (*PersonFilter) WherePhone

func (f *PersonFilter) WherePhone(p entql.StringP)

WherePhone applies the entql string predicate on the phone field.

func (*PersonFilter) WherePostalCode

func (f *PersonFilter) WherePostalCode(p entql.StringP)

WherePostalCode applies the entql string predicate on the postal_code field.

func (*PersonFilter) WhereStripeID

func (f *PersonFilter) WhereStripeID(p entql.StringP)

WhereStripeID applies the entql string predicate on the stripe_id field.

func (*PersonFilter) WhereSubscribed

func (f *PersonFilter) WhereSubscribed(p entql.BoolP)

WhereSubscribed applies the entql bool predicate on the subscribed field.

func (*PersonFilter) WhereTaxID

func (f *PersonFilter) WhereTaxID(p entql.StringP)

WhereTaxID applies the entql string predicate on the tax_id field.

func (*PersonFilter) WhereUpdatedAt

func (f *PersonFilter) WhereUpdatedAt(p entql.TimeP)

WhereUpdatedAt applies the entql time.Time predicate on the updated_at field.

type PersonGroupBy

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

PersonGroupBy is the group-by builder for Person entities.

func (*PersonGroupBy) Aggregate

func (pgb *PersonGroupBy) Aggregate(fns ...AggregateFunc) *PersonGroupBy

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

func (*PersonGroupBy) Bool

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

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

func (*PersonGroupBy) BoolX

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

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

func (*PersonGroupBy) Bools

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

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

func (*PersonGroupBy) BoolsX

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

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

func (*PersonGroupBy) Float64

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

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

func (*PersonGroupBy) Float64X

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

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

func (*PersonGroupBy) Float64s

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

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

func (*PersonGroupBy) Float64sX

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

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

func (*PersonGroupBy) Int

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

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

func (*PersonGroupBy) IntX

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

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

func (*PersonGroupBy) Ints

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

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

func (*PersonGroupBy) IntsX

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

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

func (*PersonGroupBy) Scan

func (pgb *PersonGroupBy) Scan(ctx context.Context, v any) error

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

func (*PersonGroupBy) ScanX

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

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

func (*PersonGroupBy) String

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

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

func (*PersonGroupBy) StringX

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

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

func (*PersonGroupBy) Strings

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

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

func (*PersonGroupBy) StringsX

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

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

type PersonMutation

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

PersonMutation represents an operation that mutates the Person nodes in the graph.

func (*PersonMutation) AddAuthenticationIDs

func (m *PersonMutation) AddAuthenticationIDs(ids ...uuid.UUID)

AddAuthenticationIDs adds the "authentications" edge to the Authentication entity by ids.

func (*PersonMutation) AddAuthorizationIDs

func (m *PersonMutation) AddAuthorizationIDs(ids ...uuid.UUID)

AddAuthorizationIDs adds the "authorizations" edge to the Authorization entity by ids.

func (*PersonMutation) AddField

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

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

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

func (*PersonMutation) AddedField

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

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

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

func (*PersonMutation) AddedIDs

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

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

func (*PersonMutation) Address

func (m *PersonMutation) Address() (r string, exists bool)

Address returns the value of the "address" field in the mutation.

func (*PersonMutation) AddressCleared

func (m *PersonMutation) AddressCleared() bool

AddressCleared returns if the "address" field was cleared in this mutation.

func (*PersonMutation) AuthenticationsCleared

func (m *PersonMutation) AuthenticationsCleared() bool

AuthenticationsCleared reports if the "authentications" edge to the Authentication entity was cleared.

func (*PersonMutation) AuthenticationsIDs

func (m *PersonMutation) AuthenticationsIDs() (ids []uuid.UUID)

AuthenticationsIDs returns the "authentications" edge IDs in the mutation.

func (*PersonMutation) AuthorizationsCleared

func (m *PersonMutation) AuthorizationsCleared() bool

AuthorizationsCleared reports if the "authorizations" edge to the Authorization entity was cleared.

func (*PersonMutation) AuthorizationsIDs

func (m *PersonMutation) AuthorizationsIDs() (ids []uuid.UUID)

AuthorizationsIDs returns the "authorizations" edge IDs in the mutation.

func (*PersonMutation) Birthdate

func (m *PersonMutation) Birthdate() (r time.Time, exists bool)

Birthdate returns the value of the "birthdate" field in the mutation.

func (*PersonMutation) BirthdateCleared

func (m *PersonMutation) BirthdateCleared() bool

BirthdateCleared returns if the "birthdate" field was cleared in this mutation.

func (*PersonMutation) City

func (m *PersonMutation) City() (r string, exists bool)

City returns the value of the "city" field in the mutation.

func (*PersonMutation) CityCleared

func (m *PersonMutation) CityCleared() bool

CityCleared returns if the "city" field was cleared in this mutation.

func (*PersonMutation) ClearAddress

func (m *PersonMutation) ClearAddress()

ClearAddress clears the value of the "address" field.

func (*PersonMutation) ClearAuthentications

func (m *PersonMutation) ClearAuthentications()

ClearAuthentications clears the "authentications" edge to the Authentication entity.

func (*PersonMutation) ClearAuthorizations

func (m *PersonMutation) ClearAuthorizations()

ClearAuthorizations clears the "authorizations" edge to the Authorization entity.

func (*PersonMutation) ClearBirthdate

func (m *PersonMutation) ClearBirthdate()

ClearBirthdate clears the value of the "birthdate" field.

func (*PersonMutation) ClearCity

func (m *PersonMutation) ClearCity()

ClearCity clears the value of the "city" field.

func (*PersonMutation) ClearCountry

func (m *PersonMutation) ClearCountry()

ClearCountry clears the value of the "country" field.

func (*PersonMutation) ClearEdge

func (m *PersonMutation) 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 (*PersonMutation) ClearEmailVerifiedAt

func (m *PersonMutation) ClearEmailVerifiedAt()

ClearEmailVerifiedAt clears the value of the "email_verified_at" field.

func (*PersonMutation) ClearField

func (m *PersonMutation) 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 (*PersonMutation) ClearGender

func (m *PersonMutation) ClearGender()

ClearGender clears the value of the "gender" field.

func (*PersonMutation) ClearLastName

func (m *PersonMutation) ClearLastName()

ClearLastName clears the value of the "last_name" field.

func (*PersonMutation) ClearPhone

func (m *PersonMutation) ClearPhone()

ClearPhone clears the value of the "phone" field.

func (*PersonMutation) ClearPostalCode

func (m *PersonMutation) ClearPostalCode()

ClearPostalCode clears the value of the "postal_code" field.

func (*PersonMutation) ClearStripeID

func (m *PersonMutation) ClearStripeID()

ClearStripeID clears the value of the "stripe_id" field.

func (*PersonMutation) ClearedEdges

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

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

func (*PersonMutation) ClearedFields

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

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

func (PersonMutation) Client

func (m PersonMutation) 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 (*PersonMutation) Country

func (m *PersonMutation) Country() (r string, exists bool)

Country returns the value of the "country" field in the mutation.

func (*PersonMutation) CountryCleared

func (m *PersonMutation) CountryCleared() bool

CountryCleared returns if the "country" field was cleared in this mutation.

func (*PersonMutation) CreatedAt

func (m *PersonMutation) CreatedAt() (r time.Time, exists bool)

CreatedAt returns the value of the "created_at" field in the mutation.

func (*PersonMutation) EdgeCleared

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

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

func (*PersonMutation) Email

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

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

func (*PersonMutation) EmailVerifiedAt

func (m *PersonMutation) EmailVerifiedAt() (r time.Time, exists bool)

EmailVerifiedAt returns the value of the "email_verified_at" field in the mutation.

func (*PersonMutation) EmailVerifiedAtCleared

func (m *PersonMutation) EmailVerifiedAtCleared() bool

EmailVerifiedAtCleared returns if the "email_verified_at" field was cleared in this mutation.

func (*PersonMutation) ExecContext

func (c *PersonMutation) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*PersonMutation) Field

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

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

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

func (*PersonMutation) Fields

func (m *PersonMutation) 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 (*PersonMutation) Filter

func (m *PersonMutation) Filter() *PersonFilter

Filter returns an entql.Where implementation to apply filters on the PersonMutation builder.

func (*PersonMutation) FirstName

func (m *PersonMutation) FirstName() (r string, exists bool)

FirstName returns the value of the "first_name" field in the mutation.

func (*PersonMutation) Gender

func (m *PersonMutation) Gender() (r person.Gender, exists bool)

Gender returns the value of the "gender" field in the mutation.

func (*PersonMutation) GenderCleared

func (m *PersonMutation) GenderCleared() bool

GenderCleared returns if the "gender" field was cleared in this mutation.

func (*PersonMutation) ID

func (m *PersonMutation) 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 (*PersonMutation) IDs

func (m *PersonMutation) 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 (*PersonMutation) Language

func (m *PersonMutation) Language() (r string, exists bool)

Language returns the value of the "language" field in the mutation.

func (*PersonMutation) LastName

func (m *PersonMutation) LastName() (r string, exists bool)

LastName returns the value of the "last_name" field in the mutation.

func (*PersonMutation) LastNameCleared

func (m *PersonMutation) LastNameCleared() bool

LastNameCleared returns if the "last_name" field was cleared in this mutation.

func (*PersonMutation) OldAddress

func (m *PersonMutation) OldAddress(ctx context.Context) (v *string, err error)

OldAddress returns the old "address" field's value of the Person entity. If the Person 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 (*PersonMutation) OldBirthdate

func (m *PersonMutation) OldBirthdate(ctx context.Context) (v *time.Time, err error)

OldBirthdate returns the old "birthdate" field's value of the Person entity. If the Person 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 (*PersonMutation) OldCity

func (m *PersonMutation) OldCity(ctx context.Context) (v *string, err error)

OldCity returns the old "city" field's value of the Person entity. If the Person 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 (*PersonMutation) OldCountry

func (m *PersonMutation) OldCountry(ctx context.Context) (v *string, err error)

OldCountry returns the old "country" field's value of the Person entity. If the Person 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 (*PersonMutation) OldCreatedAt

func (m *PersonMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)

OldCreatedAt returns the old "created_at" field's value of the Person entity. If the Person 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 (*PersonMutation) OldEmail

func (m *PersonMutation) OldEmail(ctx context.Context) (v string, err error)

OldEmail returns the old "email" field's value of the Person entity. If the Person 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 (*PersonMutation) OldEmailVerifiedAt

func (m *PersonMutation) OldEmailVerifiedAt(ctx context.Context) (v *time.Time, err error)

OldEmailVerifiedAt returns the old "email_verified_at" field's value of the Person entity. If the Person 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 (*PersonMutation) OldField

func (m *PersonMutation) 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 (*PersonMutation) OldFirstName

func (m *PersonMutation) OldFirstName(ctx context.Context) (v string, err error)

OldFirstName returns the old "first_name" field's value of the Person entity. If the Person 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 (*PersonMutation) OldGender

func (m *PersonMutation) OldGender(ctx context.Context) (v *person.Gender, err error)

OldGender returns the old "gender" field's value of the Person entity. If the Person 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 (*PersonMutation) OldLanguage

func (m *PersonMutation) OldLanguage(ctx context.Context) (v string, err error)

OldLanguage returns the old "language" field's value of the Person entity. If the Person 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 (*PersonMutation) OldLastName

func (m *PersonMutation) OldLastName(ctx context.Context) (v *string, err error)

OldLastName returns the old "last_name" field's value of the Person entity. If the Person 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 (*PersonMutation) OldPassword

func (m *PersonMutation) OldPassword(ctx context.Context) (v string, err error)

OldPassword returns the old "password" field's value of the Person entity. If the Person 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 (*PersonMutation) OldPhone

func (m *PersonMutation) OldPhone(ctx context.Context) (v *string, err error)

OldPhone returns the old "phone" field's value of the Person entity. If the Person 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 (*PersonMutation) OldPostalCode

func (m *PersonMutation) OldPostalCode(ctx context.Context) (v *string, err error)

OldPostalCode returns the old "postal_code" field's value of the Person entity. If the Person 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 (*PersonMutation) OldStripeID

func (m *PersonMutation) OldStripeID(ctx context.Context) (v *string, err error)

OldStripeID returns the old "stripe_id" field's value of the Person entity. If the Person 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 (*PersonMutation) OldSubscribed

func (m *PersonMutation) OldSubscribed(ctx context.Context) (v bool, err error)

OldSubscribed returns the old "subscribed" field's value of the Person entity. If the Person 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 (*PersonMutation) OldTaxID

func (m *PersonMutation) OldTaxID(ctx context.Context) (v string, err error)

OldTaxID returns the old "tax_id" field's value of the Person entity. If the Person 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 (*PersonMutation) OldUpdatedAt

func (m *PersonMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)

OldUpdatedAt returns the old "updated_at" field's value of the Person entity. If the Person 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 (*PersonMutation) Op

func (m *PersonMutation) Op() Op

Op returns the operation name.

func (*PersonMutation) Password

func (m *PersonMutation) Password() (r string, exists bool)

Password returns the value of the "password" field in the mutation.

func (*PersonMutation) Phone

func (m *PersonMutation) Phone() (r string, exists bool)

Phone returns the value of the "phone" field in the mutation.

func (*PersonMutation) PhoneCleared

func (m *PersonMutation) PhoneCleared() bool

PhoneCleared returns if the "phone" field was cleared in this mutation.

func (*PersonMutation) PostalCode

func (m *PersonMutation) PostalCode() (r string, exists bool)

PostalCode returns the value of the "postal_code" field in the mutation.

func (*PersonMutation) PostalCodeCleared

func (m *PersonMutation) PostalCodeCleared() bool

PostalCodeCleared returns if the "postal_code" field was cleared in this mutation.

func (*PersonMutation) QueryContext

func (c *PersonMutation) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*PersonMutation) RemoveAuthenticationIDs

func (m *PersonMutation) RemoveAuthenticationIDs(ids ...uuid.UUID)

RemoveAuthenticationIDs removes the "authentications" edge to the Authentication entity by IDs.

func (*PersonMutation) RemoveAuthorizationIDs

func (m *PersonMutation) RemoveAuthorizationIDs(ids ...uuid.UUID)

RemoveAuthorizationIDs removes the "authorizations" edge to the Authorization entity by IDs.

func (*PersonMutation) RemovedAuthenticationsIDs

func (m *PersonMutation) RemovedAuthenticationsIDs() (ids []uuid.UUID)

RemovedAuthentications returns the removed IDs of the "authentications" edge to the Authentication entity.

func (*PersonMutation) RemovedAuthorizationsIDs

func (m *PersonMutation) RemovedAuthorizationsIDs() (ids []uuid.UUID)

RemovedAuthorizations returns the removed IDs of the "authorizations" edge to the Authorization entity.

func (*PersonMutation) RemovedEdges

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

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

func (*PersonMutation) RemovedIDs

func (m *PersonMutation) 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 (*PersonMutation) ResetAddress

func (m *PersonMutation) ResetAddress()

ResetAddress resets all changes to the "address" field.

func (*PersonMutation) ResetAuthentications

func (m *PersonMutation) ResetAuthentications()

ResetAuthentications resets all changes to the "authentications" edge.

func (*PersonMutation) ResetAuthorizations

func (m *PersonMutation) ResetAuthorizations()

ResetAuthorizations resets all changes to the "authorizations" edge.

func (*PersonMutation) ResetBirthdate

func (m *PersonMutation) ResetBirthdate()

ResetBirthdate resets all changes to the "birthdate" field.

func (*PersonMutation) ResetCity

func (m *PersonMutation) ResetCity()

ResetCity resets all changes to the "city" field.

func (*PersonMutation) ResetCountry

func (m *PersonMutation) ResetCountry()

ResetCountry resets all changes to the "country" field.

func (*PersonMutation) ResetCreatedAt

func (m *PersonMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*PersonMutation) ResetEdge

func (m *PersonMutation) 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 (*PersonMutation) ResetEmail

func (m *PersonMutation) ResetEmail()

ResetEmail resets all changes to the "email" field.

func (*PersonMutation) ResetEmailVerifiedAt

func (m *PersonMutation) ResetEmailVerifiedAt()

ResetEmailVerifiedAt resets all changes to the "email_verified_at" field.

func (*PersonMutation) ResetField

func (m *PersonMutation) 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 (*PersonMutation) ResetFirstName

func (m *PersonMutation) ResetFirstName()

ResetFirstName resets all changes to the "first_name" field.

func (*PersonMutation) ResetGender

func (m *PersonMutation) ResetGender()

ResetGender resets all changes to the "gender" field.

func (*PersonMutation) ResetLanguage

func (m *PersonMutation) ResetLanguage()

ResetLanguage resets all changes to the "language" field.

func (*PersonMutation) ResetLastName

func (m *PersonMutation) ResetLastName()

ResetLastName resets all changes to the "last_name" field.

func (*PersonMutation) ResetPassword

func (m *PersonMutation) ResetPassword()

ResetPassword resets all changes to the "password" field.

func (*PersonMutation) ResetPhone

func (m *PersonMutation) ResetPhone()

ResetPhone resets all changes to the "phone" field.

func (*PersonMutation) ResetPostalCode

func (m *PersonMutation) ResetPostalCode()

ResetPostalCode resets all changes to the "postal_code" field.

func (*PersonMutation) ResetStripeID

func (m *PersonMutation) ResetStripeID()

ResetStripeID resets all changes to the "stripe_id" field.

func (*PersonMutation) ResetSubscribed

func (m *PersonMutation) ResetSubscribed()

ResetSubscribed resets all changes to the "subscribed" field.

func (*PersonMutation) ResetTaxID

func (m *PersonMutation) ResetTaxID()

ResetTaxID resets all changes to the "tax_id" field.

func (*PersonMutation) ResetUpdatedAt

func (m *PersonMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*PersonMutation) SetAddress

func (m *PersonMutation) SetAddress(s string)

SetAddress sets the "address" field.

func (*PersonMutation) SetBirthdate

func (m *PersonMutation) SetBirthdate(t time.Time)

SetBirthdate sets the "birthdate" field.

func (*PersonMutation) SetCity

func (m *PersonMutation) SetCity(s string)

SetCity sets the "city" field.

func (*PersonMutation) SetCountry

func (m *PersonMutation) SetCountry(s string)

SetCountry sets the "country" field.

func (*PersonMutation) SetCreatedAt

func (m *PersonMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" field.

func (*PersonMutation) SetEmail

func (m *PersonMutation) SetEmail(s string)

SetEmail sets the "email" field.

func (*PersonMutation) SetEmailVerifiedAt

func (m *PersonMutation) SetEmailVerifiedAt(t time.Time)

SetEmailVerifiedAt sets the "email_verified_at" field.

func (*PersonMutation) SetField

func (m *PersonMutation) 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 (*PersonMutation) SetFirstName

func (m *PersonMutation) SetFirstName(s string)

SetFirstName sets the "first_name" field.

func (*PersonMutation) SetGender

func (m *PersonMutation) SetGender(pe person.Gender)

SetGender sets the "gender" field.

func (*PersonMutation) SetID

func (m *PersonMutation) SetID(id uuid.UUID)

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

func (*PersonMutation) SetLanguage

func (m *PersonMutation) SetLanguage(s string)

SetLanguage sets the "language" field.

func (*PersonMutation) SetLastName

func (m *PersonMutation) SetLastName(s string)

SetLastName sets the "last_name" field.

func (*PersonMutation) SetOp

func (m *PersonMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*PersonMutation) SetPassword

func (m *PersonMutation) SetPassword(s string)

SetPassword sets the "password" field.

func (*PersonMutation) SetPhone

func (m *PersonMutation) SetPhone(s string)

SetPhone sets the "phone" field.

func (*PersonMutation) SetPostalCode

func (m *PersonMutation) SetPostalCode(s string)

SetPostalCode sets the "postal_code" field.

func (*PersonMutation) SetStripeID

func (m *PersonMutation) SetStripeID(s string)

SetStripeID sets the "stripe_id" field.

func (*PersonMutation) SetSubscribed

func (m *PersonMutation) SetSubscribed(b bool)

SetSubscribed sets the "subscribed" field.

func (*PersonMutation) SetTaxID

func (m *PersonMutation) SetTaxID(s string)

SetTaxID sets the "tax_id" field.

func (*PersonMutation) SetUpdatedAt

func (m *PersonMutation) SetUpdatedAt(t time.Time)

SetUpdatedAt sets the "updated_at" field.

func (*PersonMutation) StripeID

func (m *PersonMutation) StripeID() (r string, exists bool)

StripeID returns the value of the "stripe_id" field in the mutation.

func (*PersonMutation) StripeIDCleared

func (m *PersonMutation) StripeIDCleared() bool

StripeIDCleared returns if the "stripe_id" field was cleared in this mutation.

func (*PersonMutation) Subscribed

func (m *PersonMutation) Subscribed() (r bool, exists bool)

Subscribed returns the value of the "subscribed" field in the mutation.

func (*PersonMutation) TaxID

func (m *PersonMutation) TaxID() (r string, exists bool)

TaxID returns the value of the "tax_id" field in the mutation.

func (PersonMutation) Tx

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

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

func (*PersonMutation) Type

func (m *PersonMutation) Type() string

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

func (*PersonMutation) UpdatedAt

func (m *PersonMutation) UpdatedAt() (r time.Time, exists bool)

UpdatedAt returns the value of the "updated_at" field in the mutation.

func (*PersonMutation) Where

func (m *PersonMutation) Where(ps ...predicate.Person)

Where appends a list predicates to the PersonMutation builder.

func (*PersonMutation) WhereP

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

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

type PersonOrder

type PersonOrder struct {
	Direction OrderDirection    `json:"direction"`
	Field     *PersonOrderField `json:"field"`
}

PersonOrder defines the ordering of Person.

type PersonOrderField

type PersonOrderField struct {
	// Value extracts the ordering value from the given Person.
	Value func(*Person) (ent.Value, error)
	// contains filtered or unexported fields
}

PersonOrderField defines the ordering field of Person.

type PersonPaginateOption

type PersonPaginateOption func(*personPager) error

PersonPaginateOption enables pagination customization.

func WithPersonFilter

func WithPersonFilter(filter func(*PersonQuery) (*PersonQuery, error)) PersonPaginateOption

WithPersonFilter configures pagination filter.

func WithPersonOrder

func WithPersonOrder(order *PersonOrder) PersonPaginateOption

WithPersonOrder configures pagination ordering.

type PersonQuery

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

PersonQuery is the builder for querying Person entities.

func (*PersonQuery) Aggregate

func (pq *PersonQuery) Aggregate(fns ...AggregateFunc) *PersonSelect

Aggregate returns a PersonSelect configured with the given aggregations.

func (*PersonQuery) All

func (pq *PersonQuery) All(ctx context.Context) ([]*Person, error)

All executes the query and returns a list of Persons.

func (*PersonQuery) AllX

func (pq *PersonQuery) AllX(ctx context.Context) []*Person

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

func (*PersonQuery) Clone

func (pq *PersonQuery) Clone() *PersonQuery

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

func (*PersonQuery) CollectFields

func (pe *PersonQuery) CollectFields(ctx context.Context, satisfies ...string) (*PersonQuery, error)

CollectFields tells the query-builder to eagerly load connected nodes by resolver context.

func (*PersonQuery) Count

func (pq *PersonQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*PersonQuery) CountX

func (pq *PersonQuery) CountX(ctx context.Context) int

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

func (*PersonQuery) ExecContext

func (c *PersonQuery) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*PersonQuery) Exist

func (pq *PersonQuery) Exist(ctx context.Context) (bool, error)

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

func (*PersonQuery) ExistX

func (pq *PersonQuery) ExistX(ctx context.Context) bool

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

func (*PersonQuery) Filter

func (pq *PersonQuery) Filter() *PersonFilter

Filter returns a Filter implementation to apply filters on the PersonQuery builder.

func (*PersonQuery) First

func (pq *PersonQuery) First(ctx context.Context) (*Person, error)

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

func (*PersonQuery) FirstID

func (pq *PersonQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

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

func (*PersonQuery) FirstIDX

func (pq *PersonQuery) FirstIDX(ctx context.Context) uuid.UUID

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

func (*PersonQuery) FirstX

func (pq *PersonQuery) FirstX(ctx context.Context) *Person

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

func (*PersonQuery) GroupBy

func (pq *PersonQuery) GroupBy(field string, fields ...string) *PersonGroupBy

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

client.Person.Query().
	GroupBy(person.FieldStripeID).
	Aggregate(data.Count()).
	Scan(ctx, &v)

func (*PersonQuery) IDs

func (pq *PersonQuery) IDs(ctx context.Context) (ids []uuid.UUID, err error)

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

func (*PersonQuery) IDsX

func (pq *PersonQuery) IDsX(ctx context.Context) []uuid.UUID

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

func (*PersonQuery) Limit

func (pq *PersonQuery) Limit(limit int) *PersonQuery

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

func (*PersonQuery) Offset

func (pq *PersonQuery) Offset(offset int) *PersonQuery

Offset to start from.

func (*PersonQuery) Only

func (pq *PersonQuery) Only(ctx context.Context) (*Person, error)

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

func (*PersonQuery) OnlyID

func (pq *PersonQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

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

func (*PersonQuery) OnlyIDX

func (pq *PersonQuery) OnlyIDX(ctx context.Context) uuid.UUID

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

func (*PersonQuery) OnlyX

func (pq *PersonQuery) OnlyX(ctx context.Context) *Person

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

func (*PersonQuery) Order

func (pq *PersonQuery) Order(o ...person.OrderOption) *PersonQuery

Order specifies how the records should be ordered.

func (*PersonQuery) Paginate

func (pe *PersonQuery) Paginate(
	ctx context.Context, after *Cursor, first *int,
	before *Cursor, last *int, opts ...PersonPaginateOption,
) (*PersonConnection, error)

Paginate executes the query and returns a relay based cursor connection to Person.

func (*PersonQuery) QueryAuthentications

func (pq *PersonQuery) QueryAuthentications() *AuthenticationQuery

QueryAuthentications chains the current query on the "authentications" edge.

func (*PersonQuery) QueryAuthorizations

func (pq *PersonQuery) QueryAuthorizations() *AuthorizationQuery

QueryAuthorizations chains the current query on the "authorizations" edge.

func (*PersonQuery) QueryContext

func (c *PersonQuery) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*PersonQuery) Select

func (pq *PersonQuery) Select(fields ...string) *PersonSelect

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

client.Person.Query().
	Select(person.FieldStripeID).
	Scan(ctx, &v)

func (*PersonQuery) Unique

func (pq *PersonQuery) Unique(unique bool) *PersonQuery

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

func (pq *PersonQuery) Where(ps ...predicate.Person) *PersonQuery

Where adds a new predicate for the PersonQuery builder.

func (*PersonQuery) WithAuthentications

func (pq *PersonQuery) WithAuthentications(opts ...func(*AuthenticationQuery)) *PersonQuery

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

func (*PersonQuery) WithAuthorizations

func (pq *PersonQuery) WithAuthorizations(opts ...func(*AuthorizationQuery)) *PersonQuery

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

func (*PersonQuery) WithNamedAuthentications

func (pq *PersonQuery) WithNamedAuthentications(name string, opts ...func(*AuthenticationQuery)) *PersonQuery

WithNamedAuthentications tells the query-builder to eager-load the nodes that are connected to the "authentications" edge with the given name. The optional arguments are used to configure the query builder of the edge.

func (*PersonQuery) WithNamedAuthorizations

func (pq *PersonQuery) WithNamedAuthorizations(name string, opts ...func(*AuthorizationQuery)) *PersonQuery

WithNamedAuthorizations tells the query-builder to eager-load the nodes that are connected to the "authorizations" edge with the given name. The optional arguments are used to configure the query builder of the edge.

type PersonSelect

type PersonSelect struct {
	*PersonQuery
	// contains filtered or unexported fields
}

PersonSelect is the builder for selecting fields of Person entities.

func (*PersonSelect) Aggregate

func (ps *PersonSelect) Aggregate(fns ...AggregateFunc) *PersonSelect

Aggregate adds the given aggregation functions to the selector query.

func (*PersonSelect) Bool

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

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

func (*PersonSelect) BoolX

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

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

func (*PersonSelect) Bools

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

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

func (*PersonSelect) BoolsX

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

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

func (PersonSelect) ExecContext

func (c PersonSelect) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*PersonSelect) Float64

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

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

func (*PersonSelect) Float64X

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

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

func (*PersonSelect) Float64s

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

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

func (*PersonSelect) Float64sX

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

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

func (*PersonSelect) Int

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

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

func (*PersonSelect) IntX

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

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

func (*PersonSelect) Ints

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

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

func (*PersonSelect) IntsX

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

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

func (PersonSelect) QueryContext

func (c PersonSelect) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*PersonSelect) Scan

func (ps *PersonSelect) Scan(ctx context.Context, v any) error

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

func (*PersonSelect) ScanX

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

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

func (*PersonSelect) String

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

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

func (*PersonSelect) StringX

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

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

func (*PersonSelect) Strings

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

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

func (*PersonSelect) StringsX

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

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

type PersonUpdate

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

PersonUpdate is the builder for updating Person entities.

func (*PersonUpdate) AddAuthenticationIDs

func (pu *PersonUpdate) AddAuthenticationIDs(ids ...uuid.UUID) *PersonUpdate

AddAuthenticationIDs adds the "authentications" edge to the Authentication entity by IDs.

func (*PersonUpdate) AddAuthentications

func (pu *PersonUpdate) AddAuthentications(a ...*Authentication) *PersonUpdate

AddAuthentications adds the "authentications" edges to the Authentication entity.

func (*PersonUpdate) AddAuthorizationIDs

func (pu *PersonUpdate) AddAuthorizationIDs(ids ...uuid.UUID) *PersonUpdate

AddAuthorizationIDs adds the "authorizations" edge to the Authorization entity by IDs.

func (*PersonUpdate) AddAuthorizations

func (pu *PersonUpdate) AddAuthorizations(a ...*Authorization) *PersonUpdate

AddAuthorizations adds the "authorizations" edges to the Authorization entity.

func (*PersonUpdate) ClearAddress

func (pu *PersonUpdate) ClearAddress() *PersonUpdate

ClearAddress clears the value of the "address" field.

func (*PersonUpdate) ClearAuthentications

func (pu *PersonUpdate) ClearAuthentications() *PersonUpdate

ClearAuthentications clears all "authentications" edges to the Authentication entity.

func (*PersonUpdate) ClearAuthorizations

func (pu *PersonUpdate) ClearAuthorizations() *PersonUpdate

ClearAuthorizations clears all "authorizations" edges to the Authorization entity.

func (*PersonUpdate) ClearBirthdate

func (pu *PersonUpdate) ClearBirthdate() *PersonUpdate

ClearBirthdate clears the value of the "birthdate" field.

func (*PersonUpdate) ClearCity

func (pu *PersonUpdate) ClearCity() *PersonUpdate

ClearCity clears the value of the "city" field.

func (*PersonUpdate) ClearCountry

func (pu *PersonUpdate) ClearCountry() *PersonUpdate

ClearCountry clears the value of the "country" field.

func (*PersonUpdate) ClearEmailVerifiedAt

func (pu *PersonUpdate) ClearEmailVerifiedAt() *PersonUpdate

ClearEmailVerifiedAt clears the value of the "email_verified_at" field.

func (*PersonUpdate) ClearGender

func (pu *PersonUpdate) ClearGender() *PersonUpdate

ClearGender clears the value of the "gender" field.

func (*PersonUpdate) ClearLastName

func (pu *PersonUpdate) ClearLastName() *PersonUpdate

ClearLastName clears the value of the "last_name" field.

func (*PersonUpdate) ClearPhone

func (pu *PersonUpdate) ClearPhone() *PersonUpdate

ClearPhone clears the value of the "phone" field.

func (*PersonUpdate) ClearPostalCode

func (pu *PersonUpdate) ClearPostalCode() *PersonUpdate

ClearPostalCode clears the value of the "postal_code" field.

func (*PersonUpdate) ClearStripeID

func (pu *PersonUpdate) ClearStripeID() *PersonUpdate

ClearStripeID clears the value of the "stripe_id" field.

func (*PersonUpdate) Exec

func (pu *PersonUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*PersonUpdate) ExecContext

func (c *PersonUpdate) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*PersonUpdate) ExecX

func (pu *PersonUpdate) ExecX(ctx context.Context)

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

func (*PersonUpdate) Mutation

func (pu *PersonUpdate) Mutation() *PersonMutation

Mutation returns the PersonMutation object of the builder.

func (*PersonUpdate) QueryContext

func (c *PersonUpdate) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*PersonUpdate) RemoveAuthenticationIDs

func (pu *PersonUpdate) RemoveAuthenticationIDs(ids ...uuid.UUID) *PersonUpdate

RemoveAuthenticationIDs removes the "authentications" edge to Authentication entities by IDs.

func (*PersonUpdate) RemoveAuthentications

func (pu *PersonUpdate) RemoveAuthentications(a ...*Authentication) *PersonUpdate

RemoveAuthentications removes "authentications" edges to Authentication entities.

func (*PersonUpdate) RemoveAuthorizationIDs

func (pu *PersonUpdate) RemoveAuthorizationIDs(ids ...uuid.UUID) *PersonUpdate

RemoveAuthorizationIDs removes the "authorizations" edge to Authorization entities by IDs.

func (*PersonUpdate) RemoveAuthorizations

func (pu *PersonUpdate) RemoveAuthorizations(a ...*Authorization) *PersonUpdate

RemoveAuthorizations removes "authorizations" edges to Authorization entities.

func (*PersonUpdate) Save

func (pu *PersonUpdate) Save(ctx context.Context) (int, error)

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

func (*PersonUpdate) SaveX

func (pu *PersonUpdate) SaveX(ctx context.Context) int

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

func (*PersonUpdate) SetAddress

func (pu *PersonUpdate) SetAddress(s string) *PersonUpdate

SetAddress sets the "address" field.

func (*PersonUpdate) SetBirthdate

func (pu *PersonUpdate) SetBirthdate(t time.Time) *PersonUpdate

SetBirthdate sets the "birthdate" field.

func (*PersonUpdate) SetCity

func (pu *PersonUpdate) SetCity(s string) *PersonUpdate

SetCity sets the "city" field.

func (*PersonUpdate) SetCountry

func (pu *PersonUpdate) SetCountry(s string) *PersonUpdate

SetCountry sets the "country" field.

func (*PersonUpdate) SetEmail

func (pu *PersonUpdate) SetEmail(s string) *PersonUpdate

SetEmail sets the "email" field.

func (*PersonUpdate) SetEmailVerifiedAt

func (pu *PersonUpdate) SetEmailVerifiedAt(t time.Time) *PersonUpdate

SetEmailVerifiedAt sets the "email_verified_at" field.

func (*PersonUpdate) SetFirstName

func (pu *PersonUpdate) SetFirstName(s string) *PersonUpdate

SetFirstName sets the "first_name" field.

func (*PersonUpdate) SetGender

func (pu *PersonUpdate) SetGender(pe person.Gender) *PersonUpdate

SetGender sets the "gender" field.

func (*PersonUpdate) SetLanguage

func (pu *PersonUpdate) SetLanguage(s string) *PersonUpdate

SetLanguage sets the "language" field.

func (*PersonUpdate) SetLastName

func (pu *PersonUpdate) SetLastName(s string) *PersonUpdate

SetLastName sets the "last_name" field.

func (*PersonUpdate) SetNillableAddress

func (pu *PersonUpdate) SetNillableAddress(s *string) *PersonUpdate

SetNillableAddress sets the "address" field if the given value is not nil.

func (*PersonUpdate) SetNillableBirthdate

func (pu *PersonUpdate) SetNillableBirthdate(t *time.Time) *PersonUpdate

SetNillableBirthdate sets the "birthdate" field if the given value is not nil.

func (*PersonUpdate) SetNillableCity

func (pu *PersonUpdate) SetNillableCity(s *string) *PersonUpdate

SetNillableCity sets the "city" field if the given value is not nil.

func (*PersonUpdate) SetNillableCountry

func (pu *PersonUpdate) SetNillableCountry(s *string) *PersonUpdate

SetNillableCountry sets the "country" field if the given value is not nil.

func (*PersonUpdate) SetNillableEmailVerifiedAt

func (pu *PersonUpdate) SetNillableEmailVerifiedAt(t *time.Time) *PersonUpdate

SetNillableEmailVerifiedAt sets the "email_verified_at" field if the given value is not nil.

func (*PersonUpdate) SetNillableGender

func (pu *PersonUpdate) SetNillableGender(pe *person.Gender) *PersonUpdate

SetNillableGender sets the "gender" field if the given value is not nil.

func (*PersonUpdate) SetNillableLastName

func (pu *PersonUpdate) SetNillableLastName(s *string) *PersonUpdate

SetNillableLastName sets the "last_name" field if the given value is not nil.

func (*PersonUpdate) SetNillablePhone

func (pu *PersonUpdate) SetNillablePhone(s *string) *PersonUpdate

SetNillablePhone sets the "phone" field if the given value is not nil.

func (*PersonUpdate) SetNillablePostalCode

func (pu *PersonUpdate) SetNillablePostalCode(s *string) *PersonUpdate

SetNillablePostalCode sets the "postal_code" field if the given value is not nil.

func (*PersonUpdate) SetNillableStripeID

func (pu *PersonUpdate) SetNillableStripeID(s *string) *PersonUpdate

SetNillableStripeID sets the "stripe_id" field if the given value is not nil.

func (*PersonUpdate) SetNillableSubscribed

func (pu *PersonUpdate) SetNillableSubscribed(b *bool) *PersonUpdate

SetNillableSubscribed sets the "subscribed" field if the given value is not nil.

func (*PersonUpdate) SetPassword

func (pu *PersonUpdate) SetPassword(s string) *PersonUpdate

SetPassword sets the "password" field.

func (*PersonUpdate) SetPhone

func (pu *PersonUpdate) SetPhone(s string) *PersonUpdate

SetPhone sets the "phone" field.

func (*PersonUpdate) SetPostalCode

func (pu *PersonUpdate) SetPostalCode(s string) *PersonUpdate

SetPostalCode sets the "postal_code" field.

func (*PersonUpdate) SetStripeID

func (pu *PersonUpdate) SetStripeID(s string) *PersonUpdate

SetStripeID sets the "stripe_id" field.

func (*PersonUpdate) SetSubscribed

func (pu *PersonUpdate) SetSubscribed(b bool) *PersonUpdate

SetSubscribed sets the "subscribed" field.

func (*PersonUpdate) SetTaxID

func (pu *PersonUpdate) SetTaxID(s string) *PersonUpdate

SetTaxID sets the "tax_id" field.

func (*PersonUpdate) SetUpdatedAt

func (pu *PersonUpdate) SetUpdatedAt(t time.Time) *PersonUpdate

SetUpdatedAt sets the "updated_at" field.

func (*PersonUpdate) Where

func (pu *PersonUpdate) Where(ps ...predicate.Person) *PersonUpdate

Where appends a list predicates to the PersonUpdate builder.

type PersonUpdateOne

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

PersonUpdateOne is the builder for updating a single Person entity.

func (*PersonUpdateOne) AddAuthenticationIDs

func (puo *PersonUpdateOne) AddAuthenticationIDs(ids ...uuid.UUID) *PersonUpdateOne

AddAuthenticationIDs adds the "authentications" edge to the Authentication entity by IDs.

func (*PersonUpdateOne) AddAuthentications

func (puo *PersonUpdateOne) AddAuthentications(a ...*Authentication) *PersonUpdateOne

AddAuthentications adds the "authentications" edges to the Authentication entity.

func (*PersonUpdateOne) AddAuthorizationIDs

func (puo *PersonUpdateOne) AddAuthorizationIDs(ids ...uuid.UUID) *PersonUpdateOne

AddAuthorizationIDs adds the "authorizations" edge to the Authorization entity by IDs.

func (*PersonUpdateOne) AddAuthorizations

func (puo *PersonUpdateOne) AddAuthorizations(a ...*Authorization) *PersonUpdateOne

AddAuthorizations adds the "authorizations" edges to the Authorization entity.

func (*PersonUpdateOne) ClearAddress

func (puo *PersonUpdateOne) ClearAddress() *PersonUpdateOne

ClearAddress clears the value of the "address" field.

func (*PersonUpdateOne) ClearAuthentications

func (puo *PersonUpdateOne) ClearAuthentications() *PersonUpdateOne

ClearAuthentications clears all "authentications" edges to the Authentication entity.

func (*PersonUpdateOne) ClearAuthorizations

func (puo *PersonUpdateOne) ClearAuthorizations() *PersonUpdateOne

ClearAuthorizations clears all "authorizations" edges to the Authorization entity.

func (*PersonUpdateOne) ClearBirthdate

func (puo *PersonUpdateOne) ClearBirthdate() *PersonUpdateOne

ClearBirthdate clears the value of the "birthdate" field.

func (*PersonUpdateOne) ClearCity

func (puo *PersonUpdateOne) ClearCity() *PersonUpdateOne

ClearCity clears the value of the "city" field.

func (*PersonUpdateOne) ClearCountry

func (puo *PersonUpdateOne) ClearCountry() *PersonUpdateOne

ClearCountry clears the value of the "country" field.

func (*PersonUpdateOne) ClearEmailVerifiedAt

func (puo *PersonUpdateOne) ClearEmailVerifiedAt() *PersonUpdateOne

ClearEmailVerifiedAt clears the value of the "email_verified_at" field.

func (*PersonUpdateOne) ClearGender

func (puo *PersonUpdateOne) ClearGender() *PersonUpdateOne

ClearGender clears the value of the "gender" field.

func (*PersonUpdateOne) ClearLastName

func (puo *PersonUpdateOne) ClearLastName() *PersonUpdateOne

ClearLastName clears the value of the "last_name" field.

func (*PersonUpdateOne) ClearPhone

func (puo *PersonUpdateOne) ClearPhone() *PersonUpdateOne

ClearPhone clears the value of the "phone" field.

func (*PersonUpdateOne) ClearPostalCode

func (puo *PersonUpdateOne) ClearPostalCode() *PersonUpdateOne

ClearPostalCode clears the value of the "postal_code" field.

func (*PersonUpdateOne) ClearStripeID

func (puo *PersonUpdateOne) ClearStripeID() *PersonUpdateOne

ClearStripeID clears the value of the "stripe_id" field.

func (*PersonUpdateOne) Exec

func (puo *PersonUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*PersonUpdateOne) ExecContext

func (c *PersonUpdateOne) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*PersonUpdateOne) ExecX

func (puo *PersonUpdateOne) ExecX(ctx context.Context)

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

func (*PersonUpdateOne) Mutation

func (puo *PersonUpdateOne) Mutation() *PersonMutation

Mutation returns the PersonMutation object of the builder.

func (*PersonUpdateOne) QueryContext

func (c *PersonUpdateOne) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*PersonUpdateOne) RemoveAuthenticationIDs

func (puo *PersonUpdateOne) RemoveAuthenticationIDs(ids ...uuid.UUID) *PersonUpdateOne

RemoveAuthenticationIDs removes the "authentications" edge to Authentication entities by IDs.

func (*PersonUpdateOne) RemoveAuthentications

func (puo *PersonUpdateOne) RemoveAuthentications(a ...*Authentication) *PersonUpdateOne

RemoveAuthentications removes "authentications" edges to Authentication entities.

func (*PersonUpdateOne) RemoveAuthorizationIDs

func (puo *PersonUpdateOne) RemoveAuthorizationIDs(ids ...uuid.UUID) *PersonUpdateOne

RemoveAuthorizationIDs removes the "authorizations" edge to Authorization entities by IDs.

func (*PersonUpdateOne) RemoveAuthorizations

func (puo *PersonUpdateOne) RemoveAuthorizations(a ...*Authorization) *PersonUpdateOne

RemoveAuthorizations removes "authorizations" edges to Authorization entities.

func (*PersonUpdateOne) Save

func (puo *PersonUpdateOne) Save(ctx context.Context) (*Person, error)

Save executes the query and returns the updated Person entity.

func (*PersonUpdateOne) SaveX

func (puo *PersonUpdateOne) SaveX(ctx context.Context) *Person

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

func (*PersonUpdateOne) Select

func (puo *PersonUpdateOne) Select(field string, fields ...string) *PersonUpdateOne

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

func (*PersonUpdateOne) SetAddress

func (puo *PersonUpdateOne) SetAddress(s string) *PersonUpdateOne

SetAddress sets the "address" field.

func (*PersonUpdateOne) SetBirthdate

func (puo *PersonUpdateOne) SetBirthdate(t time.Time) *PersonUpdateOne

SetBirthdate sets the "birthdate" field.

func (*PersonUpdateOne) SetCity

func (puo *PersonUpdateOne) SetCity(s string) *PersonUpdateOne

SetCity sets the "city" field.

func (*PersonUpdateOne) SetCountry

func (puo *PersonUpdateOne) SetCountry(s string) *PersonUpdateOne

SetCountry sets the "country" field.

func (*PersonUpdateOne) SetEmail

func (puo *PersonUpdateOne) SetEmail(s string) *PersonUpdateOne

SetEmail sets the "email" field.

func (*PersonUpdateOne) SetEmailVerifiedAt

func (puo *PersonUpdateOne) SetEmailVerifiedAt(t time.Time) *PersonUpdateOne

SetEmailVerifiedAt sets the "email_verified_at" field.

func (*PersonUpdateOne) SetFirstName

func (puo *PersonUpdateOne) SetFirstName(s string) *PersonUpdateOne

SetFirstName sets the "first_name" field.

func (*PersonUpdateOne) SetGender

func (puo *PersonUpdateOne) SetGender(pe person.Gender) *PersonUpdateOne

SetGender sets the "gender" field.

func (*PersonUpdateOne) SetLanguage

func (puo *PersonUpdateOne) SetLanguage(s string) *PersonUpdateOne

SetLanguage sets the "language" field.

func (*PersonUpdateOne) SetLastName

func (puo *PersonUpdateOne) SetLastName(s string) *PersonUpdateOne

SetLastName sets the "last_name" field.

func (*PersonUpdateOne) SetNillableAddress

func (puo *PersonUpdateOne) SetNillableAddress(s *string) *PersonUpdateOne

SetNillableAddress sets the "address" field if the given value is not nil.

func (*PersonUpdateOne) SetNillableBirthdate

func (puo *PersonUpdateOne) SetNillableBirthdate(t *time.Time) *PersonUpdateOne

SetNillableBirthdate sets the "birthdate" field if the given value is not nil.

func (*PersonUpdateOne) SetNillableCity

func (puo *PersonUpdateOne) SetNillableCity(s *string) *PersonUpdateOne

SetNillableCity sets the "city" field if the given value is not nil.

func (*PersonUpdateOne) SetNillableCountry

func (puo *PersonUpdateOne) SetNillableCountry(s *string) *PersonUpdateOne

SetNillableCountry sets the "country" field if the given value is not nil.

func (*PersonUpdateOne) SetNillableEmailVerifiedAt

func (puo *PersonUpdateOne) SetNillableEmailVerifiedAt(t *time.Time) *PersonUpdateOne

SetNillableEmailVerifiedAt sets the "email_verified_at" field if the given value is not nil.

func (*PersonUpdateOne) SetNillableGender

func (puo *PersonUpdateOne) SetNillableGender(pe *person.Gender) *PersonUpdateOne

SetNillableGender sets the "gender" field if the given value is not nil.

func (*PersonUpdateOne) SetNillableLastName

func (puo *PersonUpdateOne) SetNillableLastName(s *string) *PersonUpdateOne

SetNillableLastName sets the "last_name" field if the given value is not nil.

func (*PersonUpdateOne) SetNillablePhone

func (puo *PersonUpdateOne) SetNillablePhone(s *string) *PersonUpdateOne

SetNillablePhone sets the "phone" field if the given value is not nil.

func (*PersonUpdateOne) SetNillablePostalCode

func (puo *PersonUpdateOne) SetNillablePostalCode(s *string) *PersonUpdateOne

SetNillablePostalCode sets the "postal_code" field if the given value is not nil.

func (*PersonUpdateOne) SetNillableStripeID

func (puo *PersonUpdateOne) SetNillableStripeID(s *string) *PersonUpdateOne

SetNillableStripeID sets the "stripe_id" field if the given value is not nil.

func (*PersonUpdateOne) SetNillableSubscribed

func (puo *PersonUpdateOne) SetNillableSubscribed(b *bool) *PersonUpdateOne

SetNillableSubscribed sets the "subscribed" field if the given value is not nil.

func (*PersonUpdateOne) SetPassword

func (puo *PersonUpdateOne) SetPassword(s string) *PersonUpdateOne

SetPassword sets the "password" field.

func (*PersonUpdateOne) SetPhone

func (puo *PersonUpdateOne) SetPhone(s string) *PersonUpdateOne

SetPhone sets the "phone" field.

func (*PersonUpdateOne) SetPostalCode

func (puo *PersonUpdateOne) SetPostalCode(s string) *PersonUpdateOne

SetPostalCode sets the "postal_code" field.

func (*PersonUpdateOne) SetStripeID

func (puo *PersonUpdateOne) SetStripeID(s string) *PersonUpdateOne

SetStripeID sets the "stripe_id" field.

func (*PersonUpdateOne) SetSubscribed

func (puo *PersonUpdateOne) SetSubscribed(b bool) *PersonUpdateOne

SetSubscribed sets the "subscribed" field.

func (*PersonUpdateOne) SetTaxID

func (puo *PersonUpdateOne) SetTaxID(s string) *PersonUpdateOne

SetTaxID sets the "tax_id" field.

func (*PersonUpdateOne) SetUpdatedAt

func (puo *PersonUpdateOne) SetUpdatedAt(t time.Time) *PersonUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*PersonUpdateOne) Where

func (puo *PersonUpdateOne) Where(ps ...predicate.Person) *PersonUpdateOne

Where appends a list predicates to the PersonUpdate builder.

type PersonWhereInput

type PersonWhereInput struct {
	Predicates []predicate.Person  `json:"-"`
	Not        *PersonWhereInput   `json:"not,omitempty"`
	Or         []*PersonWhereInput `json:"or,omitempty"`
	And        []*PersonWhereInput `json:"and,omitempty"`

	// "id" field predicates.
	ID      *uuid.UUID  `json:"id,omitempty"`
	IDNEQ   *uuid.UUID  `json:"idNEQ,omitempty"`
	IDIn    []uuid.UUID `json:"idIn,omitempty"`
	IDNotIn []uuid.UUID `json:"idNotIn,omitempty"`
	IDGT    *uuid.UUID  `json:"idGT,omitempty"`
	IDGTE   *uuid.UUID  `json:"idGTE,omitempty"`
	IDLT    *uuid.UUID  `json:"idLT,omitempty"`
	IDLTE   *uuid.UUID  `json:"idLTE,omitempty"`

	// "stripe_id" field predicates.
	StripeID             *string  `json:"stripeID,omitempty"`
	StripeIDNEQ          *string  `json:"stripeIDNEQ,omitempty"`
	StripeIDIn           []string `json:"stripeIDIn,omitempty"`
	StripeIDNotIn        []string `json:"stripeIDNotIn,omitempty"`
	StripeIDGT           *string  `json:"stripeIDGT,omitempty"`
	StripeIDGTE          *string  `json:"stripeIDGTE,omitempty"`
	StripeIDLT           *string  `json:"stripeIDLT,omitempty"`
	StripeIDLTE          *string  `json:"stripeIDLTE,omitempty"`
	StripeIDContains     *string  `json:"stripeIDContains,omitempty"`
	StripeIDHasPrefix    *string  `json:"stripeIDHasPrefix,omitempty"`
	StripeIDHasSuffix    *string  `json:"stripeIDHasSuffix,omitempty"`
	StripeIDIsNil        bool     `json:"stripeIDIsNil,omitempty"`
	StripeIDNotNil       bool     `json:"stripeIDNotNil,omitempty"`
	StripeIDEqualFold    *string  `json:"stripeIDEqualFold,omitempty"`
	StripeIDContainsFold *string  `json:"stripeIDContainsFold,omitempty"`

	// "email" field predicates.
	Email             *string  `json:"email,omitempty"`
	EmailNEQ          *string  `json:"emailNEQ,omitempty"`
	EmailIn           []string `json:"emailIn,omitempty"`
	EmailNotIn        []string `json:"emailNotIn,omitempty"`
	EmailGT           *string  `json:"emailGT,omitempty"`
	EmailGTE          *string  `json:"emailGTE,omitempty"`
	EmailLT           *string  `json:"emailLT,omitempty"`
	EmailLTE          *string  `json:"emailLTE,omitempty"`
	EmailContains     *string  `json:"emailContains,omitempty"`
	EmailHasPrefix    *string  `json:"emailHasPrefix,omitempty"`
	EmailHasSuffix    *string  `json:"emailHasSuffix,omitempty"`
	EmailEqualFold    *string  `json:"emailEqualFold,omitempty"`
	EmailContainsFold *string  `json:"emailContainsFold,omitempty"`

	// "email_verified_at" field predicates.
	EmailVerifiedAt       *time.Time  `json:"emailVerifiedAt,omitempty"`
	EmailVerifiedAtNEQ    *time.Time  `json:"emailVerifiedAtNEQ,omitempty"`
	EmailVerifiedAtIn     []time.Time `json:"emailVerifiedAtIn,omitempty"`
	EmailVerifiedAtNotIn  []time.Time `json:"emailVerifiedAtNotIn,omitempty"`
	EmailVerifiedAtGT     *time.Time  `json:"emailVerifiedAtGT,omitempty"`
	EmailVerifiedAtGTE    *time.Time  `json:"emailVerifiedAtGTE,omitempty"`
	EmailVerifiedAtLT     *time.Time  `json:"emailVerifiedAtLT,omitempty"`
	EmailVerifiedAtLTE    *time.Time  `json:"emailVerifiedAtLTE,omitempty"`
	EmailVerifiedAtIsNil  bool        `json:"emailVerifiedAtIsNil,omitempty"`
	EmailVerifiedAtNotNil bool        `json:"emailVerifiedAtNotNil,omitempty"`

	// "phone" field predicates.
	Phone             *string  `json:"phone,omitempty"`
	PhoneNEQ          *string  `json:"phoneNEQ,omitempty"`
	PhoneIn           []string `json:"phoneIn,omitempty"`
	PhoneNotIn        []string `json:"phoneNotIn,omitempty"`
	PhoneGT           *string  `json:"phoneGT,omitempty"`
	PhoneGTE          *string  `json:"phoneGTE,omitempty"`
	PhoneLT           *string  `json:"phoneLT,omitempty"`
	PhoneLTE          *string  `json:"phoneLTE,omitempty"`
	PhoneContains     *string  `json:"phoneContains,omitempty"`
	PhoneHasPrefix    *string  `json:"phoneHasPrefix,omitempty"`
	PhoneHasSuffix    *string  `json:"phoneHasSuffix,omitempty"`
	PhoneIsNil        bool     `json:"phoneIsNil,omitempty"`
	PhoneNotNil       bool     `json:"phoneNotNil,omitempty"`
	PhoneEqualFold    *string  `json:"phoneEqualFold,omitempty"`
	PhoneContainsFold *string  `json:"phoneContainsFold,omitempty"`

	// "password" field predicates.
	Password             *string  `json:"password,omitempty"`
	PasswordNEQ          *string  `json:"passwordNEQ,omitempty"`
	PasswordIn           []string `json:"passwordIn,omitempty"`
	PasswordNotIn        []string `json:"passwordNotIn,omitempty"`
	PasswordGT           *string  `json:"passwordGT,omitempty"`
	PasswordGTE          *string  `json:"passwordGTE,omitempty"`
	PasswordLT           *string  `json:"passwordLT,omitempty"`
	PasswordLTE          *string  `json:"passwordLTE,omitempty"`
	PasswordContains     *string  `json:"passwordContains,omitempty"`
	PasswordHasPrefix    *string  `json:"passwordHasPrefix,omitempty"`
	PasswordHasSuffix    *string  `json:"passwordHasSuffix,omitempty"`
	PasswordEqualFold    *string  `json:"passwordEqualFold,omitempty"`
	PasswordContainsFold *string  `json:"passwordContainsFold,omitempty"`

	// "tax_id" field predicates.
	TaxID             *string  `json:"taxID,omitempty"`
	TaxIDNEQ          *string  `json:"taxIDNEQ,omitempty"`
	TaxIDIn           []string `json:"taxIDIn,omitempty"`
	TaxIDNotIn        []string `json:"taxIDNotIn,omitempty"`
	TaxIDGT           *string  `json:"taxIDGT,omitempty"`
	TaxIDGTE          *string  `json:"taxIDGTE,omitempty"`
	TaxIDLT           *string  `json:"taxIDLT,omitempty"`
	TaxIDLTE          *string  `json:"taxIDLTE,omitempty"`
	TaxIDContains     *string  `json:"taxIDContains,omitempty"`
	TaxIDHasPrefix    *string  `json:"taxIDHasPrefix,omitempty"`
	TaxIDHasSuffix    *string  `json:"taxIDHasSuffix,omitempty"`
	TaxIDEqualFold    *string  `json:"taxIDEqualFold,omitempty"`
	TaxIDContainsFold *string  `json:"taxIDContainsFold,omitempty"`

	// "first_name" field predicates.
	FirstName             *string  `json:"firstName,omitempty"`
	FirstNameNEQ          *string  `json:"firstNameNEQ,omitempty"`
	FirstNameIn           []string `json:"firstNameIn,omitempty"`
	FirstNameNotIn        []string `json:"firstNameNotIn,omitempty"`
	FirstNameGT           *string  `json:"firstNameGT,omitempty"`
	FirstNameGTE          *string  `json:"firstNameGTE,omitempty"`
	FirstNameLT           *string  `json:"firstNameLT,omitempty"`
	FirstNameLTE          *string  `json:"firstNameLTE,omitempty"`
	FirstNameContains     *string  `json:"firstNameContains,omitempty"`
	FirstNameHasPrefix    *string  `json:"firstNameHasPrefix,omitempty"`
	FirstNameHasSuffix    *string  `json:"firstNameHasSuffix,omitempty"`
	FirstNameEqualFold    *string  `json:"firstNameEqualFold,omitempty"`
	FirstNameContainsFold *string  `json:"firstNameContainsFold,omitempty"`

	// "last_name" field predicates.
	LastName             *string  `json:"lastName,omitempty"`
	LastNameNEQ          *string  `json:"lastNameNEQ,omitempty"`
	LastNameIn           []string `json:"lastNameIn,omitempty"`
	LastNameNotIn        []string `json:"lastNameNotIn,omitempty"`
	LastNameGT           *string  `json:"lastNameGT,omitempty"`
	LastNameGTE          *string  `json:"lastNameGTE,omitempty"`
	LastNameLT           *string  `json:"lastNameLT,omitempty"`
	LastNameLTE          *string  `json:"lastNameLTE,omitempty"`
	LastNameContains     *string  `json:"lastNameContains,omitempty"`
	LastNameHasPrefix    *string  `json:"lastNameHasPrefix,omitempty"`
	LastNameHasSuffix    *string  `json:"lastNameHasSuffix,omitempty"`
	LastNameIsNil        bool     `json:"lastNameIsNil,omitempty"`
	LastNameNotNil       bool     `json:"lastNameNotNil,omitempty"`
	LastNameEqualFold    *string  `json:"lastNameEqualFold,omitempty"`
	LastNameContainsFold *string  `json:"lastNameContainsFold,omitempty"`

	// "language" field predicates.
	Language             *string  `json:"language,omitempty"`
	LanguageNEQ          *string  `json:"languageNEQ,omitempty"`
	LanguageIn           []string `json:"languageIn,omitempty"`
	LanguageNotIn        []string `json:"languageNotIn,omitempty"`
	LanguageGT           *string  `json:"languageGT,omitempty"`
	LanguageGTE          *string  `json:"languageGTE,omitempty"`
	LanguageLT           *string  `json:"languageLT,omitempty"`
	LanguageLTE          *string  `json:"languageLTE,omitempty"`
	LanguageContains     *string  `json:"languageContains,omitempty"`
	LanguageHasPrefix    *string  `json:"languageHasPrefix,omitempty"`
	LanguageHasSuffix    *string  `json:"languageHasSuffix,omitempty"`
	LanguageEqualFold    *string  `json:"languageEqualFold,omitempty"`
	LanguageContainsFold *string  `json:"languageContainsFold,omitempty"`

	// "birthdate" field predicates.
	Birthdate       *time.Time  `json:"birthdate,omitempty"`
	BirthdateNEQ    *time.Time  `json:"birthdateNEQ,omitempty"`
	BirthdateIn     []time.Time `json:"birthdateIn,omitempty"`
	BirthdateNotIn  []time.Time `json:"birthdateNotIn,omitempty"`
	BirthdateGT     *time.Time  `json:"birthdateGT,omitempty"`
	BirthdateGTE    *time.Time  `json:"birthdateGTE,omitempty"`
	BirthdateLT     *time.Time  `json:"birthdateLT,omitempty"`
	BirthdateLTE    *time.Time  `json:"birthdateLTE,omitempty"`
	BirthdateIsNil  bool        `json:"birthdateIsNil,omitempty"`
	BirthdateNotNil bool        `json:"birthdateNotNil,omitempty"`

	// "gender" field predicates.
	Gender       *person.Gender  `json:"gender,omitempty"`
	GenderNEQ    *person.Gender  `json:"genderNEQ,omitempty"`
	GenderIn     []person.Gender `json:"genderIn,omitempty"`
	GenderNotIn  []person.Gender `json:"genderNotIn,omitempty"`
	GenderIsNil  bool            `json:"genderIsNil,omitempty"`
	GenderNotNil bool            `json:"genderNotNil,omitempty"`

	// "address" field predicates.
	Address             *string  `json:"address,omitempty"`
	AddressNEQ          *string  `json:"addressNEQ,omitempty"`
	AddressIn           []string `json:"addressIn,omitempty"`
	AddressNotIn        []string `json:"addressNotIn,omitempty"`
	AddressGT           *string  `json:"addressGT,omitempty"`
	AddressGTE          *string  `json:"addressGTE,omitempty"`
	AddressLT           *string  `json:"addressLT,omitempty"`
	AddressLTE          *string  `json:"addressLTE,omitempty"`
	AddressContains     *string  `json:"addressContains,omitempty"`
	AddressHasPrefix    *string  `json:"addressHasPrefix,omitempty"`
	AddressHasSuffix    *string  `json:"addressHasSuffix,omitempty"`
	AddressIsNil        bool     `json:"addressIsNil,omitempty"`
	AddressNotNil       bool     `json:"addressNotNil,omitempty"`
	AddressEqualFold    *string  `json:"addressEqualFold,omitempty"`
	AddressContainsFold *string  `json:"addressContainsFold,omitempty"`

	// "postal_code" field predicates.
	PostalCode             *string  `json:"postalCode,omitempty"`
	PostalCodeNEQ          *string  `json:"postalCodeNEQ,omitempty"`
	PostalCodeIn           []string `json:"postalCodeIn,omitempty"`
	PostalCodeNotIn        []string `json:"postalCodeNotIn,omitempty"`
	PostalCodeGT           *string  `json:"postalCodeGT,omitempty"`
	PostalCodeGTE          *string  `json:"postalCodeGTE,omitempty"`
	PostalCodeLT           *string  `json:"postalCodeLT,omitempty"`
	PostalCodeLTE          *string  `json:"postalCodeLTE,omitempty"`
	PostalCodeContains     *string  `json:"postalCodeContains,omitempty"`
	PostalCodeHasPrefix    *string  `json:"postalCodeHasPrefix,omitempty"`
	PostalCodeHasSuffix    *string  `json:"postalCodeHasSuffix,omitempty"`
	PostalCodeIsNil        bool     `json:"postalCodeIsNil,omitempty"`
	PostalCodeNotNil       bool     `json:"postalCodeNotNil,omitempty"`
	PostalCodeEqualFold    *string  `json:"postalCodeEqualFold,omitempty"`
	PostalCodeContainsFold *string  `json:"postalCodeContainsFold,omitempty"`

	// "city" field predicates.
	City             *string  `json:"city,omitempty"`
	CityNEQ          *string  `json:"cityNEQ,omitempty"`
	CityIn           []string `json:"cityIn,omitempty"`
	CityNotIn        []string `json:"cityNotIn,omitempty"`
	CityGT           *string  `json:"cityGT,omitempty"`
	CityGTE          *string  `json:"cityGTE,omitempty"`
	CityLT           *string  `json:"cityLT,omitempty"`
	CityLTE          *string  `json:"cityLTE,omitempty"`
	CityContains     *string  `json:"cityContains,omitempty"`
	CityHasPrefix    *string  `json:"cityHasPrefix,omitempty"`
	CityHasSuffix    *string  `json:"cityHasSuffix,omitempty"`
	CityIsNil        bool     `json:"cityIsNil,omitempty"`
	CityNotNil       bool     `json:"cityNotNil,omitempty"`
	CityEqualFold    *string  `json:"cityEqualFold,omitempty"`
	CityContainsFold *string  `json:"cityContainsFold,omitempty"`

	// "country" field predicates.
	Country             *string  `json:"country,omitempty"`
	CountryNEQ          *string  `json:"countryNEQ,omitempty"`
	CountryIn           []string `json:"countryIn,omitempty"`
	CountryNotIn        []string `json:"countryNotIn,omitempty"`
	CountryGT           *string  `json:"countryGT,omitempty"`
	CountryGTE          *string  `json:"countryGTE,omitempty"`
	CountryLT           *string  `json:"countryLT,omitempty"`
	CountryLTE          *string  `json:"countryLTE,omitempty"`
	CountryContains     *string  `json:"countryContains,omitempty"`
	CountryHasPrefix    *string  `json:"countryHasPrefix,omitempty"`
	CountryHasSuffix    *string  `json:"countryHasSuffix,omitempty"`
	CountryIsNil        bool     `json:"countryIsNil,omitempty"`
	CountryNotNil       bool     `json:"countryNotNil,omitempty"`
	CountryEqualFold    *string  `json:"countryEqualFold,omitempty"`
	CountryContainsFold *string  `json:"countryContainsFold,omitempty"`

	// "subscribed" field predicates.
	Subscribed    *bool `json:"subscribed,omitempty"`
	SubscribedNEQ *bool `json:"subscribedNEQ,omitempty"`

	// "created_at" field predicates.
	CreatedAt      *time.Time  `json:"createdAt,omitempty"`
	CreatedAtNEQ   *time.Time  `json:"createdAtNEQ,omitempty"`
	CreatedAtIn    []time.Time `json:"createdAtIn,omitempty"`
	CreatedAtNotIn []time.Time `json:"createdAtNotIn,omitempty"`
	CreatedAtGT    *time.Time  `json:"createdAtGT,omitempty"`
	CreatedAtGTE   *time.Time  `json:"createdAtGTE,omitempty"`
	CreatedAtLT    *time.Time  `json:"createdAtLT,omitempty"`
	CreatedAtLTE   *time.Time  `json:"createdAtLTE,omitempty"`

	// "updated_at" field predicates.
	UpdatedAt      *time.Time  `json:"updatedAt,omitempty"`
	UpdatedAtNEQ   *time.Time  `json:"updatedAtNEQ,omitempty"`
	UpdatedAtIn    []time.Time `json:"updatedAtIn,omitempty"`
	UpdatedAtNotIn []time.Time `json:"updatedAtNotIn,omitempty"`
	UpdatedAtGT    *time.Time  `json:"updatedAtGT,omitempty"`
	UpdatedAtGTE   *time.Time  `json:"updatedAtGTE,omitempty"`
	UpdatedAtLT    *time.Time  `json:"updatedAtLT,omitempty"`
	UpdatedAtLTE   *time.Time  `json:"updatedAtLTE,omitempty"`

	// "authentications" edge predicates.
	HasAuthentications     *bool                       `json:"hasAuthentications,omitempty"`
	HasAuthenticationsWith []*AuthenticationWhereInput `json:"hasAuthenticationsWith,omitempty"`

	// "authorizations" edge predicates.
	HasAuthorizations     *bool                      `json:"hasAuthorizations,omitempty"`
	HasAuthorizationsWith []*AuthorizationWhereInput `json:"hasAuthorizationsWith,omitempty"`
}

PersonWhereInput represents a where input for filtering Person queries.

func (*PersonWhereInput) AddPredicates

func (i *PersonWhereInput) AddPredicates(predicates ...predicate.Person)

AddPredicates adds custom predicates to the where input to be used during the filtering phase.

func (*PersonWhereInput) Filter

func (i *PersonWhereInput) Filter(q *PersonQuery) (*PersonQuery, error)

Filter applies the PersonWhereInput filter on the PersonQuery builder.

func (*PersonWhereInput) P

P returns a predicate for filtering persons. An error is returned if the input is empty or invalid.

type Persons

type Persons []*Person

Persons is a parsable slice of Person.

type Policy

type Policy = ent.Policy

ent aliases to avoid import conflicts in user's code.

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 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 {

	// Authentication is the client for interacting with the Authentication builders.
	Authentication *AuthenticationClient
	// Authorization is the client for interacting with the Authorization builders.
	Authorization *AuthorizationClient
	// Person is the client for interacting with the Person builders.
	Person *PersonClient
	// 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) ExecContext

func (c *Tx) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

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

func (c *Tx) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*Tx) Rollback

func (tx *Tx) Rollback() error

Rollback rollbacks the transaction.

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.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL