ent

package
v0.0.0-...-c68951b Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2021 License: MIT Imports: 24 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.
	TypeCrackedPassword = "CrackedPassword"
	TypeTask            = "Task"
	TypeUser            = "User"
)

Variables

This section is empty.

Functions

func IsConstraintError

func IsConstraintError(err error) bool

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

func IsNotFound

func IsNotFound(err error) bool

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

func IsNotLoaded

func IsNotLoaded(err error) bool

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

func IsNotSingular

func IsNotSingular(err error) bool

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

func IsValidationError

func IsValidationError(err error) bool

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

func MaskNotFound

func MaskNotFound(err error) error

MaskNotFound masks not found error.

func NewContext

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

NewContext returns a new context with the given Client attached.

func NewTxContext

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

NewTxContext returns a new context with the given Tx attached.

Types

type AggregateFunc

type AggregateFunc func(*sql.Selector) string

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

func As

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

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

func Count

func Count() AggregateFunc

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

func Max

func Max(field string) AggregateFunc

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

func Mean

func Mean(field string) AggregateFunc

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

func Min

func Min(field string) AggregateFunc

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

func Sum

func Sum(field string) AggregateFunc

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

type Client

type Client struct {

	// Schema is the client for creating, migrating and dropping schema.
	Schema *migrate.Schema
	// CrackedPassword is the client for interacting with the CrackedPassword builders.
	CrackedPassword *CrackedPasswordClient
	// Task is the client for interacting with the Task builders.
	Task *TaskClient
	// User is the client for interacting with the User builders.
	User *UserClient
	// contains filtered or unexported fields
}

Client is the client that holds all ent builders.

func FromContext

func FromContext(ctx context.Context) *Client

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

func NewClient

func NewClient(opts ...Option) *Client

NewClient creates a new client configured with the given options.

func Open

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

Open opens a database/sql.DB specified by the driver name and the data source name, and returns a new client attached to it. Optional parameters can be added for configuring the client.

func (*Client) BeginTx

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

BeginTx returns a transactional client with specified options.

func (*Client) Close

func (c *Client) Close() error

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

func (*Client) Debug

func (c *Client) Debug() *Client

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

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

func (*Client) Tx

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

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

func (*Client) Use

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

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

type CommitFunc

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

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

func (CommitFunc) Commit

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

Commit calls f(ctx, m).

type CommitHook

type CommitHook func(Committer) Committer

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

hook := func(next ent.Committer) ent.Committer {
	return ent.CommitFunc(func(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 Committer method.

type ConstraintError

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

ConstraintError returns when trying to create/update one or more entities and one or more of their constraints failed. For example, violation of edge or field uniqueness.

func (ConstraintError) Error

func (e ConstraintError) Error() string

Error implements the error interface.

func (*ConstraintError) Unwrap

func (e *ConstraintError) Unwrap() error

Unwrap implements the errors.Wrapper interface.

type CrackedPassword

type CrackedPassword struct {

	// ID of the ent.
	ID uuid.UUID `json:"id,omitempty"`
	// Hash holds the value of the "hash" field.
	Hash string `json:"hash,omitempty"`
	// Value holds the value of the "value" field.
	Value string `json:"value,omitempty"`
	// CrackedAt holds the value of the "cracked_at" field.
	CrackedAt time.Time `json:"cracked_at,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the CrackedPasswordQuery when eager-loading is set.
	Edges CrackedPasswordEdges `json:"edges"`
	// contains filtered or unexported fields
}

CrackedPassword is the model entity for the CrackedPassword schema.

func (*CrackedPassword) QueryRelatedTask

func (cp *CrackedPassword) QueryRelatedTask() *TaskQuery

QueryRelatedTask queries the "related_task" edge of the CrackedPassword entity.

func (*CrackedPassword) String

func (cp *CrackedPassword) String() string

String implements the fmt.Stringer.

func (*CrackedPassword) Unwrap

func (cp *CrackedPassword) Unwrap() *CrackedPassword

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

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

type CrackedPasswordClient

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

CrackedPasswordClient is a client for the CrackedPassword schema.

func NewCrackedPasswordClient

func NewCrackedPasswordClient(c config) *CrackedPasswordClient

NewCrackedPasswordClient returns a client for the CrackedPassword from the given config.

func (*CrackedPasswordClient) Create

Create returns a create builder for CrackedPassword.

func (*CrackedPasswordClient) CreateBulk

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

func (*CrackedPasswordClient) Delete

Delete returns a delete builder for CrackedPassword.

func (*CrackedPasswordClient) DeleteOne

DeleteOne returns a delete builder for the given entity.

func (*CrackedPasswordClient) DeleteOneID

DeleteOneID returns a delete builder for the given id.

func (*CrackedPasswordClient) Get

Get returns a CrackedPassword entity by its id.

func (*CrackedPasswordClient) GetX

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

func (*CrackedPasswordClient) Hooks

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

Hooks returns the client hooks.

func (*CrackedPasswordClient) Query

Query returns a query builder for CrackedPassword.

func (*CrackedPasswordClient) QueryRelatedTask

func (c *CrackedPasswordClient) QueryRelatedTask(cp *CrackedPassword) *TaskQuery

QueryRelatedTask queries the related_task edge of a CrackedPassword.

func (*CrackedPasswordClient) Update

Update returns an update builder for CrackedPassword.

func (*CrackedPasswordClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*CrackedPasswordClient) UpdateOneID

UpdateOneID returns an update builder for the given id.

func (*CrackedPasswordClient) Use

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

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

type CrackedPasswordCreate

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

CrackedPasswordCreate is the builder for creating a CrackedPassword entity.

func (*CrackedPasswordCreate) Exec

func (cpc *CrackedPasswordCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*CrackedPasswordCreate) ExecX

func (cpc *CrackedPasswordCreate) ExecX(ctx context.Context)

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

func (*CrackedPasswordCreate) Mutation

Mutation returns the CrackedPasswordMutation object of the builder.

func (*CrackedPasswordCreate) OnConflict

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.CrackedPassword.Create().
	SetHash(v).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.CrackedPasswordUpsert) {
		SetHash(v+v).
	}).
	Exec(ctx)

func (*CrackedPasswordCreate) OnConflictColumns

func (cpc *CrackedPasswordCreate) OnConflictColumns(columns ...string) *CrackedPasswordUpsertOne

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.CrackedPassword.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*CrackedPasswordCreate) Save

Save creates the CrackedPassword in the database.

func (*CrackedPasswordCreate) SaveX

SaveX calls Save and panics if Save returns an error.

func (*CrackedPasswordCreate) SetCrackedAt

func (cpc *CrackedPasswordCreate) SetCrackedAt(t time.Time) *CrackedPasswordCreate

SetCrackedAt sets the "cracked_at" field.

func (*CrackedPasswordCreate) SetHash

SetHash sets the "hash" field.

func (*CrackedPasswordCreate) SetID

SetID sets the "id" field.

func (*CrackedPasswordCreate) SetNillableCrackedAt

func (cpc *CrackedPasswordCreate) SetNillableCrackedAt(t *time.Time) *CrackedPasswordCreate

SetNillableCrackedAt sets the "cracked_at" field if the given value is not nil.

func (*CrackedPasswordCreate) SetRelatedTask

func (cpc *CrackedPasswordCreate) SetRelatedTask(t *Task) *CrackedPasswordCreate

SetRelatedTask sets the "related_task" edge to the Task entity.

func (*CrackedPasswordCreate) SetRelatedTaskID

func (cpc *CrackedPasswordCreate) SetRelatedTaskID(id uuid.UUID) *CrackedPasswordCreate

SetRelatedTaskID sets the "related_task" edge to the Task entity by ID.

func (*CrackedPasswordCreate) SetValue

SetValue sets the "value" field.

type CrackedPasswordCreateBulk

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

CrackedPasswordCreateBulk is the builder for creating many CrackedPassword entities in bulk.

func (*CrackedPasswordCreateBulk) Exec

Exec executes the query.

func (*CrackedPasswordCreateBulk) ExecX

func (cpcb *CrackedPasswordCreateBulk) ExecX(ctx context.Context)

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

func (*CrackedPasswordCreateBulk) OnConflict

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.CrackedPassword.CreateBulk(builders...).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.CrackedPasswordUpsert) {
		SetHash(v+v).
	}).
	Exec(ctx)

func (*CrackedPasswordCreateBulk) OnConflictColumns

func (cpcb *CrackedPasswordCreateBulk) OnConflictColumns(columns ...string) *CrackedPasswordUpsertBulk

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.CrackedPassword.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*CrackedPasswordCreateBulk) Save

Save creates the CrackedPassword entities in the database.

func (*CrackedPasswordCreateBulk) SaveX

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

type CrackedPasswordDelete

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

CrackedPasswordDelete is the builder for deleting a CrackedPassword entity.

func (*CrackedPasswordDelete) Exec

func (cpd *CrackedPasswordDelete) Exec(ctx context.Context) (int, error)

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

func (*CrackedPasswordDelete) ExecX

func (cpd *CrackedPasswordDelete) ExecX(ctx context.Context) int

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

func (*CrackedPasswordDelete) Where

Where appends a list predicates to the CrackedPasswordDelete builder.

type CrackedPasswordDeleteOne

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

CrackedPasswordDeleteOne is the builder for deleting a single CrackedPassword entity.

func (*CrackedPasswordDeleteOne) Exec

Exec executes the deletion query.

func (*CrackedPasswordDeleteOne) ExecX

func (cpdo *CrackedPasswordDeleteOne) ExecX(ctx context.Context)

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

type CrackedPasswordEdges

type CrackedPasswordEdges struct {
	// RelatedTask holds the value of the related_task edge.
	RelatedTask *Task `json:"related_task,omitempty"`
	// contains filtered or unexported fields
}

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

func (CrackedPasswordEdges) RelatedTaskOrErr

func (e CrackedPasswordEdges) RelatedTaskOrErr() (*Task, error)

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

type CrackedPasswordFilter

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

CrackedPasswordFilter provides a generic filtering capability at runtime for CrackedPasswordQuery.

func (*CrackedPasswordFilter) Where

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

Where applies the entql predicate on the query filter.

func (*CrackedPasswordFilter) WhereCrackedAt

func (f *CrackedPasswordFilter) WhereCrackedAt(p entql.TimeP)

WhereCrackedAt applies the entql time.Time predicate on the cracked_at field.

func (*CrackedPasswordFilter) WhereHasRelatedTask

func (f *CrackedPasswordFilter) WhereHasRelatedTask()

WhereHasRelatedTask applies a predicate to check if query has an edge related_task.

func (*CrackedPasswordFilter) WhereHasRelatedTaskWith

func (f *CrackedPasswordFilter) WhereHasRelatedTaskWith(preds ...predicate.Task)

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

func (*CrackedPasswordFilter) WhereHash

func (f *CrackedPasswordFilter) WhereHash(p entql.StringP)

WhereHash applies the entql string predicate on the hash field.

func (*CrackedPasswordFilter) WhereID

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

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

func (*CrackedPasswordFilter) WhereValue

func (f *CrackedPasswordFilter) WhereValue(p entql.StringP)

WhereValue applies the entql string predicate on the value field.

type CrackedPasswordGroupBy

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

CrackedPasswordGroupBy is the group-by builder for CrackedPassword entities.

func (*CrackedPasswordGroupBy) Aggregate

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

func (*CrackedPasswordGroupBy) Bool

func (cpgb *CrackedPasswordGroupBy) Bool(ctx context.Context) (_ bool, err error)

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

func (*CrackedPasswordGroupBy) BoolX

func (cpgb *CrackedPasswordGroupBy) BoolX(ctx context.Context) bool

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

func (*CrackedPasswordGroupBy) Bools

func (cpgb *CrackedPasswordGroupBy) Bools(ctx context.Context) ([]bool, error)

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

func (*CrackedPasswordGroupBy) BoolsX

func (cpgb *CrackedPasswordGroupBy) BoolsX(ctx context.Context) []bool

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

func (*CrackedPasswordGroupBy) Float64

func (cpgb *CrackedPasswordGroupBy) Float64(ctx context.Context) (_ float64, err error)

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

func (*CrackedPasswordGroupBy) Float64X

func (cpgb *CrackedPasswordGroupBy) Float64X(ctx context.Context) float64

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

func (*CrackedPasswordGroupBy) Float64s

func (cpgb *CrackedPasswordGroupBy) Float64s(ctx context.Context) ([]float64, error)

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

func (*CrackedPasswordGroupBy) Float64sX

func (cpgb *CrackedPasswordGroupBy) Float64sX(ctx context.Context) []float64

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

func (*CrackedPasswordGroupBy) Int

func (cpgb *CrackedPasswordGroupBy) Int(ctx context.Context) (_ int, err error)

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

func (*CrackedPasswordGroupBy) IntX

func (cpgb *CrackedPasswordGroupBy) IntX(ctx context.Context) int

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

func (*CrackedPasswordGroupBy) Ints

func (cpgb *CrackedPasswordGroupBy) Ints(ctx context.Context) ([]int, error)

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

func (*CrackedPasswordGroupBy) IntsX

func (cpgb *CrackedPasswordGroupBy) IntsX(ctx context.Context) []int

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

func (*CrackedPasswordGroupBy) Scan

func (cpgb *CrackedPasswordGroupBy) Scan(ctx context.Context, v interface{}) error

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

func (*CrackedPasswordGroupBy) ScanX

func (cpgb *CrackedPasswordGroupBy) ScanX(ctx context.Context, v interface{})

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

func (*CrackedPasswordGroupBy) String

func (cpgb *CrackedPasswordGroupBy) String(ctx context.Context) (_ string, err error)

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

func (*CrackedPasswordGroupBy) StringX

func (cpgb *CrackedPasswordGroupBy) StringX(ctx context.Context) string

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

func (*CrackedPasswordGroupBy) Strings

func (cpgb *CrackedPasswordGroupBy) Strings(ctx context.Context) ([]string, error)

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

func (*CrackedPasswordGroupBy) StringsX

func (cpgb *CrackedPasswordGroupBy) StringsX(ctx context.Context) []string

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

type CrackedPasswordMutation

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

CrackedPasswordMutation represents an operation that mutates the CrackedPassword nodes in the graph.

func (*CrackedPasswordMutation) AddField

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

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

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

func (*CrackedPasswordMutation) AddedField

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

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

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

func (*CrackedPasswordMutation) AddedIDs

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

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

func (*CrackedPasswordMutation) ClearEdge

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

func (m *CrackedPasswordMutation) 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 (*CrackedPasswordMutation) ClearRelatedTask

func (m *CrackedPasswordMutation) ClearRelatedTask()

ClearRelatedTask clears the "related_task" edge to the Task entity.

func (*CrackedPasswordMutation) ClearedEdges

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

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

func (*CrackedPasswordMutation) ClearedFields

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

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

func (CrackedPasswordMutation) Client

func (m CrackedPasswordMutation) 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 (*CrackedPasswordMutation) CrackedAt

func (m *CrackedPasswordMutation) CrackedAt() (r time.Time, exists bool)

CrackedAt returns the value of the "cracked_at" field in the mutation.

func (*CrackedPasswordMutation) EdgeCleared

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

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

func (*CrackedPasswordMutation) Field

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

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

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

func (*CrackedPasswordMutation) Fields

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

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

func (*CrackedPasswordMutation) Hash

func (m *CrackedPasswordMutation) Hash() (r string, exists bool)

Hash returns the value of the "hash" field in the mutation.

func (*CrackedPasswordMutation) ID

func (m *CrackedPasswordMutation) ID() (id uuid.UUID, exists bool)

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

func (*CrackedPasswordMutation) IDs

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

func (*CrackedPasswordMutation) OldCrackedAt

func (m *CrackedPasswordMutation) OldCrackedAt(ctx context.Context) (v time.Time, err error)

OldCrackedAt returns the old "cracked_at" field's value of the CrackedPassword entity. If the CrackedPassword 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 (*CrackedPasswordMutation) OldField

func (m *CrackedPasswordMutation) 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 (*CrackedPasswordMutation) OldHash

func (m *CrackedPasswordMutation) OldHash(ctx context.Context) (v string, err error)

OldHash returns the old "hash" field's value of the CrackedPassword entity. If the CrackedPassword 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 (*CrackedPasswordMutation) OldValue

func (m *CrackedPasswordMutation) OldValue(ctx context.Context) (v string, err error)

OldValue returns the old "value" field's value of the CrackedPassword entity. If the CrackedPassword 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 (*CrackedPasswordMutation) Op

func (m *CrackedPasswordMutation) Op() Op

Op returns the operation name.

func (*CrackedPasswordMutation) RelatedTaskCleared

func (m *CrackedPasswordMutation) RelatedTaskCleared() bool

RelatedTaskCleared reports if the "related_task" edge to the Task entity was cleared.

func (*CrackedPasswordMutation) RelatedTaskID

func (m *CrackedPasswordMutation) RelatedTaskID() (id uuid.UUID, exists bool)

RelatedTaskID returns the "related_task" edge ID in the mutation.

func (*CrackedPasswordMutation) RelatedTaskIDs

func (m *CrackedPasswordMutation) RelatedTaskIDs() (ids []uuid.UUID)

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

func (*CrackedPasswordMutation) RemovedEdges

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

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

func (*CrackedPasswordMutation) RemovedIDs

func (m *CrackedPasswordMutation) 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 (*CrackedPasswordMutation) ResetCrackedAt

func (m *CrackedPasswordMutation) ResetCrackedAt()

ResetCrackedAt resets all changes to the "cracked_at" field.

func (*CrackedPasswordMutation) ResetEdge

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

func (m *CrackedPasswordMutation) 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 (*CrackedPasswordMutation) ResetHash

func (m *CrackedPasswordMutation) ResetHash()

ResetHash resets all changes to the "hash" field.

func (*CrackedPasswordMutation) ResetRelatedTask

func (m *CrackedPasswordMutation) ResetRelatedTask()

ResetRelatedTask resets all changes to the "related_task" edge.

func (*CrackedPasswordMutation) ResetValue

func (m *CrackedPasswordMutation) ResetValue()

ResetValue resets all changes to the "value" field.

func (*CrackedPasswordMutation) SetCrackedAt

func (m *CrackedPasswordMutation) SetCrackedAt(t time.Time)

SetCrackedAt sets the "cracked_at" field.

func (*CrackedPasswordMutation) SetField

func (m *CrackedPasswordMutation) 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 (*CrackedPasswordMutation) SetHash

func (m *CrackedPasswordMutation) SetHash(s string)

SetHash sets the "hash" field.

func (*CrackedPasswordMutation) SetID

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

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

func (*CrackedPasswordMutation) SetRelatedTaskID

func (m *CrackedPasswordMutation) SetRelatedTaskID(id uuid.UUID)

SetRelatedTaskID sets the "related_task" edge to the Task entity by id.

func (*CrackedPasswordMutation) SetValue

func (m *CrackedPasswordMutation) SetValue(s string)

SetValue sets the "value" field.

func (CrackedPasswordMutation) Tx

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

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

func (*CrackedPasswordMutation) Type

func (m *CrackedPasswordMutation) Type() string

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

func (*CrackedPasswordMutation) Value

func (m *CrackedPasswordMutation) Value() (r string, exists bool)

Value returns the value of the "value" field in the mutation.

func (*CrackedPasswordMutation) Where

Where appends a list predicates to the CrackedPasswordMutation builder.

type CrackedPasswordQuery

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

CrackedPasswordQuery is the builder for querying CrackedPassword entities.

func (*CrackedPasswordQuery) All

All executes the query and returns a list of CrackedPasswords.

func (*CrackedPasswordQuery) AllX

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

func (*CrackedPasswordQuery) Clone

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

func (*CrackedPasswordQuery) Count

func (cpq *CrackedPasswordQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*CrackedPasswordQuery) CountX

func (cpq *CrackedPasswordQuery) CountX(ctx context.Context) int

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

func (*CrackedPasswordQuery) Exist

func (cpq *CrackedPasswordQuery) Exist(ctx context.Context) (bool, error)

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

func (*CrackedPasswordQuery) ExistX

func (cpq *CrackedPasswordQuery) ExistX(ctx context.Context) bool

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

func (*CrackedPasswordQuery) Filter

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

func (*CrackedPasswordQuery) First

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

func (*CrackedPasswordQuery) FirstID

func (cpq *CrackedPasswordQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

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

func (*CrackedPasswordQuery) FirstIDX

func (cpq *CrackedPasswordQuery) FirstIDX(ctx context.Context) uuid.UUID

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

func (*CrackedPasswordQuery) FirstX

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

func (*CrackedPasswordQuery) GroupBy

func (cpq *CrackedPasswordQuery) GroupBy(field string, fields ...string) *CrackedPasswordGroupBy

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

client.CrackedPassword.Query().
	GroupBy(crackedpassword.FieldHash).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*CrackedPasswordQuery) IDs

func (cpq *CrackedPasswordQuery) IDs(ctx context.Context) ([]uuid.UUID, error)

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

func (*CrackedPasswordQuery) IDsX

func (cpq *CrackedPasswordQuery) IDsX(ctx context.Context) []uuid.UUID

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

func (*CrackedPasswordQuery) Limit

func (cpq *CrackedPasswordQuery) Limit(limit int) *CrackedPasswordQuery

Limit adds a limit step to the query.

func (*CrackedPasswordQuery) Modify

func (cpq *CrackedPasswordQuery) Modify(modifiers ...func(s *sql.Selector)) *CrackedPasswordSelect

Modify adds a query modifier for attaching custom logic to queries.

func (*CrackedPasswordQuery) Offset

func (cpq *CrackedPasswordQuery) Offset(offset int) *CrackedPasswordQuery

Offset adds an offset step to the query.

func (*CrackedPasswordQuery) Only

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

func (*CrackedPasswordQuery) OnlyID

func (cpq *CrackedPasswordQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

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

func (*CrackedPasswordQuery) OnlyIDX

func (cpq *CrackedPasswordQuery) OnlyIDX(ctx context.Context) uuid.UUID

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

func (*CrackedPasswordQuery) OnlyX

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

func (*CrackedPasswordQuery) Order

Order adds an order step to the query.

func (*CrackedPasswordQuery) QueryRelatedTask

func (cpq *CrackedPasswordQuery) QueryRelatedTask() *TaskQuery

QueryRelatedTask chains the current query on the "related_task" edge.

func (*CrackedPasswordQuery) Select

func (cpq *CrackedPasswordQuery) Select(fields ...string) *CrackedPasswordSelect

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

client.CrackedPassword.Query().
	Select(crackedpassword.FieldHash).
	Scan(ctx, &v)

func (*CrackedPasswordQuery) Unique

func (cpq *CrackedPasswordQuery) Unique(unique bool) *CrackedPasswordQuery

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

Where adds a new predicate for the CrackedPasswordQuery builder.

func (*CrackedPasswordQuery) WithRelatedTask

func (cpq *CrackedPasswordQuery) WithRelatedTask(opts ...func(*TaskQuery)) *CrackedPasswordQuery

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

type CrackedPasswordSelect

type CrackedPasswordSelect struct {
	*CrackedPasswordQuery
	// contains filtered or unexported fields
}

CrackedPasswordSelect is the builder for selecting fields of CrackedPassword entities.

func (*CrackedPasswordSelect) Bool

func (cps *CrackedPasswordSelect) Bool(ctx context.Context) (_ bool, err error)

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

func (*CrackedPasswordSelect) BoolX

func (cps *CrackedPasswordSelect) BoolX(ctx context.Context) bool

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

func (*CrackedPasswordSelect) Bools

func (cps *CrackedPasswordSelect) Bools(ctx context.Context) ([]bool, error)

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

func (*CrackedPasswordSelect) BoolsX

func (cps *CrackedPasswordSelect) BoolsX(ctx context.Context) []bool

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

func (*CrackedPasswordSelect) Float64

func (cps *CrackedPasswordSelect) Float64(ctx context.Context) (_ float64, err error)

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

func (*CrackedPasswordSelect) Float64X

func (cps *CrackedPasswordSelect) Float64X(ctx context.Context) float64

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

func (*CrackedPasswordSelect) Float64s

func (cps *CrackedPasswordSelect) Float64s(ctx context.Context) ([]float64, error)

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

func (*CrackedPasswordSelect) Float64sX

func (cps *CrackedPasswordSelect) Float64sX(ctx context.Context) []float64

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

func (*CrackedPasswordSelect) Int

func (cps *CrackedPasswordSelect) Int(ctx context.Context) (_ int, err error)

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

func (*CrackedPasswordSelect) IntX

func (cps *CrackedPasswordSelect) IntX(ctx context.Context) int

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

func (*CrackedPasswordSelect) Ints

func (cps *CrackedPasswordSelect) Ints(ctx context.Context) ([]int, error)

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

func (*CrackedPasswordSelect) IntsX

func (cps *CrackedPasswordSelect) IntsX(ctx context.Context) []int

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

func (*CrackedPasswordSelect) Modify

func (cps *CrackedPasswordSelect) Modify(modifiers ...func(s *sql.Selector)) *CrackedPasswordSelect

Modify adds a query modifier for attaching custom logic to queries.

func (*CrackedPasswordSelect) Scan

func (cps *CrackedPasswordSelect) Scan(ctx context.Context, v interface{}) error

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

func (*CrackedPasswordSelect) ScanX

func (cps *CrackedPasswordSelect) ScanX(ctx context.Context, v interface{})

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

func (*CrackedPasswordSelect) String

func (cps *CrackedPasswordSelect) String(ctx context.Context) (_ string, err error)

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

func (*CrackedPasswordSelect) StringX

func (cps *CrackedPasswordSelect) StringX(ctx context.Context) string

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

func (*CrackedPasswordSelect) Strings

func (cps *CrackedPasswordSelect) Strings(ctx context.Context) ([]string, error)

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

func (*CrackedPasswordSelect) StringsX

func (cps *CrackedPasswordSelect) StringsX(ctx context.Context) []string

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

type CrackedPasswordUpdate

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

CrackedPasswordUpdate is the builder for updating CrackedPassword entities.

func (*CrackedPasswordUpdate) ClearRelatedTask

func (cpu *CrackedPasswordUpdate) ClearRelatedTask() *CrackedPasswordUpdate

ClearRelatedTask clears the "related_task" edge to the Task entity.

func (*CrackedPasswordUpdate) Exec

func (cpu *CrackedPasswordUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*CrackedPasswordUpdate) ExecX

func (cpu *CrackedPasswordUpdate) ExecX(ctx context.Context)

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

func (*CrackedPasswordUpdate) Mutation

Mutation returns the CrackedPasswordMutation object of the builder.

func (*CrackedPasswordUpdate) Save

func (cpu *CrackedPasswordUpdate) Save(ctx context.Context) (int, error)

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

func (*CrackedPasswordUpdate) SaveX

func (cpu *CrackedPasswordUpdate) SaveX(ctx context.Context) int

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

func (*CrackedPasswordUpdate) SetHash

SetHash sets the "hash" field.

func (*CrackedPasswordUpdate) SetRelatedTask

func (cpu *CrackedPasswordUpdate) SetRelatedTask(t *Task) *CrackedPasswordUpdate

SetRelatedTask sets the "related_task" edge to the Task entity.

func (*CrackedPasswordUpdate) SetRelatedTaskID

func (cpu *CrackedPasswordUpdate) SetRelatedTaskID(id uuid.UUID) *CrackedPasswordUpdate

SetRelatedTaskID sets the "related_task" edge to the Task entity by ID.

func (*CrackedPasswordUpdate) SetValue

SetValue sets the "value" field.

func (*CrackedPasswordUpdate) Where

Where appends a list predicates to the CrackedPasswordUpdate builder.

type CrackedPasswordUpdateOne

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

CrackedPasswordUpdateOne is the builder for updating a single CrackedPassword entity.

func (*CrackedPasswordUpdateOne) ClearRelatedTask

func (cpuo *CrackedPasswordUpdateOne) ClearRelatedTask() *CrackedPasswordUpdateOne

ClearRelatedTask clears the "related_task" edge to the Task entity.

func (*CrackedPasswordUpdateOne) Exec

Exec executes the query on the entity.

func (*CrackedPasswordUpdateOne) ExecX

func (cpuo *CrackedPasswordUpdateOne) ExecX(ctx context.Context)

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

func (*CrackedPasswordUpdateOne) Mutation

Mutation returns the CrackedPasswordMutation object of the builder.

func (*CrackedPasswordUpdateOne) Save

Save executes the query and returns the updated CrackedPassword entity.

func (*CrackedPasswordUpdateOne) SaveX

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

func (*CrackedPasswordUpdateOne) Select

func (cpuo *CrackedPasswordUpdateOne) Select(field string, fields ...string) *CrackedPasswordUpdateOne

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

func (*CrackedPasswordUpdateOne) SetHash

SetHash sets the "hash" field.

func (*CrackedPasswordUpdateOne) SetRelatedTask

func (cpuo *CrackedPasswordUpdateOne) SetRelatedTask(t *Task) *CrackedPasswordUpdateOne

SetRelatedTask sets the "related_task" edge to the Task entity.

func (*CrackedPasswordUpdateOne) SetRelatedTaskID

func (cpuo *CrackedPasswordUpdateOne) SetRelatedTaskID(id uuid.UUID) *CrackedPasswordUpdateOne

SetRelatedTaskID sets the "related_task" edge to the Task entity by ID.

func (*CrackedPasswordUpdateOne) SetValue

SetValue sets the "value" field.

type CrackedPasswordUpsert

type CrackedPasswordUpsert struct {
	*sql.UpdateSet
}

CrackedPasswordUpsert is the "OnConflict" setter.

func (*CrackedPasswordUpsert) SetCrackedAt

SetCrackedAt sets the "cracked_at" field.

func (*CrackedPasswordUpsert) SetHash

SetHash sets the "hash" field.

func (*CrackedPasswordUpsert) SetValue

SetValue sets the "value" field.

func (*CrackedPasswordUpsert) UpdateCrackedAt

func (u *CrackedPasswordUpsert) UpdateCrackedAt() *CrackedPasswordUpsert

UpdateCrackedAt sets the "cracked_at" field to the value that was provided on create.

func (*CrackedPasswordUpsert) UpdateHash

UpdateHash sets the "hash" field to the value that was provided on create.

func (*CrackedPasswordUpsert) UpdateValue

func (u *CrackedPasswordUpsert) UpdateValue() *CrackedPasswordUpsert

UpdateValue sets the "value" field to the value that was provided on create.

type CrackedPasswordUpsertBulk

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

CrackedPasswordUpsertBulk is the builder for "upsert"-ing a bulk of CrackedPassword nodes.

func (*CrackedPasswordUpsertBulk) DoNothing

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*CrackedPasswordUpsertBulk) Exec

Exec executes the query.

func (*CrackedPasswordUpsertBulk) ExecX

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

func (*CrackedPasswordUpsertBulk) Ignore

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.CrackedPassword.Create().
	OnConflict(sql.ResolveWithIgnore()).
	Exec(ctx)

func (*CrackedPasswordUpsertBulk) SetCrackedAt

SetCrackedAt sets the "cracked_at" field.

func (*CrackedPasswordUpsertBulk) SetHash

SetHash sets the "hash" field.

func (*CrackedPasswordUpsertBulk) SetValue

SetValue sets the "value" field.

func (*CrackedPasswordUpsertBulk) Update

Update allows overriding fields `UPDATE` values. See the CrackedPasswordCreateBulk.OnConflict documentation for more info.

func (*CrackedPasswordUpsertBulk) UpdateCrackedAt

UpdateCrackedAt sets the "cracked_at" field to the value that was provided on create.

func (*CrackedPasswordUpsertBulk) UpdateHash

UpdateHash sets the "hash" field to the value that was provided on create.

func (*CrackedPasswordUpsertBulk) UpdateNewValues

UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:

client.CrackedPassword.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
		sql.ResolveWith(func(u *sql.UpdateSet) {
			u.SetIgnore(crackedpassword.FieldID)
		}),
	).
	Exec(ctx)

func (*CrackedPasswordUpsertBulk) UpdateValue

UpdateValue sets the "value" field to the value that was provided on create.

type CrackedPasswordUpsertOne

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

CrackedPasswordUpsertOne is the builder for "upsert"-ing

one CrackedPassword node.

func (*CrackedPasswordUpsertOne) DoNothing

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*CrackedPasswordUpsertOne) Exec

Exec executes the query.

func (*CrackedPasswordUpsertOne) ExecX

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

func (*CrackedPasswordUpsertOne) ID

func (u *CrackedPasswordUpsertOne) ID(ctx context.Context) (id uuid.UUID, err error)

Exec executes the UPSERT query and returns the inserted/updated ID.

func (*CrackedPasswordUpsertOne) IDX

IDX is like ID, but panics if an error occurs.

func (*CrackedPasswordUpsertOne) Ignore

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.CrackedPassword.Create().
    OnConflict(sql.ResolveWithIgnore()).
    Exec(ctx)

func (*CrackedPasswordUpsertOne) SetCrackedAt

SetCrackedAt sets the "cracked_at" field.

func (*CrackedPasswordUpsertOne) SetHash

SetHash sets the "hash" field.

func (*CrackedPasswordUpsertOne) SetValue

SetValue sets the "value" field.

func (*CrackedPasswordUpsertOne) Update

Update allows overriding fields `UPDATE` values. See the CrackedPasswordCreate.OnConflict documentation for more info.

func (*CrackedPasswordUpsertOne) UpdateCrackedAt

func (u *CrackedPasswordUpsertOne) UpdateCrackedAt() *CrackedPasswordUpsertOne

UpdateCrackedAt sets the "cracked_at" field to the value that was provided on create.

func (*CrackedPasswordUpsertOne) UpdateHash

UpdateHash sets the "hash" field to the value that was provided on create.

func (*CrackedPasswordUpsertOne) UpdateNewValues

func (u *CrackedPasswordUpsertOne) UpdateNewValues() *CrackedPasswordUpsertOne

UpdateNewValues updates the mutable fields using the new values that were set on create except the ID field. Using this option is equivalent to using:

client.CrackedPassword.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
		sql.ResolveWith(func(u *sql.UpdateSet) {
			u.SetIgnore(crackedpassword.FieldID)
		}),
	).
	Exec(ctx)

func (*CrackedPasswordUpsertOne) UpdateValue

UpdateValue sets the "value" field to the value that was provided on create.

type CrackedPasswords

type CrackedPasswords []*CrackedPassword

CrackedPasswords is a parsable slice of CrackedPassword.

type Hook

type Hook = ent.Hook

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

type MutateFunc

type MutateFunc = ent.MutateFunc

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

type Mutation

type Mutation = ent.Mutation

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

type Mutator

type Mutator = ent.Mutator

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

type NotFoundError

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

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

func (*NotFoundError) Error

func (e *NotFoundError) Error() string

Error implements the error interface.

type NotLoadedError

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

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

func (*NotLoadedError) Error

func (e *NotLoadedError) Error() string

Error implements the error interface.

type NotSingularError

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

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

func (*NotSingularError) Error

func (e *NotSingularError) Error() string

Error implements the error interface.

type Op

type Op = ent.Op

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

type Option

type Option func(*config)

Option function to configure the client.

func Debug

func Debug() Option

Debug enables debug logging on the ent.Driver.

func Driver

func Driver(driver dialect.Driver) Option

Driver configures the client driver.

func Log

func Log(fn func(...interface{})) Option

Log sets the logging function for debug mode.

type OrderFunc

type OrderFunc func(*sql.Selector)

OrderFunc applies an ordering on the sql selector.

func Asc

func Asc(fields ...string) OrderFunc

Asc applies the given fields in ASC order.

func Desc

func Desc(fields ...string) OrderFunc

Desc applies the given fields in DESC order.

type Policy

type Policy = ent.Policy

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

type Query

type Query = ent.Query

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

type RollbackFunc

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

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

func (RollbackFunc) Rollback

func (f RollbackFunc) Rollback(ctx context.Context, tx *Tx) error

Rollback calls f(ctx, m).

type RollbackHook

type RollbackHook func(Rollbacker) Rollbacker

RollbackHook defines the "rollback middleware". A function that gets a Rollbacker and returns a Rollbacker. For example:

hook := func(next ent.Rollbacker) ent.Rollbacker {
	return ent.RollbackFunc(func(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 Rollbacker method.

type Task

type Task struct {

	// ID of the ent.
	ID uuid.UUID `json:"id,omitempty"`
	// Name holds the value of the "name" field.
	Name string `json:"name,omitempty"`
	// Status holds the value of the "status" field.
	Status oldschema.TaskStatus `json:"status,omitempty"`
	// EnginePayload holds the value of the "engine_payload" field.
	EnginePayload map[string]interface{} `json:"engine_payload,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// LastUpdatedAt holds the value of the "last_updated_at" field.
	LastUpdatedAt time.Time `json:"last_updated_at,omitempty"`
	// AssignedToHost holds the value of the "assigned_to_host" field.
	AssignedToHost string `json:"assigned_to_host,omitempty"`
	// Comment holds the value of the "comment" field.
	Comment string `json:"comment,omitempty"`
	// CaseCode holds the value of the "case_code" field.
	CaseCode string `json:"case_code,omitempty"`
	// NumberCracked holds the value of the "number_cracked" field.
	NumberCracked int `json:"number_cracked,omitempty"`
	// NumberPasswords holds the value of the "number_passwords" field.
	NumberPasswords int `json:"number_passwords,omitempty"`
	// Error holds the value of the "error" field.
	Error string `json:"error,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the TaskQuery when eager-loading is set.
	Edges TaskEdges `json:"edges"`
	// contains filtered or unexported fields
}

Task is the model entity for the Task schema.

func (*Task) QueryCrackedPasswords

func (t *Task) QueryCrackedPasswords() *CrackedPasswordQuery

QueryCrackedPasswords queries the "cracked_passwords" edge of the Task entity.

func (*Task) QueryCreatedBy

func (t *Task) QueryCreatedBy() *UserQuery

QueryCreatedBy queries the "created_by" edge of the Task entity.

func (*Task) String

func (t *Task) String() string

String implements the fmt.Stringer.

func (*Task) Unwrap

func (t *Task) Unwrap() *Task

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

func (t *Task) Update() *TaskUpdateOne

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

type TaskClient

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

TaskClient is a client for the Task schema.

func NewTaskClient

func NewTaskClient(c config) *TaskClient

NewTaskClient returns a client for the Task from the given config.

func (*TaskClient) Create

func (c *TaskClient) Create() *TaskCreate

Create returns a create builder for Task.

func (*TaskClient) CreateBulk

func (c *TaskClient) CreateBulk(builders ...*TaskCreate) *TaskCreateBulk

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

func (*TaskClient) Delete

func (c *TaskClient) Delete() *TaskDelete

Delete returns a delete builder for Task.

func (*TaskClient) DeleteOne

func (c *TaskClient) DeleteOne(t *Task) *TaskDeleteOne

DeleteOne returns a delete builder for the given entity.

func (*TaskClient) DeleteOneID

func (c *TaskClient) DeleteOneID(id uuid.UUID) *TaskDeleteOne

DeleteOneID returns a delete builder for the given id.

func (*TaskClient) Get

func (c *TaskClient) Get(ctx context.Context, id uuid.UUID) (*Task, error)

Get returns a Task entity by its id.

func (*TaskClient) GetX

func (c *TaskClient) GetX(ctx context.Context, id uuid.UUID) *Task

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

func (*TaskClient) Hooks

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

Hooks returns the client hooks.

func (*TaskClient) Query

func (c *TaskClient) Query() *TaskQuery

Query returns a query builder for Task.

func (*TaskClient) QueryCrackedPasswords

func (c *TaskClient) QueryCrackedPasswords(t *Task) *CrackedPasswordQuery

QueryCrackedPasswords queries the cracked_passwords edge of a Task.

func (*TaskClient) QueryCreatedBy

func (c *TaskClient) QueryCreatedBy(t *Task) *UserQuery

QueryCreatedBy queries the created_by edge of a Task.

func (*TaskClient) Update

func (c *TaskClient) Update() *TaskUpdate

Update returns an update builder for Task.

func (*TaskClient) UpdateOne

func (c *TaskClient) UpdateOne(t *Task) *TaskUpdateOne

UpdateOne returns an update builder for the given entity.

func (*TaskClient) UpdateOneID

func (c *TaskClient) UpdateOneID(id uuid.UUID) *TaskUpdateOne

UpdateOneID returns an update builder for the given id.

func (*TaskClient) Use

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

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

type TaskCreate

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

TaskCreate is the builder for creating a Task entity.

func (*TaskCreate) AddCrackedPasswordIDs

func (tc *TaskCreate) AddCrackedPasswordIDs(ids ...uuid.UUID) *TaskCreate

AddCrackedPasswordIDs adds the "cracked_passwords" edge to the CrackedPassword entity by IDs.

func (*TaskCreate) AddCrackedPasswords

func (tc *TaskCreate) AddCrackedPasswords(c ...*CrackedPassword) *TaskCreate

AddCrackedPasswords adds the "cracked_passwords" edges to the CrackedPassword entity.

func (*TaskCreate) Exec

func (tc *TaskCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*TaskCreate) ExecX

func (tc *TaskCreate) ExecX(ctx context.Context)

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

func (*TaskCreate) Mutation

func (tc *TaskCreate) Mutation() *TaskMutation

Mutation returns the TaskMutation object of the builder.

func (*TaskCreate) OnConflict

func (tc *TaskCreate) OnConflict(opts ...sql.ConflictOption) *TaskUpsertOne

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.Task.Create().
	SetName(v).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.TaskUpsert) {
		SetName(v+v).
	}).
	Exec(ctx)

func (*TaskCreate) OnConflictColumns

func (tc *TaskCreate) OnConflictColumns(columns ...string) *TaskUpsertOne

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.Task.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*TaskCreate) Save

func (tc *TaskCreate) Save(ctx context.Context) (*Task, error)

Save creates the Task in the database.

func (*TaskCreate) SaveX

func (tc *TaskCreate) SaveX(ctx context.Context) *Task

SaveX calls Save and panics if Save returns an error.

func (*TaskCreate) SetAssignedToHost

func (tc *TaskCreate) SetAssignedToHost(s string) *TaskCreate

SetAssignedToHost sets the "assigned_to_host" field.

func (*TaskCreate) SetCaseCode

func (tc *TaskCreate) SetCaseCode(s string) *TaskCreate

SetCaseCode sets the "case_code" field.

func (*TaskCreate) SetComment

func (tc *TaskCreate) SetComment(s string) *TaskCreate

SetComment sets the "comment" field.

func (*TaskCreate) SetCreatedAt

func (tc *TaskCreate) SetCreatedAt(t time.Time) *TaskCreate

SetCreatedAt sets the "created_at" field.

func (*TaskCreate) SetCreatedBy

func (tc *TaskCreate) SetCreatedBy(u *User) *TaskCreate

SetCreatedBy sets the "created_by" edge to the User entity.

func (*TaskCreate) SetCreatedByID

func (tc *TaskCreate) SetCreatedByID(id uuid.UUID) *TaskCreate

SetCreatedByID sets the "created_by" edge to the User entity by ID.

func (*TaskCreate) SetEnginePayload

func (tc *TaskCreate) SetEnginePayload(m map[string]interface{}) *TaskCreate

SetEnginePayload sets the "engine_payload" field.

func (*TaskCreate) SetError

func (tc *TaskCreate) SetError(s string) *TaskCreate

SetError sets the "error" field.

func (*TaskCreate) SetID

func (tc *TaskCreate) SetID(u uuid.UUID) *TaskCreate

SetID sets the "id" field.

func (*TaskCreate) SetLastUpdatedAt

func (tc *TaskCreate) SetLastUpdatedAt(t time.Time) *TaskCreate

SetLastUpdatedAt sets the "last_updated_at" field.

func (*TaskCreate) SetName

func (tc *TaskCreate) SetName(s string) *TaskCreate

SetName sets the "name" field.

func (*TaskCreate) SetNillableAssignedToHost

func (tc *TaskCreate) SetNillableAssignedToHost(s *string) *TaskCreate

SetNillableAssignedToHost sets the "assigned_to_host" field if the given value is not nil.

func (*TaskCreate) SetNillableCaseCode

func (tc *TaskCreate) SetNillableCaseCode(s *string) *TaskCreate

SetNillableCaseCode sets the "case_code" field if the given value is not nil.

func (*TaskCreate) SetNillableComment

func (tc *TaskCreate) SetNillableComment(s *string) *TaskCreate

SetNillableComment sets the "comment" field if the given value is not nil.

func (*TaskCreate) SetNillableCreatedAt

func (tc *TaskCreate) SetNillableCreatedAt(t *time.Time) *TaskCreate

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

func (*TaskCreate) SetNillableError

func (tc *TaskCreate) SetNillableError(s *string) *TaskCreate

SetNillableError sets the "error" field if the given value is not nil.

func (*TaskCreate) SetNillableLastUpdatedAt

func (tc *TaskCreate) SetNillableLastUpdatedAt(t *time.Time) *TaskCreate

SetNillableLastUpdatedAt sets the "last_updated_at" field if the given value is not nil.

func (*TaskCreate) SetNillableNumberCracked

func (tc *TaskCreate) SetNillableNumberCracked(i *int) *TaskCreate

SetNillableNumberCracked sets the "number_cracked" field if the given value is not nil.

func (*TaskCreate) SetNillableNumberPasswords

func (tc *TaskCreate) SetNillableNumberPasswords(i *int) *TaskCreate

SetNillableNumberPasswords sets the "number_passwords" field if the given value is not nil.

func (*TaskCreate) SetNumberCracked

func (tc *TaskCreate) SetNumberCracked(i int) *TaskCreate

SetNumberCracked sets the "number_cracked" field.

func (*TaskCreate) SetNumberPasswords

func (tc *TaskCreate) SetNumberPasswords(i int) *TaskCreate

SetNumberPasswords sets the "number_passwords" field.

func (*TaskCreate) SetStatus

func (tc *TaskCreate) SetStatus(os oldschema.TaskStatus) *TaskCreate

SetStatus sets the "status" field.

type TaskCreateBulk

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

TaskCreateBulk is the builder for creating many Task entities in bulk.

func (*TaskCreateBulk) Exec

func (tcb *TaskCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*TaskCreateBulk) ExecX

func (tcb *TaskCreateBulk) ExecX(ctx context.Context)

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

func (*TaskCreateBulk) OnConflict

func (tcb *TaskCreateBulk) OnConflict(opts ...sql.ConflictOption) *TaskUpsertBulk

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.Task.CreateBulk(builders...).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.TaskUpsert) {
		SetName(v+v).
	}).
	Exec(ctx)

func (*TaskCreateBulk) OnConflictColumns

func (tcb *TaskCreateBulk) OnConflictColumns(columns ...string) *TaskUpsertBulk

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.Task.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*TaskCreateBulk) Save

func (tcb *TaskCreateBulk) Save(ctx context.Context) ([]*Task, error)

Save creates the Task entities in the database.

func (*TaskCreateBulk) SaveX

func (tcb *TaskCreateBulk) SaveX(ctx context.Context) []*Task

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

type TaskDelete

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

TaskDelete is the builder for deleting a Task entity.

func (*TaskDelete) Exec

func (td *TaskDelete) Exec(ctx context.Context) (int, error)

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

func (*TaskDelete) ExecX

func (td *TaskDelete) ExecX(ctx context.Context) int

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

func (*TaskDelete) Where

func (td *TaskDelete) Where(ps ...predicate.Task) *TaskDelete

Where appends a list predicates to the TaskDelete builder.

type TaskDeleteOne

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

TaskDeleteOne is the builder for deleting a single Task entity.

func (*TaskDeleteOne) Exec

func (tdo *TaskDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*TaskDeleteOne) ExecX

func (tdo *TaskDeleteOne) ExecX(ctx context.Context)

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

type TaskEdges

type TaskEdges struct {
	// CreatedBy holds the value of the created_by edge.
	CreatedBy *User `json:"created_by,omitempty"`
	// CrackedPasswords holds the value of the cracked_passwords edge.
	CrackedPasswords []*CrackedPassword `json:"cracked_passwords,omitempty"`
	// contains filtered or unexported fields
}

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

func (TaskEdges) CrackedPasswordsOrErr

func (e TaskEdges) CrackedPasswordsOrErr() ([]*CrackedPassword, error)

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

func (TaskEdges) CreatedByOrErr

func (e TaskEdges) CreatedByOrErr() (*User, error)

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

type TaskFilter

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

TaskFilter provides a generic filtering capability at runtime for TaskQuery.

func (*TaskFilter) Where

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

Where applies the entql predicate on the query filter.

func (*TaskFilter) WhereAssignedToHost

func (f *TaskFilter) WhereAssignedToHost(p entql.StringP)

WhereAssignedToHost applies the entql string predicate on the assigned_to_host field.

func (*TaskFilter) WhereCaseCode

func (f *TaskFilter) WhereCaseCode(p entql.StringP)

WhereCaseCode applies the entql string predicate on the case_code field.

func (*TaskFilter) WhereComment

func (f *TaskFilter) WhereComment(p entql.StringP)

WhereComment applies the entql string predicate on the comment field.

func (*TaskFilter) WhereCreatedAt

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

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

func (*TaskFilter) WhereEnginePayload

func (f *TaskFilter) WhereEnginePayload(p entql.BytesP)

WhereEnginePayload applies the entql json.RawMessage predicate on the engine_payload field.

func (*TaskFilter) WhereError

func (f *TaskFilter) WhereError(p entql.StringP)

WhereError applies the entql string predicate on the error field.

func (*TaskFilter) WhereHasCrackedPasswords

func (f *TaskFilter) WhereHasCrackedPasswords()

WhereHasCrackedPasswords applies a predicate to check if query has an edge cracked_passwords.

func (*TaskFilter) WhereHasCrackedPasswordsWith

func (f *TaskFilter) WhereHasCrackedPasswordsWith(preds ...predicate.CrackedPassword)

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

func (*TaskFilter) WhereHasCreatedBy

func (f *TaskFilter) WhereHasCreatedBy()

WhereHasCreatedBy applies a predicate to check if query has an edge created_by.

func (*TaskFilter) WhereHasCreatedByWith

func (f *TaskFilter) WhereHasCreatedByWith(preds ...predicate.User)

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

func (*TaskFilter) WhereID

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

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

func (*TaskFilter) WhereLastUpdatedAt

func (f *TaskFilter) WhereLastUpdatedAt(p entql.TimeP)

WhereLastUpdatedAt applies the entql time.Time predicate on the last_updated_at field.

func (*TaskFilter) WhereName

func (f *TaskFilter) WhereName(p entql.StringP)

WhereName applies the entql string predicate on the name field.

func (*TaskFilter) WhereNumberCracked

func (f *TaskFilter) WhereNumberCracked(p entql.IntP)

WhereNumberCracked applies the entql int predicate on the number_cracked field.

func (*TaskFilter) WhereNumberPasswords

func (f *TaskFilter) WhereNumberPasswords(p entql.IntP)

WhereNumberPasswords applies the entql int predicate on the number_passwords field.

func (*TaskFilter) WhereStatus

func (f *TaskFilter) WhereStatus(p entql.StringP)

WhereStatus applies the entql string predicate on the status field.

type TaskGroupBy

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

TaskGroupBy is the group-by builder for Task entities.

func (*TaskGroupBy) Aggregate

func (tgb *TaskGroupBy) Aggregate(fns ...AggregateFunc) *TaskGroupBy

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

func (*TaskGroupBy) Bool

func (tgb *TaskGroupBy) Bool(ctx context.Context) (_ bool, err error)

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

func (*TaskGroupBy) BoolX

func (tgb *TaskGroupBy) BoolX(ctx context.Context) bool

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

func (*TaskGroupBy) Bools

func (tgb *TaskGroupBy) Bools(ctx context.Context) ([]bool, error)

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

func (*TaskGroupBy) BoolsX

func (tgb *TaskGroupBy) BoolsX(ctx context.Context) []bool

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

func (*TaskGroupBy) Float64

func (tgb *TaskGroupBy) Float64(ctx context.Context) (_ float64, err error)

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

func (*TaskGroupBy) Float64X

func (tgb *TaskGroupBy) Float64X(ctx context.Context) float64

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

func (*TaskGroupBy) Float64s

func (tgb *TaskGroupBy) Float64s(ctx context.Context) ([]float64, error)

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

func (*TaskGroupBy) Float64sX

func (tgb *TaskGroupBy) Float64sX(ctx context.Context) []float64

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

func (*TaskGroupBy) Int

func (tgb *TaskGroupBy) Int(ctx context.Context) (_ int, err error)

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

func (*TaskGroupBy) IntX

func (tgb *TaskGroupBy) IntX(ctx context.Context) int

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

func (*TaskGroupBy) Ints

func (tgb *TaskGroupBy) Ints(ctx context.Context) ([]int, error)

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

func (*TaskGroupBy) IntsX

func (tgb *TaskGroupBy) IntsX(ctx context.Context) []int

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

func (*TaskGroupBy) Scan

func (tgb *TaskGroupBy) Scan(ctx context.Context, v interface{}) error

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

func (*TaskGroupBy) ScanX

func (tgb *TaskGroupBy) ScanX(ctx context.Context, v interface{})

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

func (*TaskGroupBy) String

func (tgb *TaskGroupBy) String(ctx context.Context) (_ string, err error)

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

func (*TaskGroupBy) StringX

func (tgb *TaskGroupBy) StringX(ctx context.Context) string

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

func (*TaskGroupBy) Strings

func (tgb *TaskGroupBy) Strings(ctx context.Context) ([]string, error)

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

func (*TaskGroupBy) StringsX

func (tgb *TaskGroupBy) StringsX(ctx context.Context) []string

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

type TaskMutation

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

TaskMutation represents an operation that mutates the Task nodes in the graph.

func (*TaskMutation) AddCrackedPasswordIDs

func (m *TaskMutation) AddCrackedPasswordIDs(ids ...uuid.UUID)

AddCrackedPasswordIDs adds the "cracked_passwords" edge to the CrackedPassword entity by ids.

func (*TaskMutation) AddField

func (m *TaskMutation) 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 (*TaskMutation) AddNumberCracked

func (m *TaskMutation) AddNumberCracked(i int)

AddNumberCracked adds i to the "number_cracked" field.

func (*TaskMutation) AddNumberPasswords

func (m *TaskMutation) AddNumberPasswords(i int)

AddNumberPasswords adds i to the "number_passwords" field.

func (*TaskMutation) AddedEdges

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

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

func (*TaskMutation) AddedField

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

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

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

func (*TaskMutation) AddedIDs

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

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

func (*TaskMutation) AddedNumberCracked

func (m *TaskMutation) AddedNumberCracked() (r int, exists bool)

AddedNumberCracked returns the value that was added to the "number_cracked" field in this mutation.

func (*TaskMutation) AddedNumberPasswords

func (m *TaskMutation) AddedNumberPasswords() (r int, exists bool)

AddedNumberPasswords returns the value that was added to the "number_passwords" field in this mutation.

func (*TaskMutation) AssignedToHost

func (m *TaskMutation) AssignedToHost() (r string, exists bool)

AssignedToHost returns the value of the "assigned_to_host" field in the mutation.

func (*TaskMutation) AssignedToHostCleared

func (m *TaskMutation) AssignedToHostCleared() bool

AssignedToHostCleared returns if the "assigned_to_host" field was cleared in this mutation.

func (*TaskMutation) CaseCode

func (m *TaskMutation) CaseCode() (r string, exists bool)

CaseCode returns the value of the "case_code" field in the mutation.

func (*TaskMutation) CaseCodeCleared

func (m *TaskMutation) CaseCodeCleared() bool

CaseCodeCleared returns if the "case_code" field was cleared in this mutation.

func (*TaskMutation) ClearAssignedToHost

func (m *TaskMutation) ClearAssignedToHost()

ClearAssignedToHost clears the value of the "assigned_to_host" field.

func (*TaskMutation) ClearCaseCode

func (m *TaskMutation) ClearCaseCode()

ClearCaseCode clears the value of the "case_code" field.

func (*TaskMutation) ClearComment

func (m *TaskMutation) ClearComment()

ClearComment clears the value of the "comment" field.

func (*TaskMutation) ClearCrackedPasswords

func (m *TaskMutation) ClearCrackedPasswords()

ClearCrackedPasswords clears the "cracked_passwords" edge to the CrackedPassword entity.

func (*TaskMutation) ClearCreatedBy

func (m *TaskMutation) ClearCreatedBy()

ClearCreatedBy clears the "created_by" edge to the User entity.

func (*TaskMutation) ClearEdge

func (m *TaskMutation) 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 (*TaskMutation) ClearEnginePayload

func (m *TaskMutation) ClearEnginePayload()

ClearEnginePayload clears the value of the "engine_payload" field.

func (*TaskMutation) ClearError

func (m *TaskMutation) ClearError()

ClearError clears the value of the "error" field.

func (*TaskMutation) ClearField

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

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

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

func (*TaskMutation) ClearedFields

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

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

func (TaskMutation) Client

func (m TaskMutation) 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 (*TaskMutation) Comment

func (m *TaskMutation) Comment() (r string, exists bool)

Comment returns the value of the "comment" field in the mutation.

func (*TaskMutation) CommentCleared

func (m *TaskMutation) CommentCleared() bool

CommentCleared returns if the "comment" field was cleared in this mutation.

func (*TaskMutation) CrackedPasswordsCleared

func (m *TaskMutation) CrackedPasswordsCleared() bool

CrackedPasswordsCleared reports if the "cracked_passwords" edge to the CrackedPassword entity was cleared.

func (*TaskMutation) CrackedPasswordsIDs

func (m *TaskMutation) CrackedPasswordsIDs() (ids []uuid.UUID)

CrackedPasswordsIDs returns the "cracked_passwords" edge IDs in the mutation.

func (*TaskMutation) CreatedAt

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

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

func (*TaskMutation) CreatedByCleared

func (m *TaskMutation) CreatedByCleared() bool

CreatedByCleared reports if the "created_by" edge to the User entity was cleared.

func (*TaskMutation) CreatedByID

func (m *TaskMutation) CreatedByID() (id uuid.UUID, exists bool)

CreatedByID returns the "created_by" edge ID in the mutation.

func (*TaskMutation) CreatedByIDs

func (m *TaskMutation) CreatedByIDs() (ids []uuid.UUID)

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

func (*TaskMutation) EdgeCleared

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

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

func (*TaskMutation) EnginePayload

func (m *TaskMutation) EnginePayload() (r map[string]interface{}, exists bool)

EnginePayload returns the value of the "engine_payload" field in the mutation.

func (*TaskMutation) EnginePayloadCleared

func (m *TaskMutation) EnginePayloadCleared() bool

EnginePayloadCleared returns if the "engine_payload" field was cleared in this mutation.

func (*TaskMutation) Error

func (m *TaskMutation) Error() (r string, exists bool)

Error returns the value of the "error" field in the mutation.

func (*TaskMutation) ErrorCleared

func (m *TaskMutation) ErrorCleared() bool

ErrorCleared returns if the "error" field was cleared in this mutation.

func (*TaskMutation) Field

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

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

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

func (*TaskMutation) Fields

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

func (m *TaskMutation) Filter() *TaskFilter

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

func (*TaskMutation) ID

func (m *TaskMutation) ID() (id uuid.UUID, exists bool)

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

func (*TaskMutation) IDs

func (m *TaskMutation) IDs(ctx context.Context) ([]uuid.UUID, error)

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

func (*TaskMutation) LastUpdatedAt

func (m *TaskMutation) LastUpdatedAt() (r time.Time, exists bool)

LastUpdatedAt returns the value of the "last_updated_at" field in the mutation.

func (*TaskMutation) Name

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

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

func (*TaskMutation) NumberCracked

func (m *TaskMutation) NumberCracked() (r int, exists bool)

NumberCracked returns the value of the "number_cracked" field in the mutation.

func (*TaskMutation) NumberPasswords

func (m *TaskMutation) NumberPasswords() (r int, exists bool)

NumberPasswords returns the value of the "number_passwords" field in the mutation.

func (*TaskMutation) OldAssignedToHost

func (m *TaskMutation) OldAssignedToHost(ctx context.Context) (v string, err error)

OldAssignedToHost returns the old "assigned_to_host" field's value of the Task entity. If the Task 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 (*TaskMutation) OldCaseCode

func (m *TaskMutation) OldCaseCode(ctx context.Context) (v string, err error)

OldCaseCode returns the old "case_code" field's value of the Task entity. If the Task 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 (*TaskMutation) OldComment

func (m *TaskMutation) OldComment(ctx context.Context) (v string, err error)

OldComment returns the old "comment" field's value of the Task entity. If the Task 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 (*TaskMutation) OldCreatedAt

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

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

func (m *TaskMutation) OldEnginePayload(ctx context.Context) (v map[string]interface{}, err error)

OldEnginePayload returns the old "engine_payload" field's value of the Task entity. If the Task 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 (*TaskMutation) OldError

func (m *TaskMutation) OldError(ctx context.Context) (v string, err error)

OldError returns the old "error" field's value of the Task entity. If the Task 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 (*TaskMutation) OldField

func (m *TaskMutation) 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 (*TaskMutation) OldLastUpdatedAt

func (m *TaskMutation) OldLastUpdatedAt(ctx context.Context) (v time.Time, err error)

OldLastUpdatedAt returns the old "last_updated_at" field's value of the Task entity. If the Task 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 (*TaskMutation) OldName

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

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

func (m *TaskMutation) OldNumberCracked(ctx context.Context) (v int, err error)

OldNumberCracked returns the old "number_cracked" field's value of the Task entity. If the Task 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 (*TaskMutation) OldNumberPasswords

func (m *TaskMutation) OldNumberPasswords(ctx context.Context) (v int, err error)

OldNumberPasswords returns the old "number_passwords" field's value of the Task entity. If the Task 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 (*TaskMutation) OldStatus

func (m *TaskMutation) OldStatus(ctx context.Context) (v oldschema.TaskStatus, err error)

OldStatus returns the old "status" field's value of the Task entity. If the Task 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 (*TaskMutation) Op

func (m *TaskMutation) Op() Op

Op returns the operation name.

func (*TaskMutation) RemoveCrackedPasswordIDs

func (m *TaskMutation) RemoveCrackedPasswordIDs(ids ...uuid.UUID)

RemoveCrackedPasswordIDs removes the "cracked_passwords" edge to the CrackedPassword entity by IDs.

func (*TaskMutation) RemovedCrackedPasswordsIDs

func (m *TaskMutation) RemovedCrackedPasswordsIDs() (ids []uuid.UUID)

RemovedCrackedPasswords returns the removed IDs of the "cracked_passwords" edge to the CrackedPassword entity.

func (*TaskMutation) RemovedEdges

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

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

func (*TaskMutation) RemovedIDs

func (m *TaskMutation) 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 (*TaskMutation) ResetAssignedToHost

func (m *TaskMutation) ResetAssignedToHost()

ResetAssignedToHost resets all changes to the "assigned_to_host" field.

func (*TaskMutation) ResetCaseCode

func (m *TaskMutation) ResetCaseCode()

ResetCaseCode resets all changes to the "case_code" field.

func (*TaskMutation) ResetComment

func (m *TaskMutation) ResetComment()

ResetComment resets all changes to the "comment" field.

func (*TaskMutation) ResetCrackedPasswords

func (m *TaskMutation) ResetCrackedPasswords()

ResetCrackedPasswords resets all changes to the "cracked_passwords" edge.

func (*TaskMutation) ResetCreatedAt

func (m *TaskMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*TaskMutation) ResetCreatedBy

func (m *TaskMutation) ResetCreatedBy()

ResetCreatedBy resets all changes to the "created_by" edge.

func (*TaskMutation) ResetEdge

func (m *TaskMutation) 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 (*TaskMutation) ResetEnginePayload

func (m *TaskMutation) ResetEnginePayload()

ResetEnginePayload resets all changes to the "engine_payload" field.

func (*TaskMutation) ResetError

func (m *TaskMutation) ResetError()

ResetError resets all changes to the "error" field.

func (*TaskMutation) ResetField

func (m *TaskMutation) 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 (*TaskMutation) ResetLastUpdatedAt

func (m *TaskMutation) ResetLastUpdatedAt()

ResetLastUpdatedAt resets all changes to the "last_updated_at" field.

func (*TaskMutation) ResetName

func (m *TaskMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*TaskMutation) ResetNumberCracked

func (m *TaskMutation) ResetNumberCracked()

ResetNumberCracked resets all changes to the "number_cracked" field.

func (*TaskMutation) ResetNumberPasswords

func (m *TaskMutation) ResetNumberPasswords()

ResetNumberPasswords resets all changes to the "number_passwords" field.

func (*TaskMutation) ResetStatus

func (m *TaskMutation) ResetStatus()

ResetStatus resets all changes to the "status" field.

func (*TaskMutation) SetAssignedToHost

func (m *TaskMutation) SetAssignedToHost(s string)

SetAssignedToHost sets the "assigned_to_host" field.

func (*TaskMutation) SetCaseCode

func (m *TaskMutation) SetCaseCode(s string)

SetCaseCode sets the "case_code" field.

func (*TaskMutation) SetComment

func (m *TaskMutation) SetComment(s string)

SetComment sets the "comment" field.

func (*TaskMutation) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*TaskMutation) SetCreatedByID

func (m *TaskMutation) SetCreatedByID(id uuid.UUID)

SetCreatedByID sets the "created_by" edge to the User entity by id.

func (*TaskMutation) SetEnginePayload

func (m *TaskMutation) SetEnginePayload(value map[string]interface{})

SetEnginePayload sets the "engine_payload" field.

func (*TaskMutation) SetError

func (m *TaskMutation) SetError(s string)

SetError sets the "error" field.

func (*TaskMutation) SetField

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

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

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

func (*TaskMutation) SetLastUpdatedAt

func (m *TaskMutation) SetLastUpdatedAt(t time.Time)

SetLastUpdatedAt sets the "last_updated_at" field.

func (*TaskMutation) SetName

func (m *TaskMutation) SetName(s string)

SetName sets the "name" field.

func (*TaskMutation) SetNumberCracked

func (m *TaskMutation) SetNumberCracked(i int)

SetNumberCracked sets the "number_cracked" field.

func (*TaskMutation) SetNumberPasswords

func (m *TaskMutation) SetNumberPasswords(i int)

SetNumberPasswords sets the "number_passwords" field.

func (*TaskMutation) SetStatus

func (m *TaskMutation) SetStatus(os oldschema.TaskStatus)

SetStatus sets the "status" field.

func (*TaskMutation) Status

func (m *TaskMutation) Status() (r oldschema.TaskStatus, exists bool)

Status returns the value of the "status" field in the mutation.

func (TaskMutation) Tx

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

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

func (*TaskMutation) Type

func (m *TaskMutation) Type() string

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

func (*TaskMutation) Where

func (m *TaskMutation) Where(ps ...predicate.Task)

Where appends a list predicates to the TaskMutation builder.

type TaskQuery

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

TaskQuery is the builder for querying Task entities.

func (*TaskQuery) All

func (tq *TaskQuery) All(ctx context.Context) ([]*Task, error)

All executes the query and returns a list of Tasks.

func (*TaskQuery) AllX

func (tq *TaskQuery) AllX(ctx context.Context) []*Task

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

func (*TaskQuery) Clone

func (tq *TaskQuery) Clone() *TaskQuery

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

func (*TaskQuery) Count

func (tq *TaskQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*TaskQuery) CountX

func (tq *TaskQuery) CountX(ctx context.Context) int

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

func (*TaskQuery) Exist

func (tq *TaskQuery) Exist(ctx context.Context) (bool, error)

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

func (*TaskQuery) ExistX

func (tq *TaskQuery) ExistX(ctx context.Context) bool

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

func (*TaskQuery) Filter

func (tq *TaskQuery) Filter() *TaskFilter

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

func (*TaskQuery) First

func (tq *TaskQuery) First(ctx context.Context) (*Task, error)

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

func (*TaskQuery) FirstID

func (tq *TaskQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

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

func (*TaskQuery) FirstIDX

func (tq *TaskQuery) FirstIDX(ctx context.Context) uuid.UUID

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

func (*TaskQuery) FirstX

func (tq *TaskQuery) FirstX(ctx context.Context) *Task

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

func (*TaskQuery) GroupBy

func (tq *TaskQuery) GroupBy(field string, fields ...string) *TaskGroupBy

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.Task.Query().
	GroupBy(task.FieldName).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*TaskQuery) IDs

func (tq *TaskQuery) IDs(ctx context.Context) ([]uuid.UUID, error)

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

func (*TaskQuery) IDsX

func (tq *TaskQuery) IDsX(ctx context.Context) []uuid.UUID

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

func (*TaskQuery) Limit

func (tq *TaskQuery) Limit(limit int) *TaskQuery

Limit adds a limit step to the query.

func (*TaskQuery) Modify

func (tq *TaskQuery) Modify(modifiers ...func(s *sql.Selector)) *TaskSelect

Modify adds a query modifier for attaching custom logic to queries.

func (*TaskQuery) Offset

func (tq *TaskQuery) Offset(offset int) *TaskQuery

Offset adds an offset step to the query.

func (*TaskQuery) Only

func (tq *TaskQuery) Only(ctx context.Context) (*Task, error)

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

func (*TaskQuery) OnlyID

func (tq *TaskQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

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

func (*TaskQuery) OnlyIDX

func (tq *TaskQuery) OnlyIDX(ctx context.Context) uuid.UUID

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

func (*TaskQuery) OnlyX

func (tq *TaskQuery) OnlyX(ctx context.Context) *Task

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

func (*TaskQuery) Order

func (tq *TaskQuery) Order(o ...OrderFunc) *TaskQuery

Order adds an order step to the query.

func (*TaskQuery) QueryCrackedPasswords

func (tq *TaskQuery) QueryCrackedPasswords() *CrackedPasswordQuery

QueryCrackedPasswords chains the current query on the "cracked_passwords" edge.

func (*TaskQuery) QueryCreatedBy

func (tq *TaskQuery) QueryCreatedBy() *UserQuery

QueryCreatedBy chains the current query on the "created_by" edge.

func (*TaskQuery) Select

func (tq *TaskQuery) Select(fields ...string) *TaskSelect

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.Task.Query().
	Select(task.FieldName).
	Scan(ctx, &v)

func (*TaskQuery) Unique

func (tq *TaskQuery) Unique(unique bool) *TaskQuery

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

func (tq *TaskQuery) Where(ps ...predicate.Task) *TaskQuery

Where adds a new predicate for the TaskQuery builder.

func (*TaskQuery) WithCrackedPasswords

func (tq *TaskQuery) WithCrackedPasswords(opts ...func(*CrackedPasswordQuery)) *TaskQuery

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

func (*TaskQuery) WithCreatedBy

func (tq *TaskQuery) WithCreatedBy(opts ...func(*UserQuery)) *TaskQuery

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

type TaskSelect

type TaskSelect struct {
	*TaskQuery
	// contains filtered or unexported fields
}

TaskSelect is the builder for selecting fields of Task entities.

func (*TaskSelect) Bool

func (ts *TaskSelect) Bool(ctx context.Context) (_ bool, err error)

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

func (*TaskSelect) BoolX

func (ts *TaskSelect) BoolX(ctx context.Context) bool

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

func (*TaskSelect) Bools

func (ts *TaskSelect) Bools(ctx context.Context) ([]bool, error)

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

func (*TaskSelect) BoolsX

func (ts *TaskSelect) BoolsX(ctx context.Context) []bool

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

func (*TaskSelect) Float64

func (ts *TaskSelect) Float64(ctx context.Context) (_ float64, err error)

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

func (*TaskSelect) Float64X

func (ts *TaskSelect) Float64X(ctx context.Context) float64

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

func (*TaskSelect) Float64s

func (ts *TaskSelect) Float64s(ctx context.Context) ([]float64, error)

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

func (*TaskSelect) Float64sX

func (ts *TaskSelect) Float64sX(ctx context.Context) []float64

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

func (*TaskSelect) Int

func (ts *TaskSelect) Int(ctx context.Context) (_ int, err error)

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

func (*TaskSelect) IntX

func (ts *TaskSelect) IntX(ctx context.Context) int

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

func (*TaskSelect) Ints

func (ts *TaskSelect) Ints(ctx context.Context) ([]int, error)

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

func (*TaskSelect) IntsX

func (ts *TaskSelect) IntsX(ctx context.Context) []int

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

func (*TaskSelect) Modify

func (ts *TaskSelect) Modify(modifiers ...func(s *sql.Selector)) *TaskSelect

Modify adds a query modifier for attaching custom logic to queries.

func (*TaskSelect) Scan

func (ts *TaskSelect) Scan(ctx context.Context, v interface{}) error

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

func (*TaskSelect) ScanX

func (ts *TaskSelect) ScanX(ctx context.Context, v interface{})

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

func (*TaskSelect) String

func (ts *TaskSelect) String(ctx context.Context) (_ string, err error)

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

func (*TaskSelect) StringX

func (ts *TaskSelect) StringX(ctx context.Context) string

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

func (*TaskSelect) Strings

func (ts *TaskSelect) Strings(ctx context.Context) ([]string, error)

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

func (*TaskSelect) StringsX

func (ts *TaskSelect) StringsX(ctx context.Context) []string

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

type TaskUpdate

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

TaskUpdate is the builder for updating Task entities.

func (*TaskUpdate) AddCrackedPasswordIDs

func (tu *TaskUpdate) AddCrackedPasswordIDs(ids ...uuid.UUID) *TaskUpdate

AddCrackedPasswordIDs adds the "cracked_passwords" edge to the CrackedPassword entity by IDs.

func (*TaskUpdate) AddCrackedPasswords

func (tu *TaskUpdate) AddCrackedPasswords(c ...*CrackedPassword) *TaskUpdate

AddCrackedPasswords adds the "cracked_passwords" edges to the CrackedPassword entity.

func (*TaskUpdate) AddNumberCracked

func (tu *TaskUpdate) AddNumberCracked(i int) *TaskUpdate

AddNumberCracked adds i to the "number_cracked" field.

func (*TaskUpdate) AddNumberPasswords

func (tu *TaskUpdate) AddNumberPasswords(i int) *TaskUpdate

AddNumberPasswords adds i to the "number_passwords" field.

func (*TaskUpdate) ClearAssignedToHost

func (tu *TaskUpdate) ClearAssignedToHost() *TaskUpdate

ClearAssignedToHost clears the value of the "assigned_to_host" field.

func (*TaskUpdate) ClearCaseCode

func (tu *TaskUpdate) ClearCaseCode() *TaskUpdate

ClearCaseCode clears the value of the "case_code" field.

func (*TaskUpdate) ClearComment

func (tu *TaskUpdate) ClearComment() *TaskUpdate

ClearComment clears the value of the "comment" field.

func (*TaskUpdate) ClearCrackedPasswords

func (tu *TaskUpdate) ClearCrackedPasswords() *TaskUpdate

ClearCrackedPasswords clears all "cracked_passwords" edges to the CrackedPassword entity.

func (*TaskUpdate) ClearCreatedBy

func (tu *TaskUpdate) ClearCreatedBy() *TaskUpdate

ClearCreatedBy clears the "created_by" edge to the User entity.

func (*TaskUpdate) ClearEnginePayload

func (tu *TaskUpdate) ClearEnginePayload() *TaskUpdate

ClearEnginePayload clears the value of the "engine_payload" field.

func (*TaskUpdate) ClearError

func (tu *TaskUpdate) ClearError() *TaskUpdate

ClearError clears the value of the "error" field.

func (*TaskUpdate) Exec

func (tu *TaskUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*TaskUpdate) ExecX

func (tu *TaskUpdate) ExecX(ctx context.Context)

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

func (*TaskUpdate) Mutation

func (tu *TaskUpdate) Mutation() *TaskMutation

Mutation returns the TaskMutation object of the builder.

func (*TaskUpdate) RemoveCrackedPasswordIDs

func (tu *TaskUpdate) RemoveCrackedPasswordIDs(ids ...uuid.UUID) *TaskUpdate

RemoveCrackedPasswordIDs removes the "cracked_passwords" edge to CrackedPassword entities by IDs.

func (*TaskUpdate) RemoveCrackedPasswords

func (tu *TaskUpdate) RemoveCrackedPasswords(c ...*CrackedPassword) *TaskUpdate

RemoveCrackedPasswords removes "cracked_passwords" edges to CrackedPassword entities.

func (*TaskUpdate) Save

func (tu *TaskUpdate) Save(ctx context.Context) (int, error)

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

func (*TaskUpdate) SaveX

func (tu *TaskUpdate) SaveX(ctx context.Context) int

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

func (*TaskUpdate) SetAssignedToHost

func (tu *TaskUpdate) SetAssignedToHost(s string) *TaskUpdate

SetAssignedToHost sets the "assigned_to_host" field.

func (*TaskUpdate) SetCaseCode

func (tu *TaskUpdate) SetCaseCode(s string) *TaskUpdate

SetCaseCode sets the "case_code" field.

func (*TaskUpdate) SetComment

func (tu *TaskUpdate) SetComment(s string) *TaskUpdate

SetComment sets the "comment" field.

func (*TaskUpdate) SetCreatedBy

func (tu *TaskUpdate) SetCreatedBy(u *User) *TaskUpdate

SetCreatedBy sets the "created_by" edge to the User entity.

func (*TaskUpdate) SetCreatedByID

func (tu *TaskUpdate) SetCreatedByID(id uuid.UUID) *TaskUpdate

SetCreatedByID sets the "created_by" edge to the User entity by ID.

func (*TaskUpdate) SetEnginePayload

func (tu *TaskUpdate) SetEnginePayload(m map[string]interface{}) *TaskUpdate

SetEnginePayload sets the "engine_payload" field.

func (*TaskUpdate) SetError

func (tu *TaskUpdate) SetError(s string) *TaskUpdate

SetError sets the "error" field.

func (*TaskUpdate) SetName

func (tu *TaskUpdate) SetName(s string) *TaskUpdate

SetName sets the "name" field.

func (*TaskUpdate) SetNillableAssignedToHost

func (tu *TaskUpdate) SetNillableAssignedToHost(s *string) *TaskUpdate

SetNillableAssignedToHost sets the "assigned_to_host" field if the given value is not nil.

func (*TaskUpdate) SetNillableCaseCode

func (tu *TaskUpdate) SetNillableCaseCode(s *string) *TaskUpdate

SetNillableCaseCode sets the "case_code" field if the given value is not nil.

func (*TaskUpdate) SetNillableComment

func (tu *TaskUpdate) SetNillableComment(s *string) *TaskUpdate

SetNillableComment sets the "comment" field if the given value is not nil.

func (*TaskUpdate) SetNillableError

func (tu *TaskUpdate) SetNillableError(s *string) *TaskUpdate

SetNillableError sets the "error" field if the given value is not nil.

func (*TaskUpdate) SetNillableNumberCracked

func (tu *TaskUpdate) SetNillableNumberCracked(i *int) *TaskUpdate

SetNillableNumberCracked sets the "number_cracked" field if the given value is not nil.

func (*TaskUpdate) SetNillableNumberPasswords

func (tu *TaskUpdate) SetNillableNumberPasswords(i *int) *TaskUpdate

SetNillableNumberPasswords sets the "number_passwords" field if the given value is not nil.

func (*TaskUpdate) SetNumberCracked

func (tu *TaskUpdate) SetNumberCracked(i int) *TaskUpdate

SetNumberCracked sets the "number_cracked" field.

func (*TaskUpdate) SetNumberPasswords

func (tu *TaskUpdate) SetNumberPasswords(i int) *TaskUpdate

SetNumberPasswords sets the "number_passwords" field.

func (*TaskUpdate) SetStatus

func (tu *TaskUpdate) SetStatus(os oldschema.TaskStatus) *TaskUpdate

SetStatus sets the "status" field.

func (*TaskUpdate) Where

func (tu *TaskUpdate) Where(ps ...predicate.Task) *TaskUpdate

Where appends a list predicates to the TaskUpdate builder.

type TaskUpdateOne

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

TaskUpdateOne is the builder for updating a single Task entity.

func (*TaskUpdateOne) AddCrackedPasswordIDs

func (tuo *TaskUpdateOne) AddCrackedPasswordIDs(ids ...uuid.UUID) *TaskUpdateOne

AddCrackedPasswordIDs adds the "cracked_passwords" edge to the CrackedPassword entity by IDs.

func (*TaskUpdateOne) AddCrackedPasswords

func (tuo *TaskUpdateOne) AddCrackedPasswords(c ...*CrackedPassword) *TaskUpdateOne

AddCrackedPasswords adds the "cracked_passwords" edges to the CrackedPassword entity.

func (*TaskUpdateOne) AddNumberCracked

func (tuo *TaskUpdateOne) AddNumberCracked(i int) *TaskUpdateOne

AddNumberCracked adds i to the "number_cracked" field.

func (*TaskUpdateOne) AddNumberPasswords

func (tuo *TaskUpdateOne) AddNumberPasswords(i int) *TaskUpdateOne

AddNumberPasswords adds i to the "number_passwords" field.

func (*TaskUpdateOne) ClearAssignedToHost

func (tuo *TaskUpdateOne) ClearAssignedToHost() *TaskUpdateOne

ClearAssignedToHost clears the value of the "assigned_to_host" field.

func (*TaskUpdateOne) ClearCaseCode

func (tuo *TaskUpdateOne) ClearCaseCode() *TaskUpdateOne

ClearCaseCode clears the value of the "case_code" field.

func (*TaskUpdateOne) ClearComment

func (tuo *TaskUpdateOne) ClearComment() *TaskUpdateOne

ClearComment clears the value of the "comment" field.

func (*TaskUpdateOne) ClearCrackedPasswords

func (tuo *TaskUpdateOne) ClearCrackedPasswords() *TaskUpdateOne

ClearCrackedPasswords clears all "cracked_passwords" edges to the CrackedPassword entity.

func (*TaskUpdateOne) ClearCreatedBy

func (tuo *TaskUpdateOne) ClearCreatedBy() *TaskUpdateOne

ClearCreatedBy clears the "created_by" edge to the User entity.

func (*TaskUpdateOne) ClearEnginePayload

func (tuo *TaskUpdateOne) ClearEnginePayload() *TaskUpdateOne

ClearEnginePayload clears the value of the "engine_payload" field.

func (*TaskUpdateOne) ClearError

func (tuo *TaskUpdateOne) ClearError() *TaskUpdateOne

ClearError clears the value of the "error" field.

func (*TaskUpdateOne) Exec

func (tuo *TaskUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*TaskUpdateOne) ExecX

func (tuo *TaskUpdateOne) ExecX(ctx context.Context)

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

func (*TaskUpdateOne) Mutation

func (tuo *TaskUpdateOne) Mutation() *TaskMutation

Mutation returns the TaskMutation object of the builder.

func (*TaskUpdateOne) RemoveCrackedPasswordIDs

func (tuo *TaskUpdateOne) RemoveCrackedPasswordIDs(ids ...uuid.UUID) *TaskUpdateOne

RemoveCrackedPasswordIDs removes the "cracked_passwords" edge to CrackedPassword entities by IDs.

func (*TaskUpdateOne) RemoveCrackedPasswords

func (tuo *TaskUpdateOne) RemoveCrackedPasswords(c ...*CrackedPassword) *TaskUpdateOne

RemoveCrackedPasswords removes "cracked_passwords" edges to CrackedPassword entities.

func (*TaskUpdateOne) Save

func (tuo *TaskUpdateOne) Save(ctx context.Context) (*Task, error)

Save executes the query and returns the updated Task entity.

func (*TaskUpdateOne) SaveX

func (tuo *TaskUpdateOne) SaveX(ctx context.Context) *Task

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

func (*TaskUpdateOne) Select

func (tuo *TaskUpdateOne) Select(field string, fields ...string) *TaskUpdateOne

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

func (*TaskUpdateOne) SetAssignedToHost

func (tuo *TaskUpdateOne) SetAssignedToHost(s string) *TaskUpdateOne

SetAssignedToHost sets the "assigned_to_host" field.

func (*TaskUpdateOne) SetCaseCode

func (tuo *TaskUpdateOne) SetCaseCode(s string) *TaskUpdateOne

SetCaseCode sets the "case_code" field.

func (*TaskUpdateOne) SetComment

func (tuo *TaskUpdateOne) SetComment(s string) *TaskUpdateOne

SetComment sets the "comment" field.

func (*TaskUpdateOne) SetCreatedBy

func (tuo *TaskUpdateOne) SetCreatedBy(u *User) *TaskUpdateOne

SetCreatedBy sets the "created_by" edge to the User entity.

func (*TaskUpdateOne) SetCreatedByID

func (tuo *TaskUpdateOne) SetCreatedByID(id uuid.UUID) *TaskUpdateOne

SetCreatedByID sets the "created_by" edge to the User entity by ID.

func (*TaskUpdateOne) SetEnginePayload

func (tuo *TaskUpdateOne) SetEnginePayload(m map[string]interface{}) *TaskUpdateOne

SetEnginePayload sets the "engine_payload" field.

func (*TaskUpdateOne) SetError

func (tuo *TaskUpdateOne) SetError(s string) *TaskUpdateOne

SetError sets the "error" field.

func (*TaskUpdateOne) SetName

func (tuo *TaskUpdateOne) SetName(s string) *TaskUpdateOne

SetName sets the "name" field.

func (*TaskUpdateOne) SetNillableAssignedToHost

func (tuo *TaskUpdateOne) SetNillableAssignedToHost(s *string) *TaskUpdateOne

SetNillableAssignedToHost sets the "assigned_to_host" field if the given value is not nil.

func (*TaskUpdateOne) SetNillableCaseCode

func (tuo *TaskUpdateOne) SetNillableCaseCode(s *string) *TaskUpdateOne

SetNillableCaseCode sets the "case_code" field if the given value is not nil.

func (*TaskUpdateOne) SetNillableComment

func (tuo *TaskUpdateOne) SetNillableComment(s *string) *TaskUpdateOne

SetNillableComment sets the "comment" field if the given value is not nil.

func (*TaskUpdateOne) SetNillableError

func (tuo *TaskUpdateOne) SetNillableError(s *string) *TaskUpdateOne

SetNillableError sets the "error" field if the given value is not nil.

func (*TaskUpdateOne) SetNillableNumberCracked

func (tuo *TaskUpdateOne) SetNillableNumberCracked(i *int) *TaskUpdateOne

SetNillableNumberCracked sets the "number_cracked" field if the given value is not nil.

func (*TaskUpdateOne) SetNillableNumberPasswords

func (tuo *TaskUpdateOne) SetNillableNumberPasswords(i *int) *TaskUpdateOne

SetNillableNumberPasswords sets the "number_passwords" field if the given value is not nil.

func (*TaskUpdateOne) SetNumberCracked

func (tuo *TaskUpdateOne) SetNumberCracked(i int) *TaskUpdateOne

SetNumberCracked sets the "number_cracked" field.

func (*TaskUpdateOne) SetNumberPasswords

func (tuo *TaskUpdateOne) SetNumberPasswords(i int) *TaskUpdateOne

SetNumberPasswords sets the "number_passwords" field.

func (*TaskUpdateOne) SetStatus

func (tuo *TaskUpdateOne) SetStatus(os oldschema.TaskStatus) *TaskUpdateOne

SetStatus sets the "status" field.

type TaskUpsert

type TaskUpsert struct {
	*sql.UpdateSet
}

TaskUpsert is the "OnConflict" setter.

func (*TaskUpsert) AddNumberCracked

func (u *TaskUpsert) AddNumberCracked(v int) *TaskUpsert

AddNumberCracked adds v to the "number_cracked" field.

func (*TaskUpsert) AddNumberPasswords

func (u *TaskUpsert) AddNumberPasswords(v int) *TaskUpsert

AddNumberPasswords adds v to the "number_passwords" field.

func (*TaskUpsert) ClearAssignedToHost

func (u *TaskUpsert) ClearAssignedToHost() *TaskUpsert

ClearAssignedToHost clears the value of the "assigned_to_host" field.

func (*TaskUpsert) ClearCaseCode

func (u *TaskUpsert) ClearCaseCode() *TaskUpsert

ClearCaseCode clears the value of the "case_code" field.

func (*TaskUpsert) ClearComment

func (u *TaskUpsert) ClearComment() *TaskUpsert

ClearComment clears the value of the "comment" field.

func (*TaskUpsert) ClearEnginePayload

func (u *TaskUpsert) ClearEnginePayload() *TaskUpsert

ClearEnginePayload clears the value of the "engine_payload" field.

func (*TaskUpsert) ClearError

func (u *TaskUpsert) ClearError() *TaskUpsert

ClearError clears the value of the "error" field.

func (*TaskUpsert) SetAssignedToHost

func (u *TaskUpsert) SetAssignedToHost(v string) *TaskUpsert

SetAssignedToHost sets the "assigned_to_host" field.

func (*TaskUpsert) SetCaseCode

func (u *TaskUpsert) SetCaseCode(v string) *TaskUpsert

SetCaseCode sets the "case_code" field.

func (*TaskUpsert) SetComment

func (u *TaskUpsert) SetComment(v string) *TaskUpsert

SetComment sets the "comment" field.

func (*TaskUpsert) SetCreatedAt

func (u *TaskUpsert) SetCreatedAt(v time.Time) *TaskUpsert

SetCreatedAt sets the "created_at" field.

func (*TaskUpsert) SetEnginePayload

func (u *TaskUpsert) SetEnginePayload(v map[string]interface{}) *TaskUpsert

SetEnginePayload sets the "engine_payload" field.

func (*TaskUpsert) SetError

func (u *TaskUpsert) SetError(v string) *TaskUpsert

SetError sets the "error" field.

func (*TaskUpsert) SetLastUpdatedAt

func (u *TaskUpsert) SetLastUpdatedAt(v time.Time) *TaskUpsert

SetLastUpdatedAt sets the "last_updated_at" field.

func (*TaskUpsert) SetName

func (u *TaskUpsert) SetName(v string) *TaskUpsert

SetName sets the "name" field.

func (*TaskUpsert) SetNumberCracked

func (u *TaskUpsert) SetNumberCracked(v int) *TaskUpsert

SetNumberCracked sets the "number_cracked" field.

func (*TaskUpsert) SetNumberPasswords

func (u *TaskUpsert) SetNumberPasswords(v int) *TaskUpsert

SetNumberPasswords sets the "number_passwords" field.

func (*TaskUpsert) SetStatus

func (u *TaskUpsert) SetStatus(v oldschema.TaskStatus) *TaskUpsert

SetStatus sets the "status" field.

func (*TaskUpsert) UpdateAssignedToHost

func (u *TaskUpsert) UpdateAssignedToHost() *TaskUpsert

UpdateAssignedToHost sets the "assigned_to_host" field to the value that was provided on create.

func (*TaskUpsert) UpdateCaseCode

func (u *TaskUpsert) UpdateCaseCode() *TaskUpsert

UpdateCaseCode sets the "case_code" field to the value that was provided on create.

func (*TaskUpsert) UpdateComment

func (u *TaskUpsert) UpdateComment() *TaskUpsert

UpdateComment sets the "comment" field to the value that was provided on create.

func (*TaskUpsert) UpdateCreatedAt

func (u *TaskUpsert) UpdateCreatedAt() *TaskUpsert

UpdateCreatedAt sets the "created_at" field to the value that was provided on create.

func (*TaskUpsert) UpdateEnginePayload

func (u *TaskUpsert) UpdateEnginePayload() *TaskUpsert

UpdateEnginePayload sets the "engine_payload" field to the value that was provided on create.

func (*TaskUpsert) UpdateError

func (u *TaskUpsert) UpdateError() *TaskUpsert

UpdateError sets the "error" field to the value that was provided on create.

func (*TaskUpsert) UpdateLastUpdatedAt

func (u *TaskUpsert) UpdateLastUpdatedAt() *TaskUpsert

UpdateLastUpdatedAt sets the "last_updated_at" field to the value that was provided on create.

func (*TaskUpsert) UpdateName

func (u *TaskUpsert) UpdateName() *TaskUpsert

UpdateName sets the "name" field to the value that was provided on create.

func (*TaskUpsert) UpdateNumberCracked

func (u *TaskUpsert) UpdateNumberCracked() *TaskUpsert

UpdateNumberCracked sets the "number_cracked" field to the value that was provided on create.

func (*TaskUpsert) UpdateNumberPasswords

func (u *TaskUpsert) UpdateNumberPasswords() *TaskUpsert

UpdateNumberPasswords sets the "number_passwords" field to the value that was provided on create.

func (*TaskUpsert) UpdateStatus

func (u *TaskUpsert) UpdateStatus() *TaskUpsert

UpdateStatus sets the "status" field to the value that was provided on create.

type TaskUpsertBulk

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

TaskUpsertBulk is the builder for "upsert"-ing a bulk of Task nodes.

func (*TaskUpsertBulk) AddNumberCracked

func (u *TaskUpsertBulk) AddNumberCracked(v int) *TaskUpsertBulk

AddNumberCracked adds v to the "number_cracked" field.

func (*TaskUpsertBulk) AddNumberPasswords

func (u *TaskUpsertBulk) AddNumberPasswords(v int) *TaskUpsertBulk

AddNumberPasswords adds v to the "number_passwords" field.

func (*TaskUpsertBulk) ClearAssignedToHost

func (u *TaskUpsertBulk) ClearAssignedToHost() *TaskUpsertBulk

ClearAssignedToHost clears the value of the "assigned_to_host" field.

func (*TaskUpsertBulk) ClearCaseCode

func (u *TaskUpsertBulk) ClearCaseCode() *TaskUpsertBulk

ClearCaseCode clears the value of the "case_code" field.

func (*TaskUpsertBulk) ClearComment

func (u *TaskUpsertBulk) ClearComment() *TaskUpsertBulk

ClearComment clears the value of the "comment" field.

func (*TaskUpsertBulk) ClearEnginePayload

func (u *TaskUpsertBulk) ClearEnginePayload() *TaskUpsertBulk

ClearEnginePayload clears the value of the "engine_payload" field.

func (*TaskUpsertBulk) ClearError

func (u *TaskUpsertBulk) ClearError() *TaskUpsertBulk

ClearError clears the value of the "error" field.

func (*TaskUpsertBulk) DoNothing

func (u *TaskUpsertBulk) DoNothing() *TaskUpsertBulk

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*TaskUpsertBulk) Exec

func (u *TaskUpsertBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*TaskUpsertBulk) ExecX

func (u *TaskUpsertBulk) ExecX(ctx context.Context)

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

func (*TaskUpsertBulk) Ignore

func (u *TaskUpsertBulk) Ignore() *TaskUpsertBulk

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.Task.Create().
	OnConflict(sql.ResolveWithIgnore()).
	Exec(ctx)

func (*TaskUpsertBulk) SetAssignedToHost

func (u *TaskUpsertBulk) SetAssignedToHost(v string) *TaskUpsertBulk

SetAssignedToHost sets the "assigned_to_host" field.

func (*TaskUpsertBulk) SetCaseCode

func (u *TaskUpsertBulk) SetCaseCode(v string) *TaskUpsertBulk

SetCaseCode sets the "case_code" field.

func (*TaskUpsertBulk) SetComment

func (u *TaskUpsertBulk) SetComment(v string) *TaskUpsertBulk

SetComment sets the "comment" field.

func (*TaskUpsertBulk) SetCreatedAt

func (u *TaskUpsertBulk) SetCreatedAt(v time.Time) *TaskUpsertBulk

SetCreatedAt sets the "created_at" field.

func (*TaskUpsertBulk) SetEnginePayload

func (u *TaskUpsertBulk) SetEnginePayload(v map[string]interface{}) *TaskUpsertBulk

SetEnginePayload sets the "engine_payload" field.

func (*TaskUpsertBulk) SetError

func (u *TaskUpsertBulk) SetError(v string) *TaskUpsertBulk

SetError sets the "error" field.

func (*TaskUpsertBulk) SetLastUpdatedAt

func (u *TaskUpsertBulk) SetLastUpdatedAt(v time.Time) *TaskUpsertBulk

SetLastUpdatedAt sets the "last_updated_at" field.

func (*TaskUpsertBulk) SetName

func (u *TaskUpsertBulk) SetName(v string) *TaskUpsertBulk

SetName sets the "name" field.

func (*TaskUpsertBulk) SetNumberCracked

func (u *TaskUpsertBulk) SetNumberCracked(v int) *TaskUpsertBulk

SetNumberCracked sets the "number_cracked" field.

func (*TaskUpsertBulk) SetNumberPasswords

func (u *TaskUpsertBulk) SetNumberPasswords(v int) *TaskUpsertBulk

SetNumberPasswords sets the "number_passwords" field.

func (*TaskUpsertBulk) SetStatus

SetStatus sets the "status" field.

func (*TaskUpsertBulk) Update

func (u *TaskUpsertBulk) Update(set func(*TaskUpsert)) *TaskUpsertBulk

Update allows overriding fields `UPDATE` values. See the TaskCreateBulk.OnConflict documentation for more info.

func (*TaskUpsertBulk) UpdateAssignedToHost

func (u *TaskUpsertBulk) UpdateAssignedToHost() *TaskUpsertBulk

UpdateAssignedToHost sets the "assigned_to_host" field to the value that was provided on create.

func (*TaskUpsertBulk) UpdateCaseCode

func (u *TaskUpsertBulk) UpdateCaseCode() *TaskUpsertBulk

UpdateCaseCode sets the "case_code" field to the value that was provided on create.

func (*TaskUpsertBulk) UpdateComment

func (u *TaskUpsertBulk) UpdateComment() *TaskUpsertBulk

UpdateComment sets the "comment" field to the value that was provided on create.

func (*TaskUpsertBulk) UpdateCreatedAt

func (u *TaskUpsertBulk) UpdateCreatedAt() *TaskUpsertBulk

UpdateCreatedAt sets the "created_at" field to the value that was provided on create.

func (*TaskUpsertBulk) UpdateEnginePayload

func (u *TaskUpsertBulk) UpdateEnginePayload() *TaskUpsertBulk

UpdateEnginePayload sets the "engine_payload" field to the value that was provided on create.

func (*TaskUpsertBulk) UpdateError

func (u *TaskUpsertBulk) UpdateError() *TaskUpsertBulk

UpdateError sets the "error" field to the value that was provided on create.

func (*TaskUpsertBulk) UpdateLastUpdatedAt

func (u *TaskUpsertBulk) UpdateLastUpdatedAt() *TaskUpsertBulk

UpdateLastUpdatedAt sets the "last_updated_at" field to the value that was provided on create.

func (*TaskUpsertBulk) UpdateName

func (u *TaskUpsertBulk) UpdateName() *TaskUpsertBulk

UpdateName sets the "name" field to the value that was provided on create.

func (*TaskUpsertBulk) UpdateNewValues

func (u *TaskUpsertBulk) UpdateNewValues() *TaskUpsertBulk

UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:

client.Task.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
		sql.ResolveWith(func(u *sql.UpdateSet) {
			u.SetIgnore(task.FieldID)
		}),
	).
	Exec(ctx)

func (*TaskUpsertBulk) UpdateNumberCracked

func (u *TaskUpsertBulk) UpdateNumberCracked() *TaskUpsertBulk

UpdateNumberCracked sets the "number_cracked" field to the value that was provided on create.

func (*TaskUpsertBulk) UpdateNumberPasswords

func (u *TaskUpsertBulk) UpdateNumberPasswords() *TaskUpsertBulk

UpdateNumberPasswords sets the "number_passwords" field to the value that was provided on create.

func (*TaskUpsertBulk) UpdateStatus

func (u *TaskUpsertBulk) UpdateStatus() *TaskUpsertBulk

UpdateStatus sets the "status" field to the value that was provided on create.

type TaskUpsertOne

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

TaskUpsertOne is the builder for "upsert"-ing

one Task node.

func (*TaskUpsertOne) AddNumberCracked

func (u *TaskUpsertOne) AddNumberCracked(v int) *TaskUpsertOne

AddNumberCracked adds v to the "number_cracked" field.

func (*TaskUpsertOne) AddNumberPasswords

func (u *TaskUpsertOne) AddNumberPasswords(v int) *TaskUpsertOne

AddNumberPasswords adds v to the "number_passwords" field.

func (*TaskUpsertOne) ClearAssignedToHost

func (u *TaskUpsertOne) ClearAssignedToHost() *TaskUpsertOne

ClearAssignedToHost clears the value of the "assigned_to_host" field.

func (*TaskUpsertOne) ClearCaseCode

func (u *TaskUpsertOne) ClearCaseCode() *TaskUpsertOne

ClearCaseCode clears the value of the "case_code" field.

func (*TaskUpsertOne) ClearComment

func (u *TaskUpsertOne) ClearComment() *TaskUpsertOne

ClearComment clears the value of the "comment" field.

func (*TaskUpsertOne) ClearEnginePayload

func (u *TaskUpsertOne) ClearEnginePayload() *TaskUpsertOne

ClearEnginePayload clears the value of the "engine_payload" field.

func (*TaskUpsertOne) ClearError

func (u *TaskUpsertOne) ClearError() *TaskUpsertOne

ClearError clears the value of the "error" field.

func (*TaskUpsertOne) DoNothing

func (u *TaskUpsertOne) DoNothing() *TaskUpsertOne

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*TaskUpsertOne) Exec

func (u *TaskUpsertOne) Exec(ctx context.Context) error

Exec executes the query.

func (*TaskUpsertOne) ExecX

func (u *TaskUpsertOne) ExecX(ctx context.Context)

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

func (*TaskUpsertOne) ID

func (u *TaskUpsertOne) ID(ctx context.Context) (id uuid.UUID, err error)

Exec executes the UPSERT query and returns the inserted/updated ID.

func (*TaskUpsertOne) IDX

func (u *TaskUpsertOne) IDX(ctx context.Context) uuid.UUID

IDX is like ID, but panics if an error occurs.

func (*TaskUpsertOne) Ignore

func (u *TaskUpsertOne) Ignore() *TaskUpsertOne

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.Task.Create().
    OnConflict(sql.ResolveWithIgnore()).
    Exec(ctx)

func (*TaskUpsertOne) SetAssignedToHost

func (u *TaskUpsertOne) SetAssignedToHost(v string) *TaskUpsertOne

SetAssignedToHost sets the "assigned_to_host" field.

func (*TaskUpsertOne) SetCaseCode

func (u *TaskUpsertOne) SetCaseCode(v string) *TaskUpsertOne

SetCaseCode sets the "case_code" field.

func (*TaskUpsertOne) SetComment

func (u *TaskUpsertOne) SetComment(v string) *TaskUpsertOne

SetComment sets the "comment" field.

func (*TaskUpsertOne) SetCreatedAt

func (u *TaskUpsertOne) SetCreatedAt(v time.Time) *TaskUpsertOne

SetCreatedAt sets the "created_at" field.

func (*TaskUpsertOne) SetEnginePayload

func (u *TaskUpsertOne) SetEnginePayload(v map[string]interface{}) *TaskUpsertOne

SetEnginePayload sets the "engine_payload" field.

func (*TaskUpsertOne) SetError

func (u *TaskUpsertOne) SetError(v string) *TaskUpsertOne

SetError sets the "error" field.

func (*TaskUpsertOne) SetLastUpdatedAt

func (u *TaskUpsertOne) SetLastUpdatedAt(v time.Time) *TaskUpsertOne

SetLastUpdatedAt sets the "last_updated_at" field.

func (*TaskUpsertOne) SetName

func (u *TaskUpsertOne) SetName(v string) *TaskUpsertOne

SetName sets the "name" field.

func (*TaskUpsertOne) SetNumberCracked

func (u *TaskUpsertOne) SetNumberCracked(v int) *TaskUpsertOne

SetNumberCracked sets the "number_cracked" field.

func (*TaskUpsertOne) SetNumberPasswords

func (u *TaskUpsertOne) SetNumberPasswords(v int) *TaskUpsertOne

SetNumberPasswords sets the "number_passwords" field.

func (*TaskUpsertOne) SetStatus

SetStatus sets the "status" field.

func (*TaskUpsertOne) Update

func (u *TaskUpsertOne) Update(set func(*TaskUpsert)) *TaskUpsertOne

Update allows overriding fields `UPDATE` values. See the TaskCreate.OnConflict documentation for more info.

func (*TaskUpsertOne) UpdateAssignedToHost

func (u *TaskUpsertOne) UpdateAssignedToHost() *TaskUpsertOne

UpdateAssignedToHost sets the "assigned_to_host" field to the value that was provided on create.

func (*TaskUpsertOne) UpdateCaseCode

func (u *TaskUpsertOne) UpdateCaseCode() *TaskUpsertOne

UpdateCaseCode sets the "case_code" field to the value that was provided on create.

func (*TaskUpsertOne) UpdateComment

func (u *TaskUpsertOne) UpdateComment() *TaskUpsertOne

UpdateComment sets the "comment" field to the value that was provided on create.

func (*TaskUpsertOne) UpdateCreatedAt

func (u *TaskUpsertOne) UpdateCreatedAt() *TaskUpsertOne

UpdateCreatedAt sets the "created_at" field to the value that was provided on create.

func (*TaskUpsertOne) UpdateEnginePayload

func (u *TaskUpsertOne) UpdateEnginePayload() *TaskUpsertOne

UpdateEnginePayload sets the "engine_payload" field to the value that was provided on create.

func (*TaskUpsertOne) UpdateError

func (u *TaskUpsertOne) UpdateError() *TaskUpsertOne

UpdateError sets the "error" field to the value that was provided on create.

func (*TaskUpsertOne) UpdateLastUpdatedAt

func (u *TaskUpsertOne) UpdateLastUpdatedAt() *TaskUpsertOne

UpdateLastUpdatedAt sets the "last_updated_at" field to the value that was provided on create.

func (*TaskUpsertOne) UpdateName

func (u *TaskUpsertOne) UpdateName() *TaskUpsertOne

UpdateName sets the "name" field to the value that was provided on create.

func (*TaskUpsertOne) UpdateNewValues

func (u *TaskUpsertOne) UpdateNewValues() *TaskUpsertOne

UpdateNewValues updates the mutable fields using the new values that were set on create except the ID field. Using this option is equivalent to using:

client.Task.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
		sql.ResolveWith(func(u *sql.UpdateSet) {
			u.SetIgnore(task.FieldID)
		}),
	).
	Exec(ctx)

func (*TaskUpsertOne) UpdateNumberCracked

func (u *TaskUpsertOne) UpdateNumberCracked() *TaskUpsertOne

UpdateNumberCracked sets the "number_cracked" field to the value that was provided on create.

func (*TaskUpsertOne) UpdateNumberPasswords

func (u *TaskUpsertOne) UpdateNumberPasswords() *TaskUpsertOne

UpdateNumberPasswords sets the "number_passwords" field to the value that was provided on create.

func (*TaskUpsertOne) UpdateStatus

func (u *TaskUpsertOne) UpdateStatus() *TaskUpsertOne

UpdateStatus sets the "status" field to the value that was provided on create.

type Tasks

type Tasks []*Task

Tasks is a parsable slice of Task.

type Tx

type Tx struct {

	// CrackedPassword is the client for interacting with the CrackedPassword builders.
	CrackedPassword *CrackedPasswordClient
	// Task is the client for interacting with the Task builders.
	Task *TaskClient
	// User is the client for interacting with the User builders.
	User *UserClient
	// contains filtered or unexported fields
}

Tx is a transactional client that is created by calling Client.Tx().

func TxFromContext

func TxFromContext(ctx context.Context) *Tx

TxFromContext returns a Tx stored inside a context, or nil if there isn't one.

func (*Tx) Client

func (tx *Tx) Client() *Client

Client returns a Client that binds to current transaction.

func (*Tx) Commit

func (tx *Tx) Commit() error

Commit commits the transaction.

func (*Tx) OnCommit

func (tx *Tx) OnCommit(f CommitHook)

OnCommit adds a hook to call on commit.

func (*Tx) OnRollback

func (tx *Tx) OnRollback(f RollbackHook)

OnRollback adds a hook to call on rollback.

func (*Tx) Rollback

func (tx *Tx) Rollback() error

Rollback rollbacks the transaction.

type User

type User struct {

	// ID of the ent.
	ID uuid.UUID `json:"id,omitempty"`
	// Username holds the value of the "username" field.
	Username string `json:"username,omitempty"`
	// Enabled holds the value of the "enabled" field.
	Enabled bool `json:"enabled,omitempty"`
	// EmailAddress holds the value of the "email_address" field.
	EmailAddress string `json:"email_address,omitempty"`
	// IsSuperUser holds the value of the "is_super_user" field.
	IsSuperUser bool `json:"is_super_user,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the UserQuery when eager-loading is set.
	Edges UserEdges `json:"edges"`
	// contains filtered or unexported fields
}

User is the model entity for the User schema.

func (*User) QueryCreatedTasks

func (u *User) QueryCreatedTasks() *TaskQuery

QueryCreatedTasks queries the "created_tasks" edge of the User entity.

func (*User) String

func (u *User) String() string

String implements the fmt.Stringer.

func (*User) Unwrap

func (u *User) Unwrap() *User

Unwrap unwraps the User entity that was returned from a transaction after it was closed, so that all future queries will be executed through the driver which created the transaction.

func (*User) Update

func (u *User) Update() *UserUpdateOne

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

type UserClient

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

UserClient is a client for the User schema.

func NewUserClient

func NewUserClient(c config) *UserClient

NewUserClient returns a client for the User from the given config.

func (*UserClient) Create

func (c *UserClient) Create() *UserCreate

Create returns a create builder for User.

func (*UserClient) CreateBulk

func (c *UserClient) CreateBulk(builders ...*UserCreate) *UserCreateBulk

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

func (*UserClient) Delete

func (c *UserClient) Delete() *UserDelete

Delete returns a delete builder for User.

func (*UserClient) DeleteOne

func (c *UserClient) DeleteOne(u *User) *UserDeleteOne

DeleteOne returns a delete builder for the given entity.

func (*UserClient) DeleteOneID

func (c *UserClient) DeleteOneID(id uuid.UUID) *UserDeleteOne

DeleteOneID returns a delete builder for the given id.

func (*UserClient) Get

func (c *UserClient) Get(ctx context.Context, id uuid.UUID) (*User, error)

Get returns a User entity by its id.

func (*UserClient) GetX

func (c *UserClient) GetX(ctx context.Context, id uuid.UUID) *User

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

func (*UserClient) Hooks

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

Hooks returns the client hooks.

func (*UserClient) Query

func (c *UserClient) Query() *UserQuery

Query returns a query builder for User.

func (*UserClient) QueryCreatedTasks

func (c *UserClient) QueryCreatedTasks(u *User) *TaskQuery

QueryCreatedTasks queries the created_tasks edge of a User.

func (*UserClient) Update

func (c *UserClient) Update() *UserUpdate

Update returns an update builder for User.

func (*UserClient) UpdateOne

func (c *UserClient) UpdateOne(u *User) *UserUpdateOne

UpdateOne returns an update builder for the given entity.

func (*UserClient) UpdateOneID

func (c *UserClient) UpdateOneID(id uuid.UUID) *UserUpdateOne

UpdateOneID returns an update builder for the given id.

func (*UserClient) Use

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

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

type UserCreate

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

UserCreate is the builder for creating a User entity.

func (*UserCreate) AddCreatedTaskIDs

func (uc *UserCreate) AddCreatedTaskIDs(ids ...uuid.UUID) *UserCreate

AddCreatedTaskIDs adds the "created_tasks" edge to the Task entity by IDs.

func (*UserCreate) AddCreatedTasks

func (uc *UserCreate) AddCreatedTasks(t ...*Task) *UserCreate

AddCreatedTasks adds the "created_tasks" edges to the Task entity.

func (*UserCreate) Exec

func (uc *UserCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*UserCreate) ExecX

func (uc *UserCreate) ExecX(ctx context.Context)

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

func (*UserCreate) Mutation

func (uc *UserCreate) Mutation() *UserMutation

Mutation returns the UserMutation object of the builder.

func (*UserCreate) OnConflict

func (uc *UserCreate) OnConflict(opts ...sql.ConflictOption) *UserUpsertOne

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.User.Create().
	SetUsername(v).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.UserUpsert) {
		SetUsername(v+v).
	}).
	Exec(ctx)

func (*UserCreate) OnConflictColumns

func (uc *UserCreate) OnConflictColumns(columns ...string) *UserUpsertOne

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.User.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*UserCreate) Save

func (uc *UserCreate) Save(ctx context.Context) (*User, error)

Save creates the User in the database.

func (*UserCreate) SaveX

func (uc *UserCreate) SaveX(ctx context.Context) *User

SaveX calls Save and panics if Save returns an error.

func (*UserCreate) SetCreatedAt

func (uc *UserCreate) SetCreatedAt(t time.Time) *UserCreate

SetCreatedAt sets the "created_at" field.

func (*UserCreate) SetEmailAddress

func (uc *UserCreate) SetEmailAddress(s string) *UserCreate

SetEmailAddress sets the "email_address" field.

func (*UserCreate) SetEnabled

func (uc *UserCreate) SetEnabled(b bool) *UserCreate

SetEnabled sets the "enabled" field.

func (*UserCreate) SetID

func (uc *UserCreate) SetID(u uuid.UUID) *UserCreate

SetID sets the "id" field.

func (*UserCreate) SetIsSuperUser

func (uc *UserCreate) SetIsSuperUser(b bool) *UserCreate

SetIsSuperUser sets the "is_super_user" field.

func (*UserCreate) SetNillableCreatedAt

func (uc *UserCreate) SetNillableCreatedAt(t *time.Time) *UserCreate

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

func (*UserCreate) SetUsername

func (uc *UserCreate) SetUsername(s string) *UserCreate

SetUsername sets the "username" field.

type UserCreateBulk

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

UserCreateBulk is the builder for creating many User entities in bulk.

func (*UserCreateBulk) Exec

func (ucb *UserCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*UserCreateBulk) ExecX

func (ucb *UserCreateBulk) ExecX(ctx context.Context)

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

func (*UserCreateBulk) OnConflict

func (ucb *UserCreateBulk) OnConflict(opts ...sql.ConflictOption) *UserUpsertBulk

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.User.CreateBulk(builders...).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.UserUpsert) {
		SetUsername(v+v).
	}).
	Exec(ctx)

func (*UserCreateBulk) OnConflictColumns

func (ucb *UserCreateBulk) OnConflictColumns(columns ...string) *UserUpsertBulk

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.User.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*UserCreateBulk) Save

func (ucb *UserCreateBulk) Save(ctx context.Context) ([]*User, error)

Save creates the User entities in the database.

func (*UserCreateBulk) SaveX

func (ucb *UserCreateBulk) SaveX(ctx context.Context) []*User

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

type UserDelete

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

UserDelete is the builder for deleting a User entity.

func (*UserDelete) Exec

func (ud *UserDelete) Exec(ctx context.Context) (int, error)

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

func (*UserDelete) ExecX

func (ud *UserDelete) ExecX(ctx context.Context) int

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

func (*UserDelete) Where

func (ud *UserDelete) Where(ps ...predicate.User) *UserDelete

Where appends a list predicates to the UserDelete builder.

type UserDeleteOne

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

UserDeleteOne is the builder for deleting a single User entity.

func (*UserDeleteOne) Exec

func (udo *UserDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*UserDeleteOne) ExecX

func (udo *UserDeleteOne) ExecX(ctx context.Context)

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

type UserEdges

type UserEdges struct {
	// CreatedTasks holds the value of the created_tasks edge.
	CreatedTasks []*Task `json:"created_tasks,omitempty"`
	// contains filtered or unexported fields
}

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

func (UserEdges) CreatedTasksOrErr

func (e UserEdges) CreatedTasksOrErr() ([]*Task, error)

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

type UserFilter

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

UserFilter provides a generic filtering capability at runtime for UserQuery.

func (*UserFilter) Where

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

Where applies the entql predicate on the query filter.

func (*UserFilter) WhereCreatedAt

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

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

func (*UserFilter) WhereEmailAddress

func (f *UserFilter) WhereEmailAddress(p entql.StringP)

WhereEmailAddress applies the entql string predicate on the email_address field.

func (*UserFilter) WhereEnabled

func (f *UserFilter) WhereEnabled(p entql.BoolP)

WhereEnabled applies the entql bool predicate on the enabled field.

func (*UserFilter) WhereHasCreatedTasks

func (f *UserFilter) WhereHasCreatedTasks()

WhereHasCreatedTasks applies a predicate to check if query has an edge created_tasks.

func (*UserFilter) WhereHasCreatedTasksWith

func (f *UserFilter) WhereHasCreatedTasksWith(preds ...predicate.Task)

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

func (*UserFilter) WhereID

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

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

func (*UserFilter) WhereIsSuperUser

func (f *UserFilter) WhereIsSuperUser(p entql.BoolP)

WhereIsSuperUser applies the entql bool predicate on the is_super_user field.

func (*UserFilter) WhereUsername

func (f *UserFilter) WhereUsername(p entql.StringP)

WhereUsername applies the entql string predicate on the username field.

type UserGroupBy

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

UserGroupBy is the group-by builder for User entities.

func (*UserGroupBy) Aggregate

func (ugb *UserGroupBy) Aggregate(fns ...AggregateFunc) *UserGroupBy

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

func (*UserGroupBy) Bool

func (ugb *UserGroupBy) Bool(ctx context.Context) (_ bool, err error)

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

func (*UserGroupBy) BoolX

func (ugb *UserGroupBy) BoolX(ctx context.Context) bool

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

func (*UserGroupBy) Bools

func (ugb *UserGroupBy) Bools(ctx context.Context) ([]bool, error)

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

func (*UserGroupBy) BoolsX

func (ugb *UserGroupBy) BoolsX(ctx context.Context) []bool

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

func (*UserGroupBy) Float64

func (ugb *UserGroupBy) Float64(ctx context.Context) (_ float64, err error)

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

func (*UserGroupBy) Float64X

func (ugb *UserGroupBy) Float64X(ctx context.Context) float64

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

func (*UserGroupBy) Float64s

func (ugb *UserGroupBy) Float64s(ctx context.Context) ([]float64, error)

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

func (*UserGroupBy) Float64sX

func (ugb *UserGroupBy) Float64sX(ctx context.Context) []float64

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

func (*UserGroupBy) Int

func (ugb *UserGroupBy) Int(ctx context.Context) (_ int, err error)

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

func (*UserGroupBy) IntX

func (ugb *UserGroupBy) IntX(ctx context.Context) int

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

func (*UserGroupBy) Ints

func (ugb *UserGroupBy) Ints(ctx context.Context) ([]int, error)

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

func (*UserGroupBy) IntsX

func (ugb *UserGroupBy) IntsX(ctx context.Context) []int

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

func (*UserGroupBy) Scan

func (ugb *UserGroupBy) Scan(ctx context.Context, v interface{}) error

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

func (*UserGroupBy) ScanX

func (ugb *UserGroupBy) ScanX(ctx context.Context, v interface{})

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

func (*UserGroupBy) String

func (ugb *UserGroupBy) String(ctx context.Context) (_ string, err error)

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

func (*UserGroupBy) StringX

func (ugb *UserGroupBy) StringX(ctx context.Context) string

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

func (*UserGroupBy) Strings

func (ugb *UserGroupBy) Strings(ctx context.Context) ([]string, error)

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

func (*UserGroupBy) StringsX

func (ugb *UserGroupBy) StringsX(ctx context.Context) []string

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

type UserMutation

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

UserMutation represents an operation that mutates the User nodes in the graph.

func (*UserMutation) AddCreatedTaskIDs

func (m *UserMutation) AddCreatedTaskIDs(ids ...uuid.UUID)

AddCreatedTaskIDs adds the "created_tasks" edge to the Task entity by ids.

func (*UserMutation) AddField

func (m *UserMutation) AddField(name string, value ent.Value) error

AddField adds the value to the field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*UserMutation) AddedEdges

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

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

func (*UserMutation) AddedField

func (m *UserMutation) AddedField(name string) (ent.Value, bool)

AddedField returns the numeric value that was incremented/decremented on a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*UserMutation) AddedFields

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

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

func (*UserMutation) AddedIDs

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

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

func (*UserMutation) ClearCreatedTasks

func (m *UserMutation) ClearCreatedTasks()

ClearCreatedTasks clears the "created_tasks" edge to the Task entity.

func (*UserMutation) ClearEdge

func (m *UserMutation) ClearEdge(name string) error

ClearEdge clears the value of the edge with the given name. It returns an error if that edge is not defined in the schema.

func (*UserMutation) ClearField

func (m *UserMutation) ClearField(name string) error

ClearField clears the value of the field with the given name. It returns an error if the field is not defined in the schema.

func (*UserMutation) ClearedEdges

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

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

func (*UserMutation) ClearedFields

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

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

func (UserMutation) Client

func (m UserMutation) Client() *Client

Client returns a new `ent.Client` from the mutation. If the mutation was executed in a transaction (ent.Tx), a transactional client is returned.

func (*UserMutation) CreatedAt

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

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

func (*UserMutation) CreatedTasksCleared

func (m *UserMutation) CreatedTasksCleared() bool

CreatedTasksCleared reports if the "created_tasks" edge to the Task entity was cleared.

func (*UserMutation) CreatedTasksIDs

func (m *UserMutation) CreatedTasksIDs() (ids []uuid.UUID)

CreatedTasksIDs returns the "created_tasks" edge IDs in the mutation.

func (*UserMutation) EdgeCleared

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

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

func (*UserMutation) EmailAddress

func (m *UserMutation) EmailAddress() (r string, exists bool)

EmailAddress returns the value of the "email_address" field in the mutation.

func (*UserMutation) Enabled

func (m *UserMutation) Enabled() (r bool, exists bool)

Enabled returns the value of the "enabled" field in the mutation.

func (*UserMutation) Field

func (m *UserMutation) Field(name string) (ent.Value, bool)

Field returns the value of a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*UserMutation) FieldCleared

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

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

func (*UserMutation) Fields

func (m *UserMutation) Fields() []string

Fields returns all fields that were changed during this mutation. Note that in order to get all numeric fields that were incremented/decremented, call AddedFields().

func (*UserMutation) Filter

func (m *UserMutation) Filter() *UserFilter

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

func (*UserMutation) ID

func (m *UserMutation) ID() (id uuid.UUID, exists bool)

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

func (*UserMutation) IDs

func (m *UserMutation) IDs(ctx context.Context) ([]uuid.UUID, error)

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

func (*UserMutation) IsSuperUser

func (m *UserMutation) IsSuperUser() (r bool, exists bool)

IsSuperUser returns the value of the "is_super_user" field in the mutation.

func (*UserMutation) OldCreatedAt

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

OldCreatedAt returns the old "created_at" field's value of the User entity. If the User object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*UserMutation) OldEmailAddress

func (m *UserMutation) OldEmailAddress(ctx context.Context) (v string, err error)

OldEmailAddress returns the old "email_address" field's value of the User entity. If the User object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*UserMutation) OldEnabled

func (m *UserMutation) OldEnabled(ctx context.Context) (v bool, err error)

OldEnabled returns the old "enabled" field's value of the User entity. If the User object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*UserMutation) OldField

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

OldField returns the old value of the field from the database. An error is returned if the mutation operation is not UpdateOne, or the query to the database failed.

func (*UserMutation) OldIsSuperUser

func (m *UserMutation) OldIsSuperUser(ctx context.Context) (v bool, err error)

OldIsSuperUser returns the old "is_super_user" field's value of the User entity. If the User object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*UserMutation) OldUsername

func (m *UserMutation) OldUsername(ctx context.Context) (v string, err error)

OldUsername returns the old "username" field's value of the User entity. If the User object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*UserMutation) Op

func (m *UserMutation) Op() Op

Op returns the operation name.

func (*UserMutation) RemoveCreatedTaskIDs

func (m *UserMutation) RemoveCreatedTaskIDs(ids ...uuid.UUID)

RemoveCreatedTaskIDs removes the "created_tasks" edge to the Task entity by IDs.

func (*UserMutation) RemovedCreatedTasksIDs

func (m *UserMutation) RemovedCreatedTasksIDs() (ids []uuid.UUID)

RemovedCreatedTasks returns the removed IDs of the "created_tasks" edge to the Task entity.

func (*UserMutation) RemovedEdges

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

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

func (*UserMutation) RemovedIDs

func (m *UserMutation) RemovedIDs(name string) []ent.Value

RemovedIDs returns all IDs (to other nodes) that were removed for the edge with the given name in this mutation.

func (*UserMutation) ResetCreatedAt

func (m *UserMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*UserMutation) ResetCreatedTasks

func (m *UserMutation) ResetCreatedTasks()

ResetCreatedTasks resets all changes to the "created_tasks" edge.

func (*UserMutation) ResetEdge

func (m *UserMutation) ResetEdge(name string) error

ResetEdge resets all changes to the edge with the given name in this mutation. It returns an error if the edge is not defined in the schema.

func (*UserMutation) ResetEmailAddress

func (m *UserMutation) ResetEmailAddress()

ResetEmailAddress resets all changes to the "email_address" field.

func (*UserMutation) ResetEnabled

func (m *UserMutation) ResetEnabled()

ResetEnabled resets all changes to the "enabled" field.

func (*UserMutation) ResetField

func (m *UserMutation) ResetField(name string) error

ResetField resets all changes in the mutation for the field with the given name. It returns an error if the field is not defined in the schema.

func (*UserMutation) ResetIsSuperUser

func (m *UserMutation) ResetIsSuperUser()

ResetIsSuperUser resets all changes to the "is_super_user" field.

func (*UserMutation) ResetUsername

func (m *UserMutation) ResetUsername()

ResetUsername resets all changes to the "username" field.

func (*UserMutation) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*UserMutation) SetEmailAddress

func (m *UserMutation) SetEmailAddress(s string)

SetEmailAddress sets the "email_address" field.

func (*UserMutation) SetEnabled

func (m *UserMutation) SetEnabled(b bool)

SetEnabled sets the "enabled" field.

func (*UserMutation) SetField

func (m *UserMutation) SetField(name string, value ent.Value) error

SetField sets the value of a field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*UserMutation) SetID

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

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

func (*UserMutation) SetIsSuperUser

func (m *UserMutation) SetIsSuperUser(b bool)

SetIsSuperUser sets the "is_super_user" field.

func (*UserMutation) SetUsername

func (m *UserMutation) SetUsername(s string)

SetUsername sets the "username" field.

func (UserMutation) Tx

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

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

func (*UserMutation) Type

func (m *UserMutation) Type() string

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

func (*UserMutation) Username

func (m *UserMutation) Username() (r string, exists bool)

Username returns the value of the "username" field in the mutation.

func (*UserMutation) Where

func (m *UserMutation) Where(ps ...predicate.User)

Where appends a list predicates to the UserMutation builder.

type UserQuery

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

UserQuery is the builder for querying User entities.

func (*UserQuery) All

func (uq *UserQuery) All(ctx context.Context) ([]*User, error)

All executes the query and returns a list of Users.

func (*UserQuery) AllX

func (uq *UserQuery) AllX(ctx context.Context) []*User

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

func (*UserQuery) Clone

func (uq *UserQuery) Clone() *UserQuery

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

func (*UserQuery) Count

func (uq *UserQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*UserQuery) CountX

func (uq *UserQuery) CountX(ctx context.Context) int

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

func (*UserQuery) Exist

func (uq *UserQuery) Exist(ctx context.Context) (bool, error)

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

func (*UserQuery) ExistX

func (uq *UserQuery) ExistX(ctx context.Context) bool

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

func (*UserQuery) Filter

func (uq *UserQuery) Filter() *UserFilter

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

func (*UserQuery) First

func (uq *UserQuery) First(ctx context.Context) (*User, error)

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

func (*UserQuery) FirstID

func (uq *UserQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

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

func (*UserQuery) FirstIDX

func (uq *UserQuery) FirstIDX(ctx context.Context) uuid.UUID

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

func (*UserQuery) FirstX

func (uq *UserQuery) FirstX(ctx context.Context) *User

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

func (*UserQuery) GroupBy

func (uq *UserQuery) GroupBy(field string, fields ...string) *UserGroupBy

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

Example:

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

client.User.Query().
	GroupBy(user.FieldUsername).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*UserQuery) IDs

func (uq *UserQuery) IDs(ctx context.Context) ([]uuid.UUID, error)

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

func (*UserQuery) IDsX

func (uq *UserQuery) IDsX(ctx context.Context) []uuid.UUID

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

func (*UserQuery) Limit

func (uq *UserQuery) Limit(limit int) *UserQuery

Limit adds a limit step to the query.

func (*UserQuery) Modify

func (uq *UserQuery) Modify(modifiers ...func(s *sql.Selector)) *UserSelect

Modify adds a query modifier for attaching custom logic to queries.

func (*UserQuery) Offset

func (uq *UserQuery) Offset(offset int) *UserQuery

Offset adds an offset step to the query.

func (*UserQuery) Only

func (uq *UserQuery) Only(ctx context.Context) (*User, error)

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

func (*UserQuery) OnlyID

func (uq *UserQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

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

func (*UserQuery) OnlyIDX

func (uq *UserQuery) OnlyIDX(ctx context.Context) uuid.UUID

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

func (*UserQuery) OnlyX

func (uq *UserQuery) OnlyX(ctx context.Context) *User

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

func (*UserQuery) Order

func (uq *UserQuery) Order(o ...OrderFunc) *UserQuery

Order adds an order step to the query.

func (*UserQuery) QueryCreatedTasks

func (uq *UserQuery) QueryCreatedTasks() *TaskQuery

QueryCreatedTasks chains the current query on the "created_tasks" edge.

func (*UserQuery) Select

func (uq *UserQuery) Select(fields ...string) *UserSelect

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

Example:

var v []struct {
	Username string `json:"username,omitempty"`
}

client.User.Query().
	Select(user.FieldUsername).
	Scan(ctx, &v)

func (*UserQuery) Unique

func (uq *UserQuery) Unique(unique bool) *UserQuery

Unique configures the query builder to filter duplicate records on query. By default, unique is set to true, and can be disabled using this method.

func (*UserQuery) Where

func (uq *UserQuery) Where(ps ...predicate.User) *UserQuery

Where adds a new predicate for the UserQuery builder.

func (*UserQuery) WithCreatedTasks

func (uq *UserQuery) WithCreatedTasks(opts ...func(*TaskQuery)) *UserQuery

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

type UserSelect

type UserSelect struct {
	*UserQuery
	// contains filtered or unexported fields
}

UserSelect is the builder for selecting fields of User entities.

func (*UserSelect) Bool

func (us *UserSelect) Bool(ctx context.Context) (_ bool, err error)

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

func (*UserSelect) BoolX

func (us *UserSelect) BoolX(ctx context.Context) bool

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

func (*UserSelect) Bools

func (us *UserSelect) Bools(ctx context.Context) ([]bool, error)

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

func (*UserSelect) BoolsX

func (us *UserSelect) BoolsX(ctx context.Context) []bool

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

func (*UserSelect) Float64

func (us *UserSelect) Float64(ctx context.Context) (_ float64, err error)

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

func (*UserSelect) Float64X

func (us *UserSelect) Float64X(ctx context.Context) float64

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

func (*UserSelect) Float64s

func (us *UserSelect) Float64s(ctx context.Context) ([]float64, error)

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

func (*UserSelect) Float64sX

func (us *UserSelect) Float64sX(ctx context.Context) []float64

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

func (*UserSelect) Int

func (us *UserSelect) Int(ctx context.Context) (_ int, err error)

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

func (*UserSelect) IntX

func (us *UserSelect) IntX(ctx context.Context) int

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

func (*UserSelect) Ints

func (us *UserSelect) Ints(ctx context.Context) ([]int, error)

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

func (*UserSelect) IntsX

func (us *UserSelect) IntsX(ctx context.Context) []int

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

func (*UserSelect) Modify

func (us *UserSelect) Modify(modifiers ...func(s *sql.Selector)) *UserSelect

Modify adds a query modifier for attaching custom logic to queries.

func (*UserSelect) Scan

func (us *UserSelect) Scan(ctx context.Context, v interface{}) error

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

func (*UserSelect) ScanX

func (us *UserSelect) ScanX(ctx context.Context, v interface{})

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

func (*UserSelect) String

func (us *UserSelect) String(ctx context.Context) (_ string, err error)

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

func (*UserSelect) StringX

func (us *UserSelect) StringX(ctx context.Context) string

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

func (*UserSelect) Strings

func (us *UserSelect) Strings(ctx context.Context) ([]string, error)

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

func (*UserSelect) StringsX

func (us *UserSelect) StringsX(ctx context.Context) []string

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

type UserUpdate

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

UserUpdate is the builder for updating User entities.

func (*UserUpdate) AddCreatedTaskIDs

func (uu *UserUpdate) AddCreatedTaskIDs(ids ...uuid.UUID) *UserUpdate

AddCreatedTaskIDs adds the "created_tasks" edge to the Task entity by IDs.

func (*UserUpdate) AddCreatedTasks

func (uu *UserUpdate) AddCreatedTasks(t ...*Task) *UserUpdate

AddCreatedTasks adds the "created_tasks" edges to the Task entity.

func (*UserUpdate) ClearCreatedTasks

func (uu *UserUpdate) ClearCreatedTasks() *UserUpdate

ClearCreatedTasks clears all "created_tasks" edges to the Task entity.

func (*UserUpdate) Exec

func (uu *UserUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*UserUpdate) ExecX

func (uu *UserUpdate) ExecX(ctx context.Context)

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

func (*UserUpdate) Mutation

func (uu *UserUpdate) Mutation() *UserMutation

Mutation returns the UserMutation object of the builder.

func (*UserUpdate) RemoveCreatedTaskIDs

func (uu *UserUpdate) RemoveCreatedTaskIDs(ids ...uuid.UUID) *UserUpdate

RemoveCreatedTaskIDs removes the "created_tasks" edge to Task entities by IDs.

func (*UserUpdate) RemoveCreatedTasks

func (uu *UserUpdate) RemoveCreatedTasks(t ...*Task) *UserUpdate

RemoveCreatedTasks removes "created_tasks" edges to Task entities.

func (*UserUpdate) Save

func (uu *UserUpdate) Save(ctx context.Context) (int, error)

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

func (*UserUpdate) SaveX

func (uu *UserUpdate) SaveX(ctx context.Context) int

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

func (*UserUpdate) SetEmailAddress

func (uu *UserUpdate) SetEmailAddress(s string) *UserUpdate

SetEmailAddress sets the "email_address" field.

func (*UserUpdate) SetEnabled

func (uu *UserUpdate) SetEnabled(b bool) *UserUpdate

SetEnabled sets the "enabled" field.

func (*UserUpdate) SetIsSuperUser

func (uu *UserUpdate) SetIsSuperUser(b bool) *UserUpdate

SetIsSuperUser sets the "is_super_user" field.

func (*UserUpdate) SetUsername

func (uu *UserUpdate) SetUsername(s string) *UserUpdate

SetUsername sets the "username" field.

func (*UserUpdate) Where

func (uu *UserUpdate) Where(ps ...predicate.User) *UserUpdate

Where appends a list predicates to the UserUpdate builder.

type UserUpdateOne

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

UserUpdateOne is the builder for updating a single User entity.

func (*UserUpdateOne) AddCreatedTaskIDs

func (uuo *UserUpdateOne) AddCreatedTaskIDs(ids ...uuid.UUID) *UserUpdateOne

AddCreatedTaskIDs adds the "created_tasks" edge to the Task entity by IDs.

func (*UserUpdateOne) AddCreatedTasks

func (uuo *UserUpdateOne) AddCreatedTasks(t ...*Task) *UserUpdateOne

AddCreatedTasks adds the "created_tasks" edges to the Task entity.

func (*UserUpdateOne) ClearCreatedTasks

func (uuo *UserUpdateOne) ClearCreatedTasks() *UserUpdateOne

ClearCreatedTasks clears all "created_tasks" edges to the Task entity.

func (*UserUpdateOne) Exec

func (uuo *UserUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*UserUpdateOne) ExecX

func (uuo *UserUpdateOne) ExecX(ctx context.Context)

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

func (*UserUpdateOne) Mutation

func (uuo *UserUpdateOne) Mutation() *UserMutation

Mutation returns the UserMutation object of the builder.

func (*UserUpdateOne) RemoveCreatedTaskIDs

func (uuo *UserUpdateOne) RemoveCreatedTaskIDs(ids ...uuid.UUID) *UserUpdateOne

RemoveCreatedTaskIDs removes the "created_tasks" edge to Task entities by IDs.

func (*UserUpdateOne) RemoveCreatedTasks

func (uuo *UserUpdateOne) RemoveCreatedTasks(t ...*Task) *UserUpdateOne

RemoveCreatedTasks removes "created_tasks" edges to Task entities.

func (*UserUpdateOne) Save

func (uuo *UserUpdateOne) Save(ctx context.Context) (*User, error)

Save executes the query and returns the updated User entity.

func (*UserUpdateOne) SaveX

func (uuo *UserUpdateOne) SaveX(ctx context.Context) *User

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

func (*UserUpdateOne) Select

func (uuo *UserUpdateOne) Select(field string, fields ...string) *UserUpdateOne

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

func (*UserUpdateOne) SetEmailAddress

func (uuo *UserUpdateOne) SetEmailAddress(s string) *UserUpdateOne

SetEmailAddress sets the "email_address" field.

func (*UserUpdateOne) SetEnabled

func (uuo *UserUpdateOne) SetEnabled(b bool) *UserUpdateOne

SetEnabled sets the "enabled" field.

func (*UserUpdateOne) SetIsSuperUser

func (uuo *UserUpdateOne) SetIsSuperUser(b bool) *UserUpdateOne

SetIsSuperUser sets the "is_super_user" field.

func (*UserUpdateOne) SetUsername

func (uuo *UserUpdateOne) SetUsername(s string) *UserUpdateOne

SetUsername sets the "username" field.

type UserUpsert

type UserUpsert struct {
	*sql.UpdateSet
}

UserUpsert is the "OnConflict" setter.

func (*UserUpsert) SetCreatedAt

func (u *UserUpsert) SetCreatedAt(v time.Time) *UserUpsert

SetCreatedAt sets the "created_at" field.

func (*UserUpsert) SetEmailAddress

func (u *UserUpsert) SetEmailAddress(v string) *UserUpsert

SetEmailAddress sets the "email_address" field.

func (*UserUpsert) SetEnabled

func (u *UserUpsert) SetEnabled(v bool) *UserUpsert

SetEnabled sets the "enabled" field.

func (*UserUpsert) SetIsSuperUser

func (u *UserUpsert) SetIsSuperUser(v bool) *UserUpsert

SetIsSuperUser sets the "is_super_user" field.

func (*UserUpsert) SetUsername

func (u *UserUpsert) SetUsername(v string) *UserUpsert

SetUsername sets the "username" field.

func (*UserUpsert) UpdateCreatedAt

func (u *UserUpsert) UpdateCreatedAt() *UserUpsert

UpdateCreatedAt sets the "created_at" field to the value that was provided on create.

func (*UserUpsert) UpdateEmailAddress

func (u *UserUpsert) UpdateEmailAddress() *UserUpsert

UpdateEmailAddress sets the "email_address" field to the value that was provided on create.

func (*UserUpsert) UpdateEnabled

func (u *UserUpsert) UpdateEnabled() *UserUpsert

UpdateEnabled sets the "enabled" field to the value that was provided on create.

func (*UserUpsert) UpdateIsSuperUser

func (u *UserUpsert) UpdateIsSuperUser() *UserUpsert

UpdateIsSuperUser sets the "is_super_user" field to the value that was provided on create.

func (*UserUpsert) UpdateUsername

func (u *UserUpsert) UpdateUsername() *UserUpsert

UpdateUsername sets the "username" field to the value that was provided on create.

type UserUpsertBulk

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

UserUpsertBulk is the builder for "upsert"-ing a bulk of User nodes.

func (*UserUpsertBulk) DoNothing

func (u *UserUpsertBulk) DoNothing() *UserUpsertBulk

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*UserUpsertBulk) Exec

func (u *UserUpsertBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*UserUpsertBulk) ExecX

func (u *UserUpsertBulk) ExecX(ctx context.Context)

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

func (*UserUpsertBulk) Ignore

func (u *UserUpsertBulk) Ignore() *UserUpsertBulk

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.User.Create().
	OnConflict(sql.ResolveWithIgnore()).
	Exec(ctx)

func (*UserUpsertBulk) SetCreatedAt

func (u *UserUpsertBulk) SetCreatedAt(v time.Time) *UserUpsertBulk

SetCreatedAt sets the "created_at" field.

func (*UserUpsertBulk) SetEmailAddress

func (u *UserUpsertBulk) SetEmailAddress(v string) *UserUpsertBulk

SetEmailAddress sets the "email_address" field.

func (*UserUpsertBulk) SetEnabled

func (u *UserUpsertBulk) SetEnabled(v bool) *UserUpsertBulk

SetEnabled sets the "enabled" field.

func (*UserUpsertBulk) SetIsSuperUser

func (u *UserUpsertBulk) SetIsSuperUser(v bool) *UserUpsertBulk

SetIsSuperUser sets the "is_super_user" field.

func (*UserUpsertBulk) SetUsername

func (u *UserUpsertBulk) SetUsername(v string) *UserUpsertBulk

SetUsername sets the "username" field.

func (*UserUpsertBulk) Update

func (u *UserUpsertBulk) Update(set func(*UserUpsert)) *UserUpsertBulk

Update allows overriding fields `UPDATE` values. See the UserCreateBulk.OnConflict documentation for more info.

func (*UserUpsertBulk) UpdateCreatedAt

func (u *UserUpsertBulk) UpdateCreatedAt() *UserUpsertBulk

UpdateCreatedAt sets the "created_at" field to the value that was provided on create.

func (*UserUpsertBulk) UpdateEmailAddress

func (u *UserUpsertBulk) UpdateEmailAddress() *UserUpsertBulk

UpdateEmailAddress sets the "email_address" field to the value that was provided on create.

func (*UserUpsertBulk) UpdateEnabled

func (u *UserUpsertBulk) UpdateEnabled() *UserUpsertBulk

UpdateEnabled sets the "enabled" field to the value that was provided on create.

func (*UserUpsertBulk) UpdateIsSuperUser

func (u *UserUpsertBulk) UpdateIsSuperUser() *UserUpsertBulk

UpdateIsSuperUser sets the "is_super_user" field to the value that was provided on create.

func (*UserUpsertBulk) UpdateNewValues

func (u *UserUpsertBulk) UpdateNewValues() *UserUpsertBulk

UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:

client.User.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
		sql.ResolveWith(func(u *sql.UpdateSet) {
			u.SetIgnore(user.FieldID)
		}),
	).
	Exec(ctx)

func (*UserUpsertBulk) UpdateUsername

func (u *UserUpsertBulk) UpdateUsername() *UserUpsertBulk

UpdateUsername sets the "username" field to the value that was provided on create.

type UserUpsertOne

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

UserUpsertOne is the builder for "upsert"-ing

one User node.

func (*UserUpsertOne) DoNothing

func (u *UserUpsertOne) DoNothing() *UserUpsertOne

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*UserUpsertOne) Exec

func (u *UserUpsertOne) Exec(ctx context.Context) error

Exec executes the query.

func (*UserUpsertOne) ExecX

func (u *UserUpsertOne) ExecX(ctx context.Context)

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

func (*UserUpsertOne) ID

func (u *UserUpsertOne) ID(ctx context.Context) (id uuid.UUID, err error)

Exec executes the UPSERT query and returns the inserted/updated ID.

func (*UserUpsertOne) IDX

func (u *UserUpsertOne) IDX(ctx context.Context) uuid.UUID

IDX is like ID, but panics if an error occurs.

func (*UserUpsertOne) Ignore

func (u *UserUpsertOne) Ignore() *UserUpsertOne

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.User.Create().
    OnConflict(sql.ResolveWithIgnore()).
    Exec(ctx)

func (*UserUpsertOne) SetCreatedAt

func (u *UserUpsertOne) SetCreatedAt(v time.Time) *UserUpsertOne

SetCreatedAt sets the "created_at" field.

func (*UserUpsertOne) SetEmailAddress

func (u *UserUpsertOne) SetEmailAddress(v string) *UserUpsertOne

SetEmailAddress sets the "email_address" field.

func (*UserUpsertOne) SetEnabled

func (u *UserUpsertOne) SetEnabled(v bool) *UserUpsertOne

SetEnabled sets the "enabled" field.

func (*UserUpsertOne) SetIsSuperUser

func (u *UserUpsertOne) SetIsSuperUser(v bool) *UserUpsertOne

SetIsSuperUser sets the "is_super_user" field.

func (*UserUpsertOne) SetUsername

func (u *UserUpsertOne) SetUsername(v string) *UserUpsertOne

SetUsername sets the "username" field.

func (*UserUpsertOne) Update

func (u *UserUpsertOne) Update(set func(*UserUpsert)) *UserUpsertOne

Update allows overriding fields `UPDATE` values. See the UserCreate.OnConflict documentation for more info.

func (*UserUpsertOne) UpdateCreatedAt

func (u *UserUpsertOne) UpdateCreatedAt() *UserUpsertOne

UpdateCreatedAt sets the "created_at" field to the value that was provided on create.

func (*UserUpsertOne) UpdateEmailAddress

func (u *UserUpsertOne) UpdateEmailAddress() *UserUpsertOne

UpdateEmailAddress sets the "email_address" field to the value that was provided on create.

func (*UserUpsertOne) UpdateEnabled

func (u *UserUpsertOne) UpdateEnabled() *UserUpsertOne

UpdateEnabled sets the "enabled" field to the value that was provided on create.

func (*UserUpsertOne) UpdateIsSuperUser

func (u *UserUpsertOne) UpdateIsSuperUser() *UserUpsertOne

UpdateIsSuperUser sets the "is_super_user" field to the value that was provided on create.

func (*UserUpsertOne) UpdateNewValues

func (u *UserUpsertOne) UpdateNewValues() *UserUpsertOne

UpdateNewValues updates the mutable fields using the new values that were set on create except the ID field. Using this option is equivalent to using:

client.User.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
		sql.ResolveWith(func(u *sql.UpdateSet) {
			u.SetIgnore(user.FieldID)
		}),
	).
	Exec(ctx)

func (*UserUpsertOne) UpdateUsername

func (u *UserUpsertOne) UpdateUsername() *UserUpsertOne

UpdateUsername sets the "username" field to the value that was provided on create.

type Users

type Users []*User

Users is a parsable slice of User.

type ValidationError

type ValidationError struct {
	Name string // Field or edge name.
	// contains filtered or unexported fields
}

ValidationError returns when validating a field or edge fails.

func (*ValidationError) Error

func (e *ValidationError) Error() string

Error implements the error interface.

func (*ValidationError) Unwrap

func (e *ValidationError) Unwrap() error

Unwrap implements the errors.Wrapper interface.

type Value

type Value = ent.Value

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL