ent

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2026 License: MIT Imports: 25 Imported by: 0

Documentation

Index

Constants

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

	// Node types.
	TypeBinding    = "Binding"
	TypeConnection = "Connection"
	TypeCredential = "Credential"
	TypeGrant      = "Grant"
	TypeLease      = "Lease"
)

Variables

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

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

Functions

func 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.

Types

type AggregateFunc

type AggregateFunc func(*sql.Selector) string

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

func As

As is a pseudo aggregation function for renaming another other functions with custom names. For example:

GroupBy(field1, field2).
Aggregate(ent.As(ent.Sum(field1), "sum_field1"), (ent.As(ent.Sum(field2), "sum_field2")).
Scan(ctx, &v)

func Count

func Count() AggregateFunc

Count applies the "count" aggregation function on each group.

func Max

func Max(field string) AggregateFunc

Max applies the "max" aggregation function on the given field of each group.

func Mean

func Mean(field string) AggregateFunc

Mean applies the "mean" aggregation function on the given field of each group.

func Min

func Min(field string) AggregateFunc

Min applies the "min" aggregation function on the given field of each group.

func Sum

func Sum(field string) AggregateFunc

Sum applies the "sum" aggregation function on the given field of each group.

type Binding

type Binding struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// OwnerID holds the value of the "owner_id" field.
	OwnerID string `json:"owner_id,omitempty"`
	// ConnectionID holds the value of the "connection_id" field.
	ConnectionID string `json:"connection_id,omitempty"`
	// ConsumerKind holds the value of the "consumer_kind" field.
	ConsumerKind string `json:"consumer_kind,omitempty"`
	// ConsumerID holds the value of the "consumer_id" field.
	ConsumerID string `json:"consumer_id,omitempty"`
	// Purpose holds the value of the "purpose" field.
	Purpose string `json:"purpose,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// contains filtered or unexported fields
}

Binding is the model entity for the Binding schema.

func (*Binding) String

func (_m *Binding) String() string

String implements the fmt.Stringer.

func (*Binding) Unwrap

func (_m *Binding) Unwrap() *Binding

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

func (_m *Binding) Update() *BindingUpdateOne

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

func (*Binding) Value

func (_m *Binding) Value(name string) (ent.Value, error)

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

type BindingClient

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

BindingClient is a client for the Binding schema.

func NewBindingClient

func NewBindingClient(c config) *BindingClient

NewBindingClient returns a client for the Binding from the given config.

func (*BindingClient) Create

func (c *BindingClient) Create() *BindingCreate

Create returns a builder for creating a Binding entity.

func (*BindingClient) CreateBulk

func (c *BindingClient) CreateBulk(builders ...*BindingCreate) *BindingCreateBulk

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

func (*BindingClient) Delete

func (c *BindingClient) Delete() *BindingDelete

Delete returns a delete builder for Binding.

func (*BindingClient) DeleteOne

func (c *BindingClient) DeleteOne(_m *Binding) *BindingDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*BindingClient) DeleteOneID

func (c *BindingClient) DeleteOneID(id int) *BindingDeleteOne

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

func (*BindingClient) Get

func (c *BindingClient) Get(ctx context.Context, id int) (*Binding, error)

Get returns a Binding entity by its id.

func (*BindingClient) GetX

func (c *BindingClient) GetX(ctx context.Context, id int) *Binding

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

func (*BindingClient) Hooks

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

Hooks returns the client hooks.

func (*BindingClient) Intercept

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

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

func (*BindingClient) Interceptors

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

Interceptors returns the client interceptors.

func (*BindingClient) MapCreateBulk

func (c *BindingClient) MapCreateBulk(slice any, setFunc func(*BindingCreate, int)) *BindingCreateBulk

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 (*BindingClient) Query

func (c *BindingClient) Query() *BindingQuery

Query returns a query builder for Binding.

func (*BindingClient) Update

func (c *BindingClient) Update() *BindingUpdate

Update returns an update builder for Binding.

func (*BindingClient) UpdateOne

func (c *BindingClient) UpdateOne(_m *Binding) *BindingUpdateOne

UpdateOne returns an update builder for the given entity.

func (*BindingClient) UpdateOneID

func (c *BindingClient) UpdateOneID(id int) *BindingUpdateOne

UpdateOneID returns an update builder for the given id.

func (*BindingClient) Use

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

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

type BindingCreate

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

BindingCreate is the builder for creating a Binding entity.

func (*BindingCreate) Exec

func (_c *BindingCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*BindingCreate) ExecX

func (_c *BindingCreate) ExecX(ctx context.Context)

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

func (*BindingCreate) Mutation

func (_c *BindingCreate) Mutation() *BindingMutation

Mutation returns the BindingMutation object of the builder.

func (*BindingCreate) Save

func (_c *BindingCreate) Save(ctx context.Context) (*Binding, error)

Save creates the Binding in the database.

func (*BindingCreate) SaveX

func (_c *BindingCreate) SaveX(ctx context.Context) *Binding

SaveX calls Save and panics if Save returns an error.

func (*BindingCreate) SetConnectionID

func (_c *BindingCreate) SetConnectionID(v string) *BindingCreate

SetConnectionID sets the "connection_id" field.

func (*BindingCreate) SetConsumerID

func (_c *BindingCreate) SetConsumerID(v string) *BindingCreate

SetConsumerID sets the "consumer_id" field.

func (*BindingCreate) SetConsumerKind

func (_c *BindingCreate) SetConsumerKind(v string) *BindingCreate

SetConsumerKind sets the "consumer_kind" field.

func (*BindingCreate) SetCreatedAt

func (_c *BindingCreate) SetCreatedAt(v time.Time) *BindingCreate

SetCreatedAt sets the "created_at" field.

func (*BindingCreate) SetOwnerID

func (_c *BindingCreate) SetOwnerID(v string) *BindingCreate

SetOwnerID sets the "owner_id" field.

func (*BindingCreate) SetPurpose

func (_c *BindingCreate) SetPurpose(v string) *BindingCreate

SetPurpose sets the "purpose" field.

type BindingCreateBulk

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

BindingCreateBulk is the builder for creating many Binding entities in bulk.

func (*BindingCreateBulk) Exec

func (_c *BindingCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*BindingCreateBulk) ExecX

func (_c *BindingCreateBulk) ExecX(ctx context.Context)

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

func (*BindingCreateBulk) Save

func (_c *BindingCreateBulk) Save(ctx context.Context) ([]*Binding, error)

Save creates the Binding entities in the database.

func (*BindingCreateBulk) SaveX

func (_c *BindingCreateBulk) SaveX(ctx context.Context) []*Binding

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

type BindingDelete

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

BindingDelete is the builder for deleting a Binding entity.

func (*BindingDelete) Exec

func (_d *BindingDelete) Exec(ctx context.Context) (int, error)

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

func (*BindingDelete) ExecX

func (_d *BindingDelete) ExecX(ctx context.Context) int

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

func (*BindingDelete) Where

func (_d *BindingDelete) Where(ps ...predicate.Binding) *BindingDelete

Where appends a list predicates to the BindingDelete builder.

type BindingDeleteOne

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

BindingDeleteOne is the builder for deleting a single Binding entity.

func (*BindingDeleteOne) Exec

func (_d *BindingDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*BindingDeleteOne) ExecX

func (_d *BindingDeleteOne) ExecX(ctx context.Context)

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

func (*BindingDeleteOne) Where

Where appends a list predicates to the BindingDelete builder.

type BindingGroupBy

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

BindingGroupBy is the group-by builder for Binding entities.

func (*BindingGroupBy) Aggregate

func (_g *BindingGroupBy) Aggregate(fns ...AggregateFunc) *BindingGroupBy

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

func (*BindingGroupBy) Bool

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

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

func (*BindingGroupBy) BoolX

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

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

func (*BindingGroupBy) Bools

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

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

func (*BindingGroupBy) BoolsX

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

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

func (*BindingGroupBy) Float64

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

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

func (*BindingGroupBy) Float64X

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

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

func (*BindingGroupBy) Float64s

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

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

func (*BindingGroupBy) Float64sX

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

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

func (*BindingGroupBy) Int

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

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

func (*BindingGroupBy) IntX

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

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

func (*BindingGroupBy) Ints

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

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

func (*BindingGroupBy) IntsX

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

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

func (*BindingGroupBy) Scan

func (_g *BindingGroupBy) Scan(ctx context.Context, v any) error

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

func (*BindingGroupBy) ScanX

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

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

func (*BindingGroupBy) String

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

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

func (*BindingGroupBy) StringX

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

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

func (*BindingGroupBy) Strings

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

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

func (*BindingGroupBy) StringsX

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

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

type BindingMutation

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

BindingMutation represents an operation that mutates the Binding nodes in the graph.

func (*BindingMutation) AddField

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

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

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

func (*BindingMutation) AddedField

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

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

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

func (*BindingMutation) AddedIDs

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

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

func (*BindingMutation) ClearEdge

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

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

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

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

func (*BindingMutation) ClearedFields

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

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

func (BindingMutation) Client

func (m BindingMutation) 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 (*BindingMutation) ConnectionID

func (m *BindingMutation) ConnectionID() (r string, exists bool)

ConnectionID returns the value of the "connection_id" field in the mutation.

func (*BindingMutation) ConsumerID

func (m *BindingMutation) ConsumerID() (r string, exists bool)

ConsumerID returns the value of the "consumer_id" field in the mutation.

func (*BindingMutation) ConsumerKind

func (m *BindingMutation) ConsumerKind() (r string, exists bool)

ConsumerKind returns the value of the "consumer_kind" field in the mutation.

func (*BindingMutation) CreatedAt

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

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

func (*BindingMutation) EdgeCleared

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

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

func (*BindingMutation) Field

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

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

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

func (*BindingMutation) Fields

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

func (m *BindingMutation) ID() (id int, exists bool)

ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.

func (*BindingMutation) IDs

func (m *BindingMutation) IDs(ctx context.Context) ([]int, error)

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

func (*BindingMutation) OldConnectionID

func (m *BindingMutation) OldConnectionID(ctx context.Context) (v string, err error)

OldConnectionID returns the old "connection_id" field's value of the Binding entity. If the Binding 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 (*BindingMutation) OldConsumerID

func (m *BindingMutation) OldConsumerID(ctx context.Context) (v string, err error)

OldConsumerID returns the old "consumer_id" field's value of the Binding entity. If the Binding 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 (*BindingMutation) OldConsumerKind

func (m *BindingMutation) OldConsumerKind(ctx context.Context) (v string, err error)

OldConsumerKind returns the old "consumer_kind" field's value of the Binding entity. If the Binding 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 (*BindingMutation) OldCreatedAt

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

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

func (m *BindingMutation) 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 (*BindingMutation) OldOwnerID

func (m *BindingMutation) OldOwnerID(ctx context.Context) (v string, err error)

OldOwnerID returns the old "owner_id" field's value of the Binding entity. If the Binding 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 (*BindingMutation) OldPurpose

func (m *BindingMutation) OldPurpose(ctx context.Context) (v string, err error)

OldPurpose returns the old "purpose" field's value of the Binding entity. If the Binding 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 (*BindingMutation) Op

func (m *BindingMutation) Op() Op

Op returns the operation name.

func (*BindingMutation) OwnerID

func (m *BindingMutation) OwnerID() (r string, exists bool)

OwnerID returns the value of the "owner_id" field in the mutation.

func (*BindingMutation) Purpose

func (m *BindingMutation) Purpose() (r string, exists bool)

Purpose returns the value of the "purpose" field in the mutation.

func (*BindingMutation) RemovedEdges

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

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

func (*BindingMutation) RemovedIDs

func (m *BindingMutation) 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 (*BindingMutation) ResetConnectionID

func (m *BindingMutation) ResetConnectionID()

ResetConnectionID resets all changes to the "connection_id" field.

func (*BindingMutation) ResetConsumerID

func (m *BindingMutation) ResetConsumerID()

ResetConsumerID resets all changes to the "consumer_id" field.

func (*BindingMutation) ResetConsumerKind

func (m *BindingMutation) ResetConsumerKind()

ResetConsumerKind resets all changes to the "consumer_kind" field.

func (*BindingMutation) ResetCreatedAt

func (m *BindingMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*BindingMutation) ResetEdge

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

func (m *BindingMutation) 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 (*BindingMutation) ResetOwnerID

func (m *BindingMutation) ResetOwnerID()

ResetOwnerID resets all changes to the "owner_id" field.

func (*BindingMutation) ResetPurpose

func (m *BindingMutation) ResetPurpose()

ResetPurpose resets all changes to the "purpose" field.

func (*BindingMutation) SetConnectionID

func (m *BindingMutation) SetConnectionID(s string)

SetConnectionID sets the "connection_id" field.

func (*BindingMutation) SetConsumerID

func (m *BindingMutation) SetConsumerID(s string)

SetConsumerID sets the "consumer_id" field.

func (*BindingMutation) SetConsumerKind

func (m *BindingMutation) SetConsumerKind(s string)

SetConsumerKind sets the "consumer_kind" field.

func (*BindingMutation) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*BindingMutation) SetField

func (m *BindingMutation) 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 (*BindingMutation) SetOp

func (m *BindingMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*BindingMutation) SetOwnerID

func (m *BindingMutation) SetOwnerID(s string)

SetOwnerID sets the "owner_id" field.

func (*BindingMutation) SetPurpose

func (m *BindingMutation) SetPurpose(s string)

SetPurpose sets the "purpose" field.

func (BindingMutation) Tx

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

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

func (*BindingMutation) Type

func (m *BindingMutation) Type() string

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

func (*BindingMutation) Where

func (m *BindingMutation) Where(ps ...predicate.Binding)

Where appends a list predicates to the BindingMutation builder.

func (*BindingMutation) WhereP

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

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

type BindingQuery

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

BindingQuery is the builder for querying Binding entities.

func (*BindingQuery) Aggregate

func (_q *BindingQuery) Aggregate(fns ...AggregateFunc) *BindingSelect

Aggregate returns a BindingSelect configured with the given aggregations.

func (*BindingQuery) All

func (_q *BindingQuery) All(ctx context.Context) ([]*Binding, error)

All executes the query and returns a list of Bindings.

func (*BindingQuery) AllX

func (_q *BindingQuery) AllX(ctx context.Context) []*Binding

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

func (*BindingQuery) Clone

func (_q *BindingQuery) Clone() *BindingQuery

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

func (*BindingQuery) Count

func (_q *BindingQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*BindingQuery) CountX

func (_q *BindingQuery) CountX(ctx context.Context) int

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

func (*BindingQuery) Exist

func (_q *BindingQuery) Exist(ctx context.Context) (bool, error)

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

func (*BindingQuery) ExistX

func (_q *BindingQuery) ExistX(ctx context.Context) bool

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

func (*BindingQuery) First

func (_q *BindingQuery) First(ctx context.Context) (*Binding, error)

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

func (*BindingQuery) FirstID

func (_q *BindingQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*BindingQuery) FirstIDX

func (_q *BindingQuery) FirstIDX(ctx context.Context) int

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

func (*BindingQuery) FirstX

func (_q *BindingQuery) FirstX(ctx context.Context) *Binding

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

func (*BindingQuery) GroupBy

func (_q *BindingQuery) GroupBy(field string, fields ...string) *BindingGroupBy

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

client.Binding.Query().
	GroupBy(binding.FieldOwnerID).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*BindingQuery) IDs

func (_q *BindingQuery) IDs(ctx context.Context) (ids []int, err error)

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

func (*BindingQuery) IDsX

func (_q *BindingQuery) IDsX(ctx context.Context) []int

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

func (*BindingQuery) Limit

func (_q *BindingQuery) Limit(limit int) *BindingQuery

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

func (*BindingQuery) Offset

func (_q *BindingQuery) Offset(offset int) *BindingQuery

Offset to start from.

func (*BindingQuery) Only

func (_q *BindingQuery) Only(ctx context.Context) (*Binding, error)

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

func (*BindingQuery) OnlyID

func (_q *BindingQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*BindingQuery) OnlyIDX

func (_q *BindingQuery) OnlyIDX(ctx context.Context) int

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

func (*BindingQuery) OnlyX

func (_q *BindingQuery) OnlyX(ctx context.Context) *Binding

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

func (*BindingQuery) Order

func (_q *BindingQuery) Order(o ...binding.OrderOption) *BindingQuery

Order specifies how the records should be ordered.

func (*BindingQuery) Select

func (_q *BindingQuery) Select(fields ...string) *BindingSelect

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

client.Binding.Query().
	Select(binding.FieldOwnerID).
	Scan(ctx, &v)

func (*BindingQuery) Unique

func (_q *BindingQuery) Unique(unique bool) *BindingQuery

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

func (_q *BindingQuery) Where(ps ...predicate.Binding) *BindingQuery

Where adds a new predicate for the BindingQuery builder.

type BindingSelect

type BindingSelect struct {
	*BindingQuery
	// contains filtered or unexported fields
}

BindingSelect is the builder for selecting fields of Binding entities.

func (*BindingSelect) Aggregate

func (_s *BindingSelect) Aggregate(fns ...AggregateFunc) *BindingSelect

Aggregate adds the given aggregation functions to the selector query.

func (*BindingSelect) Bool

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

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

func (*BindingSelect) BoolX

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

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

func (*BindingSelect) Bools

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

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

func (*BindingSelect) BoolsX

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

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

func (*BindingSelect) Float64

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

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

func (*BindingSelect) Float64X

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

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

func (*BindingSelect) Float64s

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

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

func (*BindingSelect) Float64sX

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

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

func (*BindingSelect) Int

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

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

func (*BindingSelect) IntX

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

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

func (*BindingSelect) Ints

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

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

func (*BindingSelect) IntsX

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

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

func (*BindingSelect) Scan

func (_s *BindingSelect) Scan(ctx context.Context, v any) error

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

func (*BindingSelect) ScanX

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

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

func (*BindingSelect) String

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

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

func (*BindingSelect) StringX

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

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

func (*BindingSelect) Strings

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

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

func (*BindingSelect) StringsX

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

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

type BindingUpdate

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

BindingUpdate is the builder for updating Binding entities.

func (*BindingUpdate) Exec

func (_u *BindingUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*BindingUpdate) ExecX

func (_u *BindingUpdate) ExecX(ctx context.Context)

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

func (*BindingUpdate) Mutation

func (_u *BindingUpdate) Mutation() *BindingMutation

Mutation returns the BindingMutation object of the builder.

func (*BindingUpdate) Save

func (_u *BindingUpdate) Save(ctx context.Context) (int, error)

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

func (*BindingUpdate) SaveX

func (_u *BindingUpdate) SaveX(ctx context.Context) int

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

func (*BindingUpdate) Where

func (_u *BindingUpdate) Where(ps ...predicate.Binding) *BindingUpdate

Where appends a list predicates to the BindingUpdate builder.

type BindingUpdateOne

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

BindingUpdateOne is the builder for updating a single Binding entity.

func (*BindingUpdateOne) Exec

func (_u *BindingUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*BindingUpdateOne) ExecX

func (_u *BindingUpdateOne) ExecX(ctx context.Context)

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

func (*BindingUpdateOne) Mutation

func (_u *BindingUpdateOne) Mutation() *BindingMutation

Mutation returns the BindingMutation object of the builder.

func (*BindingUpdateOne) Save

func (_u *BindingUpdateOne) Save(ctx context.Context) (*Binding, error)

Save executes the query and returns the updated Binding entity.

func (*BindingUpdateOne) SaveX

func (_u *BindingUpdateOne) SaveX(ctx context.Context) *Binding

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

func (*BindingUpdateOne) Select

func (_u *BindingUpdateOne) Select(field string, fields ...string) *BindingUpdateOne

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

func (*BindingUpdateOne) Where

Where appends a list predicates to the BindingUpdate builder.

type Bindings

type Bindings []*Binding

Bindings is a parsable slice of Binding.

type Client

type Client struct {

	// Schema is the client for creating, migrating and dropping schema.
	Schema *migrate.Schema
	// Binding is the client for interacting with the Binding builders.
	Binding *BindingClient
	// Connection is the client for interacting with the Connection builders.
	Connection *ConnectionClient
	// Credential is the client for interacting with the Credential builders.
	Credential *CredentialClient
	// Grant is the client for interacting with the Grant builders.
	Grant *GrantClient
	// Lease is the client for interacting with the Lease builders.
	Lease *LeaseClient
	// 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().
	Binding.
	Query().
	Count(ctx)

func (*Client) Intercept

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

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

func (*Client) Mutate

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

Mutate implements the ent.Mutator interface.

func (*Client) Tx

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

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

func (*Client) Use

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

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

type CommitFunc

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

The CommitFunc type is an adapter to allow the use of ordinary function as a Committer. If f is a function with the appropriate signature, CommitFunc(f) is a Committer that calls f.

func (CommitFunc) Commit

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

Commit calls f(ctx, m).

type CommitHook

type CommitHook func(Committer) Committer

CommitHook defines the "commit middleware". A function that gets a Committer and returns a Committer. For example:

hook := func(next ent.Committer) ent.Committer {
	return ent.CommitFunc(func(ctx context.Context, tx *ent.Tx) error {
		// Do some stuff before.
		if err := next.Commit(ctx, tx); err != nil {
			return err
		}
		// Do some stuff after.
		return nil
	})
}

type Committer

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

Committer is the interface that wraps the Commit method.

type Connection

type Connection struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// OwnerID holds the value of the "owner_id" field.
	OwnerID string `json:"owner_id,omitempty"`
	// ConnectionID holds the value of the "connection_id" field.
	ConnectionID string `json:"connection_id,omitempty"`
	// Provider holds the value of the "provider" field.
	Provider string `json:"provider,omitempty"`
	// AuthMethod holds the value of the "auth_method" field.
	AuthMethod string `json:"auth_method,omitempty"`
	// DisplayName holds the value of the "display_name" field.
	DisplayName string `json:"display_name,omitempty"`
	// ExternalAccountID holds the value of the "external_account_id" field.
	ExternalAccountID string `json:"external_account_id,omitempty"`
	// ExternalLabel holds the value of the "external_label" field.
	ExternalLabel string `json:"external_label,omitempty"`
	// Scopes holds the value of the "scopes" field.
	Scopes []string `json:"scopes,omitempty"`
	// State holds the value of the "state" field.
	State string `json:"state,omitempty"`
	// Health holds the value of the "health" field.
	Health connectionforge.Health `json:"health,omitempty"`
	// Metadata holds the value of the "metadata" field.
	Metadata map[string]string `json:"metadata,omitempty"`
	// CreatedByKind holds the value of the "created_by_kind" field.
	CreatedByKind string `json:"created_by_kind,omitempty"`
	// CreatedByID holds the value of the "created_by_id" field.
	CreatedByID string `json:"created_by_id,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"`
	// Revision holds the value of the "revision" field.
	Revision uint64 `json:"revision,omitempty"`
	// contains filtered or unexported fields
}

Connection is the model entity for the Connection schema.

func (*Connection) String

func (_m *Connection) String() string

String implements the fmt.Stringer.

func (*Connection) Unwrap

func (_m *Connection) Unwrap() *Connection

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

func (_m *Connection) Update() *ConnectionUpdateOne

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

func (*Connection) Value

func (_m *Connection) Value(name string) (ent.Value, error)

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

type ConnectionClient

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

ConnectionClient is a client for the Connection schema.

func NewConnectionClient

func NewConnectionClient(c config) *ConnectionClient

NewConnectionClient returns a client for the Connection from the given config.

func (*ConnectionClient) Create

func (c *ConnectionClient) Create() *ConnectionCreate

Create returns a builder for creating a Connection entity.

func (*ConnectionClient) CreateBulk

func (c *ConnectionClient) CreateBulk(builders ...*ConnectionCreate) *ConnectionCreateBulk

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

func (*ConnectionClient) Delete

func (c *ConnectionClient) Delete() *ConnectionDelete

Delete returns a delete builder for Connection.

func (*ConnectionClient) DeleteOne

func (c *ConnectionClient) DeleteOne(_m *Connection) *ConnectionDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*ConnectionClient) DeleteOneID

func (c *ConnectionClient) DeleteOneID(id int) *ConnectionDeleteOne

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

func (*ConnectionClient) Get

func (c *ConnectionClient) Get(ctx context.Context, id int) (*Connection, error)

Get returns a Connection entity by its id.

func (*ConnectionClient) GetX

func (c *ConnectionClient) GetX(ctx context.Context, id int) *Connection

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

func (*ConnectionClient) Hooks

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

Hooks returns the client hooks.

func (*ConnectionClient) Intercept

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

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

func (*ConnectionClient) Interceptors

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

Interceptors returns the client interceptors.

func (*ConnectionClient) MapCreateBulk

func (c *ConnectionClient) MapCreateBulk(slice any, setFunc func(*ConnectionCreate, int)) *ConnectionCreateBulk

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 (*ConnectionClient) Query

func (c *ConnectionClient) Query() *ConnectionQuery

Query returns a query builder for Connection.

func (*ConnectionClient) Update

func (c *ConnectionClient) Update() *ConnectionUpdate

Update returns an update builder for Connection.

func (*ConnectionClient) UpdateOne

func (c *ConnectionClient) UpdateOne(_m *Connection) *ConnectionUpdateOne

UpdateOne returns an update builder for the given entity.

func (*ConnectionClient) UpdateOneID

func (c *ConnectionClient) UpdateOneID(id int) *ConnectionUpdateOne

UpdateOneID returns an update builder for the given id.

func (*ConnectionClient) Use

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

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

type ConnectionCreate

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

ConnectionCreate is the builder for creating a Connection entity.

func (*ConnectionCreate) Exec

func (_c *ConnectionCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*ConnectionCreate) ExecX

func (_c *ConnectionCreate) ExecX(ctx context.Context)

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

func (*ConnectionCreate) Mutation

func (_c *ConnectionCreate) Mutation() *ConnectionMutation

Mutation returns the ConnectionMutation object of the builder.

func (*ConnectionCreate) Save

func (_c *ConnectionCreate) Save(ctx context.Context) (*Connection, error)

Save creates the Connection in the database.

func (*ConnectionCreate) SaveX

func (_c *ConnectionCreate) SaveX(ctx context.Context) *Connection

SaveX calls Save and panics if Save returns an error.

func (*ConnectionCreate) SetAuthMethod

func (_c *ConnectionCreate) SetAuthMethod(v string) *ConnectionCreate

SetAuthMethod sets the "auth_method" field.

func (*ConnectionCreate) SetConnectionID

func (_c *ConnectionCreate) SetConnectionID(v string) *ConnectionCreate

SetConnectionID sets the "connection_id" field.

func (*ConnectionCreate) SetCreatedAt

func (_c *ConnectionCreate) SetCreatedAt(v time.Time) *ConnectionCreate

SetCreatedAt sets the "created_at" field.

func (*ConnectionCreate) SetCreatedByID

func (_c *ConnectionCreate) SetCreatedByID(v string) *ConnectionCreate

SetCreatedByID sets the "created_by_id" field.

func (*ConnectionCreate) SetCreatedByKind

func (_c *ConnectionCreate) SetCreatedByKind(v string) *ConnectionCreate

SetCreatedByKind sets the "created_by_kind" field.

func (*ConnectionCreate) SetDisplayName

func (_c *ConnectionCreate) SetDisplayName(v string) *ConnectionCreate

SetDisplayName sets the "display_name" field.

func (*ConnectionCreate) SetExternalAccountID

func (_c *ConnectionCreate) SetExternalAccountID(v string) *ConnectionCreate

SetExternalAccountID sets the "external_account_id" field.

func (*ConnectionCreate) SetExternalLabel

func (_c *ConnectionCreate) SetExternalLabel(v string) *ConnectionCreate

SetExternalLabel sets the "external_label" field.

func (*ConnectionCreate) SetHealth

SetHealth sets the "health" field.

func (*ConnectionCreate) SetMetadata

func (_c *ConnectionCreate) SetMetadata(v map[string]string) *ConnectionCreate

SetMetadata sets the "metadata" field.

func (*ConnectionCreate) SetNillableExternalAccountID

func (_c *ConnectionCreate) SetNillableExternalAccountID(v *string) *ConnectionCreate

SetNillableExternalAccountID sets the "external_account_id" field if the given value is not nil.

func (*ConnectionCreate) SetNillableExternalLabel

func (_c *ConnectionCreate) SetNillableExternalLabel(v *string) *ConnectionCreate

SetNillableExternalLabel sets the "external_label" field if the given value is not nil.

func (*ConnectionCreate) SetOwnerID

func (_c *ConnectionCreate) SetOwnerID(v string) *ConnectionCreate

SetOwnerID sets the "owner_id" field.

func (*ConnectionCreate) SetProvider

func (_c *ConnectionCreate) SetProvider(v string) *ConnectionCreate

SetProvider sets the "provider" field.

func (*ConnectionCreate) SetRevision

func (_c *ConnectionCreate) SetRevision(v uint64) *ConnectionCreate

SetRevision sets the "revision" field.

func (*ConnectionCreate) SetScopes

func (_c *ConnectionCreate) SetScopes(v []string) *ConnectionCreate

SetScopes sets the "scopes" field.

func (*ConnectionCreate) SetState

func (_c *ConnectionCreate) SetState(v string) *ConnectionCreate

SetState sets the "state" field.

func (*ConnectionCreate) SetUpdatedAt

func (_c *ConnectionCreate) SetUpdatedAt(v time.Time) *ConnectionCreate

SetUpdatedAt sets the "updated_at" field.

type ConnectionCreateBulk

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

ConnectionCreateBulk is the builder for creating many Connection entities in bulk.

func (*ConnectionCreateBulk) Exec

func (_c *ConnectionCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*ConnectionCreateBulk) ExecX

func (_c *ConnectionCreateBulk) ExecX(ctx context.Context)

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

func (*ConnectionCreateBulk) Save

func (_c *ConnectionCreateBulk) Save(ctx context.Context) ([]*Connection, error)

Save creates the Connection entities in the database.

func (*ConnectionCreateBulk) SaveX

func (_c *ConnectionCreateBulk) SaveX(ctx context.Context) []*Connection

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

type ConnectionDelete

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

ConnectionDelete is the builder for deleting a Connection entity.

func (*ConnectionDelete) Exec

func (_d *ConnectionDelete) Exec(ctx context.Context) (int, error)

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

func (*ConnectionDelete) ExecX

func (_d *ConnectionDelete) ExecX(ctx context.Context) int

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

func (*ConnectionDelete) Where

Where appends a list predicates to the ConnectionDelete builder.

type ConnectionDeleteOne

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

ConnectionDeleteOne is the builder for deleting a single Connection entity.

func (*ConnectionDeleteOne) Exec

func (_d *ConnectionDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*ConnectionDeleteOne) ExecX

func (_d *ConnectionDeleteOne) ExecX(ctx context.Context)

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

func (*ConnectionDeleteOne) Where

Where appends a list predicates to the ConnectionDelete builder.

type ConnectionGroupBy

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

ConnectionGroupBy is the group-by builder for Connection entities.

func (*ConnectionGroupBy) Aggregate

func (_g *ConnectionGroupBy) Aggregate(fns ...AggregateFunc) *ConnectionGroupBy

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

func (*ConnectionGroupBy) Bool

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

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

func (*ConnectionGroupBy) BoolX

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

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

func (*ConnectionGroupBy) Bools

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

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

func (*ConnectionGroupBy) BoolsX

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

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

func (*ConnectionGroupBy) Float64

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

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

func (*ConnectionGroupBy) Float64X

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

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

func (*ConnectionGroupBy) Float64s

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

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

func (*ConnectionGroupBy) Float64sX

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

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

func (*ConnectionGroupBy) Int

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

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

func (*ConnectionGroupBy) IntX

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

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

func (*ConnectionGroupBy) Ints

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

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

func (*ConnectionGroupBy) IntsX

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

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

func (*ConnectionGroupBy) Scan

func (_g *ConnectionGroupBy) Scan(ctx context.Context, v any) error

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

func (*ConnectionGroupBy) ScanX

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

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

func (*ConnectionGroupBy) String

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

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

func (*ConnectionGroupBy) StringX

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

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

func (*ConnectionGroupBy) Strings

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

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

func (*ConnectionGroupBy) StringsX

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

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

type ConnectionMutation

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

ConnectionMutation represents an operation that mutates the Connection nodes in the graph.

func (*ConnectionMutation) AddField

func (m *ConnectionMutation) 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 (*ConnectionMutation) AddRevision

func (m *ConnectionMutation) AddRevision(u int64)

AddRevision adds u to the "revision" field.

func (*ConnectionMutation) AddedEdges

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

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

func (*ConnectionMutation) AddedField

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

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

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

func (*ConnectionMutation) AddedIDs

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

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

func (*ConnectionMutation) AddedRevision

func (m *ConnectionMutation) AddedRevision() (r int64, exists bool)

AddedRevision returns the value that was added to the "revision" field in this mutation.

func (*ConnectionMutation) AppendScopes

func (m *ConnectionMutation) AppendScopes(s []string)

AppendScopes adds s to the "scopes" field.

func (*ConnectionMutation) AppendedScopes

func (m *ConnectionMutation) AppendedScopes() ([]string, bool)

AppendedScopes returns the list of values that were appended to the "scopes" field in this mutation.

func (*ConnectionMutation) AuthMethod

func (m *ConnectionMutation) AuthMethod() (r string, exists bool)

AuthMethod returns the value of the "auth_method" field in the mutation.

func (*ConnectionMutation) ClearEdge

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

func (m *ConnectionMutation) 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 (*ConnectionMutation) ClearMetadata

func (m *ConnectionMutation) ClearMetadata()

ClearMetadata clears the value of the "metadata" field.

func (*ConnectionMutation) ClearScopes

func (m *ConnectionMutation) ClearScopes()

ClearScopes clears the value of the "scopes" field.

func (*ConnectionMutation) ClearedEdges

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

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

func (*ConnectionMutation) ClearedFields

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

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

func (ConnectionMutation) Client

func (m ConnectionMutation) 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 (*ConnectionMutation) ConnectionID

func (m *ConnectionMutation) ConnectionID() (r string, exists bool)

ConnectionID returns the value of the "connection_id" field in the mutation.

func (*ConnectionMutation) CreatedAt

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

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

func (*ConnectionMutation) CreatedByID

func (m *ConnectionMutation) CreatedByID() (r string, exists bool)

CreatedByID returns the value of the "created_by_id" field in the mutation.

func (*ConnectionMutation) CreatedByKind

func (m *ConnectionMutation) CreatedByKind() (r string, exists bool)

CreatedByKind returns the value of the "created_by_kind" field in the mutation.

func (*ConnectionMutation) DisplayName

func (m *ConnectionMutation) DisplayName() (r string, exists bool)

DisplayName returns the value of the "display_name" field in the mutation.

func (*ConnectionMutation) EdgeCleared

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

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

func (*ConnectionMutation) ExternalAccountID

func (m *ConnectionMutation) ExternalAccountID() (r string, exists bool)

ExternalAccountID returns the value of the "external_account_id" field in the mutation.

func (*ConnectionMutation) ExternalLabel

func (m *ConnectionMutation) ExternalLabel() (r string, exists bool)

ExternalLabel returns the value of the "external_label" field in the mutation.

func (*ConnectionMutation) Field

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

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

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

func (*ConnectionMutation) Fields

func (m *ConnectionMutation) 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 (*ConnectionMutation) Health

func (m *ConnectionMutation) Health() (r connectionforge.Health, exists bool)

Health returns the value of the "health" field in the mutation.

func (*ConnectionMutation) ID

func (m *ConnectionMutation) ID() (id int, exists bool)

ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.

func (*ConnectionMutation) IDs

func (m *ConnectionMutation) IDs(ctx context.Context) ([]int, error)

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

func (*ConnectionMutation) Metadata

func (m *ConnectionMutation) Metadata() (r map[string]string, exists bool)

Metadata returns the value of the "metadata" field in the mutation.

func (*ConnectionMutation) MetadataCleared

func (m *ConnectionMutation) MetadataCleared() bool

MetadataCleared returns if the "metadata" field was cleared in this mutation.

func (*ConnectionMutation) OldAuthMethod

func (m *ConnectionMutation) OldAuthMethod(ctx context.Context) (v string, err error)

OldAuthMethod returns the old "auth_method" field's value of the Connection entity. If the Connection 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 (*ConnectionMutation) OldConnectionID

func (m *ConnectionMutation) OldConnectionID(ctx context.Context) (v string, err error)

OldConnectionID returns the old "connection_id" field's value of the Connection entity. If the Connection 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 (*ConnectionMutation) OldCreatedAt

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

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

func (m *ConnectionMutation) OldCreatedByID(ctx context.Context) (v string, err error)

OldCreatedByID returns the old "created_by_id" field's value of the Connection entity. If the Connection 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 (*ConnectionMutation) OldCreatedByKind

func (m *ConnectionMutation) OldCreatedByKind(ctx context.Context) (v string, err error)

OldCreatedByKind returns the old "created_by_kind" field's value of the Connection entity. If the Connection 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 (*ConnectionMutation) OldDisplayName

func (m *ConnectionMutation) OldDisplayName(ctx context.Context) (v string, err error)

OldDisplayName returns the old "display_name" field's value of the Connection entity. If the Connection 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 (*ConnectionMutation) OldExternalAccountID

func (m *ConnectionMutation) OldExternalAccountID(ctx context.Context) (v string, err error)

OldExternalAccountID returns the old "external_account_id" field's value of the Connection entity. If the Connection 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 (*ConnectionMutation) OldExternalLabel

func (m *ConnectionMutation) OldExternalLabel(ctx context.Context) (v string, err error)

OldExternalLabel returns the old "external_label" field's value of the Connection entity. If the Connection 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 (*ConnectionMutation) OldField

func (m *ConnectionMutation) 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 (*ConnectionMutation) OldHealth

func (m *ConnectionMutation) OldHealth(ctx context.Context) (v connectionforge.Health, err error)

OldHealth returns the old "health" field's value of the Connection entity. If the Connection 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 (*ConnectionMutation) OldMetadata

func (m *ConnectionMutation) OldMetadata(ctx context.Context) (v map[string]string, err error)

OldMetadata returns the old "metadata" field's value of the Connection entity. If the Connection 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 (*ConnectionMutation) OldOwnerID

func (m *ConnectionMutation) OldOwnerID(ctx context.Context) (v string, err error)

OldOwnerID returns the old "owner_id" field's value of the Connection entity. If the Connection 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 (*ConnectionMutation) OldProvider

func (m *ConnectionMutation) OldProvider(ctx context.Context) (v string, err error)

OldProvider returns the old "provider" field's value of the Connection entity. If the Connection 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 (*ConnectionMutation) OldRevision

func (m *ConnectionMutation) OldRevision(ctx context.Context) (v uint64, err error)

OldRevision returns the old "revision" field's value of the Connection entity. If the Connection 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 (*ConnectionMutation) OldScopes

func (m *ConnectionMutation) OldScopes(ctx context.Context) (v []string, err error)

OldScopes returns the old "scopes" field's value of the Connection entity. If the Connection 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 (*ConnectionMutation) OldState

func (m *ConnectionMutation) OldState(ctx context.Context) (v string, err error)

OldState returns the old "state" field's value of the Connection entity. If the Connection 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 (*ConnectionMutation) OldUpdatedAt

func (m *ConnectionMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)

OldUpdatedAt returns the old "updated_at" field's value of the Connection entity. If the Connection 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 (*ConnectionMutation) Op

func (m *ConnectionMutation) Op() Op

Op returns the operation name.

func (*ConnectionMutation) OwnerID

func (m *ConnectionMutation) OwnerID() (r string, exists bool)

OwnerID returns the value of the "owner_id" field in the mutation.

func (*ConnectionMutation) Provider

func (m *ConnectionMutation) Provider() (r string, exists bool)

Provider returns the value of the "provider" field in the mutation.

func (*ConnectionMutation) RemovedEdges

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

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

func (*ConnectionMutation) RemovedIDs

func (m *ConnectionMutation) 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 (*ConnectionMutation) ResetAuthMethod

func (m *ConnectionMutation) ResetAuthMethod()

ResetAuthMethod resets all changes to the "auth_method" field.

func (*ConnectionMutation) ResetConnectionID

func (m *ConnectionMutation) ResetConnectionID()

ResetConnectionID resets all changes to the "connection_id" field.

func (*ConnectionMutation) ResetCreatedAt

func (m *ConnectionMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*ConnectionMutation) ResetCreatedByID

func (m *ConnectionMutation) ResetCreatedByID()

ResetCreatedByID resets all changes to the "created_by_id" field.

func (*ConnectionMutation) ResetCreatedByKind

func (m *ConnectionMutation) ResetCreatedByKind()

ResetCreatedByKind resets all changes to the "created_by_kind" field.

func (*ConnectionMutation) ResetDisplayName

func (m *ConnectionMutation) ResetDisplayName()

ResetDisplayName resets all changes to the "display_name" field.

func (*ConnectionMutation) ResetEdge

func (m *ConnectionMutation) 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 (*ConnectionMutation) ResetExternalAccountID

func (m *ConnectionMutation) ResetExternalAccountID()

ResetExternalAccountID resets all changes to the "external_account_id" field.

func (*ConnectionMutation) ResetExternalLabel

func (m *ConnectionMutation) ResetExternalLabel()

ResetExternalLabel resets all changes to the "external_label" field.

func (*ConnectionMutation) ResetField

func (m *ConnectionMutation) 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 (*ConnectionMutation) ResetHealth

func (m *ConnectionMutation) ResetHealth()

ResetHealth resets all changes to the "health" field.

func (*ConnectionMutation) ResetMetadata

func (m *ConnectionMutation) ResetMetadata()

ResetMetadata resets all changes to the "metadata" field.

func (*ConnectionMutation) ResetOwnerID

func (m *ConnectionMutation) ResetOwnerID()

ResetOwnerID resets all changes to the "owner_id" field.

func (*ConnectionMutation) ResetProvider

func (m *ConnectionMutation) ResetProvider()

ResetProvider resets all changes to the "provider" field.

func (*ConnectionMutation) ResetRevision

func (m *ConnectionMutation) ResetRevision()

ResetRevision resets all changes to the "revision" field.

func (*ConnectionMutation) ResetScopes

func (m *ConnectionMutation) ResetScopes()

ResetScopes resets all changes to the "scopes" field.

func (*ConnectionMutation) ResetState

func (m *ConnectionMutation) ResetState()

ResetState resets all changes to the "state" field.

func (*ConnectionMutation) ResetUpdatedAt

func (m *ConnectionMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*ConnectionMutation) Revision

func (m *ConnectionMutation) Revision() (r uint64, exists bool)

Revision returns the value of the "revision" field in the mutation.

func (*ConnectionMutation) Scopes

func (m *ConnectionMutation) Scopes() (r []string, exists bool)

Scopes returns the value of the "scopes" field in the mutation.

func (*ConnectionMutation) ScopesCleared

func (m *ConnectionMutation) ScopesCleared() bool

ScopesCleared returns if the "scopes" field was cleared in this mutation.

func (*ConnectionMutation) SetAuthMethod

func (m *ConnectionMutation) SetAuthMethod(s string)

SetAuthMethod sets the "auth_method" field.

func (*ConnectionMutation) SetConnectionID

func (m *ConnectionMutation) SetConnectionID(s string)

SetConnectionID sets the "connection_id" field.

func (*ConnectionMutation) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*ConnectionMutation) SetCreatedByID

func (m *ConnectionMutation) SetCreatedByID(s string)

SetCreatedByID sets the "created_by_id" field.

func (*ConnectionMutation) SetCreatedByKind

func (m *ConnectionMutation) SetCreatedByKind(s string)

SetCreatedByKind sets the "created_by_kind" field.

func (*ConnectionMutation) SetDisplayName

func (m *ConnectionMutation) SetDisplayName(s string)

SetDisplayName sets the "display_name" field.

func (*ConnectionMutation) SetExternalAccountID

func (m *ConnectionMutation) SetExternalAccountID(s string)

SetExternalAccountID sets the "external_account_id" field.

func (*ConnectionMutation) SetExternalLabel

func (m *ConnectionMutation) SetExternalLabel(s string)

SetExternalLabel sets the "external_label" field.

func (*ConnectionMutation) SetField

func (m *ConnectionMutation) 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 (*ConnectionMutation) SetHealth

func (m *ConnectionMutation) SetHealth(c connectionforge.Health)

SetHealth sets the "health" field.

func (*ConnectionMutation) SetMetadata

func (m *ConnectionMutation) SetMetadata(value map[string]string)

SetMetadata sets the "metadata" field.

func (*ConnectionMutation) SetOp

func (m *ConnectionMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*ConnectionMutation) SetOwnerID

func (m *ConnectionMutation) SetOwnerID(s string)

SetOwnerID sets the "owner_id" field.

func (*ConnectionMutation) SetProvider

func (m *ConnectionMutation) SetProvider(s string)

SetProvider sets the "provider" field.

func (*ConnectionMutation) SetRevision

func (m *ConnectionMutation) SetRevision(u uint64)

SetRevision sets the "revision" field.

func (*ConnectionMutation) SetScopes

func (m *ConnectionMutation) SetScopes(s []string)

SetScopes sets the "scopes" field.

func (*ConnectionMutation) SetState

func (m *ConnectionMutation) SetState(s string)

SetState sets the "state" field.

func (*ConnectionMutation) SetUpdatedAt

func (m *ConnectionMutation) SetUpdatedAt(t time.Time)

SetUpdatedAt sets the "updated_at" field.

func (*ConnectionMutation) State

func (m *ConnectionMutation) State() (r string, exists bool)

State returns the value of the "state" field in the mutation.

func (ConnectionMutation) Tx

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

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

func (*ConnectionMutation) Type

func (m *ConnectionMutation) Type() string

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

func (*ConnectionMutation) UpdatedAt

func (m *ConnectionMutation) UpdatedAt() (r time.Time, exists bool)

UpdatedAt returns the value of the "updated_at" field in the mutation.

func (*ConnectionMutation) Where

func (m *ConnectionMutation) Where(ps ...predicate.Connection)

Where appends a list predicates to the ConnectionMutation builder.

func (*ConnectionMutation) WhereP

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

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

type ConnectionQuery

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

ConnectionQuery is the builder for querying Connection entities.

func (*ConnectionQuery) Aggregate

func (_q *ConnectionQuery) Aggregate(fns ...AggregateFunc) *ConnectionSelect

Aggregate returns a ConnectionSelect configured with the given aggregations.

func (*ConnectionQuery) All

func (_q *ConnectionQuery) All(ctx context.Context) ([]*Connection, error)

All executes the query and returns a list of Connections.

func (*ConnectionQuery) AllX

func (_q *ConnectionQuery) AllX(ctx context.Context) []*Connection

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

func (*ConnectionQuery) Clone

func (_q *ConnectionQuery) Clone() *ConnectionQuery

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

func (*ConnectionQuery) Count

func (_q *ConnectionQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*ConnectionQuery) CountX

func (_q *ConnectionQuery) CountX(ctx context.Context) int

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

func (*ConnectionQuery) Exist

func (_q *ConnectionQuery) Exist(ctx context.Context) (bool, error)

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

func (*ConnectionQuery) ExistX

func (_q *ConnectionQuery) ExistX(ctx context.Context) bool

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

func (*ConnectionQuery) First

func (_q *ConnectionQuery) First(ctx context.Context) (*Connection, error)

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

func (*ConnectionQuery) FirstID

func (_q *ConnectionQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*ConnectionQuery) FirstIDX

func (_q *ConnectionQuery) FirstIDX(ctx context.Context) int

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

func (*ConnectionQuery) FirstX

func (_q *ConnectionQuery) FirstX(ctx context.Context) *Connection

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

func (*ConnectionQuery) GroupBy

func (_q *ConnectionQuery) GroupBy(field string, fields ...string) *ConnectionGroupBy

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

client.Connection.Query().
	GroupBy(connection.FieldOwnerID).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*ConnectionQuery) IDs

func (_q *ConnectionQuery) IDs(ctx context.Context) (ids []int, err error)

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

func (*ConnectionQuery) IDsX

func (_q *ConnectionQuery) IDsX(ctx context.Context) []int

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

func (*ConnectionQuery) Limit

func (_q *ConnectionQuery) Limit(limit int) *ConnectionQuery

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

func (*ConnectionQuery) Offset

func (_q *ConnectionQuery) Offset(offset int) *ConnectionQuery

Offset to start from.

func (*ConnectionQuery) Only

func (_q *ConnectionQuery) Only(ctx context.Context) (*Connection, error)

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

func (*ConnectionQuery) OnlyID

func (_q *ConnectionQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*ConnectionQuery) OnlyIDX

func (_q *ConnectionQuery) OnlyIDX(ctx context.Context) int

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

func (*ConnectionQuery) OnlyX

func (_q *ConnectionQuery) OnlyX(ctx context.Context) *Connection

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

func (*ConnectionQuery) Order

Order specifies how the records should be ordered.

func (*ConnectionQuery) Select

func (_q *ConnectionQuery) Select(fields ...string) *ConnectionSelect

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

client.Connection.Query().
	Select(connection.FieldOwnerID).
	Scan(ctx, &v)

func (*ConnectionQuery) Unique

func (_q *ConnectionQuery) Unique(unique bool) *ConnectionQuery

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

Where adds a new predicate for the ConnectionQuery builder.

type ConnectionSelect

type ConnectionSelect struct {
	*ConnectionQuery
	// contains filtered or unexported fields
}

ConnectionSelect is the builder for selecting fields of Connection entities.

func (*ConnectionSelect) Aggregate

func (_s *ConnectionSelect) Aggregate(fns ...AggregateFunc) *ConnectionSelect

Aggregate adds the given aggregation functions to the selector query.

func (*ConnectionSelect) Bool

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

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

func (*ConnectionSelect) BoolX

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

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

func (*ConnectionSelect) Bools

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

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

func (*ConnectionSelect) BoolsX

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

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

func (*ConnectionSelect) Float64

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

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

func (*ConnectionSelect) Float64X

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

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

func (*ConnectionSelect) Float64s

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

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

func (*ConnectionSelect) Float64sX

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

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

func (*ConnectionSelect) Int

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

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

func (*ConnectionSelect) IntX

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

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

func (*ConnectionSelect) Ints

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

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

func (*ConnectionSelect) IntsX

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

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

func (*ConnectionSelect) Scan

func (_s *ConnectionSelect) Scan(ctx context.Context, v any) error

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

func (*ConnectionSelect) ScanX

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

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

func (*ConnectionSelect) String

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

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

func (*ConnectionSelect) StringX

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

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

func (*ConnectionSelect) Strings

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

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

func (*ConnectionSelect) StringsX

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

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

type ConnectionUpdate

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

ConnectionUpdate is the builder for updating Connection entities.

func (*ConnectionUpdate) AddRevision

func (_u *ConnectionUpdate) AddRevision(v int64) *ConnectionUpdate

AddRevision adds value to the "revision" field.

func (*ConnectionUpdate) AppendScopes

func (_u *ConnectionUpdate) AppendScopes(v []string) *ConnectionUpdate

AppendScopes appends value to the "scopes" field.

func (*ConnectionUpdate) ClearMetadata

func (_u *ConnectionUpdate) ClearMetadata() *ConnectionUpdate

ClearMetadata clears the value of the "metadata" field.

func (*ConnectionUpdate) ClearScopes

func (_u *ConnectionUpdate) ClearScopes() *ConnectionUpdate

ClearScopes clears the value of the "scopes" field.

func (*ConnectionUpdate) Exec

func (_u *ConnectionUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*ConnectionUpdate) ExecX

func (_u *ConnectionUpdate) ExecX(ctx context.Context)

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

func (*ConnectionUpdate) Mutation

func (_u *ConnectionUpdate) Mutation() *ConnectionMutation

Mutation returns the ConnectionMutation object of the builder.

func (*ConnectionUpdate) Save

func (_u *ConnectionUpdate) Save(ctx context.Context) (int, error)

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

func (*ConnectionUpdate) SaveX

func (_u *ConnectionUpdate) SaveX(ctx context.Context) int

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

func (*ConnectionUpdate) SetAuthMethod

func (_u *ConnectionUpdate) SetAuthMethod(v string) *ConnectionUpdate

SetAuthMethod sets the "auth_method" field.

func (*ConnectionUpdate) SetCreatedByID

func (_u *ConnectionUpdate) SetCreatedByID(v string) *ConnectionUpdate

SetCreatedByID sets the "created_by_id" field.

func (*ConnectionUpdate) SetCreatedByKind

func (_u *ConnectionUpdate) SetCreatedByKind(v string) *ConnectionUpdate

SetCreatedByKind sets the "created_by_kind" field.

func (*ConnectionUpdate) SetDisplayName

func (_u *ConnectionUpdate) SetDisplayName(v string) *ConnectionUpdate

SetDisplayName sets the "display_name" field.

func (*ConnectionUpdate) SetExternalAccountID

func (_u *ConnectionUpdate) SetExternalAccountID(v string) *ConnectionUpdate

SetExternalAccountID sets the "external_account_id" field.

func (*ConnectionUpdate) SetExternalLabel

func (_u *ConnectionUpdate) SetExternalLabel(v string) *ConnectionUpdate

SetExternalLabel sets the "external_label" field.

func (*ConnectionUpdate) SetHealth

SetHealth sets the "health" field.

func (*ConnectionUpdate) SetMetadata

func (_u *ConnectionUpdate) SetMetadata(v map[string]string) *ConnectionUpdate

SetMetadata sets the "metadata" field.

func (*ConnectionUpdate) SetNillableAuthMethod

func (_u *ConnectionUpdate) SetNillableAuthMethod(v *string) *ConnectionUpdate

SetNillableAuthMethod sets the "auth_method" field if the given value is not nil.

func (*ConnectionUpdate) SetNillableCreatedByID

func (_u *ConnectionUpdate) SetNillableCreatedByID(v *string) *ConnectionUpdate

SetNillableCreatedByID sets the "created_by_id" field if the given value is not nil.

func (*ConnectionUpdate) SetNillableCreatedByKind

func (_u *ConnectionUpdate) SetNillableCreatedByKind(v *string) *ConnectionUpdate

SetNillableCreatedByKind sets the "created_by_kind" field if the given value is not nil.

func (*ConnectionUpdate) SetNillableDisplayName

func (_u *ConnectionUpdate) SetNillableDisplayName(v *string) *ConnectionUpdate

SetNillableDisplayName sets the "display_name" field if the given value is not nil.

func (*ConnectionUpdate) SetNillableExternalAccountID

func (_u *ConnectionUpdate) SetNillableExternalAccountID(v *string) *ConnectionUpdate

SetNillableExternalAccountID sets the "external_account_id" field if the given value is not nil.

func (*ConnectionUpdate) SetNillableExternalLabel

func (_u *ConnectionUpdate) SetNillableExternalLabel(v *string) *ConnectionUpdate

SetNillableExternalLabel sets the "external_label" field if the given value is not nil.

func (*ConnectionUpdate) SetNillableHealth

func (_u *ConnectionUpdate) SetNillableHealth(v *connectionforge.Health) *ConnectionUpdate

SetNillableHealth sets the "health" field if the given value is not nil.

func (*ConnectionUpdate) SetNillableRevision

func (_u *ConnectionUpdate) SetNillableRevision(v *uint64) *ConnectionUpdate

SetNillableRevision sets the "revision" field if the given value is not nil.

func (*ConnectionUpdate) SetNillableState

func (_u *ConnectionUpdate) SetNillableState(v *string) *ConnectionUpdate

SetNillableState sets the "state" field if the given value is not nil.

func (*ConnectionUpdate) SetNillableUpdatedAt

func (_u *ConnectionUpdate) SetNillableUpdatedAt(v *time.Time) *ConnectionUpdate

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

func (*ConnectionUpdate) SetRevision

func (_u *ConnectionUpdate) SetRevision(v uint64) *ConnectionUpdate

SetRevision sets the "revision" field.

func (*ConnectionUpdate) SetScopes

func (_u *ConnectionUpdate) SetScopes(v []string) *ConnectionUpdate

SetScopes sets the "scopes" field.

func (*ConnectionUpdate) SetState

func (_u *ConnectionUpdate) SetState(v string) *ConnectionUpdate

SetState sets the "state" field.

func (*ConnectionUpdate) SetUpdatedAt

func (_u *ConnectionUpdate) SetUpdatedAt(v time.Time) *ConnectionUpdate

SetUpdatedAt sets the "updated_at" field.

func (*ConnectionUpdate) Where

Where appends a list predicates to the ConnectionUpdate builder.

type ConnectionUpdateOne

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

ConnectionUpdateOne is the builder for updating a single Connection entity.

func (*ConnectionUpdateOne) AddRevision

func (_u *ConnectionUpdateOne) AddRevision(v int64) *ConnectionUpdateOne

AddRevision adds value to the "revision" field.

func (*ConnectionUpdateOne) AppendScopes

func (_u *ConnectionUpdateOne) AppendScopes(v []string) *ConnectionUpdateOne

AppendScopes appends value to the "scopes" field.

func (*ConnectionUpdateOne) ClearMetadata

func (_u *ConnectionUpdateOne) ClearMetadata() *ConnectionUpdateOne

ClearMetadata clears the value of the "metadata" field.

func (*ConnectionUpdateOne) ClearScopes

func (_u *ConnectionUpdateOne) ClearScopes() *ConnectionUpdateOne

ClearScopes clears the value of the "scopes" field.

func (*ConnectionUpdateOne) Exec

func (_u *ConnectionUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*ConnectionUpdateOne) ExecX

func (_u *ConnectionUpdateOne) ExecX(ctx context.Context)

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

func (*ConnectionUpdateOne) Mutation

func (_u *ConnectionUpdateOne) Mutation() *ConnectionMutation

Mutation returns the ConnectionMutation object of the builder.

func (*ConnectionUpdateOne) Save

Save executes the query and returns the updated Connection entity.

func (*ConnectionUpdateOne) SaveX

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

func (*ConnectionUpdateOne) Select

func (_u *ConnectionUpdateOne) Select(field string, fields ...string) *ConnectionUpdateOne

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

func (*ConnectionUpdateOne) SetAuthMethod

func (_u *ConnectionUpdateOne) SetAuthMethod(v string) *ConnectionUpdateOne

SetAuthMethod sets the "auth_method" field.

func (*ConnectionUpdateOne) SetCreatedByID

func (_u *ConnectionUpdateOne) SetCreatedByID(v string) *ConnectionUpdateOne

SetCreatedByID sets the "created_by_id" field.

func (*ConnectionUpdateOne) SetCreatedByKind

func (_u *ConnectionUpdateOne) SetCreatedByKind(v string) *ConnectionUpdateOne

SetCreatedByKind sets the "created_by_kind" field.

func (*ConnectionUpdateOne) SetDisplayName

func (_u *ConnectionUpdateOne) SetDisplayName(v string) *ConnectionUpdateOne

SetDisplayName sets the "display_name" field.

func (*ConnectionUpdateOne) SetExternalAccountID

func (_u *ConnectionUpdateOne) SetExternalAccountID(v string) *ConnectionUpdateOne

SetExternalAccountID sets the "external_account_id" field.

func (*ConnectionUpdateOne) SetExternalLabel

func (_u *ConnectionUpdateOne) SetExternalLabel(v string) *ConnectionUpdateOne

SetExternalLabel sets the "external_label" field.

func (*ConnectionUpdateOne) SetHealth

SetHealth sets the "health" field.

func (*ConnectionUpdateOne) SetMetadata

func (_u *ConnectionUpdateOne) SetMetadata(v map[string]string) *ConnectionUpdateOne

SetMetadata sets the "metadata" field.

func (*ConnectionUpdateOne) SetNillableAuthMethod

func (_u *ConnectionUpdateOne) SetNillableAuthMethod(v *string) *ConnectionUpdateOne

SetNillableAuthMethod sets the "auth_method" field if the given value is not nil.

func (*ConnectionUpdateOne) SetNillableCreatedByID

func (_u *ConnectionUpdateOne) SetNillableCreatedByID(v *string) *ConnectionUpdateOne

SetNillableCreatedByID sets the "created_by_id" field if the given value is not nil.

func (*ConnectionUpdateOne) SetNillableCreatedByKind

func (_u *ConnectionUpdateOne) SetNillableCreatedByKind(v *string) *ConnectionUpdateOne

SetNillableCreatedByKind sets the "created_by_kind" field if the given value is not nil.

func (*ConnectionUpdateOne) SetNillableDisplayName

func (_u *ConnectionUpdateOne) SetNillableDisplayName(v *string) *ConnectionUpdateOne

SetNillableDisplayName sets the "display_name" field if the given value is not nil.

func (*ConnectionUpdateOne) SetNillableExternalAccountID

func (_u *ConnectionUpdateOne) SetNillableExternalAccountID(v *string) *ConnectionUpdateOne

SetNillableExternalAccountID sets the "external_account_id" field if the given value is not nil.

func (*ConnectionUpdateOne) SetNillableExternalLabel

func (_u *ConnectionUpdateOne) SetNillableExternalLabel(v *string) *ConnectionUpdateOne

SetNillableExternalLabel sets the "external_label" field if the given value is not nil.

func (*ConnectionUpdateOne) SetNillableHealth

SetNillableHealth sets the "health" field if the given value is not nil.

func (*ConnectionUpdateOne) SetNillableRevision

func (_u *ConnectionUpdateOne) SetNillableRevision(v *uint64) *ConnectionUpdateOne

SetNillableRevision sets the "revision" field if the given value is not nil.

func (*ConnectionUpdateOne) SetNillableState

func (_u *ConnectionUpdateOne) SetNillableState(v *string) *ConnectionUpdateOne

SetNillableState sets the "state" field if the given value is not nil.

func (*ConnectionUpdateOne) SetNillableUpdatedAt

func (_u *ConnectionUpdateOne) SetNillableUpdatedAt(v *time.Time) *ConnectionUpdateOne

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

func (*ConnectionUpdateOne) SetRevision

func (_u *ConnectionUpdateOne) SetRevision(v uint64) *ConnectionUpdateOne

SetRevision sets the "revision" field.

func (*ConnectionUpdateOne) SetScopes

func (_u *ConnectionUpdateOne) SetScopes(v []string) *ConnectionUpdateOne

SetScopes sets the "scopes" field.

func (*ConnectionUpdateOne) SetState

SetState sets the "state" field.

func (*ConnectionUpdateOne) SetUpdatedAt

func (_u *ConnectionUpdateOne) SetUpdatedAt(v time.Time) *ConnectionUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*ConnectionUpdateOne) Where

Where appends a list predicates to the ConnectionUpdate builder.

type Connections

type Connections []*Connection

Connections is a parsable slice of Connection.

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 Credential

type Credential struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// OwnerID holds the value of the "owner_id" field.
	OwnerID string `json:"owner_id,omitempty"`
	// ConnectionID holds the value of the "connection_id" field.
	ConnectionID string `json:"connection_id,omitempty"`
	// Version holds the value of the "version" field.
	Version int `json:"version,omitempty"`
	// Kind holds the value of the "kind" field.
	Kind string `json:"kind,omitempty"`
	// Ciphertext holds the value of the "ciphertext" field.
	Ciphertext []byte `json:"ciphertext,omitempty"`
	// ExpiresAt holds the value of the "expires_at" field.
	ExpiresAt *time.Time `json:"expires_at,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// contains filtered or unexported fields
}

Credential is the model entity for the Credential schema.

func (*Credential) String

func (_m *Credential) String() string

String implements the fmt.Stringer.

func (*Credential) Unwrap

func (_m *Credential) Unwrap() *Credential

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

func (_m *Credential) Update() *CredentialUpdateOne

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

func (*Credential) Value

func (_m *Credential) Value(name string) (ent.Value, error)

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

type CredentialClient

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

CredentialClient is a client for the Credential schema.

func NewCredentialClient

func NewCredentialClient(c config) *CredentialClient

NewCredentialClient returns a client for the Credential from the given config.

func (*CredentialClient) Create

func (c *CredentialClient) Create() *CredentialCreate

Create returns a builder for creating a Credential entity.

func (*CredentialClient) CreateBulk

func (c *CredentialClient) CreateBulk(builders ...*CredentialCreate) *CredentialCreateBulk

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

func (*CredentialClient) Delete

func (c *CredentialClient) Delete() *CredentialDelete

Delete returns a delete builder for Credential.

func (*CredentialClient) DeleteOne

func (c *CredentialClient) DeleteOne(_m *Credential) *CredentialDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*CredentialClient) DeleteOneID

func (c *CredentialClient) DeleteOneID(id int) *CredentialDeleteOne

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

func (*CredentialClient) Get

func (c *CredentialClient) Get(ctx context.Context, id int) (*Credential, error)

Get returns a Credential entity by its id.

func (*CredentialClient) GetX

func (c *CredentialClient) GetX(ctx context.Context, id int) *Credential

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

func (*CredentialClient) Hooks

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

Hooks returns the client hooks.

func (*CredentialClient) Intercept

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

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

func (*CredentialClient) Interceptors

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

Interceptors returns the client interceptors.

func (*CredentialClient) MapCreateBulk

func (c *CredentialClient) MapCreateBulk(slice any, setFunc func(*CredentialCreate, int)) *CredentialCreateBulk

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 (*CredentialClient) Query

func (c *CredentialClient) Query() *CredentialQuery

Query returns a query builder for Credential.

func (*CredentialClient) Update

func (c *CredentialClient) Update() *CredentialUpdate

Update returns an update builder for Credential.

func (*CredentialClient) UpdateOne

func (c *CredentialClient) UpdateOne(_m *Credential) *CredentialUpdateOne

UpdateOne returns an update builder for the given entity.

func (*CredentialClient) UpdateOneID

func (c *CredentialClient) UpdateOneID(id int) *CredentialUpdateOne

UpdateOneID returns an update builder for the given id.

func (*CredentialClient) Use

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

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

type CredentialCreate

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

CredentialCreate is the builder for creating a Credential entity.

func (*CredentialCreate) Exec

func (_c *CredentialCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*CredentialCreate) ExecX

func (_c *CredentialCreate) ExecX(ctx context.Context)

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

func (*CredentialCreate) Mutation

func (_c *CredentialCreate) Mutation() *CredentialMutation

Mutation returns the CredentialMutation object of the builder.

func (*CredentialCreate) Save

func (_c *CredentialCreate) Save(ctx context.Context) (*Credential, error)

Save creates the Credential in the database.

func (*CredentialCreate) SaveX

func (_c *CredentialCreate) SaveX(ctx context.Context) *Credential

SaveX calls Save and panics if Save returns an error.

func (*CredentialCreate) SetCiphertext

func (_c *CredentialCreate) SetCiphertext(v []byte) *CredentialCreate

SetCiphertext sets the "ciphertext" field.

func (*CredentialCreate) SetConnectionID

func (_c *CredentialCreate) SetConnectionID(v string) *CredentialCreate

SetConnectionID sets the "connection_id" field.

func (*CredentialCreate) SetCreatedAt

func (_c *CredentialCreate) SetCreatedAt(v time.Time) *CredentialCreate

SetCreatedAt sets the "created_at" field.

func (*CredentialCreate) SetExpiresAt

func (_c *CredentialCreate) SetExpiresAt(v time.Time) *CredentialCreate

SetExpiresAt sets the "expires_at" field.

func (*CredentialCreate) SetKind

func (_c *CredentialCreate) SetKind(v string) *CredentialCreate

SetKind sets the "kind" field.

func (*CredentialCreate) SetNillableExpiresAt

func (_c *CredentialCreate) SetNillableExpiresAt(v *time.Time) *CredentialCreate

SetNillableExpiresAt sets the "expires_at" field if the given value is not nil.

func (*CredentialCreate) SetOwnerID

func (_c *CredentialCreate) SetOwnerID(v string) *CredentialCreate

SetOwnerID sets the "owner_id" field.

func (*CredentialCreate) SetVersion

func (_c *CredentialCreate) SetVersion(v int) *CredentialCreate

SetVersion sets the "version" field.

type CredentialCreateBulk

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

CredentialCreateBulk is the builder for creating many Credential entities in bulk.

func (*CredentialCreateBulk) Exec

func (_c *CredentialCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*CredentialCreateBulk) ExecX

func (_c *CredentialCreateBulk) ExecX(ctx context.Context)

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

func (*CredentialCreateBulk) Save

func (_c *CredentialCreateBulk) Save(ctx context.Context) ([]*Credential, error)

Save creates the Credential entities in the database.

func (*CredentialCreateBulk) SaveX

func (_c *CredentialCreateBulk) SaveX(ctx context.Context) []*Credential

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

type CredentialDelete

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

CredentialDelete is the builder for deleting a Credential entity.

func (*CredentialDelete) Exec

func (_d *CredentialDelete) Exec(ctx context.Context) (int, error)

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

func (*CredentialDelete) ExecX

func (_d *CredentialDelete) ExecX(ctx context.Context) int

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

func (*CredentialDelete) Where

Where appends a list predicates to the CredentialDelete builder.

type CredentialDeleteOne

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

CredentialDeleteOne is the builder for deleting a single Credential entity.

func (*CredentialDeleteOne) Exec

func (_d *CredentialDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*CredentialDeleteOne) ExecX

func (_d *CredentialDeleteOne) ExecX(ctx context.Context)

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

func (*CredentialDeleteOne) Where

Where appends a list predicates to the CredentialDelete builder.

type CredentialGroupBy

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

CredentialGroupBy is the group-by builder for Credential entities.

func (*CredentialGroupBy) Aggregate

func (_g *CredentialGroupBy) Aggregate(fns ...AggregateFunc) *CredentialGroupBy

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

func (*CredentialGroupBy) Bool

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

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

func (*CredentialGroupBy) BoolX

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

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

func (*CredentialGroupBy) Bools

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

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

func (*CredentialGroupBy) BoolsX

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

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

func (*CredentialGroupBy) Float64

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

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

func (*CredentialGroupBy) Float64X

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

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

func (*CredentialGroupBy) Float64s

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

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

func (*CredentialGroupBy) Float64sX

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

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

func (*CredentialGroupBy) Int

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

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

func (*CredentialGroupBy) IntX

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

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

func (*CredentialGroupBy) Ints

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

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

func (*CredentialGroupBy) IntsX

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

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

func (*CredentialGroupBy) Scan

func (_g *CredentialGroupBy) Scan(ctx context.Context, v any) error

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

func (*CredentialGroupBy) ScanX

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

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

func (*CredentialGroupBy) String

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

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

func (*CredentialGroupBy) StringX

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

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

func (*CredentialGroupBy) Strings

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

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

func (*CredentialGroupBy) StringsX

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

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

type CredentialMutation

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

CredentialMutation represents an operation that mutates the Credential nodes in the graph.

func (*CredentialMutation) AddField

func (m *CredentialMutation) 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 (*CredentialMutation) AddVersion

func (m *CredentialMutation) AddVersion(i int)

AddVersion adds i to the "version" field.

func (*CredentialMutation) AddedEdges

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

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

func (*CredentialMutation) AddedField

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

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

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

func (*CredentialMutation) AddedIDs

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

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

func (*CredentialMutation) AddedVersion

func (m *CredentialMutation) AddedVersion() (r int, exists bool)

AddedVersion returns the value that was added to the "version" field in this mutation.

func (*CredentialMutation) Ciphertext

func (m *CredentialMutation) Ciphertext() (r []byte, exists bool)

Ciphertext returns the value of the "ciphertext" field in the mutation.

func (*CredentialMutation) ClearEdge

func (m *CredentialMutation) 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 (*CredentialMutation) ClearExpiresAt

func (m *CredentialMutation) ClearExpiresAt()

ClearExpiresAt clears the value of the "expires_at" field.

func (*CredentialMutation) ClearField

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

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

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

func (*CredentialMutation) ClearedFields

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

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

func (CredentialMutation) Client

func (m CredentialMutation) 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 (*CredentialMutation) ConnectionID

func (m *CredentialMutation) ConnectionID() (r string, exists bool)

ConnectionID returns the value of the "connection_id" field in the mutation.

func (*CredentialMutation) CreatedAt

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

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

func (*CredentialMutation) EdgeCleared

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

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

func (*CredentialMutation) ExpiresAt

func (m *CredentialMutation) ExpiresAt() (r time.Time, exists bool)

ExpiresAt returns the value of the "expires_at" field in the mutation.

func (*CredentialMutation) ExpiresAtCleared

func (m *CredentialMutation) ExpiresAtCleared() bool

ExpiresAtCleared returns if the "expires_at" field was cleared in this mutation.

func (*CredentialMutation) Field

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

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

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

func (*CredentialMutation) Fields

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

func (m *CredentialMutation) ID() (id int, exists bool)

ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.

func (*CredentialMutation) IDs

func (m *CredentialMutation) IDs(ctx context.Context) ([]int, error)

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

func (*CredentialMutation) Kind

func (m *CredentialMutation) Kind() (r string, exists bool)

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

func (*CredentialMutation) OldCiphertext

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

OldCiphertext returns the old "ciphertext" field's value of the Credential entity. If the Credential 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 (*CredentialMutation) OldConnectionID

func (m *CredentialMutation) OldConnectionID(ctx context.Context) (v string, err error)

OldConnectionID returns the old "connection_id" field's value of the Credential entity. If the Credential 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 (*CredentialMutation) OldCreatedAt

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

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

func (m *CredentialMutation) OldExpiresAt(ctx context.Context) (v *time.Time, err error)

OldExpiresAt returns the old "expires_at" field's value of the Credential entity. If the Credential 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 (*CredentialMutation) OldField

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

func (m *CredentialMutation) OldKind(ctx context.Context) (v string, err error)

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

func (m *CredentialMutation) OldOwnerID(ctx context.Context) (v string, err error)

OldOwnerID returns the old "owner_id" field's value of the Credential entity. If the Credential 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 (*CredentialMutation) OldVersion

func (m *CredentialMutation) OldVersion(ctx context.Context) (v int, err error)

OldVersion returns the old "version" field's value of the Credential entity. If the Credential 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 (*CredentialMutation) Op

func (m *CredentialMutation) Op() Op

Op returns the operation name.

func (*CredentialMutation) OwnerID

func (m *CredentialMutation) OwnerID() (r string, exists bool)

OwnerID returns the value of the "owner_id" field in the mutation.

func (*CredentialMutation) RemovedEdges

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

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

func (*CredentialMutation) RemovedIDs

func (m *CredentialMutation) 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 (*CredentialMutation) ResetCiphertext

func (m *CredentialMutation) ResetCiphertext()

ResetCiphertext resets all changes to the "ciphertext" field.

func (*CredentialMutation) ResetConnectionID

func (m *CredentialMutation) ResetConnectionID()

ResetConnectionID resets all changes to the "connection_id" field.

func (*CredentialMutation) ResetCreatedAt

func (m *CredentialMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*CredentialMutation) ResetEdge

func (m *CredentialMutation) 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 (*CredentialMutation) ResetExpiresAt

func (m *CredentialMutation) ResetExpiresAt()

ResetExpiresAt resets all changes to the "expires_at" field.

func (*CredentialMutation) ResetField

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

func (m *CredentialMutation) ResetKind()

ResetKind resets all changes to the "kind" field.

func (*CredentialMutation) ResetOwnerID

func (m *CredentialMutation) ResetOwnerID()

ResetOwnerID resets all changes to the "owner_id" field.

func (*CredentialMutation) ResetVersion

func (m *CredentialMutation) ResetVersion()

ResetVersion resets all changes to the "version" field.

func (*CredentialMutation) SetCiphertext

func (m *CredentialMutation) SetCiphertext(b []byte)

SetCiphertext sets the "ciphertext" field.

func (*CredentialMutation) SetConnectionID

func (m *CredentialMutation) SetConnectionID(s string)

SetConnectionID sets the "connection_id" field.

func (*CredentialMutation) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*CredentialMutation) SetExpiresAt

func (m *CredentialMutation) SetExpiresAt(t time.Time)

SetExpiresAt sets the "expires_at" field.

func (*CredentialMutation) SetField

func (m *CredentialMutation) 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 (*CredentialMutation) SetKind

func (m *CredentialMutation) SetKind(s string)

SetKind sets the "kind" field.

func (*CredentialMutation) SetOp

func (m *CredentialMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*CredentialMutation) SetOwnerID

func (m *CredentialMutation) SetOwnerID(s string)

SetOwnerID sets the "owner_id" field.

func (*CredentialMutation) SetVersion

func (m *CredentialMutation) SetVersion(i int)

SetVersion sets the "version" field.

func (CredentialMutation) Tx

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

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

func (*CredentialMutation) Type

func (m *CredentialMutation) Type() string

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

func (*CredentialMutation) Version

func (m *CredentialMutation) Version() (r int, exists bool)

Version returns the value of the "version" field in the mutation.

func (*CredentialMutation) Where

func (m *CredentialMutation) Where(ps ...predicate.Credential)

Where appends a list predicates to the CredentialMutation builder.

func (*CredentialMutation) WhereP

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

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

type CredentialQuery

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

CredentialQuery is the builder for querying Credential entities.

func (*CredentialQuery) Aggregate

func (_q *CredentialQuery) Aggregate(fns ...AggregateFunc) *CredentialSelect

Aggregate returns a CredentialSelect configured with the given aggregations.

func (*CredentialQuery) All

func (_q *CredentialQuery) All(ctx context.Context) ([]*Credential, error)

All executes the query and returns a list of Credentials.

func (*CredentialQuery) AllX

func (_q *CredentialQuery) AllX(ctx context.Context) []*Credential

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

func (*CredentialQuery) Clone

func (_q *CredentialQuery) Clone() *CredentialQuery

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

func (*CredentialQuery) Count

func (_q *CredentialQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*CredentialQuery) CountX

func (_q *CredentialQuery) CountX(ctx context.Context) int

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

func (*CredentialQuery) Exist

func (_q *CredentialQuery) Exist(ctx context.Context) (bool, error)

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

func (*CredentialQuery) ExistX

func (_q *CredentialQuery) ExistX(ctx context.Context) bool

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

func (*CredentialQuery) First

func (_q *CredentialQuery) First(ctx context.Context) (*Credential, error)

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

func (*CredentialQuery) FirstID

func (_q *CredentialQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*CredentialQuery) FirstIDX

func (_q *CredentialQuery) FirstIDX(ctx context.Context) int

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

func (*CredentialQuery) FirstX

func (_q *CredentialQuery) FirstX(ctx context.Context) *Credential

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

func (*CredentialQuery) GroupBy

func (_q *CredentialQuery) GroupBy(field string, fields ...string) *CredentialGroupBy

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

client.Credential.Query().
	GroupBy(credential.FieldOwnerID).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*CredentialQuery) IDs

func (_q *CredentialQuery) IDs(ctx context.Context) (ids []int, err error)

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

func (*CredentialQuery) IDsX

func (_q *CredentialQuery) IDsX(ctx context.Context) []int

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

func (*CredentialQuery) Limit

func (_q *CredentialQuery) Limit(limit int) *CredentialQuery

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

func (*CredentialQuery) Offset

func (_q *CredentialQuery) Offset(offset int) *CredentialQuery

Offset to start from.

func (*CredentialQuery) Only

func (_q *CredentialQuery) Only(ctx context.Context) (*Credential, error)

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

func (*CredentialQuery) OnlyID

func (_q *CredentialQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*CredentialQuery) OnlyIDX

func (_q *CredentialQuery) OnlyIDX(ctx context.Context) int

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

func (*CredentialQuery) OnlyX

func (_q *CredentialQuery) OnlyX(ctx context.Context) *Credential

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

func (*CredentialQuery) Order

Order specifies how the records should be ordered.

func (*CredentialQuery) Select

func (_q *CredentialQuery) Select(fields ...string) *CredentialSelect

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

client.Credential.Query().
	Select(credential.FieldOwnerID).
	Scan(ctx, &v)

func (*CredentialQuery) Unique

func (_q *CredentialQuery) Unique(unique bool) *CredentialQuery

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

Where adds a new predicate for the CredentialQuery builder.

type CredentialSelect

type CredentialSelect struct {
	*CredentialQuery
	// contains filtered or unexported fields
}

CredentialSelect is the builder for selecting fields of Credential entities.

func (*CredentialSelect) Aggregate

func (_s *CredentialSelect) Aggregate(fns ...AggregateFunc) *CredentialSelect

Aggregate adds the given aggregation functions to the selector query.

func (*CredentialSelect) Bool

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

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

func (*CredentialSelect) BoolX

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

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

func (*CredentialSelect) Bools

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

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

func (*CredentialSelect) BoolsX

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

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

func (*CredentialSelect) Float64

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

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

func (*CredentialSelect) Float64X

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

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

func (*CredentialSelect) Float64s

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

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

func (*CredentialSelect) Float64sX

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

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

func (*CredentialSelect) Int

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

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

func (*CredentialSelect) IntX

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

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

func (*CredentialSelect) Ints

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

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

func (*CredentialSelect) IntsX

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

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

func (*CredentialSelect) Scan

func (_s *CredentialSelect) Scan(ctx context.Context, v any) error

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

func (*CredentialSelect) ScanX

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

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

func (*CredentialSelect) String

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

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

func (*CredentialSelect) StringX

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

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

func (*CredentialSelect) Strings

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

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

func (*CredentialSelect) StringsX

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

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

type CredentialUpdate

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

CredentialUpdate is the builder for updating Credential entities.

func (*CredentialUpdate) Exec

func (_u *CredentialUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*CredentialUpdate) ExecX

func (_u *CredentialUpdate) ExecX(ctx context.Context)

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

func (*CredentialUpdate) Mutation

func (_u *CredentialUpdate) Mutation() *CredentialMutation

Mutation returns the CredentialMutation object of the builder.

func (*CredentialUpdate) Save

func (_u *CredentialUpdate) Save(ctx context.Context) (int, error)

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

func (*CredentialUpdate) SaveX

func (_u *CredentialUpdate) SaveX(ctx context.Context) int

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

func (*CredentialUpdate) Where

Where appends a list predicates to the CredentialUpdate builder.

type CredentialUpdateOne

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

CredentialUpdateOne is the builder for updating a single Credential entity.

func (*CredentialUpdateOne) Exec

func (_u *CredentialUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*CredentialUpdateOne) ExecX

func (_u *CredentialUpdateOne) ExecX(ctx context.Context)

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

func (*CredentialUpdateOne) Mutation

func (_u *CredentialUpdateOne) Mutation() *CredentialMutation

Mutation returns the CredentialMutation object of the builder.

func (*CredentialUpdateOne) Save

Save executes the query and returns the updated Credential entity.

func (*CredentialUpdateOne) SaveX

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

func (*CredentialUpdateOne) Select

func (_u *CredentialUpdateOne) Select(field string, fields ...string) *CredentialUpdateOne

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

func (*CredentialUpdateOne) Where

Where appends a list predicates to the CredentialUpdate builder.

type Credentials

type Credentials []*Credential

Credentials is a parsable slice of Credential.

type Grant

type Grant struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// OwnerID holds the value of the "owner_id" field.
	OwnerID string `json:"owner_id,omitempty"`
	// ConnectionID holds the value of the "connection_id" field.
	ConnectionID string `json:"connection_id,omitempty"`
	// PrincipalKind holds the value of the "principal_kind" field.
	PrincipalKind string `json:"principal_kind,omitempty"`
	// PrincipalID holds the value of the "principal_id" field.
	PrincipalID string `json:"principal_id,omitempty"`
	// Actions holds the value of the "actions" field.
	Actions []string `json:"actions,omitempty"`
	// contains filtered or unexported fields
}

Grant is the model entity for the Grant schema.

func (*Grant) String

func (_m *Grant) String() string

String implements the fmt.Stringer.

func (*Grant) Unwrap

func (_m *Grant) Unwrap() *Grant

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

func (_m *Grant) Update() *GrantUpdateOne

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

func (*Grant) Value

func (_m *Grant) Value(name string) (ent.Value, error)

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

type GrantClient

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

GrantClient is a client for the Grant schema.

func NewGrantClient

func NewGrantClient(c config) *GrantClient

NewGrantClient returns a client for the Grant from the given config.

func (*GrantClient) Create

func (c *GrantClient) Create() *GrantCreate

Create returns a builder for creating a Grant entity.

func (*GrantClient) CreateBulk

func (c *GrantClient) CreateBulk(builders ...*GrantCreate) *GrantCreateBulk

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

func (*GrantClient) Delete

func (c *GrantClient) Delete() *GrantDelete

Delete returns a delete builder for Grant.

func (*GrantClient) DeleteOne

func (c *GrantClient) DeleteOne(_m *Grant) *GrantDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*GrantClient) DeleteOneID

func (c *GrantClient) DeleteOneID(id int) *GrantDeleteOne

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

func (*GrantClient) Get

func (c *GrantClient) Get(ctx context.Context, id int) (*Grant, error)

Get returns a Grant entity by its id.

func (*GrantClient) GetX

func (c *GrantClient) GetX(ctx context.Context, id int) *Grant

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

func (*GrantClient) Hooks

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

Hooks returns the client hooks.

func (*GrantClient) Intercept

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

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

func (*GrantClient) Interceptors

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

Interceptors returns the client interceptors.

func (*GrantClient) MapCreateBulk

func (c *GrantClient) MapCreateBulk(slice any, setFunc func(*GrantCreate, int)) *GrantCreateBulk

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 (*GrantClient) Query

func (c *GrantClient) Query() *GrantQuery

Query returns a query builder for Grant.

func (*GrantClient) Update

func (c *GrantClient) Update() *GrantUpdate

Update returns an update builder for Grant.

func (*GrantClient) UpdateOne

func (c *GrantClient) UpdateOne(_m *Grant) *GrantUpdateOne

UpdateOne returns an update builder for the given entity.

func (*GrantClient) UpdateOneID

func (c *GrantClient) UpdateOneID(id int) *GrantUpdateOne

UpdateOneID returns an update builder for the given id.

func (*GrantClient) Use

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

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

type GrantCreate

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

GrantCreate is the builder for creating a Grant entity.

func (*GrantCreate) Exec

func (_c *GrantCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*GrantCreate) ExecX

func (_c *GrantCreate) ExecX(ctx context.Context)

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

func (*GrantCreate) Mutation

func (_c *GrantCreate) Mutation() *GrantMutation

Mutation returns the GrantMutation object of the builder.

func (*GrantCreate) Save

func (_c *GrantCreate) Save(ctx context.Context) (*Grant, error)

Save creates the Grant in the database.

func (*GrantCreate) SaveX

func (_c *GrantCreate) SaveX(ctx context.Context) *Grant

SaveX calls Save and panics if Save returns an error.

func (*GrantCreate) SetActions

func (_c *GrantCreate) SetActions(v []string) *GrantCreate

SetActions sets the "actions" field.

func (*GrantCreate) SetConnectionID

func (_c *GrantCreate) SetConnectionID(v string) *GrantCreate

SetConnectionID sets the "connection_id" field.

func (*GrantCreate) SetOwnerID

func (_c *GrantCreate) SetOwnerID(v string) *GrantCreate

SetOwnerID sets the "owner_id" field.

func (*GrantCreate) SetPrincipalID

func (_c *GrantCreate) SetPrincipalID(v string) *GrantCreate

SetPrincipalID sets the "principal_id" field.

func (*GrantCreate) SetPrincipalKind

func (_c *GrantCreate) SetPrincipalKind(v string) *GrantCreate

SetPrincipalKind sets the "principal_kind" field.

type GrantCreateBulk

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

GrantCreateBulk is the builder for creating many Grant entities in bulk.

func (*GrantCreateBulk) Exec

func (_c *GrantCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*GrantCreateBulk) ExecX

func (_c *GrantCreateBulk) ExecX(ctx context.Context)

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

func (*GrantCreateBulk) Save

func (_c *GrantCreateBulk) Save(ctx context.Context) ([]*Grant, error)

Save creates the Grant entities in the database.

func (*GrantCreateBulk) SaveX

func (_c *GrantCreateBulk) SaveX(ctx context.Context) []*Grant

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

type GrantDelete

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

GrantDelete is the builder for deleting a Grant entity.

func (*GrantDelete) Exec

func (_d *GrantDelete) Exec(ctx context.Context) (int, error)

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

func (*GrantDelete) ExecX

func (_d *GrantDelete) ExecX(ctx context.Context) int

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

func (*GrantDelete) Where

func (_d *GrantDelete) Where(ps ...predicate.Grant) *GrantDelete

Where appends a list predicates to the GrantDelete builder.

type GrantDeleteOne

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

GrantDeleteOne is the builder for deleting a single Grant entity.

func (*GrantDeleteOne) Exec

func (_d *GrantDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*GrantDeleteOne) ExecX

func (_d *GrantDeleteOne) ExecX(ctx context.Context)

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

func (*GrantDeleteOne) Where

func (_d *GrantDeleteOne) Where(ps ...predicate.Grant) *GrantDeleteOne

Where appends a list predicates to the GrantDelete builder.

type GrantGroupBy

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

GrantGroupBy is the group-by builder for Grant entities.

func (*GrantGroupBy) Aggregate

func (_g *GrantGroupBy) Aggregate(fns ...AggregateFunc) *GrantGroupBy

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

func (*GrantGroupBy) Bool

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

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

func (*GrantGroupBy) BoolX

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

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

func (*GrantGroupBy) Bools

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

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

func (*GrantGroupBy) BoolsX

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

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

func (*GrantGroupBy) Float64

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

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

func (*GrantGroupBy) Float64X

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

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

func (*GrantGroupBy) Float64s

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

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

func (*GrantGroupBy) Float64sX

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

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

func (*GrantGroupBy) Int

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

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

func (*GrantGroupBy) IntX

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

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

func (*GrantGroupBy) Ints

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

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

func (*GrantGroupBy) IntsX

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

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

func (*GrantGroupBy) Scan

func (_g *GrantGroupBy) Scan(ctx context.Context, v any) error

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

func (*GrantGroupBy) ScanX

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

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

func (*GrantGroupBy) String

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

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

func (*GrantGroupBy) StringX

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

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

func (*GrantGroupBy) Strings

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

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

func (*GrantGroupBy) StringsX

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

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

type GrantMutation

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

GrantMutation represents an operation that mutates the Grant nodes in the graph.

func (*GrantMutation) Actions

func (m *GrantMutation) Actions() (r []string, exists bool)

Actions returns the value of the "actions" field in the mutation.

func (*GrantMutation) AddField

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

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

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

func (*GrantMutation) AddedField

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

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

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

func (*GrantMutation) AddedIDs

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

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

func (*GrantMutation) AppendActions

func (m *GrantMutation) AppendActions(s []string)

AppendActions adds s to the "actions" field.

func (*GrantMutation) AppendedActions

func (m *GrantMutation) AppendedActions() ([]string, bool)

AppendedActions returns the list of values that were appended to the "actions" field in this mutation.

func (*GrantMutation) ClearEdge

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

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

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

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

func (*GrantMutation) ClearedFields

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

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

func (GrantMutation) Client

func (m GrantMutation) 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 (*GrantMutation) ConnectionID

func (m *GrantMutation) ConnectionID() (r string, exists bool)

ConnectionID returns the value of the "connection_id" field in the mutation.

func (*GrantMutation) EdgeCleared

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

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

func (*GrantMutation) Field

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

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

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

func (*GrantMutation) Fields

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

func (m *GrantMutation) ID() (id int, exists bool)

ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.

func (*GrantMutation) IDs

func (m *GrantMutation) IDs(ctx context.Context) ([]int, error)

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

func (*GrantMutation) OldActions

func (m *GrantMutation) OldActions(ctx context.Context) (v []string, err error)

OldActions returns the old "actions" field's value of the Grant entity. If the Grant 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 (*GrantMutation) OldConnectionID

func (m *GrantMutation) OldConnectionID(ctx context.Context) (v string, err error)

OldConnectionID returns the old "connection_id" field's value of the Grant entity. If the Grant 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 (*GrantMutation) OldField

func (m *GrantMutation) 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 (*GrantMutation) OldOwnerID

func (m *GrantMutation) OldOwnerID(ctx context.Context) (v string, err error)

OldOwnerID returns the old "owner_id" field's value of the Grant entity. If the Grant 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 (*GrantMutation) OldPrincipalID

func (m *GrantMutation) OldPrincipalID(ctx context.Context) (v string, err error)

OldPrincipalID returns the old "principal_id" field's value of the Grant entity. If the Grant 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 (*GrantMutation) OldPrincipalKind

func (m *GrantMutation) OldPrincipalKind(ctx context.Context) (v string, err error)

OldPrincipalKind returns the old "principal_kind" field's value of the Grant entity. If the Grant 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 (*GrantMutation) Op

func (m *GrantMutation) Op() Op

Op returns the operation name.

func (*GrantMutation) OwnerID

func (m *GrantMutation) OwnerID() (r string, exists bool)

OwnerID returns the value of the "owner_id" field in the mutation.

func (*GrantMutation) PrincipalID

func (m *GrantMutation) PrincipalID() (r string, exists bool)

PrincipalID returns the value of the "principal_id" field in the mutation.

func (*GrantMutation) PrincipalKind

func (m *GrantMutation) PrincipalKind() (r string, exists bool)

PrincipalKind returns the value of the "principal_kind" field in the mutation.

func (*GrantMutation) RemovedEdges

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

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

func (*GrantMutation) RemovedIDs

func (m *GrantMutation) 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 (*GrantMutation) ResetActions

func (m *GrantMutation) ResetActions()

ResetActions resets all changes to the "actions" field.

func (*GrantMutation) ResetConnectionID

func (m *GrantMutation) ResetConnectionID()

ResetConnectionID resets all changes to the "connection_id" field.

func (*GrantMutation) ResetEdge

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

func (m *GrantMutation) 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 (*GrantMutation) ResetOwnerID

func (m *GrantMutation) ResetOwnerID()

ResetOwnerID resets all changes to the "owner_id" field.

func (*GrantMutation) ResetPrincipalID

func (m *GrantMutation) ResetPrincipalID()

ResetPrincipalID resets all changes to the "principal_id" field.

func (*GrantMutation) ResetPrincipalKind

func (m *GrantMutation) ResetPrincipalKind()

ResetPrincipalKind resets all changes to the "principal_kind" field.

func (*GrantMutation) SetActions

func (m *GrantMutation) SetActions(s []string)

SetActions sets the "actions" field.

func (*GrantMutation) SetConnectionID

func (m *GrantMutation) SetConnectionID(s string)

SetConnectionID sets the "connection_id" field.

func (*GrantMutation) SetField

func (m *GrantMutation) 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 (*GrantMutation) SetOp

func (m *GrantMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*GrantMutation) SetOwnerID

func (m *GrantMutation) SetOwnerID(s string)

SetOwnerID sets the "owner_id" field.

func (*GrantMutation) SetPrincipalID

func (m *GrantMutation) SetPrincipalID(s string)

SetPrincipalID sets the "principal_id" field.

func (*GrantMutation) SetPrincipalKind

func (m *GrantMutation) SetPrincipalKind(s string)

SetPrincipalKind sets the "principal_kind" field.

func (GrantMutation) Tx

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

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

func (*GrantMutation) Type

func (m *GrantMutation) Type() string

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

func (*GrantMutation) Where

func (m *GrantMutation) Where(ps ...predicate.Grant)

Where appends a list predicates to the GrantMutation builder.

func (*GrantMutation) WhereP

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

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

type GrantQuery

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

GrantQuery is the builder for querying Grant entities.

func (*GrantQuery) Aggregate

func (_q *GrantQuery) Aggregate(fns ...AggregateFunc) *GrantSelect

Aggregate returns a GrantSelect configured with the given aggregations.

func (*GrantQuery) All

func (_q *GrantQuery) All(ctx context.Context) ([]*Grant, error)

All executes the query and returns a list of Grants.

func (*GrantQuery) AllX

func (_q *GrantQuery) AllX(ctx context.Context) []*Grant

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

func (*GrantQuery) Clone

func (_q *GrantQuery) Clone() *GrantQuery

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

func (*GrantQuery) Count

func (_q *GrantQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*GrantQuery) CountX

func (_q *GrantQuery) CountX(ctx context.Context) int

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

func (*GrantQuery) Exist

func (_q *GrantQuery) Exist(ctx context.Context) (bool, error)

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

func (*GrantQuery) ExistX

func (_q *GrantQuery) ExistX(ctx context.Context) bool

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

func (*GrantQuery) First

func (_q *GrantQuery) First(ctx context.Context) (*Grant, error)

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

func (*GrantQuery) FirstID

func (_q *GrantQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*GrantQuery) FirstIDX

func (_q *GrantQuery) FirstIDX(ctx context.Context) int

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

func (*GrantQuery) FirstX

func (_q *GrantQuery) FirstX(ctx context.Context) *Grant

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

func (*GrantQuery) GroupBy

func (_q *GrantQuery) GroupBy(field string, fields ...string) *GrantGroupBy

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

client.Grant.Query().
	GroupBy(grant.FieldOwnerID).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*GrantQuery) IDs

func (_q *GrantQuery) IDs(ctx context.Context) (ids []int, err error)

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

func (*GrantQuery) IDsX

func (_q *GrantQuery) IDsX(ctx context.Context) []int

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

func (*GrantQuery) Limit

func (_q *GrantQuery) Limit(limit int) *GrantQuery

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

func (*GrantQuery) Offset

func (_q *GrantQuery) Offset(offset int) *GrantQuery

Offset to start from.

func (*GrantQuery) Only

func (_q *GrantQuery) Only(ctx context.Context) (*Grant, error)

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

func (*GrantQuery) OnlyID

func (_q *GrantQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*GrantQuery) OnlyIDX

func (_q *GrantQuery) OnlyIDX(ctx context.Context) int

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

func (*GrantQuery) OnlyX

func (_q *GrantQuery) OnlyX(ctx context.Context) *Grant

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

func (*GrantQuery) Order

func (_q *GrantQuery) Order(o ...grant.OrderOption) *GrantQuery

Order specifies how the records should be ordered.

func (*GrantQuery) Select

func (_q *GrantQuery) Select(fields ...string) *GrantSelect

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

client.Grant.Query().
	Select(grant.FieldOwnerID).
	Scan(ctx, &v)

func (*GrantQuery) Unique

func (_q *GrantQuery) Unique(unique bool) *GrantQuery

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

func (_q *GrantQuery) Where(ps ...predicate.Grant) *GrantQuery

Where adds a new predicate for the GrantQuery builder.

type GrantSelect

type GrantSelect struct {
	*GrantQuery
	// contains filtered or unexported fields
}

GrantSelect is the builder for selecting fields of Grant entities.

func (*GrantSelect) Aggregate

func (_s *GrantSelect) Aggregate(fns ...AggregateFunc) *GrantSelect

Aggregate adds the given aggregation functions to the selector query.

func (*GrantSelect) Bool

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

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

func (*GrantSelect) BoolX

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

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

func (*GrantSelect) Bools

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

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

func (*GrantSelect) BoolsX

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

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

func (*GrantSelect) Float64

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

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

func (*GrantSelect) Float64X

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

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

func (*GrantSelect) Float64s

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

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

func (*GrantSelect) Float64sX

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

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

func (*GrantSelect) Int

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

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

func (*GrantSelect) IntX

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

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

func (*GrantSelect) Ints

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

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

func (*GrantSelect) IntsX

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

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

func (*GrantSelect) Scan

func (_s *GrantSelect) Scan(ctx context.Context, v any) error

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

func (*GrantSelect) ScanX

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

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

func (*GrantSelect) String

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

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

func (*GrantSelect) StringX

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

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

func (*GrantSelect) Strings

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

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

func (*GrantSelect) StringsX

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

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

type GrantUpdate

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

GrantUpdate is the builder for updating Grant entities.

func (*GrantUpdate) AppendActions

func (_u *GrantUpdate) AppendActions(v []string) *GrantUpdate

AppendActions appends value to the "actions" field.

func (*GrantUpdate) Exec

func (_u *GrantUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*GrantUpdate) ExecX

func (_u *GrantUpdate) ExecX(ctx context.Context)

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

func (*GrantUpdate) Mutation

func (_u *GrantUpdate) Mutation() *GrantMutation

Mutation returns the GrantMutation object of the builder.

func (*GrantUpdate) Save

func (_u *GrantUpdate) Save(ctx context.Context) (int, error)

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

func (*GrantUpdate) SaveX

func (_u *GrantUpdate) SaveX(ctx context.Context) int

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

func (*GrantUpdate) SetActions

func (_u *GrantUpdate) SetActions(v []string) *GrantUpdate

SetActions sets the "actions" field.

func (*GrantUpdate) Where

func (_u *GrantUpdate) Where(ps ...predicate.Grant) *GrantUpdate

Where appends a list predicates to the GrantUpdate builder.

type GrantUpdateOne

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

GrantUpdateOne is the builder for updating a single Grant entity.

func (*GrantUpdateOne) AppendActions

func (_u *GrantUpdateOne) AppendActions(v []string) *GrantUpdateOne

AppendActions appends value to the "actions" field.

func (*GrantUpdateOne) Exec

func (_u *GrantUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*GrantUpdateOne) ExecX

func (_u *GrantUpdateOne) ExecX(ctx context.Context)

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

func (*GrantUpdateOne) Mutation

func (_u *GrantUpdateOne) Mutation() *GrantMutation

Mutation returns the GrantMutation object of the builder.

func (*GrantUpdateOne) Save

func (_u *GrantUpdateOne) Save(ctx context.Context) (*Grant, error)

Save executes the query and returns the updated Grant entity.

func (*GrantUpdateOne) SaveX

func (_u *GrantUpdateOne) SaveX(ctx context.Context) *Grant

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

func (*GrantUpdateOne) Select

func (_u *GrantUpdateOne) Select(field string, fields ...string) *GrantUpdateOne

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

func (*GrantUpdateOne) SetActions

func (_u *GrantUpdateOne) SetActions(v []string) *GrantUpdateOne

SetActions sets the "actions" field.

func (*GrantUpdateOne) Where

func (_u *GrantUpdateOne) Where(ps ...predicate.Grant) *GrantUpdateOne

Where appends a list predicates to the GrantUpdate builder.

type Grants

type Grants []*Grant

Grants is a parsable slice of Grant.

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 Lease

type Lease struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// Name holds the value of the "name" field.
	Name string `json:"name,omitempty"`
	// Token holds the value of the "token" field.
	Token string `json:"token,omitempty"`
	// ExpiresAt holds the value of the "expires_at" field.
	ExpiresAt time.Time `json:"expires_at,omitempty"`
	// contains filtered or unexported fields
}

Lease is the model entity for the Lease schema.

func (*Lease) String

func (_m *Lease) String() string

String implements the fmt.Stringer.

func (*Lease) Unwrap

func (_m *Lease) Unwrap() *Lease

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

func (_m *Lease) Update() *LeaseUpdateOne

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

func (*Lease) Value

func (_m *Lease) Value(name string) (ent.Value, error)

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

type LeaseClient

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

LeaseClient is a client for the Lease schema.

func NewLeaseClient

func NewLeaseClient(c config) *LeaseClient

NewLeaseClient returns a client for the Lease from the given config.

func (*LeaseClient) Create

func (c *LeaseClient) Create() *LeaseCreate

Create returns a builder for creating a Lease entity.

func (*LeaseClient) CreateBulk

func (c *LeaseClient) CreateBulk(builders ...*LeaseCreate) *LeaseCreateBulk

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

func (*LeaseClient) Delete

func (c *LeaseClient) Delete() *LeaseDelete

Delete returns a delete builder for Lease.

func (*LeaseClient) DeleteOne

func (c *LeaseClient) DeleteOne(_m *Lease) *LeaseDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*LeaseClient) DeleteOneID

func (c *LeaseClient) DeleteOneID(id int) *LeaseDeleteOne

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

func (*LeaseClient) Get

func (c *LeaseClient) Get(ctx context.Context, id int) (*Lease, error)

Get returns a Lease entity by its id.

func (*LeaseClient) GetX

func (c *LeaseClient) GetX(ctx context.Context, id int) *Lease

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

func (*LeaseClient) Hooks

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

Hooks returns the client hooks.

func (*LeaseClient) Intercept

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

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

func (*LeaseClient) Interceptors

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

Interceptors returns the client interceptors.

func (*LeaseClient) MapCreateBulk

func (c *LeaseClient) MapCreateBulk(slice any, setFunc func(*LeaseCreate, int)) *LeaseCreateBulk

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 (*LeaseClient) Query

func (c *LeaseClient) Query() *LeaseQuery

Query returns a query builder for Lease.

func (*LeaseClient) Update

func (c *LeaseClient) Update() *LeaseUpdate

Update returns an update builder for Lease.

func (*LeaseClient) UpdateOne

func (c *LeaseClient) UpdateOne(_m *Lease) *LeaseUpdateOne

UpdateOne returns an update builder for the given entity.

func (*LeaseClient) UpdateOneID

func (c *LeaseClient) UpdateOneID(id int) *LeaseUpdateOne

UpdateOneID returns an update builder for the given id.

func (*LeaseClient) Use

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

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

type LeaseCreate

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

LeaseCreate is the builder for creating a Lease entity.

func (*LeaseCreate) Exec

func (_c *LeaseCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*LeaseCreate) ExecX

func (_c *LeaseCreate) ExecX(ctx context.Context)

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

func (*LeaseCreate) Mutation

func (_c *LeaseCreate) Mutation() *LeaseMutation

Mutation returns the LeaseMutation object of the builder.

func (*LeaseCreate) Save

func (_c *LeaseCreate) Save(ctx context.Context) (*Lease, error)

Save creates the Lease in the database.

func (*LeaseCreate) SaveX

func (_c *LeaseCreate) SaveX(ctx context.Context) *Lease

SaveX calls Save and panics if Save returns an error.

func (*LeaseCreate) SetExpiresAt

func (_c *LeaseCreate) SetExpiresAt(v time.Time) *LeaseCreate

SetExpiresAt sets the "expires_at" field.

func (*LeaseCreate) SetName

func (_c *LeaseCreate) SetName(v string) *LeaseCreate

SetName sets the "name" field.

func (*LeaseCreate) SetToken

func (_c *LeaseCreate) SetToken(v string) *LeaseCreate

SetToken sets the "token" field.

type LeaseCreateBulk

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

LeaseCreateBulk is the builder for creating many Lease entities in bulk.

func (*LeaseCreateBulk) Exec

func (_c *LeaseCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*LeaseCreateBulk) ExecX

func (_c *LeaseCreateBulk) ExecX(ctx context.Context)

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

func (*LeaseCreateBulk) Save

func (_c *LeaseCreateBulk) Save(ctx context.Context) ([]*Lease, error)

Save creates the Lease entities in the database.

func (*LeaseCreateBulk) SaveX

func (_c *LeaseCreateBulk) SaveX(ctx context.Context) []*Lease

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

type LeaseDelete

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

LeaseDelete is the builder for deleting a Lease entity.

func (*LeaseDelete) Exec

func (_d *LeaseDelete) Exec(ctx context.Context) (int, error)

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

func (*LeaseDelete) ExecX

func (_d *LeaseDelete) ExecX(ctx context.Context) int

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

func (*LeaseDelete) Where

func (_d *LeaseDelete) Where(ps ...predicate.Lease) *LeaseDelete

Where appends a list predicates to the LeaseDelete builder.

type LeaseDeleteOne

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

LeaseDeleteOne is the builder for deleting a single Lease entity.

func (*LeaseDeleteOne) Exec

func (_d *LeaseDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*LeaseDeleteOne) ExecX

func (_d *LeaseDeleteOne) ExecX(ctx context.Context)

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

func (*LeaseDeleteOne) Where

func (_d *LeaseDeleteOne) Where(ps ...predicate.Lease) *LeaseDeleteOne

Where appends a list predicates to the LeaseDelete builder.

type LeaseGroupBy

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

LeaseGroupBy is the group-by builder for Lease entities.

func (*LeaseGroupBy) Aggregate

func (_g *LeaseGroupBy) Aggregate(fns ...AggregateFunc) *LeaseGroupBy

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

func (*LeaseGroupBy) Bool

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

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

func (*LeaseGroupBy) BoolX

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

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

func (*LeaseGroupBy) Bools

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

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

func (*LeaseGroupBy) BoolsX

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

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

func (*LeaseGroupBy) Float64

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

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

func (*LeaseGroupBy) Float64X

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

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

func (*LeaseGroupBy) Float64s

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

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

func (*LeaseGroupBy) Float64sX

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

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

func (*LeaseGroupBy) Int

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

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

func (*LeaseGroupBy) IntX

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

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

func (*LeaseGroupBy) Ints

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

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

func (*LeaseGroupBy) IntsX

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

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

func (*LeaseGroupBy) Scan

func (_g *LeaseGroupBy) Scan(ctx context.Context, v any) error

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

func (*LeaseGroupBy) ScanX

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

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

func (*LeaseGroupBy) String

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

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

func (*LeaseGroupBy) StringX

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

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

func (*LeaseGroupBy) Strings

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

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

func (*LeaseGroupBy) StringsX

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

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

type LeaseMutation

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

LeaseMutation represents an operation that mutates the Lease nodes in the graph.

func (*LeaseMutation) AddField

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

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

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

func (*LeaseMutation) AddedField

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

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

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

func (*LeaseMutation) AddedIDs

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

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

func (*LeaseMutation) ClearEdge

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

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

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

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

func (*LeaseMutation) ClearedFields

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

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

func (LeaseMutation) Client

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

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

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

func (*LeaseMutation) ExpiresAt

func (m *LeaseMutation) ExpiresAt() (r time.Time, exists bool)

ExpiresAt returns the value of the "expires_at" field in the mutation.

func (*LeaseMutation) Field

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

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

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

func (*LeaseMutation) Fields

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

func (m *LeaseMutation) ID() (id int, exists bool)

ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.

func (*LeaseMutation) IDs

func (m *LeaseMutation) IDs(ctx context.Context) ([]int, error)

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

func (*LeaseMutation) Name

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

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

func (*LeaseMutation) OldExpiresAt

func (m *LeaseMutation) OldExpiresAt(ctx context.Context) (v time.Time, err error)

OldExpiresAt returns the old "expires_at" field's value of the Lease entity. If the Lease 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 (*LeaseMutation) OldField

func (m *LeaseMutation) 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 (*LeaseMutation) OldName

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

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

func (m *LeaseMutation) OldToken(ctx context.Context) (v string, err error)

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

func (m *LeaseMutation) Op() Op

Op returns the operation name.

func (*LeaseMutation) RemovedEdges

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

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

func (*LeaseMutation) RemovedIDs

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

func (m *LeaseMutation) 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 (*LeaseMutation) ResetExpiresAt

func (m *LeaseMutation) ResetExpiresAt()

ResetExpiresAt resets all changes to the "expires_at" field.

func (*LeaseMutation) ResetField

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

func (m *LeaseMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*LeaseMutation) ResetToken

func (m *LeaseMutation) ResetToken()

ResetToken resets all changes to the "token" field.

func (*LeaseMutation) SetExpiresAt

func (m *LeaseMutation) SetExpiresAt(t time.Time)

SetExpiresAt sets the "expires_at" field.

func (*LeaseMutation) SetField

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

func (m *LeaseMutation) SetName(s string)

SetName sets the "name" field.

func (*LeaseMutation) SetOp

func (m *LeaseMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*LeaseMutation) SetToken

func (m *LeaseMutation) SetToken(s string)

SetToken sets the "token" field.

func (*LeaseMutation) Token

func (m *LeaseMutation) Token() (r string, exists bool)

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

func (LeaseMutation) Tx

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

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

func (*LeaseMutation) Type

func (m *LeaseMutation) Type() string

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

func (*LeaseMutation) Where

func (m *LeaseMutation) Where(ps ...predicate.Lease)

Where appends a list predicates to the LeaseMutation builder.

func (*LeaseMutation) WhereP

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

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

type LeaseQuery

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

LeaseQuery is the builder for querying Lease entities.

func (*LeaseQuery) Aggregate

func (_q *LeaseQuery) Aggregate(fns ...AggregateFunc) *LeaseSelect

Aggregate returns a LeaseSelect configured with the given aggregations.

func (*LeaseQuery) All

func (_q *LeaseQuery) All(ctx context.Context) ([]*Lease, error)

All executes the query and returns a list of Leases.

func (*LeaseQuery) AllX

func (_q *LeaseQuery) AllX(ctx context.Context) []*Lease

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

func (*LeaseQuery) Clone

func (_q *LeaseQuery) Clone() *LeaseQuery

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

func (*LeaseQuery) Count

func (_q *LeaseQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*LeaseQuery) CountX

func (_q *LeaseQuery) CountX(ctx context.Context) int

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

func (*LeaseQuery) Exist

func (_q *LeaseQuery) Exist(ctx context.Context) (bool, error)

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

func (*LeaseQuery) ExistX

func (_q *LeaseQuery) ExistX(ctx context.Context) bool

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

func (*LeaseQuery) First

func (_q *LeaseQuery) First(ctx context.Context) (*Lease, error)

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

func (*LeaseQuery) FirstID

func (_q *LeaseQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*LeaseQuery) FirstIDX

func (_q *LeaseQuery) FirstIDX(ctx context.Context) int

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

func (*LeaseQuery) FirstX

func (_q *LeaseQuery) FirstX(ctx context.Context) *Lease

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

func (*LeaseQuery) GroupBy

func (_q *LeaseQuery) GroupBy(field string, fields ...string) *LeaseGroupBy

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

Example:

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

client.Lease.Query().
	GroupBy(lease.FieldName).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*LeaseQuery) IDs

func (_q *LeaseQuery) IDs(ctx context.Context) (ids []int, err error)

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

func (*LeaseQuery) IDsX

func (_q *LeaseQuery) IDsX(ctx context.Context) []int

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

func (*LeaseQuery) Limit

func (_q *LeaseQuery) Limit(limit int) *LeaseQuery

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

func (*LeaseQuery) Offset

func (_q *LeaseQuery) Offset(offset int) *LeaseQuery

Offset to start from.

func (*LeaseQuery) Only

func (_q *LeaseQuery) Only(ctx context.Context) (*Lease, error)

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

func (*LeaseQuery) OnlyID

func (_q *LeaseQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*LeaseQuery) OnlyIDX

func (_q *LeaseQuery) OnlyIDX(ctx context.Context) int

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

func (*LeaseQuery) OnlyX

func (_q *LeaseQuery) OnlyX(ctx context.Context) *Lease

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

func (*LeaseQuery) Order

func (_q *LeaseQuery) Order(o ...lease.OrderOption) *LeaseQuery

Order specifies how the records should be ordered.

func (*LeaseQuery) Select

func (_q *LeaseQuery) Select(fields ...string) *LeaseSelect

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

Example:

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

client.Lease.Query().
	Select(lease.FieldName).
	Scan(ctx, &v)

func (*LeaseQuery) Unique

func (_q *LeaseQuery) Unique(unique bool) *LeaseQuery

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

func (_q *LeaseQuery) Where(ps ...predicate.Lease) *LeaseQuery

Where adds a new predicate for the LeaseQuery builder.

type LeaseSelect

type LeaseSelect struct {
	*LeaseQuery
	// contains filtered or unexported fields
}

LeaseSelect is the builder for selecting fields of Lease entities.

func (*LeaseSelect) Aggregate

func (_s *LeaseSelect) Aggregate(fns ...AggregateFunc) *LeaseSelect

Aggregate adds the given aggregation functions to the selector query.

func (*LeaseSelect) Bool

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

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

func (*LeaseSelect) BoolX

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

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

func (*LeaseSelect) Bools

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

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

func (*LeaseSelect) BoolsX

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

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

func (*LeaseSelect) Float64

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

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

func (*LeaseSelect) Float64X

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

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

func (*LeaseSelect) Float64s

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

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

func (*LeaseSelect) Float64sX

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

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

func (*LeaseSelect) Int

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

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

func (*LeaseSelect) IntX

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

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

func (*LeaseSelect) Ints

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

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

func (*LeaseSelect) IntsX

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

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

func (*LeaseSelect) Scan

func (_s *LeaseSelect) Scan(ctx context.Context, v any) error

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

func (*LeaseSelect) ScanX

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

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

func (*LeaseSelect) String

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

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

func (*LeaseSelect) StringX

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

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

func (*LeaseSelect) Strings

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

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

func (*LeaseSelect) StringsX

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

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

type LeaseUpdate

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

LeaseUpdate is the builder for updating Lease entities.

func (*LeaseUpdate) Exec

func (_u *LeaseUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*LeaseUpdate) ExecX

func (_u *LeaseUpdate) ExecX(ctx context.Context)

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

func (*LeaseUpdate) Mutation

func (_u *LeaseUpdate) Mutation() *LeaseMutation

Mutation returns the LeaseMutation object of the builder.

func (*LeaseUpdate) Save

func (_u *LeaseUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*LeaseUpdate) SaveX

func (_u *LeaseUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*LeaseUpdate) SetExpiresAt

func (_u *LeaseUpdate) SetExpiresAt(v time.Time) *LeaseUpdate

SetExpiresAt sets the "expires_at" field.

func (*LeaseUpdate) SetNillableExpiresAt

func (_u *LeaseUpdate) SetNillableExpiresAt(v *time.Time) *LeaseUpdate

SetNillableExpiresAt sets the "expires_at" field if the given value is not nil.

func (*LeaseUpdate) SetNillableToken

func (_u *LeaseUpdate) SetNillableToken(v *string) *LeaseUpdate

SetNillableToken sets the "token" field if the given value is not nil.

func (*LeaseUpdate) SetToken

func (_u *LeaseUpdate) SetToken(v string) *LeaseUpdate

SetToken sets the "token" field.

func (*LeaseUpdate) Where

func (_u *LeaseUpdate) Where(ps ...predicate.Lease) *LeaseUpdate

Where appends a list predicates to the LeaseUpdate builder.

type LeaseUpdateOne

type LeaseUpdateOne struct {
	// contains filtered or unexported fields
}

LeaseUpdateOne is the builder for updating a single Lease entity.

func (*LeaseUpdateOne) Exec

func (_u *LeaseUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*LeaseUpdateOne) ExecX

func (_u *LeaseUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*LeaseUpdateOne) Mutation

func (_u *LeaseUpdateOne) Mutation() *LeaseMutation

Mutation returns the LeaseMutation object of the builder.

func (*LeaseUpdateOne) Save

func (_u *LeaseUpdateOne) Save(ctx context.Context) (*Lease, error)

Save executes the query and returns the updated Lease entity.

func (*LeaseUpdateOne) SaveX

func (_u *LeaseUpdateOne) SaveX(ctx context.Context) *Lease

SaveX is like Save, but panics if an error occurs.

func (*LeaseUpdateOne) Select

func (_u *LeaseUpdateOne) Select(field string, fields ...string) *LeaseUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*LeaseUpdateOne) SetExpiresAt

func (_u *LeaseUpdateOne) SetExpiresAt(v time.Time) *LeaseUpdateOne

SetExpiresAt sets the "expires_at" field.

func (*LeaseUpdateOne) SetNillableExpiresAt

func (_u *LeaseUpdateOne) SetNillableExpiresAt(v *time.Time) *LeaseUpdateOne

SetNillableExpiresAt sets the "expires_at" field if the given value is not nil.

func (*LeaseUpdateOne) SetNillableToken

func (_u *LeaseUpdateOne) SetNillableToken(v *string) *LeaseUpdateOne

SetNillableToken sets the "token" field if the given value is not nil.

func (*LeaseUpdateOne) SetToken

func (_u *LeaseUpdateOne) SetToken(v string) *LeaseUpdateOne

SetToken sets the "token" field.

func (*LeaseUpdateOne) Where

func (_u *LeaseUpdateOne) Where(ps ...predicate.Lease) *LeaseUpdateOne

Where appends a list predicates to the LeaseUpdate builder.

type Leases

type Leases []*Lease

Leases is a parsable slice of Lease.

type MutateFunc

type MutateFunc = ent.MutateFunc

ent aliases to avoid import conflicts in user's code.

type Mutation

type Mutation = ent.Mutation

ent aliases to avoid import conflicts in user's code.

type Mutator

type Mutator = ent.Mutator

ent aliases to avoid import conflicts in user's code.

type NotFoundError

type NotFoundError struct {
	// contains filtered or unexported fields
}

NotFoundError returns when trying to fetch a specific entity and it was not found in the database.

func (*NotFoundError) Error

func (e *NotFoundError) Error() string

Error implements the error interface.

type NotLoadedError

type NotLoadedError struct {
	// contains filtered or unexported fields
}

NotLoadedError returns when trying to get a node that was not loaded by the query.

func (*NotLoadedError) Error

func (e *NotLoadedError) Error() string

Error implements the error interface.

type NotSingularError

type NotSingularError struct {
	// contains filtered or unexported fields
}

NotSingularError returns when trying to fetch a singular entity and more then one was found in the database.

func (*NotSingularError) Error

func (e *NotSingularError) Error() string

Error implements the error interface.

type Op

type Op = ent.Op

ent aliases to avoid import conflicts in user's code.

type Option

type Option func(*config)

Option function to configure the client.

func Debug

func Debug() Option

Debug enables debug logging on the ent.Driver.

func Driver

func Driver(driver dialect.Driver) Option

Driver configures the client driver.

func Log

func Log(fn func(...any)) Option

Log sets the logging function for debug mode.

type OrderFunc

type OrderFunc func(*sql.Selector)

OrderFunc applies an ordering on the sql selector. Deprecated: Use Asc/Desc functions or the package builders instead.

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 {

	// Binding is the client for interacting with the Binding builders.
	Binding *BindingClient
	// Connection is the client for interacting with the Connection builders.
	Connection *ConnectionClient
	// Credential is the client for interacting with the Credential builders.
	Credential *CredentialClient
	// Grant is the client for interacting with the Grant builders.
	Grant *GrantClient
	// Lease is the client for interacting with the Lease builders.
	Lease *LeaseClient
	// contains filtered or unexported fields
}

Tx is a transactional client that is created by calling Client.Tx().

func TxFromContext

func TxFromContext(ctx context.Context) *Tx

TxFromContext returns a Tx stored inside a context, or nil if there isn't one.

func (*Tx) Client

func (tx *Tx) Client() *Client

Client returns a Client that binds to current transaction.

func (*Tx) Commit

func (tx *Tx) Commit() error

Commit commits the transaction.

func (*Tx) OnCommit

func (tx *Tx) OnCommit(f CommitHook)

OnCommit adds a hook to call on commit.

func (*Tx) OnRollback

func (tx *Tx) OnRollback(f RollbackHook)

OnRollback adds a hook to call on rollback.

func (*Tx) Rollback

func (tx *Tx) Rollback() error

Rollback rollbacks the transaction.

type 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
Package schema is the Ent schema of connectionforge's SQL store.
Package schema is the Ent schema of connectionforge's SQL store.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL