ent

package
v0.0.0-...-6d1408b Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2022 License: MIT Imports: 22 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.
	TypeSubmission   = "Submission"
	TypeSubscription = "Subscription"
	TypeToken        = "Token"
	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
	// Submission is the client for interacting with the Submission builders.
	Submission *SubmissionClient
	// Subscription is the client for interacting with the Subscription builders.
	Subscription *SubscriptionClient
	// Token is the client for interacting with the Token builders.
	Token *TokenClient
	// 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().
	Submission.
	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 Commit method.

type ConstraintError

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

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

func (ConstraintError) Error

func (e ConstraintError) Error() string

Error implements the error interface.

func (*ConstraintError) Unwrap

func (e *ConstraintError) Unwrap() error

Unwrap implements the errors.Wrapper interface.

type 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 Rollback method.

type Submission

type Submission struct {

	// ID of the ent.
	ID uuid.UUID `json:"id,omitempty"`
	// SourceLanguage holds the value of the "source_language" field.
	SourceLanguage string `json:"source_language,omitempty"`
	// TargetLanguage holds the value of the "target_language" field.
	TargetLanguage string `json:"target_language,omitempty"`
	// IsInline holds the value of the "is_inline" field.
	IsInline bool `json:"is_inline,omitempty"`
	// IsPublic holds the value of the "is_public" field.
	IsPublic bool `json:"is_public,omitempty"`
	// Status holds the value of the "status" field.
	Status submission.Status `json:"status,omitempty"`
	// Reason holds the value of the "reason" field.
	Reason string `json:"reason,omitempty"`
	// GitRepo holds the value of the "git_repo" field.
	GitRepo string `json:"git_repo,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// ShareID holds the value of the "share_id" field.
	ShareID string `json:"share_id,omitempty"`
	// SubmissionSourceSizeBytes holds the value of the "submission_source_size_bytes" field.
	SubmissionSourceSizeBytes int `json:"submission_source_size_bytes,omitempty"`
	// SubmissionTargetSizeBytes holds the value of the "submission_target_size_bytes" field.
	SubmissionTargetSizeBytes int `json:"submission_target_size_bytes,omitempty"`
	// ProcessingStartedAt holds the value of the "processing_started_at" field.
	ProcessingStartedAt time.Time `json:"processing_started_at,omitempty"`
	// ProcessingFinishedAt holds the value of the "processing_finished_at" field.
	ProcessingFinishedAt time.Time `json:"processing_finished_at,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the SubmissionQuery when eager-loading is set.
	Edges SubmissionEdges `json:"edges"`
	// contains filtered or unexported fields
}

Submission is the model entity for the Submission schema.

func (*Submission) QueryUser

func (s *Submission) QueryUser() *UserQuery

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

func (*Submission) String

func (s *Submission) String() string

String implements the fmt.Stringer.

func (*Submission) Unwrap

func (s *Submission) Unwrap() *Submission

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

func (s *Submission) Update() *SubmissionUpdateOne

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

type SubmissionClient

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

SubmissionClient is a client for the Submission schema.

func NewSubmissionClient

func NewSubmissionClient(c config) *SubmissionClient

NewSubmissionClient returns a client for the Submission from the given config.

func (*SubmissionClient) Create

func (c *SubmissionClient) Create() *SubmissionCreate

Create returns a create builder for Submission.

func (*SubmissionClient) CreateBulk

func (c *SubmissionClient) CreateBulk(builders ...*SubmissionCreate) *SubmissionCreateBulk

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

func (*SubmissionClient) Delete

func (c *SubmissionClient) Delete() *SubmissionDelete

Delete returns a delete builder for Submission.

func (*SubmissionClient) DeleteOne

DeleteOne returns a delete builder for the given entity.

func (*SubmissionClient) DeleteOneID

func (c *SubmissionClient) DeleteOneID(id uuid.UUID) *SubmissionDeleteOne

DeleteOneID returns a delete builder for the given id.

func (*SubmissionClient) Get

Get returns a Submission entity by its id.

func (*SubmissionClient) GetX

func (c *SubmissionClient) GetX(ctx context.Context, id uuid.UUID) *Submission

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

func (*SubmissionClient) Hooks

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

Hooks returns the client hooks.

func (*SubmissionClient) Query

func (c *SubmissionClient) Query() *SubmissionQuery

Query returns a query builder for Submission.

func (*SubmissionClient) QueryUser

func (c *SubmissionClient) QueryUser(s *Submission) *UserQuery

QueryUser queries the user edge of a Submission.

func (*SubmissionClient) Update

func (c *SubmissionClient) Update() *SubmissionUpdate

Update returns an update builder for Submission.

func (*SubmissionClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*SubmissionClient) UpdateOneID

func (c *SubmissionClient) UpdateOneID(id uuid.UUID) *SubmissionUpdateOne

UpdateOneID returns an update builder for the given id.

func (*SubmissionClient) Use

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

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

type SubmissionCreate

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

SubmissionCreate is the builder for creating a Submission entity.

func (*SubmissionCreate) Exec

func (sc *SubmissionCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*SubmissionCreate) ExecX

func (sc *SubmissionCreate) ExecX(ctx context.Context)

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

func (*SubmissionCreate) Mutation

func (sc *SubmissionCreate) Mutation() *SubmissionMutation

Mutation returns the SubmissionMutation object of the builder.

func (*SubmissionCreate) OnConflict

func (sc *SubmissionCreate) OnConflict(opts ...sql.ConflictOption) *SubmissionUpsertOne

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

client.Submission.Create().
	SetSourceLanguage(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.SubmissionUpsert) {
		SetSourceLanguage(v+v).
	}).
	Exec(ctx)

func (*SubmissionCreate) OnConflictColumns

func (sc *SubmissionCreate) OnConflictColumns(columns ...string) *SubmissionUpsertOne

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

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

func (*SubmissionCreate) Save

func (sc *SubmissionCreate) Save(ctx context.Context) (*Submission, error)

Save creates the Submission in the database.

func (*SubmissionCreate) SaveX

func (sc *SubmissionCreate) SaveX(ctx context.Context) *Submission

SaveX calls Save and panics if Save returns an error.

func (*SubmissionCreate) SetCreatedAt

func (sc *SubmissionCreate) SetCreatedAt(t time.Time) *SubmissionCreate

SetCreatedAt sets the "created_at" field.

func (*SubmissionCreate) SetGitRepo

func (sc *SubmissionCreate) SetGitRepo(s string) *SubmissionCreate

SetGitRepo sets the "git_repo" field.

func (*SubmissionCreate) SetID

SetID sets the "id" field.

func (*SubmissionCreate) SetIsInline

func (sc *SubmissionCreate) SetIsInline(b bool) *SubmissionCreate

SetIsInline sets the "is_inline" field.

func (*SubmissionCreate) SetIsPublic

func (sc *SubmissionCreate) SetIsPublic(b bool) *SubmissionCreate

SetIsPublic sets the "is_public" field.

func (*SubmissionCreate) SetNillableCreatedAt

func (sc *SubmissionCreate) SetNillableCreatedAt(t *time.Time) *SubmissionCreate

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

func (*SubmissionCreate) SetNillableGitRepo

func (sc *SubmissionCreate) SetNillableGitRepo(s *string) *SubmissionCreate

SetNillableGitRepo sets the "git_repo" field if the given value is not nil.

func (*SubmissionCreate) SetNillableID

func (sc *SubmissionCreate) SetNillableID(u *uuid.UUID) *SubmissionCreate

SetNillableID sets the "id" field if the given value is not nil.

func (*SubmissionCreate) SetNillableIsInline

func (sc *SubmissionCreate) SetNillableIsInline(b *bool) *SubmissionCreate

SetNillableIsInline sets the "is_inline" field if the given value is not nil.

func (*SubmissionCreate) SetNillableIsPublic

func (sc *SubmissionCreate) SetNillableIsPublic(b *bool) *SubmissionCreate

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

func (*SubmissionCreate) SetNillableProcessingFinishedAt

func (sc *SubmissionCreate) SetNillableProcessingFinishedAt(t *time.Time) *SubmissionCreate

SetNillableProcessingFinishedAt sets the "processing_finished_at" field if the given value is not nil.

func (*SubmissionCreate) SetNillableProcessingStartedAt

func (sc *SubmissionCreate) SetNillableProcessingStartedAt(t *time.Time) *SubmissionCreate

SetNillableProcessingStartedAt sets the "processing_started_at" field if the given value is not nil.

func (*SubmissionCreate) SetNillableReason

func (sc *SubmissionCreate) SetNillableReason(s *string) *SubmissionCreate

SetNillableReason sets the "reason" field if the given value is not nil.

func (*SubmissionCreate) SetNillableShareID

func (sc *SubmissionCreate) SetNillableShareID(s *string) *SubmissionCreate

SetNillableShareID sets the "share_id" field if the given value is not nil.

func (*SubmissionCreate) SetNillableStatus

func (sc *SubmissionCreate) SetNillableStatus(s *submission.Status) *SubmissionCreate

SetNillableStatus sets the "status" field if the given value is not nil.

func (*SubmissionCreate) SetNillableSubmissionSourceSizeBytes

func (sc *SubmissionCreate) SetNillableSubmissionSourceSizeBytes(i *int) *SubmissionCreate

SetNillableSubmissionSourceSizeBytes sets the "submission_source_size_bytes" field if the given value is not nil.

func (*SubmissionCreate) SetNillableSubmissionTargetSizeBytes

func (sc *SubmissionCreate) SetNillableSubmissionTargetSizeBytes(i *int) *SubmissionCreate

SetNillableSubmissionTargetSizeBytes sets the "submission_target_size_bytes" field if the given value is not nil.

func (*SubmissionCreate) SetProcessingFinishedAt

func (sc *SubmissionCreate) SetProcessingFinishedAt(t time.Time) *SubmissionCreate

SetProcessingFinishedAt sets the "processing_finished_at" field.

func (*SubmissionCreate) SetProcessingStartedAt

func (sc *SubmissionCreate) SetProcessingStartedAt(t time.Time) *SubmissionCreate

SetProcessingStartedAt sets the "processing_started_at" field.

func (*SubmissionCreate) SetReason

func (sc *SubmissionCreate) SetReason(s string) *SubmissionCreate

SetReason sets the "reason" field.

func (*SubmissionCreate) SetShareID

func (sc *SubmissionCreate) SetShareID(s string) *SubmissionCreate

SetShareID sets the "share_id" field.

func (*SubmissionCreate) SetSourceLanguage

func (sc *SubmissionCreate) SetSourceLanguage(s string) *SubmissionCreate

SetSourceLanguage sets the "source_language" field.

func (*SubmissionCreate) SetStatus

SetStatus sets the "status" field.

func (*SubmissionCreate) SetSubmissionSourceSizeBytes

func (sc *SubmissionCreate) SetSubmissionSourceSizeBytes(i int) *SubmissionCreate

SetSubmissionSourceSizeBytes sets the "submission_source_size_bytes" field.

func (*SubmissionCreate) SetSubmissionTargetSizeBytes

func (sc *SubmissionCreate) SetSubmissionTargetSizeBytes(i int) *SubmissionCreate

SetSubmissionTargetSizeBytes sets the "submission_target_size_bytes" field.

func (*SubmissionCreate) SetTargetLanguage

func (sc *SubmissionCreate) SetTargetLanguage(s string) *SubmissionCreate

SetTargetLanguage sets the "target_language" field.

func (*SubmissionCreate) SetUser

func (sc *SubmissionCreate) SetUser(u *User) *SubmissionCreate

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

func (*SubmissionCreate) SetUserID

func (sc *SubmissionCreate) SetUserID(id uuid.UUID) *SubmissionCreate

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

type SubmissionCreateBulk

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

SubmissionCreateBulk is the builder for creating many Submission entities in bulk.

func (*SubmissionCreateBulk) Exec

func (scb *SubmissionCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*SubmissionCreateBulk) ExecX

func (scb *SubmissionCreateBulk) ExecX(ctx context.Context)

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

func (*SubmissionCreateBulk) OnConflict

func (scb *SubmissionCreateBulk) OnConflict(opts ...sql.ConflictOption) *SubmissionUpsertBulk

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

client.Submission.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.SubmissionUpsert) {
		SetSourceLanguage(v+v).
	}).
	Exec(ctx)

func (*SubmissionCreateBulk) OnConflictColumns

func (scb *SubmissionCreateBulk) OnConflictColumns(columns ...string) *SubmissionUpsertBulk

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

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

func (*SubmissionCreateBulk) Save

func (scb *SubmissionCreateBulk) Save(ctx context.Context) ([]*Submission, error)

Save creates the Submission entities in the database.

func (*SubmissionCreateBulk) SaveX

func (scb *SubmissionCreateBulk) SaveX(ctx context.Context) []*Submission

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

type SubmissionDelete

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

SubmissionDelete is the builder for deleting a Submission entity.

func (*SubmissionDelete) Exec

func (sd *SubmissionDelete) Exec(ctx context.Context) (int, error)

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

func (*SubmissionDelete) ExecX

func (sd *SubmissionDelete) ExecX(ctx context.Context) int

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

func (*SubmissionDelete) Where

Where appends a list predicates to the SubmissionDelete builder.

type SubmissionDeleteOne

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

SubmissionDeleteOne is the builder for deleting a single Submission entity.

func (*SubmissionDeleteOne) Exec

func (sdo *SubmissionDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*SubmissionDeleteOne) ExecX

func (sdo *SubmissionDeleteOne) ExecX(ctx context.Context)

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

type SubmissionEdges

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

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

func (SubmissionEdges) UserOrErr

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

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

type SubmissionGroupBy

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

SubmissionGroupBy is the group-by builder for Submission entities.

func (*SubmissionGroupBy) Aggregate

func (sgb *SubmissionGroupBy) Aggregate(fns ...AggregateFunc) *SubmissionGroupBy

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

func (*SubmissionGroupBy) Bool

func (sgb *SubmissionGroupBy) 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 (*SubmissionGroupBy) BoolX

func (sgb *SubmissionGroupBy) BoolX(ctx context.Context) bool

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

func (*SubmissionGroupBy) Bools

func (sgb *SubmissionGroupBy) 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 (*SubmissionGroupBy) BoolsX

func (sgb *SubmissionGroupBy) BoolsX(ctx context.Context) []bool

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

func (*SubmissionGroupBy) Float64

func (sgb *SubmissionGroupBy) 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 (*SubmissionGroupBy) Float64X

func (sgb *SubmissionGroupBy) Float64X(ctx context.Context) float64

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

func (*SubmissionGroupBy) Float64s

func (sgb *SubmissionGroupBy) 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 (*SubmissionGroupBy) Float64sX

func (sgb *SubmissionGroupBy) Float64sX(ctx context.Context) []float64

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

func (*SubmissionGroupBy) Int

func (sgb *SubmissionGroupBy) 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 (*SubmissionGroupBy) IntX

func (sgb *SubmissionGroupBy) IntX(ctx context.Context) int

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

func (*SubmissionGroupBy) Ints

func (sgb *SubmissionGroupBy) 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 (*SubmissionGroupBy) IntsX

func (sgb *SubmissionGroupBy) IntsX(ctx context.Context) []int

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

func (*SubmissionGroupBy) Scan

func (sgb *SubmissionGroupBy) Scan(ctx context.Context, v interface{}) error

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

func (*SubmissionGroupBy) ScanX

func (sgb *SubmissionGroupBy) ScanX(ctx context.Context, v interface{})

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

func (*SubmissionGroupBy) String

func (sgb *SubmissionGroupBy) 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 (*SubmissionGroupBy) StringX

func (sgb *SubmissionGroupBy) StringX(ctx context.Context) string

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

func (*SubmissionGroupBy) Strings

func (sgb *SubmissionGroupBy) 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 (*SubmissionGroupBy) StringsX

func (sgb *SubmissionGroupBy) StringsX(ctx context.Context) []string

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

type SubmissionMutation

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

SubmissionMutation represents an operation that mutates the Submission nodes in the graph.

func (*SubmissionMutation) AddField

func (m *SubmissionMutation) 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 (*SubmissionMutation) AddSubmissionSourceSizeBytes

func (m *SubmissionMutation) AddSubmissionSourceSizeBytes(i int)

AddSubmissionSourceSizeBytes adds i to the "submission_source_size_bytes" field.

func (*SubmissionMutation) AddSubmissionTargetSizeBytes

func (m *SubmissionMutation) AddSubmissionTargetSizeBytes(i int)

AddSubmissionTargetSizeBytes adds i to the "submission_target_size_bytes" field.

func (*SubmissionMutation) AddedEdges

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

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

func (*SubmissionMutation) AddedField

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

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

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

func (*SubmissionMutation) AddedIDs

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

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

func (*SubmissionMutation) AddedSubmissionSourceSizeBytes

func (m *SubmissionMutation) AddedSubmissionSourceSizeBytes() (r int, exists bool)

AddedSubmissionSourceSizeBytes returns the value that was added to the "submission_source_size_bytes" field in this mutation.

func (*SubmissionMutation) AddedSubmissionTargetSizeBytes

func (m *SubmissionMutation) AddedSubmissionTargetSizeBytes() (r int, exists bool)

AddedSubmissionTargetSizeBytes returns the value that was added to the "submission_target_size_bytes" field in this mutation.

func (*SubmissionMutation) ClearEdge

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

func (m *SubmissionMutation) 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 (*SubmissionMutation) ClearGitRepo

func (m *SubmissionMutation) ClearGitRepo()

ClearGitRepo clears the value of the "git_repo" field.

func (*SubmissionMutation) ClearProcessingFinishedAt

func (m *SubmissionMutation) ClearProcessingFinishedAt()

ClearProcessingFinishedAt clears the value of the "processing_finished_at" field.

func (*SubmissionMutation) ClearProcessingStartedAt

func (m *SubmissionMutation) ClearProcessingStartedAt()

ClearProcessingStartedAt clears the value of the "processing_started_at" field.

func (*SubmissionMutation) ClearReason

func (m *SubmissionMutation) ClearReason()

ClearReason clears the value of the "reason" field.

func (*SubmissionMutation) ClearShareID

func (m *SubmissionMutation) ClearShareID()

ClearShareID clears the value of the "share_id" field.

func (*SubmissionMutation) ClearUser

func (m *SubmissionMutation) ClearUser()

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

func (*SubmissionMutation) ClearedEdges

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

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

func (*SubmissionMutation) ClearedFields

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

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

func (SubmissionMutation) Client

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

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

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

func (*SubmissionMutation) EdgeCleared

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

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

func (*SubmissionMutation) Field

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

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

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

func (*SubmissionMutation) Fields

func (m *SubmissionMutation) 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 (*SubmissionMutation) GitRepo

func (m *SubmissionMutation) GitRepo() (r string, exists bool)

GitRepo returns the value of the "git_repo" field in the mutation.

func (*SubmissionMutation) GitRepoCleared

func (m *SubmissionMutation) GitRepoCleared() bool

GitRepoCleared returns if the "git_repo" field was cleared in this mutation.

func (*SubmissionMutation) ID

func (m *SubmissionMutation) 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 (*SubmissionMutation) IDs

func (m *SubmissionMutation) 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 (*SubmissionMutation) IsInline

func (m *SubmissionMutation) IsInline() (r bool, exists bool)

IsInline returns the value of the "is_inline" field in the mutation.

func (*SubmissionMutation) IsPublic

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

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

func (*SubmissionMutation) OldCreatedAt

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

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

func (m *SubmissionMutation) 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 (*SubmissionMutation) OldGitRepo

func (m *SubmissionMutation) OldGitRepo(ctx context.Context) (v string, err error)

OldGitRepo returns the old "git_repo" field's value of the Submission entity. If the Submission 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 (*SubmissionMutation) OldIsInline

func (m *SubmissionMutation) OldIsInline(ctx context.Context) (v bool, err error)

OldIsInline returns the old "is_inline" field's value of the Submission entity. If the Submission 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 (*SubmissionMutation) OldIsPublic

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

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

func (m *SubmissionMutation) OldProcessingFinishedAt(ctx context.Context) (v time.Time, err error)

OldProcessingFinishedAt returns the old "processing_finished_at" field's value of the Submission entity. If the Submission 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 (*SubmissionMutation) OldProcessingStartedAt

func (m *SubmissionMutation) OldProcessingStartedAt(ctx context.Context) (v time.Time, err error)

OldProcessingStartedAt returns the old "processing_started_at" field's value of the Submission entity. If the Submission 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 (*SubmissionMutation) OldReason

func (m *SubmissionMutation) OldReason(ctx context.Context) (v string, err error)

OldReason returns the old "reason" field's value of the Submission entity. If the Submission 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 (*SubmissionMutation) OldShareID

func (m *SubmissionMutation) OldShareID(ctx context.Context) (v string, err error)

OldShareID returns the old "share_id" field's value of the Submission entity. If the Submission 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 (*SubmissionMutation) OldSourceLanguage

func (m *SubmissionMutation) OldSourceLanguage(ctx context.Context) (v string, err error)

OldSourceLanguage returns the old "source_language" field's value of the Submission entity. If the Submission 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 (*SubmissionMutation) OldStatus

func (m *SubmissionMutation) OldStatus(ctx context.Context) (v submission.Status, err error)

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

func (m *SubmissionMutation) OldSubmissionSourceSizeBytes(ctx context.Context) (v int, err error)

OldSubmissionSourceSizeBytes returns the old "submission_source_size_bytes" field's value of the Submission entity. If the Submission 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 (*SubmissionMutation) OldSubmissionTargetSizeBytes

func (m *SubmissionMutation) OldSubmissionTargetSizeBytes(ctx context.Context) (v int, err error)

OldSubmissionTargetSizeBytes returns the old "submission_target_size_bytes" field's value of the Submission entity. If the Submission 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 (*SubmissionMutation) OldTargetLanguage

func (m *SubmissionMutation) OldTargetLanguage(ctx context.Context) (v string, err error)

OldTargetLanguage returns the old "target_language" field's value of the Submission entity. If the Submission 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 (*SubmissionMutation) Op

func (m *SubmissionMutation) Op() Op

Op returns the operation name.

func (*SubmissionMutation) ProcessingFinishedAt

func (m *SubmissionMutation) ProcessingFinishedAt() (r time.Time, exists bool)

ProcessingFinishedAt returns the value of the "processing_finished_at" field in the mutation.

func (*SubmissionMutation) ProcessingFinishedAtCleared

func (m *SubmissionMutation) ProcessingFinishedAtCleared() bool

ProcessingFinishedAtCleared returns if the "processing_finished_at" field was cleared in this mutation.

func (*SubmissionMutation) ProcessingStartedAt

func (m *SubmissionMutation) ProcessingStartedAt() (r time.Time, exists bool)

ProcessingStartedAt returns the value of the "processing_started_at" field in the mutation.

func (*SubmissionMutation) ProcessingStartedAtCleared

func (m *SubmissionMutation) ProcessingStartedAtCleared() bool

ProcessingStartedAtCleared returns if the "processing_started_at" field was cleared in this mutation.

func (*SubmissionMutation) Reason

func (m *SubmissionMutation) Reason() (r string, exists bool)

Reason returns the value of the "reason" field in the mutation.

func (*SubmissionMutation) ReasonCleared

func (m *SubmissionMutation) ReasonCleared() bool

ReasonCleared returns if the "reason" field was cleared in this mutation.

func (*SubmissionMutation) RemovedEdges

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

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

func (*SubmissionMutation) RemovedIDs

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

func (m *SubmissionMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*SubmissionMutation) ResetEdge

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

func (m *SubmissionMutation) 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 (*SubmissionMutation) ResetGitRepo

func (m *SubmissionMutation) ResetGitRepo()

ResetGitRepo resets all changes to the "git_repo" field.

func (*SubmissionMutation) ResetIsInline

func (m *SubmissionMutation) ResetIsInline()

ResetIsInline resets all changes to the "is_inline" field.

func (*SubmissionMutation) ResetIsPublic

func (m *SubmissionMutation) ResetIsPublic()

ResetIsPublic resets all changes to the "is_public" field.

func (*SubmissionMutation) ResetProcessingFinishedAt

func (m *SubmissionMutation) ResetProcessingFinishedAt()

ResetProcessingFinishedAt resets all changes to the "processing_finished_at" field.

func (*SubmissionMutation) ResetProcessingStartedAt

func (m *SubmissionMutation) ResetProcessingStartedAt()

ResetProcessingStartedAt resets all changes to the "processing_started_at" field.

func (*SubmissionMutation) ResetReason

func (m *SubmissionMutation) ResetReason()

ResetReason resets all changes to the "reason" field.

func (*SubmissionMutation) ResetShareID

func (m *SubmissionMutation) ResetShareID()

ResetShareID resets all changes to the "share_id" field.

func (*SubmissionMutation) ResetSourceLanguage

func (m *SubmissionMutation) ResetSourceLanguage()

ResetSourceLanguage resets all changes to the "source_language" field.

func (*SubmissionMutation) ResetStatus

func (m *SubmissionMutation) ResetStatus()

ResetStatus resets all changes to the "status" field.

func (*SubmissionMutation) ResetSubmissionSourceSizeBytes

func (m *SubmissionMutation) ResetSubmissionSourceSizeBytes()

ResetSubmissionSourceSizeBytes resets all changes to the "submission_source_size_bytes" field.

func (*SubmissionMutation) ResetSubmissionTargetSizeBytes

func (m *SubmissionMutation) ResetSubmissionTargetSizeBytes()

ResetSubmissionTargetSizeBytes resets all changes to the "submission_target_size_bytes" field.

func (*SubmissionMutation) ResetTargetLanguage

func (m *SubmissionMutation) ResetTargetLanguage()

ResetTargetLanguage resets all changes to the "target_language" field.

func (*SubmissionMutation) ResetUser

func (m *SubmissionMutation) ResetUser()

ResetUser resets all changes to the "user" edge.

func (*SubmissionMutation) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*SubmissionMutation) SetField

func (m *SubmissionMutation) 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 (*SubmissionMutation) SetGitRepo

func (m *SubmissionMutation) SetGitRepo(s string)

SetGitRepo sets the "git_repo" field.

func (*SubmissionMutation) SetID

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

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

func (*SubmissionMutation) SetIsInline

func (m *SubmissionMutation) SetIsInline(b bool)

SetIsInline sets the "is_inline" field.

func (*SubmissionMutation) SetIsPublic

func (m *SubmissionMutation) SetIsPublic(b bool)

SetIsPublic sets the "is_public" field.

func (*SubmissionMutation) SetProcessingFinishedAt

func (m *SubmissionMutation) SetProcessingFinishedAt(t time.Time)

SetProcessingFinishedAt sets the "processing_finished_at" field.

func (*SubmissionMutation) SetProcessingStartedAt

func (m *SubmissionMutation) SetProcessingStartedAt(t time.Time)

SetProcessingStartedAt sets the "processing_started_at" field.

func (*SubmissionMutation) SetReason

func (m *SubmissionMutation) SetReason(s string)

SetReason sets the "reason" field.

func (*SubmissionMutation) SetShareID

func (m *SubmissionMutation) SetShareID(s string)

SetShareID sets the "share_id" field.

func (*SubmissionMutation) SetSourceLanguage

func (m *SubmissionMutation) SetSourceLanguage(s string)

SetSourceLanguage sets the "source_language" field.

func (*SubmissionMutation) SetStatus

func (m *SubmissionMutation) SetStatus(s submission.Status)

SetStatus sets the "status" field.

func (*SubmissionMutation) SetSubmissionSourceSizeBytes

func (m *SubmissionMutation) SetSubmissionSourceSizeBytes(i int)

SetSubmissionSourceSizeBytes sets the "submission_source_size_bytes" field.

func (*SubmissionMutation) SetSubmissionTargetSizeBytes

func (m *SubmissionMutation) SetSubmissionTargetSizeBytes(i int)

SetSubmissionTargetSizeBytes sets the "submission_target_size_bytes" field.

func (*SubmissionMutation) SetTargetLanguage

func (m *SubmissionMutation) SetTargetLanguage(s string)

SetTargetLanguage sets the "target_language" field.

func (*SubmissionMutation) SetUserID

func (m *SubmissionMutation) SetUserID(id uuid.UUID)

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

func (*SubmissionMutation) ShareID

func (m *SubmissionMutation) ShareID() (r string, exists bool)

ShareID returns the value of the "share_id" field in the mutation.

func (*SubmissionMutation) ShareIDCleared

func (m *SubmissionMutation) ShareIDCleared() bool

ShareIDCleared returns if the "share_id" field was cleared in this mutation.

func (*SubmissionMutation) SourceLanguage

func (m *SubmissionMutation) SourceLanguage() (r string, exists bool)

SourceLanguage returns the value of the "source_language" field in the mutation.

func (*SubmissionMutation) Status

func (m *SubmissionMutation) Status() (r submission.Status, exists bool)

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

func (*SubmissionMutation) SubmissionSourceSizeBytes

func (m *SubmissionMutation) SubmissionSourceSizeBytes() (r int, exists bool)

SubmissionSourceSizeBytes returns the value of the "submission_source_size_bytes" field in the mutation.

func (*SubmissionMutation) SubmissionTargetSizeBytes

func (m *SubmissionMutation) SubmissionTargetSizeBytes() (r int, exists bool)

SubmissionTargetSizeBytes returns the value of the "submission_target_size_bytes" field in the mutation.

func (*SubmissionMutation) TargetLanguage

func (m *SubmissionMutation) TargetLanguage() (r string, exists bool)

TargetLanguage returns the value of the "target_language" field in the mutation.

func (SubmissionMutation) Tx

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

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

func (*SubmissionMutation) Type

func (m *SubmissionMutation) Type() string

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

func (*SubmissionMutation) UserCleared

func (m *SubmissionMutation) UserCleared() bool

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

func (*SubmissionMutation) UserID

func (m *SubmissionMutation) UserID() (id uuid.UUID, exists bool)

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

func (*SubmissionMutation) UserIDs

func (m *SubmissionMutation) UserIDs() (ids []uuid.UUID)

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

func (*SubmissionMutation) Where

func (m *SubmissionMutation) Where(ps ...predicate.Submission)

Where appends a list predicates to the SubmissionMutation builder.

type SubmissionQuery

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

SubmissionQuery is the builder for querying Submission entities.

func (*SubmissionQuery) All

func (sq *SubmissionQuery) All(ctx context.Context) ([]*Submission, error)

All executes the query and returns a list of Submissions.

func (*SubmissionQuery) AllX

func (sq *SubmissionQuery) AllX(ctx context.Context) []*Submission

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

func (*SubmissionQuery) Clone

func (sq *SubmissionQuery) Clone() *SubmissionQuery

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

func (*SubmissionQuery) Count

func (sq *SubmissionQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*SubmissionQuery) CountX

func (sq *SubmissionQuery) CountX(ctx context.Context) int

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

func (*SubmissionQuery) Exist

func (sq *SubmissionQuery) Exist(ctx context.Context) (bool, error)

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

func (*SubmissionQuery) ExistX

func (sq *SubmissionQuery) ExistX(ctx context.Context) bool

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

func (*SubmissionQuery) First

func (sq *SubmissionQuery) First(ctx context.Context) (*Submission, error)

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

func (*SubmissionQuery) FirstID

func (sq *SubmissionQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

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

func (*SubmissionQuery) FirstIDX

func (sq *SubmissionQuery) FirstIDX(ctx context.Context) uuid.UUID

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

func (*SubmissionQuery) FirstX

func (sq *SubmissionQuery) FirstX(ctx context.Context) *Submission

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

func (*SubmissionQuery) GroupBy

func (sq *SubmissionQuery) GroupBy(field string, fields ...string) *SubmissionGroupBy

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

client.Submission.Query().
	GroupBy(submission.FieldSourceLanguage).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*SubmissionQuery) IDs

func (sq *SubmissionQuery) IDs(ctx context.Context) ([]uuid.UUID, error)

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

func (*SubmissionQuery) IDsX

func (sq *SubmissionQuery) IDsX(ctx context.Context) []uuid.UUID

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

func (*SubmissionQuery) Limit

func (sq *SubmissionQuery) Limit(limit int) *SubmissionQuery

Limit adds a limit step to the query.

func (*SubmissionQuery) Modify

func (sq *SubmissionQuery) Modify(modifiers ...func(s *sql.Selector)) *SubmissionSelect

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

func (*SubmissionQuery) Offset

func (sq *SubmissionQuery) Offset(offset int) *SubmissionQuery

Offset adds an offset step to the query.

func (*SubmissionQuery) Only

func (sq *SubmissionQuery) Only(ctx context.Context) (*Submission, error)

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

func (*SubmissionQuery) OnlyID

func (sq *SubmissionQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

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

func (*SubmissionQuery) OnlyIDX

func (sq *SubmissionQuery) OnlyIDX(ctx context.Context) uuid.UUID

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

func (*SubmissionQuery) OnlyX

func (sq *SubmissionQuery) OnlyX(ctx context.Context) *Submission

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

func (*SubmissionQuery) Order

func (sq *SubmissionQuery) Order(o ...OrderFunc) *SubmissionQuery

Order adds an order step to the query.

func (*SubmissionQuery) QueryUser

func (sq *SubmissionQuery) QueryUser() *UserQuery

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

func (*SubmissionQuery) Select

func (sq *SubmissionQuery) Select(fields ...string) *SubmissionSelect

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

client.Submission.Query().
	Select(submission.FieldSourceLanguage).
	Scan(ctx, &v)

func (*SubmissionQuery) Unique

func (sq *SubmissionQuery) Unique(unique bool) *SubmissionQuery

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

Where adds a new predicate for the SubmissionQuery builder.

func (*SubmissionQuery) WithUser

func (sq *SubmissionQuery) WithUser(opts ...func(*UserQuery)) *SubmissionQuery

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

type SubmissionSelect

type SubmissionSelect struct {
	*SubmissionQuery
	// contains filtered or unexported fields
}

SubmissionSelect is the builder for selecting fields of Submission entities.

func (*SubmissionSelect) Bool

func (ss *SubmissionSelect) Bool(ctx context.Context) (_ bool, err error)

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

func (*SubmissionSelect) BoolX

func (ss *SubmissionSelect) BoolX(ctx context.Context) bool

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

func (*SubmissionSelect) Bools

func (ss *SubmissionSelect) Bools(ctx context.Context) ([]bool, error)

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

func (*SubmissionSelect) BoolsX

func (ss *SubmissionSelect) BoolsX(ctx context.Context) []bool

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

func (*SubmissionSelect) Float64

func (ss *SubmissionSelect) Float64(ctx context.Context) (_ float64, err error)

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

func (*SubmissionSelect) Float64X

func (ss *SubmissionSelect) Float64X(ctx context.Context) float64

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

func (*SubmissionSelect) Float64s

func (ss *SubmissionSelect) Float64s(ctx context.Context) ([]float64, error)

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

func (*SubmissionSelect) Float64sX

func (ss *SubmissionSelect) Float64sX(ctx context.Context) []float64

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

func (*SubmissionSelect) Int

func (ss *SubmissionSelect) Int(ctx context.Context) (_ int, err error)

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

func (*SubmissionSelect) IntX

func (ss *SubmissionSelect) IntX(ctx context.Context) int

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

func (*SubmissionSelect) Ints

func (ss *SubmissionSelect) Ints(ctx context.Context) ([]int, error)

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

func (*SubmissionSelect) IntsX

func (ss *SubmissionSelect) IntsX(ctx context.Context) []int

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

func (*SubmissionSelect) Modify

func (ss *SubmissionSelect) Modify(modifiers ...func(s *sql.Selector)) *SubmissionSelect

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

func (*SubmissionSelect) Scan

func (ss *SubmissionSelect) Scan(ctx context.Context, v interface{}) error

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

func (*SubmissionSelect) ScanX

func (ss *SubmissionSelect) ScanX(ctx context.Context, v interface{})

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

func (*SubmissionSelect) String

func (ss *SubmissionSelect) String(ctx context.Context) (_ string, err error)

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

func (*SubmissionSelect) StringX

func (ss *SubmissionSelect) StringX(ctx context.Context) string

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

func (*SubmissionSelect) Strings

func (ss *SubmissionSelect) Strings(ctx context.Context) ([]string, error)

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

func (*SubmissionSelect) StringsX

func (ss *SubmissionSelect) StringsX(ctx context.Context) []string

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

type SubmissionUpdate

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

SubmissionUpdate is the builder for updating Submission entities.

func (*SubmissionUpdate) AddSubmissionSourceSizeBytes

func (su *SubmissionUpdate) AddSubmissionSourceSizeBytes(i int) *SubmissionUpdate

AddSubmissionSourceSizeBytes adds i to the "submission_source_size_bytes" field.

func (*SubmissionUpdate) AddSubmissionTargetSizeBytes

func (su *SubmissionUpdate) AddSubmissionTargetSizeBytes(i int) *SubmissionUpdate

AddSubmissionTargetSizeBytes adds i to the "submission_target_size_bytes" field.

func (*SubmissionUpdate) ClearGitRepo

func (su *SubmissionUpdate) ClearGitRepo() *SubmissionUpdate

ClearGitRepo clears the value of the "git_repo" field.

func (*SubmissionUpdate) ClearProcessingFinishedAt

func (su *SubmissionUpdate) ClearProcessingFinishedAt() *SubmissionUpdate

ClearProcessingFinishedAt clears the value of the "processing_finished_at" field.

func (*SubmissionUpdate) ClearProcessingStartedAt

func (su *SubmissionUpdate) ClearProcessingStartedAt() *SubmissionUpdate

ClearProcessingStartedAt clears the value of the "processing_started_at" field.

func (*SubmissionUpdate) ClearReason

func (su *SubmissionUpdate) ClearReason() *SubmissionUpdate

ClearReason clears the value of the "reason" field.

func (*SubmissionUpdate) ClearShareID

func (su *SubmissionUpdate) ClearShareID() *SubmissionUpdate

ClearShareID clears the value of the "share_id" field.

func (*SubmissionUpdate) ClearUser

func (su *SubmissionUpdate) ClearUser() *SubmissionUpdate

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

func (*SubmissionUpdate) Exec

func (su *SubmissionUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*SubmissionUpdate) ExecX

func (su *SubmissionUpdate) ExecX(ctx context.Context)

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

func (*SubmissionUpdate) Mutation

func (su *SubmissionUpdate) Mutation() *SubmissionMutation

Mutation returns the SubmissionMutation object of the builder.

func (*SubmissionUpdate) Save

func (su *SubmissionUpdate) Save(ctx context.Context) (int, error)

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

func (*SubmissionUpdate) SaveX

func (su *SubmissionUpdate) SaveX(ctx context.Context) int

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

func (*SubmissionUpdate) SetCreatedAt

func (su *SubmissionUpdate) SetCreatedAt(t time.Time) *SubmissionUpdate

SetCreatedAt sets the "created_at" field.

func (*SubmissionUpdate) SetGitRepo

func (su *SubmissionUpdate) SetGitRepo(s string) *SubmissionUpdate

SetGitRepo sets the "git_repo" field.

func (*SubmissionUpdate) SetIsInline

func (su *SubmissionUpdate) SetIsInline(b bool) *SubmissionUpdate

SetIsInline sets the "is_inline" field.

func (*SubmissionUpdate) SetIsPublic

func (su *SubmissionUpdate) SetIsPublic(b bool) *SubmissionUpdate

SetIsPublic sets the "is_public" field.

func (*SubmissionUpdate) SetNillableCreatedAt

func (su *SubmissionUpdate) SetNillableCreatedAt(t *time.Time) *SubmissionUpdate

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

func (*SubmissionUpdate) SetNillableGitRepo

func (su *SubmissionUpdate) SetNillableGitRepo(s *string) *SubmissionUpdate

SetNillableGitRepo sets the "git_repo" field if the given value is not nil.

func (*SubmissionUpdate) SetNillableIsInline

func (su *SubmissionUpdate) SetNillableIsInline(b *bool) *SubmissionUpdate

SetNillableIsInline sets the "is_inline" field if the given value is not nil.

func (*SubmissionUpdate) SetNillableIsPublic

func (su *SubmissionUpdate) SetNillableIsPublic(b *bool) *SubmissionUpdate

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

func (*SubmissionUpdate) SetNillableProcessingFinishedAt

func (su *SubmissionUpdate) SetNillableProcessingFinishedAt(t *time.Time) *SubmissionUpdate

SetNillableProcessingFinishedAt sets the "processing_finished_at" field if the given value is not nil.

func (*SubmissionUpdate) SetNillableProcessingStartedAt

func (su *SubmissionUpdate) SetNillableProcessingStartedAt(t *time.Time) *SubmissionUpdate

SetNillableProcessingStartedAt sets the "processing_started_at" field if the given value is not nil.

func (*SubmissionUpdate) SetNillableReason

func (su *SubmissionUpdate) SetNillableReason(s *string) *SubmissionUpdate

SetNillableReason sets the "reason" field if the given value is not nil.

func (*SubmissionUpdate) SetNillableShareID

func (su *SubmissionUpdate) SetNillableShareID(s *string) *SubmissionUpdate

SetNillableShareID sets the "share_id" field if the given value is not nil.

func (*SubmissionUpdate) SetNillableStatus

func (su *SubmissionUpdate) SetNillableStatus(s *submission.Status) *SubmissionUpdate

SetNillableStatus sets the "status" field if the given value is not nil.

func (*SubmissionUpdate) SetNillableSubmissionSourceSizeBytes

func (su *SubmissionUpdate) SetNillableSubmissionSourceSizeBytes(i *int) *SubmissionUpdate

SetNillableSubmissionSourceSizeBytes sets the "submission_source_size_bytes" field if the given value is not nil.

func (*SubmissionUpdate) SetNillableSubmissionTargetSizeBytes

func (su *SubmissionUpdate) SetNillableSubmissionTargetSizeBytes(i *int) *SubmissionUpdate

SetNillableSubmissionTargetSizeBytes sets the "submission_target_size_bytes" field if the given value is not nil.

func (*SubmissionUpdate) SetProcessingFinishedAt

func (su *SubmissionUpdate) SetProcessingFinishedAt(t time.Time) *SubmissionUpdate

SetProcessingFinishedAt sets the "processing_finished_at" field.

func (*SubmissionUpdate) SetProcessingStartedAt

func (su *SubmissionUpdate) SetProcessingStartedAt(t time.Time) *SubmissionUpdate

SetProcessingStartedAt sets the "processing_started_at" field.

func (*SubmissionUpdate) SetReason

func (su *SubmissionUpdate) SetReason(s string) *SubmissionUpdate

SetReason sets the "reason" field.

func (*SubmissionUpdate) SetShareID

func (su *SubmissionUpdate) SetShareID(s string) *SubmissionUpdate

SetShareID sets the "share_id" field.

func (*SubmissionUpdate) SetSourceLanguage

func (su *SubmissionUpdate) SetSourceLanguage(s string) *SubmissionUpdate

SetSourceLanguage sets the "source_language" field.

func (*SubmissionUpdate) SetStatus

SetStatus sets the "status" field.

func (*SubmissionUpdate) SetSubmissionSourceSizeBytes

func (su *SubmissionUpdate) SetSubmissionSourceSizeBytes(i int) *SubmissionUpdate

SetSubmissionSourceSizeBytes sets the "submission_source_size_bytes" field.

func (*SubmissionUpdate) SetSubmissionTargetSizeBytes

func (su *SubmissionUpdate) SetSubmissionTargetSizeBytes(i int) *SubmissionUpdate

SetSubmissionTargetSizeBytes sets the "submission_target_size_bytes" field.

func (*SubmissionUpdate) SetTargetLanguage

func (su *SubmissionUpdate) SetTargetLanguage(s string) *SubmissionUpdate

SetTargetLanguage sets the "target_language" field.

func (*SubmissionUpdate) SetUser

func (su *SubmissionUpdate) SetUser(u *User) *SubmissionUpdate

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

func (*SubmissionUpdate) SetUserID

func (su *SubmissionUpdate) SetUserID(id uuid.UUID) *SubmissionUpdate

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

func (*SubmissionUpdate) Where

Where appends a list predicates to the SubmissionUpdate builder.

type SubmissionUpdateOne

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

SubmissionUpdateOne is the builder for updating a single Submission entity.

func (*SubmissionUpdateOne) AddSubmissionSourceSizeBytes

func (suo *SubmissionUpdateOne) AddSubmissionSourceSizeBytes(i int) *SubmissionUpdateOne

AddSubmissionSourceSizeBytes adds i to the "submission_source_size_bytes" field.

func (*SubmissionUpdateOne) AddSubmissionTargetSizeBytes

func (suo *SubmissionUpdateOne) AddSubmissionTargetSizeBytes(i int) *SubmissionUpdateOne

AddSubmissionTargetSizeBytes adds i to the "submission_target_size_bytes" field.

func (*SubmissionUpdateOne) ClearGitRepo

func (suo *SubmissionUpdateOne) ClearGitRepo() *SubmissionUpdateOne

ClearGitRepo clears the value of the "git_repo" field.

func (*SubmissionUpdateOne) ClearProcessingFinishedAt

func (suo *SubmissionUpdateOne) ClearProcessingFinishedAt() *SubmissionUpdateOne

ClearProcessingFinishedAt clears the value of the "processing_finished_at" field.

func (*SubmissionUpdateOne) ClearProcessingStartedAt

func (suo *SubmissionUpdateOne) ClearProcessingStartedAt() *SubmissionUpdateOne

ClearProcessingStartedAt clears the value of the "processing_started_at" field.

func (*SubmissionUpdateOne) ClearReason

func (suo *SubmissionUpdateOne) ClearReason() *SubmissionUpdateOne

ClearReason clears the value of the "reason" field.

func (*SubmissionUpdateOne) ClearShareID

func (suo *SubmissionUpdateOne) ClearShareID() *SubmissionUpdateOne

ClearShareID clears the value of the "share_id" field.

func (*SubmissionUpdateOne) ClearUser

func (suo *SubmissionUpdateOne) ClearUser() *SubmissionUpdateOne

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

func (*SubmissionUpdateOne) Exec

func (suo *SubmissionUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*SubmissionUpdateOne) ExecX

func (suo *SubmissionUpdateOne) ExecX(ctx context.Context)

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

func (*SubmissionUpdateOne) Mutation

func (suo *SubmissionUpdateOne) Mutation() *SubmissionMutation

Mutation returns the SubmissionMutation object of the builder.

func (*SubmissionUpdateOne) Save

func (suo *SubmissionUpdateOne) Save(ctx context.Context) (*Submission, error)

Save executes the query and returns the updated Submission entity.

func (*SubmissionUpdateOne) SaveX

func (suo *SubmissionUpdateOne) SaveX(ctx context.Context) *Submission

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

func (*SubmissionUpdateOne) Select

func (suo *SubmissionUpdateOne) Select(field string, fields ...string) *SubmissionUpdateOne

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

func (*SubmissionUpdateOne) SetCreatedAt

func (suo *SubmissionUpdateOne) SetCreatedAt(t time.Time) *SubmissionUpdateOne

SetCreatedAt sets the "created_at" field.

func (*SubmissionUpdateOne) SetGitRepo

func (suo *SubmissionUpdateOne) SetGitRepo(s string) *SubmissionUpdateOne

SetGitRepo sets the "git_repo" field.

func (*SubmissionUpdateOne) SetIsInline

func (suo *SubmissionUpdateOne) SetIsInline(b bool) *SubmissionUpdateOne

SetIsInline sets the "is_inline" field.

func (*SubmissionUpdateOne) SetIsPublic

func (suo *SubmissionUpdateOne) SetIsPublic(b bool) *SubmissionUpdateOne

SetIsPublic sets the "is_public" field.

func (*SubmissionUpdateOne) SetNillableCreatedAt

func (suo *SubmissionUpdateOne) SetNillableCreatedAt(t *time.Time) *SubmissionUpdateOne

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

func (*SubmissionUpdateOne) SetNillableGitRepo

func (suo *SubmissionUpdateOne) SetNillableGitRepo(s *string) *SubmissionUpdateOne

SetNillableGitRepo sets the "git_repo" field if the given value is not nil.

func (*SubmissionUpdateOne) SetNillableIsInline

func (suo *SubmissionUpdateOne) SetNillableIsInline(b *bool) *SubmissionUpdateOne

SetNillableIsInline sets the "is_inline" field if the given value is not nil.

func (*SubmissionUpdateOne) SetNillableIsPublic

func (suo *SubmissionUpdateOne) SetNillableIsPublic(b *bool) *SubmissionUpdateOne

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

func (*SubmissionUpdateOne) SetNillableProcessingFinishedAt

func (suo *SubmissionUpdateOne) SetNillableProcessingFinishedAt(t *time.Time) *SubmissionUpdateOne

SetNillableProcessingFinishedAt sets the "processing_finished_at" field if the given value is not nil.

func (*SubmissionUpdateOne) SetNillableProcessingStartedAt

func (suo *SubmissionUpdateOne) SetNillableProcessingStartedAt(t *time.Time) *SubmissionUpdateOne

SetNillableProcessingStartedAt sets the "processing_started_at" field if the given value is not nil.

func (*SubmissionUpdateOne) SetNillableReason

func (suo *SubmissionUpdateOne) SetNillableReason(s *string) *SubmissionUpdateOne

SetNillableReason sets the "reason" field if the given value is not nil.

func (*SubmissionUpdateOne) SetNillableShareID

func (suo *SubmissionUpdateOne) SetNillableShareID(s *string) *SubmissionUpdateOne

SetNillableShareID sets the "share_id" field if the given value is not nil.

func (*SubmissionUpdateOne) SetNillableStatus

func (suo *SubmissionUpdateOne) SetNillableStatus(s *submission.Status) *SubmissionUpdateOne

SetNillableStatus sets the "status" field if the given value is not nil.

func (*SubmissionUpdateOne) SetNillableSubmissionSourceSizeBytes

func (suo *SubmissionUpdateOne) SetNillableSubmissionSourceSizeBytes(i *int) *SubmissionUpdateOne

SetNillableSubmissionSourceSizeBytes sets the "submission_source_size_bytes" field if the given value is not nil.

func (*SubmissionUpdateOne) SetNillableSubmissionTargetSizeBytes

func (suo *SubmissionUpdateOne) SetNillableSubmissionTargetSizeBytes(i *int) *SubmissionUpdateOne

SetNillableSubmissionTargetSizeBytes sets the "submission_target_size_bytes" field if the given value is not nil.

func (*SubmissionUpdateOne) SetProcessingFinishedAt

func (suo *SubmissionUpdateOne) SetProcessingFinishedAt(t time.Time) *SubmissionUpdateOne

SetProcessingFinishedAt sets the "processing_finished_at" field.

func (*SubmissionUpdateOne) SetProcessingStartedAt

func (suo *SubmissionUpdateOne) SetProcessingStartedAt(t time.Time) *SubmissionUpdateOne

SetProcessingStartedAt sets the "processing_started_at" field.

func (*SubmissionUpdateOne) SetReason

func (suo *SubmissionUpdateOne) SetReason(s string) *SubmissionUpdateOne

SetReason sets the "reason" field.

func (*SubmissionUpdateOne) SetShareID

func (suo *SubmissionUpdateOne) SetShareID(s string) *SubmissionUpdateOne

SetShareID sets the "share_id" field.

func (*SubmissionUpdateOne) SetSourceLanguage

func (suo *SubmissionUpdateOne) SetSourceLanguage(s string) *SubmissionUpdateOne

SetSourceLanguage sets the "source_language" field.

func (*SubmissionUpdateOne) SetStatus

SetStatus sets the "status" field.

func (*SubmissionUpdateOne) SetSubmissionSourceSizeBytes

func (suo *SubmissionUpdateOne) SetSubmissionSourceSizeBytes(i int) *SubmissionUpdateOne

SetSubmissionSourceSizeBytes sets the "submission_source_size_bytes" field.

func (*SubmissionUpdateOne) SetSubmissionTargetSizeBytes

func (suo *SubmissionUpdateOne) SetSubmissionTargetSizeBytes(i int) *SubmissionUpdateOne

SetSubmissionTargetSizeBytes sets the "submission_target_size_bytes" field.

func (*SubmissionUpdateOne) SetTargetLanguage

func (suo *SubmissionUpdateOne) SetTargetLanguage(s string) *SubmissionUpdateOne

SetTargetLanguage sets the "target_language" field.

func (*SubmissionUpdateOne) SetUser

func (suo *SubmissionUpdateOne) SetUser(u *User) *SubmissionUpdateOne

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

func (*SubmissionUpdateOne) SetUserID

func (suo *SubmissionUpdateOne) SetUserID(id uuid.UUID) *SubmissionUpdateOne

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

type SubmissionUpsert

type SubmissionUpsert struct {
	*sql.UpdateSet
}

SubmissionUpsert is the "OnConflict" setter.

func (*SubmissionUpsert) AddSubmissionSourceSizeBytes

func (u *SubmissionUpsert) AddSubmissionSourceSizeBytes(v int) *SubmissionUpsert

AddSubmissionSourceSizeBytes adds v to the "submission_source_size_bytes" field.

func (*SubmissionUpsert) AddSubmissionTargetSizeBytes

func (u *SubmissionUpsert) AddSubmissionTargetSizeBytes(v int) *SubmissionUpsert

AddSubmissionTargetSizeBytes adds v to the "submission_target_size_bytes" field.

func (*SubmissionUpsert) ClearGitRepo

func (u *SubmissionUpsert) ClearGitRepo() *SubmissionUpsert

ClearGitRepo clears the value of the "git_repo" field.

func (*SubmissionUpsert) ClearProcessingFinishedAt

func (u *SubmissionUpsert) ClearProcessingFinishedAt() *SubmissionUpsert

ClearProcessingFinishedAt clears the value of the "processing_finished_at" field.

func (*SubmissionUpsert) ClearProcessingStartedAt

func (u *SubmissionUpsert) ClearProcessingStartedAt() *SubmissionUpsert

ClearProcessingStartedAt clears the value of the "processing_started_at" field.

func (*SubmissionUpsert) ClearReason

func (u *SubmissionUpsert) ClearReason() *SubmissionUpsert

ClearReason clears the value of the "reason" field.

func (*SubmissionUpsert) ClearShareID

func (u *SubmissionUpsert) ClearShareID() *SubmissionUpsert

ClearShareID clears the value of the "share_id" field.

func (*SubmissionUpsert) SetCreatedAt

func (u *SubmissionUpsert) SetCreatedAt(v time.Time) *SubmissionUpsert

SetCreatedAt sets the "created_at" field.

func (*SubmissionUpsert) SetGitRepo

func (u *SubmissionUpsert) SetGitRepo(v string) *SubmissionUpsert

SetGitRepo sets the "git_repo" field.

func (*SubmissionUpsert) SetIsInline

func (u *SubmissionUpsert) SetIsInline(v bool) *SubmissionUpsert

SetIsInline sets the "is_inline" field.

func (*SubmissionUpsert) SetIsPublic

func (u *SubmissionUpsert) SetIsPublic(v bool) *SubmissionUpsert

SetIsPublic sets the "is_public" field.

func (*SubmissionUpsert) SetProcessingFinishedAt

func (u *SubmissionUpsert) SetProcessingFinishedAt(v time.Time) *SubmissionUpsert

SetProcessingFinishedAt sets the "processing_finished_at" field.

func (*SubmissionUpsert) SetProcessingStartedAt

func (u *SubmissionUpsert) SetProcessingStartedAt(v time.Time) *SubmissionUpsert

SetProcessingStartedAt sets the "processing_started_at" field.

func (*SubmissionUpsert) SetReason

func (u *SubmissionUpsert) SetReason(v string) *SubmissionUpsert

SetReason sets the "reason" field.

func (*SubmissionUpsert) SetShareID

func (u *SubmissionUpsert) SetShareID(v string) *SubmissionUpsert

SetShareID sets the "share_id" field.

func (*SubmissionUpsert) SetSourceLanguage

func (u *SubmissionUpsert) SetSourceLanguage(v string) *SubmissionUpsert

SetSourceLanguage sets the "source_language" field.

func (*SubmissionUpsert) SetStatus

SetStatus sets the "status" field.

func (*SubmissionUpsert) SetSubmissionSourceSizeBytes

func (u *SubmissionUpsert) SetSubmissionSourceSizeBytes(v int) *SubmissionUpsert

SetSubmissionSourceSizeBytes sets the "submission_source_size_bytes" field.

func (*SubmissionUpsert) SetSubmissionTargetSizeBytes

func (u *SubmissionUpsert) SetSubmissionTargetSizeBytes(v int) *SubmissionUpsert

SetSubmissionTargetSizeBytes sets the "submission_target_size_bytes" field.

func (*SubmissionUpsert) SetTargetLanguage

func (u *SubmissionUpsert) SetTargetLanguage(v string) *SubmissionUpsert

SetTargetLanguage sets the "target_language" field.

func (*SubmissionUpsert) UpdateCreatedAt

func (u *SubmissionUpsert) UpdateCreatedAt() *SubmissionUpsert

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

func (*SubmissionUpsert) UpdateGitRepo

func (u *SubmissionUpsert) UpdateGitRepo() *SubmissionUpsert

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

func (*SubmissionUpsert) UpdateIsInline

func (u *SubmissionUpsert) UpdateIsInline() *SubmissionUpsert

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

func (*SubmissionUpsert) UpdateIsPublic

func (u *SubmissionUpsert) UpdateIsPublic() *SubmissionUpsert

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

func (*SubmissionUpsert) UpdateProcessingFinishedAt

func (u *SubmissionUpsert) UpdateProcessingFinishedAt() *SubmissionUpsert

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

func (*SubmissionUpsert) UpdateProcessingStartedAt

func (u *SubmissionUpsert) UpdateProcessingStartedAt() *SubmissionUpsert

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

func (*SubmissionUpsert) UpdateReason

func (u *SubmissionUpsert) UpdateReason() *SubmissionUpsert

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

func (*SubmissionUpsert) UpdateShareID

func (u *SubmissionUpsert) UpdateShareID() *SubmissionUpsert

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

func (*SubmissionUpsert) UpdateSourceLanguage

func (u *SubmissionUpsert) UpdateSourceLanguage() *SubmissionUpsert

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

func (*SubmissionUpsert) UpdateStatus

func (u *SubmissionUpsert) UpdateStatus() *SubmissionUpsert

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

func (*SubmissionUpsert) UpdateSubmissionSourceSizeBytes

func (u *SubmissionUpsert) UpdateSubmissionSourceSizeBytes() *SubmissionUpsert

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

func (*SubmissionUpsert) UpdateSubmissionTargetSizeBytes

func (u *SubmissionUpsert) UpdateSubmissionTargetSizeBytes() *SubmissionUpsert

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

func (*SubmissionUpsert) UpdateTargetLanguage

func (u *SubmissionUpsert) UpdateTargetLanguage() *SubmissionUpsert

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

type SubmissionUpsertBulk

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

SubmissionUpsertBulk is the builder for "upsert"-ing a bulk of Submission nodes.

func (*SubmissionUpsertBulk) AddSubmissionSourceSizeBytes

func (u *SubmissionUpsertBulk) AddSubmissionSourceSizeBytes(v int) *SubmissionUpsertBulk

AddSubmissionSourceSizeBytes adds v to the "submission_source_size_bytes" field.

func (*SubmissionUpsertBulk) AddSubmissionTargetSizeBytes

func (u *SubmissionUpsertBulk) AddSubmissionTargetSizeBytes(v int) *SubmissionUpsertBulk

AddSubmissionTargetSizeBytes adds v to the "submission_target_size_bytes" field.

func (*SubmissionUpsertBulk) ClearGitRepo

func (u *SubmissionUpsertBulk) ClearGitRepo() *SubmissionUpsertBulk

ClearGitRepo clears the value of the "git_repo" field.

func (*SubmissionUpsertBulk) ClearProcessingFinishedAt

func (u *SubmissionUpsertBulk) ClearProcessingFinishedAt() *SubmissionUpsertBulk

ClearProcessingFinishedAt clears the value of the "processing_finished_at" field.

func (*SubmissionUpsertBulk) ClearProcessingStartedAt

func (u *SubmissionUpsertBulk) ClearProcessingStartedAt() *SubmissionUpsertBulk

ClearProcessingStartedAt clears the value of the "processing_started_at" field.

func (*SubmissionUpsertBulk) ClearReason

func (u *SubmissionUpsertBulk) ClearReason() *SubmissionUpsertBulk

ClearReason clears the value of the "reason" field.

func (*SubmissionUpsertBulk) ClearShareID

func (u *SubmissionUpsertBulk) ClearShareID() *SubmissionUpsertBulk

ClearShareID clears the value of the "share_id" field.

func (*SubmissionUpsertBulk) DoNothing

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

func (*SubmissionUpsertBulk) Exec

Exec executes the query.

func (*SubmissionUpsertBulk) ExecX

func (u *SubmissionUpsertBulk) ExecX(ctx context.Context)

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

func (*SubmissionUpsertBulk) Ignore

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

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

func (*SubmissionUpsertBulk) SetCreatedAt

func (u *SubmissionUpsertBulk) SetCreatedAt(v time.Time) *SubmissionUpsertBulk

SetCreatedAt sets the "created_at" field.

func (*SubmissionUpsertBulk) SetGitRepo

SetGitRepo sets the "git_repo" field.

func (*SubmissionUpsertBulk) SetIsInline

func (u *SubmissionUpsertBulk) SetIsInline(v bool) *SubmissionUpsertBulk

SetIsInline sets the "is_inline" field.

func (*SubmissionUpsertBulk) SetIsPublic

func (u *SubmissionUpsertBulk) SetIsPublic(v bool) *SubmissionUpsertBulk

SetIsPublic sets the "is_public" field.

func (*SubmissionUpsertBulk) SetProcessingFinishedAt

func (u *SubmissionUpsertBulk) SetProcessingFinishedAt(v time.Time) *SubmissionUpsertBulk

SetProcessingFinishedAt sets the "processing_finished_at" field.

func (*SubmissionUpsertBulk) SetProcessingStartedAt

func (u *SubmissionUpsertBulk) SetProcessingStartedAt(v time.Time) *SubmissionUpsertBulk

SetProcessingStartedAt sets the "processing_started_at" field.

func (*SubmissionUpsertBulk) SetReason

SetReason sets the "reason" field.

func (*SubmissionUpsertBulk) SetShareID

SetShareID sets the "share_id" field.

func (*SubmissionUpsertBulk) SetSourceLanguage

func (u *SubmissionUpsertBulk) SetSourceLanguage(v string) *SubmissionUpsertBulk

SetSourceLanguage sets the "source_language" field.

func (*SubmissionUpsertBulk) SetStatus

SetStatus sets the "status" field.

func (*SubmissionUpsertBulk) SetSubmissionSourceSizeBytes

func (u *SubmissionUpsertBulk) SetSubmissionSourceSizeBytes(v int) *SubmissionUpsertBulk

SetSubmissionSourceSizeBytes sets the "submission_source_size_bytes" field.

func (*SubmissionUpsertBulk) SetSubmissionTargetSizeBytes

func (u *SubmissionUpsertBulk) SetSubmissionTargetSizeBytes(v int) *SubmissionUpsertBulk

SetSubmissionTargetSizeBytes sets the "submission_target_size_bytes" field.

func (*SubmissionUpsertBulk) SetTargetLanguage

func (u *SubmissionUpsertBulk) SetTargetLanguage(v string) *SubmissionUpsertBulk

SetTargetLanguage sets the "target_language" field.

func (*SubmissionUpsertBulk) Update

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

func (*SubmissionUpsertBulk) UpdateCreatedAt

func (u *SubmissionUpsertBulk) UpdateCreatedAt() *SubmissionUpsertBulk

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

func (*SubmissionUpsertBulk) UpdateGitRepo

func (u *SubmissionUpsertBulk) UpdateGitRepo() *SubmissionUpsertBulk

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

func (*SubmissionUpsertBulk) UpdateIsInline

func (u *SubmissionUpsertBulk) UpdateIsInline() *SubmissionUpsertBulk

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

func (*SubmissionUpsertBulk) UpdateIsPublic

func (u *SubmissionUpsertBulk) UpdateIsPublic() *SubmissionUpsertBulk

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

func (*SubmissionUpsertBulk) UpdateNewValues

func (u *SubmissionUpsertBulk) UpdateNewValues() *SubmissionUpsertBulk

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

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

func (*SubmissionUpsertBulk) UpdateProcessingFinishedAt

func (u *SubmissionUpsertBulk) UpdateProcessingFinishedAt() *SubmissionUpsertBulk

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

func (*SubmissionUpsertBulk) UpdateProcessingStartedAt

func (u *SubmissionUpsertBulk) UpdateProcessingStartedAt() *SubmissionUpsertBulk

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

func (*SubmissionUpsertBulk) UpdateReason

func (u *SubmissionUpsertBulk) UpdateReason() *SubmissionUpsertBulk

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

func (*SubmissionUpsertBulk) UpdateShareID

func (u *SubmissionUpsertBulk) UpdateShareID() *SubmissionUpsertBulk

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

func (*SubmissionUpsertBulk) UpdateSourceLanguage

func (u *SubmissionUpsertBulk) UpdateSourceLanguage() *SubmissionUpsertBulk

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

func (*SubmissionUpsertBulk) UpdateStatus

func (u *SubmissionUpsertBulk) UpdateStatus() *SubmissionUpsertBulk

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

func (*SubmissionUpsertBulk) UpdateSubmissionSourceSizeBytes

func (u *SubmissionUpsertBulk) UpdateSubmissionSourceSizeBytes() *SubmissionUpsertBulk

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

func (*SubmissionUpsertBulk) UpdateSubmissionTargetSizeBytes

func (u *SubmissionUpsertBulk) UpdateSubmissionTargetSizeBytes() *SubmissionUpsertBulk

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

func (*SubmissionUpsertBulk) UpdateTargetLanguage

func (u *SubmissionUpsertBulk) UpdateTargetLanguage() *SubmissionUpsertBulk

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

type SubmissionUpsertOne

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

SubmissionUpsertOne is the builder for "upsert"-ing

one Submission node.

func (*SubmissionUpsertOne) AddSubmissionSourceSizeBytes

func (u *SubmissionUpsertOne) AddSubmissionSourceSizeBytes(v int) *SubmissionUpsertOne

AddSubmissionSourceSizeBytes adds v to the "submission_source_size_bytes" field.

func (*SubmissionUpsertOne) AddSubmissionTargetSizeBytes

func (u *SubmissionUpsertOne) AddSubmissionTargetSizeBytes(v int) *SubmissionUpsertOne

AddSubmissionTargetSizeBytes adds v to the "submission_target_size_bytes" field.

func (*SubmissionUpsertOne) ClearGitRepo

func (u *SubmissionUpsertOne) ClearGitRepo() *SubmissionUpsertOne

ClearGitRepo clears the value of the "git_repo" field.

func (*SubmissionUpsertOne) ClearProcessingFinishedAt

func (u *SubmissionUpsertOne) ClearProcessingFinishedAt() *SubmissionUpsertOne

ClearProcessingFinishedAt clears the value of the "processing_finished_at" field.

func (*SubmissionUpsertOne) ClearProcessingStartedAt

func (u *SubmissionUpsertOne) ClearProcessingStartedAt() *SubmissionUpsertOne

ClearProcessingStartedAt clears the value of the "processing_started_at" field.

func (*SubmissionUpsertOne) ClearReason

func (u *SubmissionUpsertOne) ClearReason() *SubmissionUpsertOne

ClearReason clears the value of the "reason" field.

func (*SubmissionUpsertOne) ClearShareID

func (u *SubmissionUpsertOne) ClearShareID() *SubmissionUpsertOne

ClearShareID clears the value of the "share_id" field.

func (*SubmissionUpsertOne) DoNothing

func (u *SubmissionUpsertOne) DoNothing() *SubmissionUpsertOne

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

func (*SubmissionUpsertOne) Exec

Exec executes the query.

func (*SubmissionUpsertOne) ExecX

func (u *SubmissionUpsertOne) ExecX(ctx context.Context)

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

func (*SubmissionUpsertOne) ID

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

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

func (*SubmissionUpsertOne) IDX

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

func (*SubmissionUpsertOne) Ignore

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

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

func (*SubmissionUpsertOne) SetCreatedAt

func (u *SubmissionUpsertOne) SetCreatedAt(v time.Time) *SubmissionUpsertOne

SetCreatedAt sets the "created_at" field.

func (*SubmissionUpsertOne) SetGitRepo

SetGitRepo sets the "git_repo" field.

func (*SubmissionUpsertOne) SetIsInline

func (u *SubmissionUpsertOne) SetIsInline(v bool) *SubmissionUpsertOne

SetIsInline sets the "is_inline" field.

func (*SubmissionUpsertOne) SetIsPublic

func (u *SubmissionUpsertOne) SetIsPublic(v bool) *SubmissionUpsertOne

SetIsPublic sets the "is_public" field.

func (*SubmissionUpsertOne) SetProcessingFinishedAt

func (u *SubmissionUpsertOne) SetProcessingFinishedAt(v time.Time) *SubmissionUpsertOne

SetProcessingFinishedAt sets the "processing_finished_at" field.

func (*SubmissionUpsertOne) SetProcessingStartedAt

func (u *SubmissionUpsertOne) SetProcessingStartedAt(v time.Time) *SubmissionUpsertOne

SetProcessingStartedAt sets the "processing_started_at" field.

func (*SubmissionUpsertOne) SetReason

SetReason sets the "reason" field.

func (*SubmissionUpsertOne) SetShareID

SetShareID sets the "share_id" field.

func (*SubmissionUpsertOne) SetSourceLanguage

func (u *SubmissionUpsertOne) SetSourceLanguage(v string) *SubmissionUpsertOne

SetSourceLanguage sets the "source_language" field.

func (*SubmissionUpsertOne) SetStatus

SetStatus sets the "status" field.

func (*SubmissionUpsertOne) SetSubmissionSourceSizeBytes

func (u *SubmissionUpsertOne) SetSubmissionSourceSizeBytes(v int) *SubmissionUpsertOne

SetSubmissionSourceSizeBytes sets the "submission_source_size_bytes" field.

func (*SubmissionUpsertOne) SetSubmissionTargetSizeBytes

func (u *SubmissionUpsertOne) SetSubmissionTargetSizeBytes(v int) *SubmissionUpsertOne

SetSubmissionTargetSizeBytes sets the "submission_target_size_bytes" field.

func (*SubmissionUpsertOne) SetTargetLanguage

func (u *SubmissionUpsertOne) SetTargetLanguage(v string) *SubmissionUpsertOne

SetTargetLanguage sets the "target_language" field.

func (*SubmissionUpsertOne) Update

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

func (*SubmissionUpsertOne) UpdateCreatedAt

func (u *SubmissionUpsertOne) UpdateCreatedAt() *SubmissionUpsertOne

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

func (*SubmissionUpsertOne) UpdateGitRepo

func (u *SubmissionUpsertOne) UpdateGitRepo() *SubmissionUpsertOne

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

func (*SubmissionUpsertOne) UpdateIsInline

func (u *SubmissionUpsertOne) UpdateIsInline() *SubmissionUpsertOne

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

func (*SubmissionUpsertOne) UpdateIsPublic

func (u *SubmissionUpsertOne) UpdateIsPublic() *SubmissionUpsertOne

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

func (*SubmissionUpsertOne) UpdateNewValues

func (u *SubmissionUpsertOne) UpdateNewValues() *SubmissionUpsertOne

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.Submission.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
		sql.ResolveWith(func(u *sql.UpdateSet) {
			u.SetIgnore(submission.FieldID)
		}),
	).
	Exec(ctx)

func (*SubmissionUpsertOne) UpdateProcessingFinishedAt

func (u *SubmissionUpsertOne) UpdateProcessingFinishedAt() *SubmissionUpsertOne

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

func (*SubmissionUpsertOne) UpdateProcessingStartedAt

func (u *SubmissionUpsertOne) UpdateProcessingStartedAt() *SubmissionUpsertOne

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

func (*SubmissionUpsertOne) UpdateReason

func (u *SubmissionUpsertOne) UpdateReason() *SubmissionUpsertOne

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

func (*SubmissionUpsertOne) UpdateShareID

func (u *SubmissionUpsertOne) UpdateShareID() *SubmissionUpsertOne

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

func (*SubmissionUpsertOne) UpdateSourceLanguage

func (u *SubmissionUpsertOne) UpdateSourceLanguage() *SubmissionUpsertOne

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

func (*SubmissionUpsertOne) UpdateStatus

func (u *SubmissionUpsertOne) UpdateStatus() *SubmissionUpsertOne

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

func (*SubmissionUpsertOne) UpdateSubmissionSourceSizeBytes

func (u *SubmissionUpsertOne) UpdateSubmissionSourceSizeBytes() *SubmissionUpsertOne

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

func (*SubmissionUpsertOne) UpdateSubmissionTargetSizeBytes

func (u *SubmissionUpsertOne) UpdateSubmissionTargetSizeBytes() *SubmissionUpsertOne

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

func (*SubmissionUpsertOne) UpdateTargetLanguage

func (u *SubmissionUpsertOne) UpdateTargetLanguage() *SubmissionUpsertOne

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

type Submissions

type Submissions []*Submission

Submissions is a parsable slice of Submission.

type Subscription

type Subscription struct {

	// ID of the ent.
	ID uuid.UUID `json:"id,omitempty"`
	// StripeCustomerID holds the value of the "stripe_customer_id" field.
	StripeCustomerID string `json:"stripe_customer_id,omitempty"`
	// StripeSubscriptionID holds the value of the "stripe_subscription_id" field.
	StripeSubscriptionID string `json:"stripe_subscription_id,omitempty"`
	// Tier holds the value of the "tier" field.
	Tier subscription.Tier `json:"tier,omitempty"`
	// ExpiresAt holds the value of the "expires_at" field.
	ExpiresAt time.Time `json:"expires_at,omitempty"`
	// Cancelled holds the value of the "cancelled" field.
	Cancelled bool `json:"cancelled,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 SubscriptionQuery when eager-loading is set.
	Edges SubscriptionEdges `json:"edges"`
	// contains filtered or unexported fields
}

Subscription is the model entity for the Subscription schema.

func (*Subscription) QueryUser

func (s *Subscription) QueryUser() *UserQuery

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

func (*Subscription) String

func (s *Subscription) String() string

String implements the fmt.Stringer.

func (*Subscription) Unwrap

func (s *Subscription) Unwrap() *Subscription

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

func (s *Subscription) Update() *SubscriptionUpdateOne

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

type SubscriptionClient

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

SubscriptionClient is a client for the Subscription schema.

func NewSubscriptionClient

func NewSubscriptionClient(c config) *SubscriptionClient

NewSubscriptionClient returns a client for the Subscription from the given config.

func (*SubscriptionClient) Create

Create returns a create builder for Subscription.

func (*SubscriptionClient) CreateBulk

func (c *SubscriptionClient) CreateBulk(builders ...*SubscriptionCreate) *SubscriptionCreateBulk

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

func (*SubscriptionClient) Delete

Delete returns a delete builder for Subscription.

func (*SubscriptionClient) DeleteOne

DeleteOne returns a delete builder for the given entity.

func (*SubscriptionClient) DeleteOneID

func (c *SubscriptionClient) DeleteOneID(id uuid.UUID) *SubscriptionDeleteOne

DeleteOneID returns a delete builder for the given id.

func (*SubscriptionClient) Get

Get returns a Subscription entity by its id.

func (*SubscriptionClient) GetX

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

func (*SubscriptionClient) Hooks

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

Hooks returns the client hooks.

func (*SubscriptionClient) Query

Query returns a query builder for Subscription.

func (*SubscriptionClient) QueryUser

func (c *SubscriptionClient) QueryUser(s *Subscription) *UserQuery

QueryUser queries the user edge of a Subscription.

func (*SubscriptionClient) Update

Update returns an update builder for Subscription.

func (*SubscriptionClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*SubscriptionClient) UpdateOneID

func (c *SubscriptionClient) UpdateOneID(id uuid.UUID) *SubscriptionUpdateOne

UpdateOneID returns an update builder for the given id.

func (*SubscriptionClient) Use

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

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

type SubscriptionCreate

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

SubscriptionCreate is the builder for creating a Subscription entity.

func (*SubscriptionCreate) Exec

func (sc *SubscriptionCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*SubscriptionCreate) ExecX

func (sc *SubscriptionCreate) ExecX(ctx context.Context)

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

func (*SubscriptionCreate) Mutation

func (sc *SubscriptionCreate) Mutation() *SubscriptionMutation

Mutation returns the SubscriptionMutation object of the builder.

func (*SubscriptionCreate) OnConflict

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

client.Subscription.Create().
	SetStripeCustomerID(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.SubscriptionUpsert) {
		SetStripeCustomerID(v+v).
	}).
	Exec(ctx)

func (*SubscriptionCreate) OnConflictColumns

func (sc *SubscriptionCreate) OnConflictColumns(columns ...string) *SubscriptionUpsertOne

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

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

func (*SubscriptionCreate) Save

Save creates the Subscription in the database.

func (*SubscriptionCreate) SaveX

SaveX calls Save and panics if Save returns an error.

func (*SubscriptionCreate) SetCancelled

func (sc *SubscriptionCreate) SetCancelled(b bool) *SubscriptionCreate

SetCancelled sets the "cancelled" field.

func (*SubscriptionCreate) SetCreatedAt

func (sc *SubscriptionCreate) SetCreatedAt(t time.Time) *SubscriptionCreate

SetCreatedAt sets the "created_at" field.

func (*SubscriptionCreate) SetExpiresAt

func (sc *SubscriptionCreate) SetExpiresAt(t time.Time) *SubscriptionCreate

SetExpiresAt sets the "expires_at" field.

func (*SubscriptionCreate) SetID

SetID sets the "id" field.

func (*SubscriptionCreate) SetNillableCancelled

func (sc *SubscriptionCreate) SetNillableCancelled(b *bool) *SubscriptionCreate

SetNillableCancelled sets the "cancelled" field if the given value is not nil.

func (*SubscriptionCreate) SetNillableCreatedAt

func (sc *SubscriptionCreate) SetNillableCreatedAt(t *time.Time) *SubscriptionCreate

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

func (*SubscriptionCreate) SetNillableExpiresAt

func (sc *SubscriptionCreate) SetNillableExpiresAt(t *time.Time) *SubscriptionCreate

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

func (*SubscriptionCreate) SetNillableID

func (sc *SubscriptionCreate) SetNillableID(u *uuid.UUID) *SubscriptionCreate

SetNillableID sets the "id" field if the given value is not nil.

func (*SubscriptionCreate) SetNillableStripeCustomerID

func (sc *SubscriptionCreate) SetNillableStripeCustomerID(s *string) *SubscriptionCreate

SetNillableStripeCustomerID sets the "stripe_customer_id" field if the given value is not nil.

func (*SubscriptionCreate) SetNillableStripeSubscriptionID

func (sc *SubscriptionCreate) SetNillableStripeSubscriptionID(s *string) *SubscriptionCreate

SetNillableStripeSubscriptionID sets the "stripe_subscription_id" field if the given value is not nil.

func (*SubscriptionCreate) SetNillableTier

func (sc *SubscriptionCreate) SetNillableTier(s *subscription.Tier) *SubscriptionCreate

SetNillableTier sets the "tier" field if the given value is not nil.

func (*SubscriptionCreate) SetStripeCustomerID

func (sc *SubscriptionCreate) SetStripeCustomerID(s string) *SubscriptionCreate

SetStripeCustomerID sets the "stripe_customer_id" field.

func (*SubscriptionCreate) SetStripeSubscriptionID

func (sc *SubscriptionCreate) SetStripeSubscriptionID(s string) *SubscriptionCreate

SetStripeSubscriptionID sets the "stripe_subscription_id" field.

func (*SubscriptionCreate) SetTier

SetTier sets the "tier" field.

func (*SubscriptionCreate) SetUser

func (sc *SubscriptionCreate) SetUser(u *User) *SubscriptionCreate

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

func (*SubscriptionCreate) SetUserID

func (sc *SubscriptionCreate) SetUserID(id uuid.UUID) *SubscriptionCreate

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

type SubscriptionCreateBulk

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

SubscriptionCreateBulk is the builder for creating many Subscription entities in bulk.

func (*SubscriptionCreateBulk) Exec

Exec executes the query.

func (*SubscriptionCreateBulk) ExecX

func (scb *SubscriptionCreateBulk) ExecX(ctx context.Context)

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

func (*SubscriptionCreateBulk) OnConflict

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

client.Subscription.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.SubscriptionUpsert) {
		SetStripeCustomerID(v+v).
	}).
	Exec(ctx)

func (*SubscriptionCreateBulk) OnConflictColumns

func (scb *SubscriptionCreateBulk) OnConflictColumns(columns ...string) *SubscriptionUpsertBulk

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

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

func (*SubscriptionCreateBulk) Save

Save creates the Subscription entities in the database.

func (*SubscriptionCreateBulk) SaveX

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

type SubscriptionDelete

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

SubscriptionDelete is the builder for deleting a Subscription entity.

func (*SubscriptionDelete) Exec

func (sd *SubscriptionDelete) Exec(ctx context.Context) (int, error)

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

func (*SubscriptionDelete) ExecX

func (sd *SubscriptionDelete) ExecX(ctx context.Context) int

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

func (*SubscriptionDelete) Where

Where appends a list predicates to the SubscriptionDelete builder.

type SubscriptionDeleteOne

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

SubscriptionDeleteOne is the builder for deleting a single Subscription entity.

func (*SubscriptionDeleteOne) Exec

func (sdo *SubscriptionDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*SubscriptionDeleteOne) ExecX

func (sdo *SubscriptionDeleteOne) ExecX(ctx context.Context)

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

type SubscriptionEdges

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

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

func (SubscriptionEdges) UserOrErr

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

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

type SubscriptionGroupBy

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

SubscriptionGroupBy is the group-by builder for Subscription entities.

func (*SubscriptionGroupBy) Aggregate

func (sgb *SubscriptionGroupBy) Aggregate(fns ...AggregateFunc) *SubscriptionGroupBy

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

func (*SubscriptionGroupBy) Bool

func (sgb *SubscriptionGroupBy) 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 (*SubscriptionGroupBy) BoolX

func (sgb *SubscriptionGroupBy) BoolX(ctx context.Context) bool

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

func (*SubscriptionGroupBy) Bools

func (sgb *SubscriptionGroupBy) 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 (*SubscriptionGroupBy) BoolsX

func (sgb *SubscriptionGroupBy) BoolsX(ctx context.Context) []bool

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

func (*SubscriptionGroupBy) Float64

func (sgb *SubscriptionGroupBy) 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 (*SubscriptionGroupBy) Float64X

func (sgb *SubscriptionGroupBy) Float64X(ctx context.Context) float64

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

func (*SubscriptionGroupBy) Float64s

func (sgb *SubscriptionGroupBy) 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 (*SubscriptionGroupBy) Float64sX

func (sgb *SubscriptionGroupBy) Float64sX(ctx context.Context) []float64

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

func (*SubscriptionGroupBy) Int

func (sgb *SubscriptionGroupBy) 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 (*SubscriptionGroupBy) IntX

func (sgb *SubscriptionGroupBy) IntX(ctx context.Context) int

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

func (*SubscriptionGroupBy) Ints

func (sgb *SubscriptionGroupBy) 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 (*SubscriptionGroupBy) IntsX

func (sgb *SubscriptionGroupBy) IntsX(ctx context.Context) []int

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

func (*SubscriptionGroupBy) Scan

func (sgb *SubscriptionGroupBy) Scan(ctx context.Context, v interface{}) error

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

func (*SubscriptionGroupBy) ScanX

func (sgb *SubscriptionGroupBy) ScanX(ctx context.Context, v interface{})

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

func (*SubscriptionGroupBy) String

func (sgb *SubscriptionGroupBy) 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 (*SubscriptionGroupBy) StringX

func (sgb *SubscriptionGroupBy) StringX(ctx context.Context) string

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

func (*SubscriptionGroupBy) Strings

func (sgb *SubscriptionGroupBy) 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 (*SubscriptionGroupBy) StringsX

func (sgb *SubscriptionGroupBy) StringsX(ctx context.Context) []string

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

type SubscriptionMutation

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

SubscriptionMutation represents an operation that mutates the Subscription nodes in the graph.

func (*SubscriptionMutation) AddField

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

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

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

func (*SubscriptionMutation) AddedField

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

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

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

func (*SubscriptionMutation) AddedIDs

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

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

func (*SubscriptionMutation) Cancelled

func (m *SubscriptionMutation) Cancelled() (r bool, exists bool)

Cancelled returns the value of the "cancelled" field in the mutation.

func (*SubscriptionMutation) ClearEdge

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

func (m *SubscriptionMutation) ClearExpiresAt()

ClearExpiresAt clears the value of the "expires_at" field.

func (*SubscriptionMutation) ClearField

func (m *SubscriptionMutation) 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 (*SubscriptionMutation) ClearStripeCustomerID

func (m *SubscriptionMutation) ClearStripeCustomerID()

ClearStripeCustomerID clears the value of the "stripe_customer_id" field.

func (*SubscriptionMutation) ClearStripeSubscriptionID

func (m *SubscriptionMutation) ClearStripeSubscriptionID()

ClearStripeSubscriptionID clears the value of the "stripe_subscription_id" field.

func (*SubscriptionMutation) ClearUser

func (m *SubscriptionMutation) ClearUser()

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

func (*SubscriptionMutation) ClearedEdges

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

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

func (*SubscriptionMutation) ClearedFields

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

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

func (SubscriptionMutation) Client

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

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

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

func (*SubscriptionMutation) EdgeCleared

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

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

func (*SubscriptionMutation) ExpiresAt

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

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

func (*SubscriptionMutation) ExpiresAtCleared

func (m *SubscriptionMutation) ExpiresAtCleared() bool

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

func (*SubscriptionMutation) Field

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

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

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

func (*SubscriptionMutation) Fields

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

func (m *SubscriptionMutation) 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 (*SubscriptionMutation) 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 (*SubscriptionMutation) OldCancelled

func (m *SubscriptionMutation) OldCancelled(ctx context.Context) (v bool, err error)

OldCancelled returns the old "cancelled" field's value of the Subscription entity. If the Subscription 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 (*SubscriptionMutation) OldCreatedAt

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

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

func (m *SubscriptionMutation) OldExpiresAt(ctx context.Context) (v time.Time, err error)

OldExpiresAt returns the old "expires_at" field's value of the Subscription entity. If the Subscription 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 (*SubscriptionMutation) OldField

func (m *SubscriptionMutation) 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 (*SubscriptionMutation) OldStripeCustomerID

func (m *SubscriptionMutation) OldStripeCustomerID(ctx context.Context) (v string, err error)

OldStripeCustomerID returns the old "stripe_customer_id" field's value of the Subscription entity. If the Subscription 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 (*SubscriptionMutation) OldStripeSubscriptionID

func (m *SubscriptionMutation) OldStripeSubscriptionID(ctx context.Context) (v string, err error)

OldStripeSubscriptionID returns the old "stripe_subscription_id" field's value of the Subscription entity. If the Subscription 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 (*SubscriptionMutation) OldTier

func (m *SubscriptionMutation) OldTier(ctx context.Context) (v subscription.Tier, err error)

OldTier returns the old "tier" field's value of the Subscription entity. If the Subscription 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 (*SubscriptionMutation) Op

func (m *SubscriptionMutation) Op() Op

Op returns the operation name.

func (*SubscriptionMutation) RemovedEdges

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

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

func (*SubscriptionMutation) RemovedIDs

func (m *SubscriptionMutation) 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 (*SubscriptionMutation) ResetCancelled

func (m *SubscriptionMutation) ResetCancelled()

ResetCancelled resets all changes to the "cancelled" field.

func (*SubscriptionMutation) ResetCreatedAt

func (m *SubscriptionMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*SubscriptionMutation) ResetEdge

func (m *SubscriptionMutation) 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 (*SubscriptionMutation) ResetExpiresAt

func (m *SubscriptionMutation) ResetExpiresAt()

ResetExpiresAt resets all changes to the "expires_at" field.

func (*SubscriptionMutation) ResetField

func (m *SubscriptionMutation) 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 (*SubscriptionMutation) ResetStripeCustomerID

func (m *SubscriptionMutation) ResetStripeCustomerID()

ResetStripeCustomerID resets all changes to the "stripe_customer_id" field.

func (*SubscriptionMutation) ResetStripeSubscriptionID

func (m *SubscriptionMutation) ResetStripeSubscriptionID()

ResetStripeSubscriptionID resets all changes to the "stripe_subscription_id" field.

func (*SubscriptionMutation) ResetTier

func (m *SubscriptionMutation) ResetTier()

ResetTier resets all changes to the "tier" field.

func (*SubscriptionMutation) ResetUser

func (m *SubscriptionMutation) ResetUser()

ResetUser resets all changes to the "user" edge.

func (*SubscriptionMutation) SetCancelled

func (m *SubscriptionMutation) SetCancelled(b bool)

SetCancelled sets the "cancelled" field.

func (*SubscriptionMutation) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*SubscriptionMutation) SetExpiresAt

func (m *SubscriptionMutation) SetExpiresAt(t time.Time)

SetExpiresAt sets the "expires_at" field.

func (*SubscriptionMutation) SetField

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

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

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

func (*SubscriptionMutation) SetStripeCustomerID

func (m *SubscriptionMutation) SetStripeCustomerID(s string)

SetStripeCustomerID sets the "stripe_customer_id" field.

func (*SubscriptionMutation) SetStripeSubscriptionID

func (m *SubscriptionMutation) SetStripeSubscriptionID(s string)

SetStripeSubscriptionID sets the "stripe_subscription_id" field.

func (*SubscriptionMutation) SetTier

func (m *SubscriptionMutation) SetTier(s subscription.Tier)

SetTier sets the "tier" field.

func (*SubscriptionMutation) SetUserID

func (m *SubscriptionMutation) SetUserID(id uuid.UUID)

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

func (*SubscriptionMutation) StripeCustomerID

func (m *SubscriptionMutation) StripeCustomerID() (r string, exists bool)

StripeCustomerID returns the value of the "stripe_customer_id" field in the mutation.

func (*SubscriptionMutation) StripeCustomerIDCleared

func (m *SubscriptionMutation) StripeCustomerIDCleared() bool

StripeCustomerIDCleared returns if the "stripe_customer_id" field was cleared in this mutation.

func (*SubscriptionMutation) StripeSubscriptionID

func (m *SubscriptionMutation) StripeSubscriptionID() (r string, exists bool)

StripeSubscriptionID returns the value of the "stripe_subscription_id" field in the mutation.

func (*SubscriptionMutation) StripeSubscriptionIDCleared

func (m *SubscriptionMutation) StripeSubscriptionIDCleared() bool

StripeSubscriptionIDCleared returns if the "stripe_subscription_id" field was cleared in this mutation.

func (*SubscriptionMutation) Tier

func (m *SubscriptionMutation) Tier() (r subscription.Tier, exists bool)

Tier returns the value of the "tier" field in the mutation.

func (SubscriptionMutation) Tx

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

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

func (*SubscriptionMutation) Type

func (m *SubscriptionMutation) Type() string

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

func (*SubscriptionMutation) UserCleared

func (m *SubscriptionMutation) UserCleared() bool

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

func (*SubscriptionMutation) UserID

func (m *SubscriptionMutation) UserID() (id uuid.UUID, exists bool)

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

func (*SubscriptionMutation) UserIDs

func (m *SubscriptionMutation) UserIDs() (ids []uuid.UUID)

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

func (*SubscriptionMutation) Where

Where appends a list predicates to the SubscriptionMutation builder.

type SubscriptionQuery

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

SubscriptionQuery is the builder for querying Subscription entities.

func (*SubscriptionQuery) All

func (sq *SubscriptionQuery) All(ctx context.Context) ([]*Subscription, error)

All executes the query and returns a list of Subscriptions.

func (*SubscriptionQuery) AllX

func (sq *SubscriptionQuery) AllX(ctx context.Context) []*Subscription

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

func (*SubscriptionQuery) Clone

func (sq *SubscriptionQuery) Clone() *SubscriptionQuery

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

func (*SubscriptionQuery) Count

func (sq *SubscriptionQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*SubscriptionQuery) CountX

func (sq *SubscriptionQuery) CountX(ctx context.Context) int

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

func (*SubscriptionQuery) Exist

func (sq *SubscriptionQuery) Exist(ctx context.Context) (bool, error)

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

func (*SubscriptionQuery) ExistX

func (sq *SubscriptionQuery) ExistX(ctx context.Context) bool

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

func (*SubscriptionQuery) First

func (sq *SubscriptionQuery) First(ctx context.Context) (*Subscription, error)

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

func (*SubscriptionQuery) FirstID

func (sq *SubscriptionQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

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

func (*SubscriptionQuery) FirstIDX

func (sq *SubscriptionQuery) FirstIDX(ctx context.Context) uuid.UUID

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

func (*SubscriptionQuery) FirstX

func (sq *SubscriptionQuery) FirstX(ctx context.Context) *Subscription

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

func (*SubscriptionQuery) GroupBy

func (sq *SubscriptionQuery) GroupBy(field string, fields ...string) *SubscriptionGroupBy

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

client.Subscription.Query().
	GroupBy(subscription.FieldStripeCustomerID).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*SubscriptionQuery) IDs

func (sq *SubscriptionQuery) IDs(ctx context.Context) ([]uuid.UUID, error)

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

func (*SubscriptionQuery) IDsX

func (sq *SubscriptionQuery) IDsX(ctx context.Context) []uuid.UUID

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

func (*SubscriptionQuery) Limit

func (sq *SubscriptionQuery) Limit(limit int) *SubscriptionQuery

Limit adds a limit step to the query.

func (*SubscriptionQuery) Modify

func (sq *SubscriptionQuery) Modify(modifiers ...func(s *sql.Selector)) *SubscriptionSelect

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

func (*SubscriptionQuery) Offset

func (sq *SubscriptionQuery) Offset(offset int) *SubscriptionQuery

Offset adds an offset step to the query.

func (*SubscriptionQuery) Only

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

func (*SubscriptionQuery) OnlyID

func (sq *SubscriptionQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

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

func (*SubscriptionQuery) OnlyIDX

func (sq *SubscriptionQuery) OnlyIDX(ctx context.Context) uuid.UUID

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

func (*SubscriptionQuery) OnlyX

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

func (*SubscriptionQuery) Order

Order adds an order step to the query.

func (*SubscriptionQuery) QueryUser

func (sq *SubscriptionQuery) QueryUser() *UserQuery

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

func (*SubscriptionQuery) Select

func (sq *SubscriptionQuery) Select(fields ...string) *SubscriptionSelect

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

client.Subscription.Query().
	Select(subscription.FieldStripeCustomerID).
	Scan(ctx, &v)

func (*SubscriptionQuery) Unique

func (sq *SubscriptionQuery) Unique(unique bool) *SubscriptionQuery

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

Where adds a new predicate for the SubscriptionQuery builder.

func (*SubscriptionQuery) WithUser

func (sq *SubscriptionQuery) WithUser(opts ...func(*UserQuery)) *SubscriptionQuery

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

type SubscriptionSelect

type SubscriptionSelect struct {
	*SubscriptionQuery
	// contains filtered or unexported fields
}

SubscriptionSelect is the builder for selecting fields of Subscription entities.

func (*SubscriptionSelect) Bool

func (ss *SubscriptionSelect) Bool(ctx context.Context) (_ bool, err error)

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

func (*SubscriptionSelect) BoolX

func (ss *SubscriptionSelect) BoolX(ctx context.Context) bool

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

func (*SubscriptionSelect) Bools

func (ss *SubscriptionSelect) Bools(ctx context.Context) ([]bool, error)

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

func (*SubscriptionSelect) BoolsX

func (ss *SubscriptionSelect) BoolsX(ctx context.Context) []bool

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

func (*SubscriptionSelect) Float64

func (ss *SubscriptionSelect) Float64(ctx context.Context) (_ float64, err error)

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

func (*SubscriptionSelect) Float64X

func (ss *SubscriptionSelect) Float64X(ctx context.Context) float64

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

func (*SubscriptionSelect) Float64s

func (ss *SubscriptionSelect) Float64s(ctx context.Context) ([]float64, error)

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

func (*SubscriptionSelect) Float64sX

func (ss *SubscriptionSelect) Float64sX(ctx context.Context) []float64

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

func (*SubscriptionSelect) Int

func (ss *SubscriptionSelect) Int(ctx context.Context) (_ int, err error)

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

func (*SubscriptionSelect) IntX

func (ss *SubscriptionSelect) IntX(ctx context.Context) int

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

func (*SubscriptionSelect) Ints

func (ss *SubscriptionSelect) Ints(ctx context.Context) ([]int, error)

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

func (*SubscriptionSelect) IntsX

func (ss *SubscriptionSelect) IntsX(ctx context.Context) []int

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

func (*SubscriptionSelect) Modify

func (ss *SubscriptionSelect) Modify(modifiers ...func(s *sql.Selector)) *SubscriptionSelect

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

func (*SubscriptionSelect) Scan

func (ss *SubscriptionSelect) Scan(ctx context.Context, v interface{}) error

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

func (*SubscriptionSelect) ScanX

func (ss *SubscriptionSelect) ScanX(ctx context.Context, v interface{})

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

func (*SubscriptionSelect) String

func (ss *SubscriptionSelect) String(ctx context.Context) (_ string, err error)

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

func (*SubscriptionSelect) StringX

func (ss *SubscriptionSelect) StringX(ctx context.Context) string

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

func (*SubscriptionSelect) Strings

func (ss *SubscriptionSelect) Strings(ctx context.Context) ([]string, error)

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

func (*SubscriptionSelect) StringsX

func (ss *SubscriptionSelect) StringsX(ctx context.Context) []string

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

type SubscriptionUpdate

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

SubscriptionUpdate is the builder for updating Subscription entities.

func (*SubscriptionUpdate) ClearExpiresAt

func (su *SubscriptionUpdate) ClearExpiresAt() *SubscriptionUpdate

ClearExpiresAt clears the value of the "expires_at" field.

func (*SubscriptionUpdate) ClearStripeCustomerID

func (su *SubscriptionUpdate) ClearStripeCustomerID() *SubscriptionUpdate

ClearStripeCustomerID clears the value of the "stripe_customer_id" field.

func (*SubscriptionUpdate) ClearStripeSubscriptionID

func (su *SubscriptionUpdate) ClearStripeSubscriptionID() *SubscriptionUpdate

ClearStripeSubscriptionID clears the value of the "stripe_subscription_id" field.

func (*SubscriptionUpdate) ClearUser

func (su *SubscriptionUpdate) ClearUser() *SubscriptionUpdate

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

func (*SubscriptionUpdate) Exec

func (su *SubscriptionUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*SubscriptionUpdate) ExecX

func (su *SubscriptionUpdate) ExecX(ctx context.Context)

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

func (*SubscriptionUpdate) Mutation

func (su *SubscriptionUpdate) Mutation() *SubscriptionMutation

Mutation returns the SubscriptionMutation object of the builder.

func (*SubscriptionUpdate) Save

func (su *SubscriptionUpdate) Save(ctx context.Context) (int, error)

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

func (*SubscriptionUpdate) SaveX

func (su *SubscriptionUpdate) SaveX(ctx context.Context) int

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

func (*SubscriptionUpdate) SetCancelled

func (su *SubscriptionUpdate) SetCancelled(b bool) *SubscriptionUpdate

SetCancelled sets the "cancelled" field.

func (*SubscriptionUpdate) SetCreatedAt

func (su *SubscriptionUpdate) SetCreatedAt(t time.Time) *SubscriptionUpdate

SetCreatedAt sets the "created_at" field.

func (*SubscriptionUpdate) SetExpiresAt

func (su *SubscriptionUpdate) SetExpiresAt(t time.Time) *SubscriptionUpdate

SetExpiresAt sets the "expires_at" field.

func (*SubscriptionUpdate) SetNillableCancelled

func (su *SubscriptionUpdate) SetNillableCancelled(b *bool) *SubscriptionUpdate

SetNillableCancelled sets the "cancelled" field if the given value is not nil.

func (*SubscriptionUpdate) SetNillableCreatedAt

func (su *SubscriptionUpdate) SetNillableCreatedAt(t *time.Time) *SubscriptionUpdate

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

func (*SubscriptionUpdate) SetNillableExpiresAt

func (su *SubscriptionUpdate) SetNillableExpiresAt(t *time.Time) *SubscriptionUpdate

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

func (*SubscriptionUpdate) SetNillableStripeCustomerID

func (su *SubscriptionUpdate) SetNillableStripeCustomerID(s *string) *SubscriptionUpdate

SetNillableStripeCustomerID sets the "stripe_customer_id" field if the given value is not nil.

func (*SubscriptionUpdate) SetNillableStripeSubscriptionID

func (su *SubscriptionUpdate) SetNillableStripeSubscriptionID(s *string) *SubscriptionUpdate

SetNillableStripeSubscriptionID sets the "stripe_subscription_id" field if the given value is not nil.

func (*SubscriptionUpdate) SetNillableTier

func (su *SubscriptionUpdate) SetNillableTier(s *subscription.Tier) *SubscriptionUpdate

SetNillableTier sets the "tier" field if the given value is not nil.

func (*SubscriptionUpdate) SetStripeCustomerID

func (su *SubscriptionUpdate) SetStripeCustomerID(s string) *SubscriptionUpdate

SetStripeCustomerID sets the "stripe_customer_id" field.

func (*SubscriptionUpdate) SetStripeSubscriptionID

func (su *SubscriptionUpdate) SetStripeSubscriptionID(s string) *SubscriptionUpdate

SetStripeSubscriptionID sets the "stripe_subscription_id" field.

func (*SubscriptionUpdate) SetTier

SetTier sets the "tier" field.

func (*SubscriptionUpdate) SetUser

func (su *SubscriptionUpdate) SetUser(u *User) *SubscriptionUpdate

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

func (*SubscriptionUpdate) SetUserID

func (su *SubscriptionUpdate) SetUserID(id uuid.UUID) *SubscriptionUpdate

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

func (*SubscriptionUpdate) Where

Where appends a list predicates to the SubscriptionUpdate builder.

type SubscriptionUpdateOne

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

SubscriptionUpdateOne is the builder for updating a single Subscription entity.

func (*SubscriptionUpdateOne) ClearExpiresAt

func (suo *SubscriptionUpdateOne) ClearExpiresAt() *SubscriptionUpdateOne

ClearExpiresAt clears the value of the "expires_at" field.

func (*SubscriptionUpdateOne) ClearStripeCustomerID

func (suo *SubscriptionUpdateOne) ClearStripeCustomerID() *SubscriptionUpdateOne

ClearStripeCustomerID clears the value of the "stripe_customer_id" field.

func (*SubscriptionUpdateOne) ClearStripeSubscriptionID

func (suo *SubscriptionUpdateOne) ClearStripeSubscriptionID() *SubscriptionUpdateOne

ClearStripeSubscriptionID clears the value of the "stripe_subscription_id" field.

func (*SubscriptionUpdateOne) ClearUser

func (suo *SubscriptionUpdateOne) ClearUser() *SubscriptionUpdateOne

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

func (*SubscriptionUpdateOne) Exec

func (suo *SubscriptionUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*SubscriptionUpdateOne) ExecX

func (suo *SubscriptionUpdateOne) ExecX(ctx context.Context)

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

func (*SubscriptionUpdateOne) Mutation

Mutation returns the SubscriptionMutation object of the builder.

func (*SubscriptionUpdateOne) Save

Save executes the query and returns the updated Subscription entity.

func (*SubscriptionUpdateOne) SaveX

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

func (*SubscriptionUpdateOne) Select

func (suo *SubscriptionUpdateOne) Select(field string, fields ...string) *SubscriptionUpdateOne

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

func (*SubscriptionUpdateOne) SetCancelled

func (suo *SubscriptionUpdateOne) SetCancelled(b bool) *SubscriptionUpdateOne

SetCancelled sets the "cancelled" field.

func (*SubscriptionUpdateOne) SetCreatedAt

func (suo *SubscriptionUpdateOne) SetCreatedAt(t time.Time) *SubscriptionUpdateOne

SetCreatedAt sets the "created_at" field.

func (*SubscriptionUpdateOne) SetExpiresAt

func (suo *SubscriptionUpdateOne) SetExpiresAt(t time.Time) *SubscriptionUpdateOne

SetExpiresAt sets the "expires_at" field.

func (*SubscriptionUpdateOne) SetNillableCancelled

func (suo *SubscriptionUpdateOne) SetNillableCancelled(b *bool) *SubscriptionUpdateOne

SetNillableCancelled sets the "cancelled" field if the given value is not nil.

func (*SubscriptionUpdateOne) SetNillableCreatedAt

func (suo *SubscriptionUpdateOne) SetNillableCreatedAt(t *time.Time) *SubscriptionUpdateOne

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

func (*SubscriptionUpdateOne) SetNillableExpiresAt

func (suo *SubscriptionUpdateOne) SetNillableExpiresAt(t *time.Time) *SubscriptionUpdateOne

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

func (*SubscriptionUpdateOne) SetNillableStripeCustomerID

func (suo *SubscriptionUpdateOne) SetNillableStripeCustomerID(s *string) *SubscriptionUpdateOne

SetNillableStripeCustomerID sets the "stripe_customer_id" field if the given value is not nil.

func (*SubscriptionUpdateOne) SetNillableStripeSubscriptionID

func (suo *SubscriptionUpdateOne) SetNillableStripeSubscriptionID(s *string) *SubscriptionUpdateOne

SetNillableStripeSubscriptionID sets the "stripe_subscription_id" field if the given value is not nil.

func (*SubscriptionUpdateOne) SetNillableTier

SetNillableTier sets the "tier" field if the given value is not nil.

func (*SubscriptionUpdateOne) SetStripeCustomerID

func (suo *SubscriptionUpdateOne) SetStripeCustomerID(s string) *SubscriptionUpdateOne

SetStripeCustomerID sets the "stripe_customer_id" field.

func (*SubscriptionUpdateOne) SetStripeSubscriptionID

func (suo *SubscriptionUpdateOne) SetStripeSubscriptionID(s string) *SubscriptionUpdateOne

SetStripeSubscriptionID sets the "stripe_subscription_id" field.

func (*SubscriptionUpdateOne) SetTier

SetTier sets the "tier" field.

func (*SubscriptionUpdateOne) SetUser

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

func (*SubscriptionUpdateOne) SetUserID

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

type SubscriptionUpsert

type SubscriptionUpsert struct {
	*sql.UpdateSet
}

SubscriptionUpsert is the "OnConflict" setter.

func (*SubscriptionUpsert) ClearExpiresAt

func (u *SubscriptionUpsert) ClearExpiresAt() *SubscriptionUpsert

ClearExpiresAt clears the value of the "expires_at" field.

func (*SubscriptionUpsert) ClearStripeCustomerID

func (u *SubscriptionUpsert) ClearStripeCustomerID() *SubscriptionUpsert

ClearStripeCustomerID clears the value of the "stripe_customer_id" field.

func (*SubscriptionUpsert) ClearStripeSubscriptionID

func (u *SubscriptionUpsert) ClearStripeSubscriptionID() *SubscriptionUpsert

ClearStripeSubscriptionID clears the value of the "stripe_subscription_id" field.

func (*SubscriptionUpsert) SetCancelled

func (u *SubscriptionUpsert) SetCancelled(v bool) *SubscriptionUpsert

SetCancelled sets the "cancelled" field.

func (*SubscriptionUpsert) SetCreatedAt

func (u *SubscriptionUpsert) SetCreatedAt(v time.Time) *SubscriptionUpsert

SetCreatedAt sets the "created_at" field.

func (*SubscriptionUpsert) SetExpiresAt

func (u *SubscriptionUpsert) SetExpiresAt(v time.Time) *SubscriptionUpsert

SetExpiresAt sets the "expires_at" field.

func (*SubscriptionUpsert) SetStripeCustomerID

func (u *SubscriptionUpsert) SetStripeCustomerID(v string) *SubscriptionUpsert

SetStripeCustomerID sets the "stripe_customer_id" field.

func (*SubscriptionUpsert) SetStripeSubscriptionID

func (u *SubscriptionUpsert) SetStripeSubscriptionID(v string) *SubscriptionUpsert

SetStripeSubscriptionID sets the "stripe_subscription_id" field.

func (*SubscriptionUpsert) SetTier

SetTier sets the "tier" field.

func (*SubscriptionUpsert) UpdateCancelled

func (u *SubscriptionUpsert) UpdateCancelled() *SubscriptionUpsert

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

func (*SubscriptionUpsert) UpdateCreatedAt

func (u *SubscriptionUpsert) UpdateCreatedAt() *SubscriptionUpsert

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

func (*SubscriptionUpsert) UpdateExpiresAt

func (u *SubscriptionUpsert) UpdateExpiresAt() *SubscriptionUpsert

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

func (*SubscriptionUpsert) UpdateStripeCustomerID

func (u *SubscriptionUpsert) UpdateStripeCustomerID() *SubscriptionUpsert

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

func (*SubscriptionUpsert) UpdateStripeSubscriptionID

func (u *SubscriptionUpsert) UpdateStripeSubscriptionID() *SubscriptionUpsert

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

func (*SubscriptionUpsert) UpdateTier

func (u *SubscriptionUpsert) UpdateTier() *SubscriptionUpsert

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

type SubscriptionUpsertBulk

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

SubscriptionUpsertBulk is the builder for "upsert"-ing a bulk of Subscription nodes.

func (*SubscriptionUpsertBulk) ClearExpiresAt

func (u *SubscriptionUpsertBulk) ClearExpiresAt() *SubscriptionUpsertBulk

ClearExpiresAt clears the value of the "expires_at" field.

func (*SubscriptionUpsertBulk) ClearStripeCustomerID

func (u *SubscriptionUpsertBulk) ClearStripeCustomerID() *SubscriptionUpsertBulk

ClearStripeCustomerID clears the value of the "stripe_customer_id" field.

func (*SubscriptionUpsertBulk) ClearStripeSubscriptionID

func (u *SubscriptionUpsertBulk) ClearStripeSubscriptionID() *SubscriptionUpsertBulk

ClearStripeSubscriptionID clears the value of the "stripe_subscription_id" field.

func (*SubscriptionUpsertBulk) DoNothing

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

func (*SubscriptionUpsertBulk) Exec

Exec executes the query.

func (*SubscriptionUpsertBulk) ExecX

func (u *SubscriptionUpsertBulk) ExecX(ctx context.Context)

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

func (*SubscriptionUpsertBulk) Ignore

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

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

func (*SubscriptionUpsertBulk) SetCancelled

SetCancelled sets the "cancelled" field.

func (*SubscriptionUpsertBulk) SetCreatedAt

SetCreatedAt sets the "created_at" field.

func (*SubscriptionUpsertBulk) SetExpiresAt

SetExpiresAt sets the "expires_at" field.

func (*SubscriptionUpsertBulk) SetStripeCustomerID

func (u *SubscriptionUpsertBulk) SetStripeCustomerID(v string) *SubscriptionUpsertBulk

SetStripeCustomerID sets the "stripe_customer_id" field.

func (*SubscriptionUpsertBulk) SetStripeSubscriptionID

func (u *SubscriptionUpsertBulk) SetStripeSubscriptionID(v string) *SubscriptionUpsertBulk

SetStripeSubscriptionID sets the "stripe_subscription_id" field.

func (*SubscriptionUpsertBulk) SetTier

SetTier sets the "tier" field.

func (*SubscriptionUpsertBulk) Update

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

func (*SubscriptionUpsertBulk) UpdateCancelled

func (u *SubscriptionUpsertBulk) UpdateCancelled() *SubscriptionUpsertBulk

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

func (*SubscriptionUpsertBulk) UpdateCreatedAt

func (u *SubscriptionUpsertBulk) UpdateCreatedAt() *SubscriptionUpsertBulk

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

func (*SubscriptionUpsertBulk) UpdateExpiresAt

func (u *SubscriptionUpsertBulk) UpdateExpiresAt() *SubscriptionUpsertBulk

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

func (*SubscriptionUpsertBulk) UpdateNewValues

func (u *SubscriptionUpsertBulk) UpdateNewValues() *SubscriptionUpsertBulk

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

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

func (*SubscriptionUpsertBulk) UpdateStripeCustomerID

func (u *SubscriptionUpsertBulk) UpdateStripeCustomerID() *SubscriptionUpsertBulk

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

func (*SubscriptionUpsertBulk) UpdateStripeSubscriptionID

func (u *SubscriptionUpsertBulk) UpdateStripeSubscriptionID() *SubscriptionUpsertBulk

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

func (*SubscriptionUpsertBulk) UpdateTier

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

type SubscriptionUpsertOne

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

SubscriptionUpsertOne is the builder for "upsert"-ing

one Subscription node.

func (*SubscriptionUpsertOne) ClearExpiresAt

func (u *SubscriptionUpsertOne) ClearExpiresAt() *SubscriptionUpsertOne

ClearExpiresAt clears the value of the "expires_at" field.

func (*SubscriptionUpsertOne) ClearStripeCustomerID

func (u *SubscriptionUpsertOne) ClearStripeCustomerID() *SubscriptionUpsertOne

ClearStripeCustomerID clears the value of the "stripe_customer_id" field.

func (*SubscriptionUpsertOne) ClearStripeSubscriptionID

func (u *SubscriptionUpsertOne) ClearStripeSubscriptionID() *SubscriptionUpsertOne

ClearStripeSubscriptionID clears the value of the "stripe_subscription_id" field.

func (*SubscriptionUpsertOne) DoNothing

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

func (*SubscriptionUpsertOne) Exec

Exec executes the query.

func (*SubscriptionUpsertOne) ExecX

func (u *SubscriptionUpsertOne) ExecX(ctx context.Context)

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

func (*SubscriptionUpsertOne) ID

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

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

func (*SubscriptionUpsertOne) IDX

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

func (*SubscriptionUpsertOne) Ignore

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

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

func (*SubscriptionUpsertOne) SetCancelled

func (u *SubscriptionUpsertOne) SetCancelled(v bool) *SubscriptionUpsertOne

SetCancelled sets the "cancelled" field.

func (*SubscriptionUpsertOne) SetCreatedAt

SetCreatedAt sets the "created_at" field.

func (*SubscriptionUpsertOne) SetExpiresAt

SetExpiresAt sets the "expires_at" field.

func (*SubscriptionUpsertOne) SetStripeCustomerID

func (u *SubscriptionUpsertOne) SetStripeCustomerID(v string) *SubscriptionUpsertOne

SetStripeCustomerID sets the "stripe_customer_id" field.

func (*SubscriptionUpsertOne) SetStripeSubscriptionID

func (u *SubscriptionUpsertOne) SetStripeSubscriptionID(v string) *SubscriptionUpsertOne

SetStripeSubscriptionID sets the "stripe_subscription_id" field.

func (*SubscriptionUpsertOne) SetTier

SetTier sets the "tier" field.

func (*SubscriptionUpsertOne) Update

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

func (*SubscriptionUpsertOne) UpdateCancelled

func (u *SubscriptionUpsertOne) UpdateCancelled() *SubscriptionUpsertOne

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

func (*SubscriptionUpsertOne) UpdateCreatedAt

func (u *SubscriptionUpsertOne) UpdateCreatedAt() *SubscriptionUpsertOne

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

func (*SubscriptionUpsertOne) UpdateExpiresAt

func (u *SubscriptionUpsertOne) UpdateExpiresAt() *SubscriptionUpsertOne

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

func (*SubscriptionUpsertOne) UpdateNewValues

func (u *SubscriptionUpsertOne) UpdateNewValues() *SubscriptionUpsertOne

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.Subscription.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
		sql.ResolveWith(func(u *sql.UpdateSet) {
			u.SetIgnore(subscription.FieldID)
		}),
	).
	Exec(ctx)

func (*SubscriptionUpsertOne) UpdateStripeCustomerID

func (u *SubscriptionUpsertOne) UpdateStripeCustomerID() *SubscriptionUpsertOne

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

func (*SubscriptionUpsertOne) UpdateStripeSubscriptionID

func (u *SubscriptionUpsertOne) UpdateStripeSubscriptionID() *SubscriptionUpsertOne

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

func (*SubscriptionUpsertOne) UpdateTier

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

type Subscriptions

type Subscriptions []*Subscription

Subscriptions is a parsable slice of Subscription.

type Token

type Token struct {

	// ID of the ent.
	ID uuid.UUID `json:"id,omitempty"`
	// IsActive holds the value of the "is_active" field.
	IsActive bool `json:"is_active,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 TokenQuery when eager-loading is set.
	Edges TokenEdges `json:"edges"`
	// contains filtered or unexported fields
}

Token is the model entity for the Token schema.

func (*Token) QueryUser

func (t *Token) QueryUser() *UserQuery

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

func (*Token) String

func (t *Token) String() string

String implements the fmt.Stringer.

func (*Token) Unwrap

func (t *Token) Unwrap() *Token

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

func (t *Token) Update() *TokenUpdateOne

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

type TokenClient

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

TokenClient is a client for the Token schema.

func NewTokenClient

func NewTokenClient(c config) *TokenClient

NewTokenClient returns a client for the Token from the given config.

func (*TokenClient) Create

func (c *TokenClient) Create() *TokenCreate

Create returns a create builder for Token.

func (*TokenClient) CreateBulk

func (c *TokenClient) CreateBulk(builders ...*TokenCreate) *TokenCreateBulk

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

func (*TokenClient) Delete

func (c *TokenClient) Delete() *TokenDelete

Delete returns a delete builder for Token.

func (*TokenClient) DeleteOne

func (c *TokenClient) DeleteOne(t *Token) *TokenDeleteOne

DeleteOne returns a delete builder for the given entity.

func (*TokenClient) DeleteOneID

func (c *TokenClient) DeleteOneID(id uuid.UUID) *TokenDeleteOne

DeleteOneID returns a delete builder for the given id.

func (*TokenClient) Get

func (c *TokenClient) Get(ctx context.Context, id uuid.UUID) (*Token, error)

Get returns a Token entity by its id.

func (*TokenClient) GetX

func (c *TokenClient) GetX(ctx context.Context, id uuid.UUID) *Token

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

func (*TokenClient) Hooks

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

Hooks returns the client hooks.

func (*TokenClient) Query

func (c *TokenClient) Query() *TokenQuery

Query returns a query builder for Token.

func (*TokenClient) QueryUser

func (c *TokenClient) QueryUser(t *Token) *UserQuery

QueryUser queries the user edge of a Token.

func (*TokenClient) Update

func (c *TokenClient) Update() *TokenUpdate

Update returns an update builder for Token.

func (*TokenClient) UpdateOne

func (c *TokenClient) UpdateOne(t *Token) *TokenUpdateOne

UpdateOne returns an update builder for the given entity.

func (*TokenClient) UpdateOneID

func (c *TokenClient) UpdateOneID(id uuid.UUID) *TokenUpdateOne

UpdateOneID returns an update builder for the given id.

func (*TokenClient) Use

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

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

type TokenCreate

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

TokenCreate is the builder for creating a Token entity.

func (*TokenCreate) Exec

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

Exec executes the query.

func (*TokenCreate) ExecX

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

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

func (*TokenCreate) Mutation

func (tc *TokenCreate) Mutation() *TokenMutation

Mutation returns the TokenMutation object of the builder.

func (*TokenCreate) OnConflict

func (tc *TokenCreate) OnConflict(opts ...sql.ConflictOption) *TokenUpsertOne

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

client.Token.Create().
	SetIsActive(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.TokenUpsert) {
		SetIsActive(v+v).
	}).
	Exec(ctx)

func (*TokenCreate) OnConflictColumns

func (tc *TokenCreate) OnConflictColumns(columns ...string) *TokenUpsertOne

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

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

func (*TokenCreate) Save

func (tc *TokenCreate) Save(ctx context.Context) (*Token, error)

Save creates the Token in the database.

func (*TokenCreate) SaveX

func (tc *TokenCreate) SaveX(ctx context.Context) *Token

SaveX calls Save and panics if Save returns an error.

func (*TokenCreate) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*TokenCreate) SetID

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

SetID sets the "id" field.

func (*TokenCreate) SetIsActive

func (tc *TokenCreate) SetIsActive(b bool) *TokenCreate

SetIsActive sets the "is_active" field.

func (*TokenCreate) SetNillableCreatedAt

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

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

func (*TokenCreate) SetNillableID

func (tc *TokenCreate) SetNillableID(u *uuid.UUID) *TokenCreate

SetNillableID sets the "id" field if the given value is not nil.

func (*TokenCreate) SetNillableIsActive

func (tc *TokenCreate) SetNillableIsActive(b *bool) *TokenCreate

SetNillableIsActive sets the "is_active" field if the given value is not nil.

func (*TokenCreate) SetUser

func (tc *TokenCreate) SetUser(u *User) *TokenCreate

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

func (*TokenCreate) SetUserID

func (tc *TokenCreate) SetUserID(id uuid.UUID) *TokenCreate

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

type TokenCreateBulk

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

TokenCreateBulk is the builder for creating many Token entities in bulk.

func (*TokenCreateBulk) Exec

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

Exec executes the query.

func (*TokenCreateBulk) ExecX

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

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

func (*TokenCreateBulk) OnConflict

func (tcb *TokenCreateBulk) OnConflict(opts ...sql.ConflictOption) *TokenUpsertBulk

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

client.Token.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.TokenUpsert) {
		SetIsActive(v+v).
	}).
	Exec(ctx)

func (*TokenCreateBulk) OnConflictColumns

func (tcb *TokenCreateBulk) OnConflictColumns(columns ...string) *TokenUpsertBulk

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

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

func (*TokenCreateBulk) Save

func (tcb *TokenCreateBulk) Save(ctx context.Context) ([]*Token, error)

Save creates the Token entities in the database.

func (*TokenCreateBulk) SaveX

func (tcb *TokenCreateBulk) SaveX(ctx context.Context) []*Token

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

type TokenDelete

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

TokenDelete is the builder for deleting a Token entity.

func (*TokenDelete) Exec

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

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

func (*TokenDelete) ExecX

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

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

func (*TokenDelete) Where

func (td *TokenDelete) Where(ps ...predicate.Token) *TokenDelete

Where appends a list predicates to the TokenDelete builder.

type TokenDeleteOne

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

TokenDeleteOne is the builder for deleting a single Token entity.

func (*TokenDeleteOne) Exec

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

Exec executes the deletion query.

func (*TokenDeleteOne) ExecX

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

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

type TokenEdges

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

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

func (TokenEdges) UserOrErr

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

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

type TokenGroupBy

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

TokenGroupBy is the group-by builder for Token entities.

func (*TokenGroupBy) Aggregate

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

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

func (*TokenGroupBy) Bool

func (tgb *TokenGroupBy) 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 (*TokenGroupBy) BoolX

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

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

func (*TokenGroupBy) Bools

func (tgb *TokenGroupBy) 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 (*TokenGroupBy) BoolsX

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

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

func (*TokenGroupBy) Float64

func (tgb *TokenGroupBy) 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 (*TokenGroupBy) Float64X

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

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

func (*TokenGroupBy) Float64s

func (tgb *TokenGroupBy) 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 (*TokenGroupBy) Float64sX

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

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

func (*TokenGroupBy) Int

func (tgb *TokenGroupBy) 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 (*TokenGroupBy) IntX

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

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

func (*TokenGroupBy) Ints

func (tgb *TokenGroupBy) 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 (*TokenGroupBy) IntsX

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

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

func (*TokenGroupBy) Scan

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

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

func (*TokenGroupBy) ScanX

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

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

func (*TokenGroupBy) String

func (tgb *TokenGroupBy) 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 (*TokenGroupBy) StringX

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

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

func (*TokenGroupBy) Strings

func (tgb *TokenGroupBy) 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 (*TokenGroupBy) StringsX

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

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

type TokenMutation

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

TokenMutation represents an operation that mutates the Token nodes in the graph.

func (*TokenMutation) AddField

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

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

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

func (*TokenMutation) AddedField

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

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

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

func (*TokenMutation) AddedIDs

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

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

func (*TokenMutation) ClearEdge

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

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

func (m *TokenMutation) ClearUser()

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

func (*TokenMutation) ClearedEdges

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

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

func (*TokenMutation) ClearedFields

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

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

func (TokenMutation) Client

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

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

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

func (*TokenMutation) EdgeCleared

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

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

func (*TokenMutation) Field

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

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

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

func (*TokenMutation) Fields

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

func (m *TokenMutation) 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 (*TokenMutation) IDs

func (m *TokenMutation) 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 (*TokenMutation) IsActive

func (m *TokenMutation) IsActive() (r bool, exists bool)

IsActive returns the value of the "is_active" field in the mutation.

func (*TokenMutation) OldCreatedAt

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

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

func (m *TokenMutation) 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 (*TokenMutation) OldIsActive

func (m *TokenMutation) OldIsActive(ctx context.Context) (v bool, err error)

OldIsActive returns the old "is_active" field's value of the Token entity. If the Token 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 (*TokenMutation) Op

func (m *TokenMutation) Op() Op

Op returns the operation name.

func (*TokenMutation) RemovedEdges

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

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

func (*TokenMutation) RemovedIDs

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

func (m *TokenMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*TokenMutation) ResetEdge

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

func (m *TokenMutation) 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 (*TokenMutation) ResetIsActive

func (m *TokenMutation) ResetIsActive()

ResetIsActive resets all changes to the "is_active" field.

func (*TokenMutation) ResetUser

func (m *TokenMutation) ResetUser()

ResetUser resets all changes to the "user" edge.

func (*TokenMutation) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*TokenMutation) SetField

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

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

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

func (*TokenMutation) SetIsActive

func (m *TokenMutation) SetIsActive(b bool)

SetIsActive sets the "is_active" field.

func (*TokenMutation) SetUserID

func (m *TokenMutation) SetUserID(id uuid.UUID)

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

func (TokenMutation) Tx

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

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

func (*TokenMutation) Type

func (m *TokenMutation) Type() string

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

func (*TokenMutation) UserCleared

func (m *TokenMutation) UserCleared() bool

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

func (*TokenMutation) UserID

func (m *TokenMutation) UserID() (id uuid.UUID, exists bool)

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

func (*TokenMutation) UserIDs

func (m *TokenMutation) UserIDs() (ids []uuid.UUID)

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

func (*TokenMutation) Where

func (m *TokenMutation) Where(ps ...predicate.Token)

Where appends a list predicates to the TokenMutation builder.

type TokenQuery

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

TokenQuery is the builder for querying Token entities.

func (*TokenQuery) All

func (tq *TokenQuery) All(ctx context.Context) ([]*Token, error)

All executes the query and returns a list of Tokens.

func (*TokenQuery) AllX

func (tq *TokenQuery) AllX(ctx context.Context) []*Token

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

func (*TokenQuery) Clone

func (tq *TokenQuery) Clone() *TokenQuery

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

func (*TokenQuery) Count

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

Count returns the count of the given query.

func (*TokenQuery) CountX

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

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

func (*TokenQuery) Exist

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

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

func (*TokenQuery) ExistX

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

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

func (*TokenQuery) First

func (tq *TokenQuery) First(ctx context.Context) (*Token, error)

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

func (*TokenQuery) FirstID

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

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

func (*TokenQuery) FirstIDX

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

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

func (*TokenQuery) FirstX

func (tq *TokenQuery) FirstX(ctx context.Context) *Token

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

func (*TokenQuery) GroupBy

func (tq *TokenQuery) GroupBy(field string, fields ...string) *TokenGroupBy

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 {
	IsActive bool `json:"is_active,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Token.Query().
	GroupBy(token.FieldIsActive).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*TokenQuery) IDs

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

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

func (*TokenQuery) IDsX

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

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

func (*TokenQuery) Limit

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

Limit adds a limit step to the query.

func (*TokenQuery) Modify

func (tq *TokenQuery) Modify(modifiers ...func(s *sql.Selector)) *TokenSelect

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

func (*TokenQuery) Offset

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

Offset adds an offset step to the query.

func (*TokenQuery) Only

func (tq *TokenQuery) Only(ctx context.Context) (*Token, error)

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

func (*TokenQuery) OnlyID

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

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

func (*TokenQuery) OnlyIDX

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

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

func (*TokenQuery) OnlyX

func (tq *TokenQuery) OnlyX(ctx context.Context) *Token

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

func (*TokenQuery) Order

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

Order adds an order step to the query.

func (*TokenQuery) QueryUser

func (tq *TokenQuery) QueryUser() *UserQuery

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

func (*TokenQuery) Select

func (tq *TokenQuery) Select(fields ...string) *TokenSelect

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 {
	IsActive bool `json:"is_active,omitempty"`
}

client.Token.Query().
	Select(token.FieldIsActive).
	Scan(ctx, &v)

func (*TokenQuery) Unique

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

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

func (tq *TokenQuery) Where(ps ...predicate.Token) *TokenQuery

Where adds a new predicate for the TokenQuery builder.

func (*TokenQuery) WithUser

func (tq *TokenQuery) WithUser(opts ...func(*UserQuery)) *TokenQuery

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

type TokenSelect

type TokenSelect struct {
	*TokenQuery
	// contains filtered or unexported fields
}

TokenSelect is the builder for selecting fields of Token entities.

func (*TokenSelect) Bool

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

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

func (*TokenSelect) BoolX

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

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

func (*TokenSelect) Bools

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

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

func (*TokenSelect) BoolsX

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

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

func (*TokenSelect) Float64

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

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

func (*TokenSelect) Float64X

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

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

func (*TokenSelect) Float64s

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

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

func (*TokenSelect) Float64sX

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

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

func (*TokenSelect) Int

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

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

func (*TokenSelect) IntX

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

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

func (*TokenSelect) Ints

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

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

func (*TokenSelect) IntsX

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

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

func (*TokenSelect) Modify

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

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

func (*TokenSelect) Scan

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

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

func (*TokenSelect) ScanX

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

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

func (*TokenSelect) String

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

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

func (*TokenSelect) StringX

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

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

func (*TokenSelect) Strings

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

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

func (*TokenSelect) StringsX

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

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

type TokenUpdate

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

TokenUpdate is the builder for updating Token entities.

func (*TokenUpdate) ClearUser

func (tu *TokenUpdate) ClearUser() *TokenUpdate

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

func (*TokenUpdate) Exec

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

Exec executes the query.

func (*TokenUpdate) ExecX

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

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

func (*TokenUpdate) Mutation

func (tu *TokenUpdate) Mutation() *TokenMutation

Mutation returns the TokenMutation object of the builder.

func (*TokenUpdate) Save

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

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

func (*TokenUpdate) SaveX

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

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

func (*TokenUpdate) SetCreatedAt

func (tu *TokenUpdate) SetCreatedAt(t time.Time) *TokenUpdate

SetCreatedAt sets the "created_at" field.

func (*TokenUpdate) SetIsActive

func (tu *TokenUpdate) SetIsActive(b bool) *TokenUpdate

SetIsActive sets the "is_active" field.

func (*TokenUpdate) SetNillableCreatedAt

func (tu *TokenUpdate) SetNillableCreatedAt(t *time.Time) *TokenUpdate

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

func (*TokenUpdate) SetNillableIsActive

func (tu *TokenUpdate) SetNillableIsActive(b *bool) *TokenUpdate

SetNillableIsActive sets the "is_active" field if the given value is not nil.

func (*TokenUpdate) SetUser

func (tu *TokenUpdate) SetUser(u *User) *TokenUpdate

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

func (*TokenUpdate) SetUserID

func (tu *TokenUpdate) SetUserID(id uuid.UUID) *TokenUpdate

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

func (*TokenUpdate) Where

func (tu *TokenUpdate) Where(ps ...predicate.Token) *TokenUpdate

Where appends a list predicates to the TokenUpdate builder.

type TokenUpdateOne

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

TokenUpdateOne is the builder for updating a single Token entity.

func (*TokenUpdateOne) ClearUser

func (tuo *TokenUpdateOne) ClearUser() *TokenUpdateOne

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

func (*TokenUpdateOne) Exec

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

Exec executes the query on the entity.

func (*TokenUpdateOne) ExecX

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

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

func (*TokenUpdateOne) Mutation

func (tuo *TokenUpdateOne) Mutation() *TokenMutation

Mutation returns the TokenMutation object of the builder.

func (*TokenUpdateOne) Save

func (tuo *TokenUpdateOne) Save(ctx context.Context) (*Token, error)

Save executes the query and returns the updated Token entity.

func (*TokenUpdateOne) SaveX

func (tuo *TokenUpdateOne) SaveX(ctx context.Context) *Token

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

func (*TokenUpdateOne) Select

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

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

func (*TokenUpdateOne) SetCreatedAt

func (tuo *TokenUpdateOne) SetCreatedAt(t time.Time) *TokenUpdateOne

SetCreatedAt sets the "created_at" field.

func (*TokenUpdateOne) SetIsActive

func (tuo *TokenUpdateOne) SetIsActive(b bool) *TokenUpdateOne

SetIsActive sets the "is_active" field.

func (*TokenUpdateOne) SetNillableCreatedAt

func (tuo *TokenUpdateOne) SetNillableCreatedAt(t *time.Time) *TokenUpdateOne

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

func (*TokenUpdateOne) SetNillableIsActive

func (tuo *TokenUpdateOne) SetNillableIsActive(b *bool) *TokenUpdateOne

SetNillableIsActive sets the "is_active" field if the given value is not nil.

func (*TokenUpdateOne) SetUser

func (tuo *TokenUpdateOne) SetUser(u *User) *TokenUpdateOne

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

func (*TokenUpdateOne) SetUserID

func (tuo *TokenUpdateOne) SetUserID(id uuid.UUID) *TokenUpdateOne

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

type TokenUpsert

type TokenUpsert struct {
	*sql.UpdateSet
}

TokenUpsert is the "OnConflict" setter.

func (*TokenUpsert) SetCreatedAt

func (u *TokenUpsert) SetCreatedAt(v time.Time) *TokenUpsert

SetCreatedAt sets the "created_at" field.

func (*TokenUpsert) SetIsActive

func (u *TokenUpsert) SetIsActive(v bool) *TokenUpsert

SetIsActive sets the "is_active" field.

func (*TokenUpsert) UpdateCreatedAt

func (u *TokenUpsert) UpdateCreatedAt() *TokenUpsert

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

func (*TokenUpsert) UpdateIsActive

func (u *TokenUpsert) UpdateIsActive() *TokenUpsert

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

type TokenUpsertBulk

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

TokenUpsertBulk is the builder for "upsert"-ing a bulk of Token nodes.

func (*TokenUpsertBulk) DoNothing

func (u *TokenUpsertBulk) DoNothing() *TokenUpsertBulk

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

func (*TokenUpsertBulk) Exec

func (u *TokenUpsertBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*TokenUpsertBulk) ExecX

func (u *TokenUpsertBulk) ExecX(ctx context.Context)

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

func (*TokenUpsertBulk) Ignore

func (u *TokenUpsertBulk) Ignore() *TokenUpsertBulk

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

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

func (*TokenUpsertBulk) SetCreatedAt

func (u *TokenUpsertBulk) SetCreatedAt(v time.Time) *TokenUpsertBulk

SetCreatedAt sets the "created_at" field.

func (*TokenUpsertBulk) SetIsActive

func (u *TokenUpsertBulk) SetIsActive(v bool) *TokenUpsertBulk

SetIsActive sets the "is_active" field.

func (*TokenUpsertBulk) Update

func (u *TokenUpsertBulk) Update(set func(*TokenUpsert)) *TokenUpsertBulk

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

func (*TokenUpsertBulk) UpdateCreatedAt

func (u *TokenUpsertBulk) UpdateCreatedAt() *TokenUpsertBulk

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

func (*TokenUpsertBulk) UpdateIsActive

func (u *TokenUpsertBulk) UpdateIsActive() *TokenUpsertBulk

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

func (*TokenUpsertBulk) UpdateNewValues

func (u *TokenUpsertBulk) UpdateNewValues() *TokenUpsertBulk

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

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

type TokenUpsertOne

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

TokenUpsertOne is the builder for "upsert"-ing

one Token node.

func (*TokenUpsertOne) DoNothing

func (u *TokenUpsertOne) DoNothing() *TokenUpsertOne

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

func (*TokenUpsertOne) Exec

func (u *TokenUpsertOne) Exec(ctx context.Context) error

Exec executes the query.

func (*TokenUpsertOne) ExecX

func (u *TokenUpsertOne) ExecX(ctx context.Context)

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

func (*TokenUpsertOne) ID

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

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

func (*TokenUpsertOne) IDX

func (u *TokenUpsertOne) IDX(ctx context.Context) uuid.UUID

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

func (*TokenUpsertOne) Ignore

func (u *TokenUpsertOne) Ignore() *TokenUpsertOne

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

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

func (*TokenUpsertOne) SetCreatedAt

func (u *TokenUpsertOne) SetCreatedAt(v time.Time) *TokenUpsertOne

SetCreatedAt sets the "created_at" field.

func (*TokenUpsertOne) SetIsActive

func (u *TokenUpsertOne) SetIsActive(v bool) *TokenUpsertOne

SetIsActive sets the "is_active" field.

func (*TokenUpsertOne) Update

func (u *TokenUpsertOne) Update(set func(*TokenUpsert)) *TokenUpsertOne

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

func (*TokenUpsertOne) UpdateCreatedAt

func (u *TokenUpsertOne) UpdateCreatedAt() *TokenUpsertOne

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

func (*TokenUpsertOne) UpdateIsActive

func (u *TokenUpsertOne) UpdateIsActive() *TokenUpsertOne

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

func (*TokenUpsertOne) UpdateNewValues

func (u *TokenUpsertOne) UpdateNewValues() *TokenUpsertOne

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.Token.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
		sql.ResolveWith(func(u *sql.UpdateSet) {
			u.SetIgnore(token.FieldID)
		}),
	).
	Exec(ctx)

type Tokens

type Tokens []*Token

Tokens is a parsable slice of Token.

type Tx

type Tx struct {

	// Submission is the client for interacting with the Submission builders.
	Submission *SubmissionClient
	// Subscription is the client for interacting with the Subscription builders.
	Subscription *SubscriptionClient
	// Token is the client for interacting with the Token builders.
	Token *TokenClient
	// 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"`
	// Email holds the value of the "email" field.
	Email string `json:"email,omitempty"`
	// Password holds the value of the "password" field.
	Password string `json:"password,omitempty"`
	// GithubUserID holds the value of the "github_user_id" field.
	GithubUserID int64 `json:"github_user_id,omitempty"`
	// GithubAccessToken holds the value of the "github_access_token" field.
	GithubAccessToken string `json:"github_access_token,omitempty"`
	// GitlabUserID holds the value of the "gitlab_user_id" field.
	GitlabUserID int `json:"gitlab_user_id,omitempty"`
	// GitlabAccessToken holds the value of the "gitlab_access_token" field.
	GitlabAccessToken string `json:"gitlab_access_token,omitempty"`
	// GitlabRefreshToken holds the value of the "gitlab_refresh_token" field.
	GitlabRefreshToken string `json:"gitlab_refresh_token,omitempty"`
	// GitlabAccessTokenExpiresAt holds the value of the "gitlab_access_token_expires_at" field.
	GitlabAccessTokenExpiresAt time.Time `json:"gitlab_access_token_expires_at,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) QuerySubmissions

func (u *User) QuerySubmissions() *SubmissionQuery

QuerySubmissions queries the "submissions" edge of the User entity.

func (*User) QuerySubscription

func (u *User) QuerySubscription() *SubscriptionQuery

QuerySubscription queries the "subscription" edge of the User entity.

func (*User) QueryTokens

func (u *User) QueryTokens() *TokenQuery

QueryTokens queries the "tokens" 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) QuerySubmissions

func (c *UserClient) QuerySubmissions(u *User) *SubmissionQuery

QuerySubmissions queries the submissions edge of a User.

func (*UserClient) QuerySubscription

func (c *UserClient) QuerySubscription(u *User) *SubscriptionQuery

QuerySubscription queries the subscription edge of a User.

func (*UserClient) QueryTokens

func (c *UserClient) QueryTokens(u *User) *TokenQuery

QueryTokens queries the tokens 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) AddSubmissionIDs

func (uc *UserCreate) AddSubmissionIDs(ids ...uuid.UUID) *UserCreate

AddSubmissionIDs adds the "submissions" edge to the Submission entity by IDs.

func (*UserCreate) AddSubmissions

func (uc *UserCreate) AddSubmissions(s ...*Submission) *UserCreate

AddSubmissions adds the "submissions" edges to the Submission entity.

func (*UserCreate) AddTokenIDs

func (uc *UserCreate) AddTokenIDs(ids ...uuid.UUID) *UserCreate

AddTokenIDs adds the "tokens" edge to the Token entity by IDs.

func (*UserCreate) AddTokens

func (uc *UserCreate) AddTokens(t ...*Token) *UserCreate

AddTokens adds the "tokens" edges to the Token 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().
	SetEmail(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) {
		SetEmail(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) SetEmail

func (uc *UserCreate) SetEmail(s string) *UserCreate

SetEmail sets the "email" field.

func (*UserCreate) SetGithubAccessToken

func (uc *UserCreate) SetGithubAccessToken(s string) *UserCreate

SetGithubAccessToken sets the "github_access_token" field.

func (*UserCreate) SetGithubUserID

func (uc *UserCreate) SetGithubUserID(i int64) *UserCreate

SetGithubUserID sets the "github_user_id" field.

func (*UserCreate) SetGitlabAccessToken

func (uc *UserCreate) SetGitlabAccessToken(s string) *UserCreate

SetGitlabAccessToken sets the "gitlab_access_token" field.

func (*UserCreate) SetGitlabAccessTokenExpiresAt

func (uc *UserCreate) SetGitlabAccessTokenExpiresAt(t time.Time) *UserCreate

SetGitlabAccessTokenExpiresAt sets the "gitlab_access_token_expires_at" field.

func (*UserCreate) SetGitlabRefreshToken

func (uc *UserCreate) SetGitlabRefreshToken(s string) *UserCreate

SetGitlabRefreshToken sets the "gitlab_refresh_token" field.

func (*UserCreate) SetGitlabUserID

func (uc *UserCreate) SetGitlabUserID(i int) *UserCreate

SetGitlabUserID sets the "gitlab_user_id" field.

func (*UserCreate) SetID

func (uc *UserCreate) SetID(u uuid.UUID) *UserCreate

SetID sets the "id" 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) SetNillableGithubAccessToken

func (uc *UserCreate) SetNillableGithubAccessToken(s *string) *UserCreate

SetNillableGithubAccessToken sets the "github_access_token" field if the given value is not nil.

func (*UserCreate) SetNillableGithubUserID

func (uc *UserCreate) SetNillableGithubUserID(i *int64) *UserCreate

SetNillableGithubUserID sets the "github_user_id" field if the given value is not nil.

func (*UserCreate) SetNillableGitlabAccessToken

func (uc *UserCreate) SetNillableGitlabAccessToken(s *string) *UserCreate

SetNillableGitlabAccessToken sets the "gitlab_access_token" field if the given value is not nil.

func (*UserCreate) SetNillableGitlabAccessTokenExpiresAt

func (uc *UserCreate) SetNillableGitlabAccessTokenExpiresAt(t *time.Time) *UserCreate

SetNillableGitlabAccessTokenExpiresAt sets the "gitlab_access_token_expires_at" field if the given value is not nil.

func (*UserCreate) SetNillableGitlabRefreshToken

func (uc *UserCreate) SetNillableGitlabRefreshToken(s *string) *UserCreate

SetNillableGitlabRefreshToken sets the "gitlab_refresh_token" field if the given value is not nil.

func (*UserCreate) SetNillableGitlabUserID

func (uc *UserCreate) SetNillableGitlabUserID(i *int) *UserCreate

SetNillableGitlabUserID sets the "gitlab_user_id" field if the given value is not nil.

func (*UserCreate) SetNillableID

func (uc *UserCreate) SetNillableID(u *uuid.UUID) *UserCreate

SetNillableID sets the "id" field if the given value is not nil.

func (*UserCreate) SetNillablePassword

func (uc *UserCreate) SetNillablePassword(s *string) *UserCreate

SetNillablePassword sets the "password" field if the given value is not nil.

func (*UserCreate) SetNillableSubscriptionID

func (uc *UserCreate) SetNillableSubscriptionID(id *uuid.UUID) *UserCreate

SetNillableSubscriptionID sets the "subscription" edge to the Subscription entity by ID if the given value is not nil.

func (*UserCreate) SetPassword

func (uc *UserCreate) SetPassword(s string) *UserCreate

SetPassword sets the "password" field.

func (*UserCreate) SetSubscription

func (uc *UserCreate) SetSubscription(s *Subscription) *UserCreate

SetSubscription sets the "subscription" edge to the Subscription entity.

func (*UserCreate) SetSubscriptionID

func (uc *UserCreate) SetSubscriptionID(id uuid.UUID) *UserCreate

SetSubscriptionID sets the "subscription" edge to the Subscription entity by ID.

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) {
		SetEmail(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 {
	// Tokens holds the value of the tokens edge.
	Tokens []*Token `json:"tokens,omitempty"`
	// Submissions holds the value of the submissions edge.
	Submissions []*Submission `json:"submissions,omitempty"`
	// Subscription holds the value of the subscription edge.
	Subscription *Subscription `json:"subscription,omitempty"`
	// contains filtered or unexported fields
}

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

func (UserEdges) SubmissionsOrErr

func (e UserEdges) SubmissionsOrErr() ([]*Submission, error)

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

func (UserEdges) SubscriptionOrErr

func (e UserEdges) SubscriptionOrErr() (*Subscription, error)

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

func (UserEdges) TokensOrErr

func (e UserEdges) TokensOrErr() ([]*Token, error)

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

type UserGroupBy

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

UserGroupBy is the group-by builder for User entities.

func (*UserGroupBy) Aggregate

func (ugb *UserGroupBy) Aggregate(fns ...AggregateFunc) *UserGroupBy

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

func (*UserGroupBy) Bool

func (ugb *UserGroupBy) Bool(ctx context.Context) (_ bool, err error)

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

func (*UserGroupBy) BoolX

func (ugb *UserGroupBy) BoolX(ctx context.Context) bool

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

func (*UserGroupBy) Bools

func (ugb *UserGroupBy) Bools(ctx context.Context) ([]bool, error)

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

func (*UserGroupBy) BoolsX

func (ugb *UserGroupBy) BoolsX(ctx context.Context) []bool

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

func (*UserGroupBy) Float64

func (ugb *UserGroupBy) Float64(ctx context.Context) (_ float64, err error)

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

func (*UserGroupBy) Float64X

func (ugb *UserGroupBy) Float64X(ctx context.Context) float64

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

func (*UserGroupBy) Float64s

func (ugb *UserGroupBy) Float64s(ctx context.Context) ([]float64, error)

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

func (*UserGroupBy) Float64sX

func (ugb *UserGroupBy) Float64sX(ctx context.Context) []float64

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

func (*UserGroupBy) Int

func (ugb *UserGroupBy) Int(ctx context.Context) (_ int, err error)

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

func (*UserGroupBy) IntX

func (ugb *UserGroupBy) IntX(ctx context.Context) int

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

func (*UserGroupBy) Ints

func (ugb *UserGroupBy) Ints(ctx context.Context) ([]int, error)

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

func (*UserGroupBy) IntsX

func (ugb *UserGroupBy) IntsX(ctx context.Context) []int

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

func (*UserGroupBy) Scan

func (ugb *UserGroupBy) Scan(ctx context.Context, v interface{}) error

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

func (*UserGroupBy) ScanX

func (ugb *UserGroupBy) ScanX(ctx context.Context, v interface{})

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

func (*UserGroupBy) String

func (ugb *UserGroupBy) String(ctx context.Context) (_ string, err error)

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

func (*UserGroupBy) StringX

func (ugb *UserGroupBy) StringX(ctx context.Context) string

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

func (*UserGroupBy) Strings

func (ugb *UserGroupBy) Strings(ctx context.Context) ([]string, error)

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

func (*UserGroupBy) StringsX

func (ugb *UserGroupBy) StringsX(ctx context.Context) []string

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

type UserMutation

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

UserMutation represents an operation that mutates the User nodes in the graph.

func (*UserMutation) 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) AddGithubUserID

func (m *UserMutation) AddGithubUserID(i int64)

AddGithubUserID adds i to the "github_user_id" field.

func (*UserMutation) AddGitlabUserID

func (m *UserMutation) AddGitlabUserID(i int)

AddGitlabUserID adds i to the "gitlab_user_id" field.

func (*UserMutation) AddSubmissionIDs

func (m *UserMutation) AddSubmissionIDs(ids ...uuid.UUID)

AddSubmissionIDs adds the "submissions" edge to the Submission entity by ids.

func (*UserMutation) AddTokenIDs

func (m *UserMutation) AddTokenIDs(ids ...uuid.UUID)

AddTokenIDs adds the "tokens" edge to the Token entity by ids.

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

func (m *UserMutation) AddedGithubUserID() (r int64, exists bool)

AddedGithubUserID returns the value that was added to the "github_user_id" field in this mutation.

func (*UserMutation) AddedGitlabUserID

func (m *UserMutation) AddedGitlabUserID() (r int, exists bool)

AddedGitlabUserID returns the value that was added to the "gitlab_user_id" field in 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) 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) ClearGithubAccessToken

func (m *UserMutation) ClearGithubAccessToken()

ClearGithubAccessToken clears the value of the "github_access_token" field.

func (*UserMutation) ClearGithubUserID

func (m *UserMutation) ClearGithubUserID()

ClearGithubUserID clears the value of the "github_user_id" field.

func (*UserMutation) ClearGitlabAccessToken

func (m *UserMutation) ClearGitlabAccessToken()

ClearGitlabAccessToken clears the value of the "gitlab_access_token" field.

func (*UserMutation) ClearGitlabAccessTokenExpiresAt

func (m *UserMutation) ClearGitlabAccessTokenExpiresAt()

ClearGitlabAccessTokenExpiresAt clears the value of the "gitlab_access_token_expires_at" field.

func (*UserMutation) ClearGitlabRefreshToken

func (m *UserMutation) ClearGitlabRefreshToken()

ClearGitlabRefreshToken clears the value of the "gitlab_refresh_token" field.

func (*UserMutation) ClearGitlabUserID

func (m *UserMutation) ClearGitlabUserID()

ClearGitlabUserID clears the value of the "gitlab_user_id" field.

func (*UserMutation) ClearPassword

func (m *UserMutation) ClearPassword()

ClearPassword clears the value of the "password" field.

func (*UserMutation) ClearSubmissions

func (m *UserMutation) ClearSubmissions()

ClearSubmissions clears the "submissions" edge to the Submission entity.

func (*UserMutation) ClearSubscription

func (m *UserMutation) ClearSubscription()

ClearSubscription clears the "subscription" edge to the Subscription entity.

func (*UserMutation) ClearTokens

func (m *UserMutation) ClearTokens()

ClearTokens clears the "tokens" edge to the Token entity.

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

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

Email returns the value of the "email" 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) GithubAccessToken

func (m *UserMutation) GithubAccessToken() (r string, exists bool)

GithubAccessToken returns the value of the "github_access_token" field in the mutation.

func (*UserMutation) GithubAccessTokenCleared

func (m *UserMutation) GithubAccessTokenCleared() bool

GithubAccessTokenCleared returns if the "github_access_token" field was cleared in this mutation.

func (*UserMutation) GithubUserID

func (m *UserMutation) GithubUserID() (r int64, exists bool)

GithubUserID returns the value of the "github_user_id" field in the mutation.

func (*UserMutation) GithubUserIDCleared

func (m *UserMutation) GithubUserIDCleared() bool

GithubUserIDCleared returns if the "github_user_id" field was cleared in this mutation.

func (*UserMutation) GitlabAccessToken

func (m *UserMutation) GitlabAccessToken() (r string, exists bool)

GitlabAccessToken returns the value of the "gitlab_access_token" field in the mutation.

func (*UserMutation) GitlabAccessTokenCleared

func (m *UserMutation) GitlabAccessTokenCleared() bool

GitlabAccessTokenCleared returns if the "gitlab_access_token" field was cleared in this mutation.

func (*UserMutation) GitlabAccessTokenExpiresAt

func (m *UserMutation) GitlabAccessTokenExpiresAt() (r time.Time, exists bool)

GitlabAccessTokenExpiresAt returns the value of the "gitlab_access_token_expires_at" field in the mutation.

func (*UserMutation) GitlabAccessTokenExpiresAtCleared

func (m *UserMutation) GitlabAccessTokenExpiresAtCleared() bool

GitlabAccessTokenExpiresAtCleared returns if the "gitlab_access_token_expires_at" field was cleared in this mutation.

func (*UserMutation) GitlabRefreshToken

func (m *UserMutation) GitlabRefreshToken() (r string, exists bool)

GitlabRefreshToken returns the value of the "gitlab_refresh_token" field in the mutation.

func (*UserMutation) GitlabRefreshTokenCleared

func (m *UserMutation) GitlabRefreshTokenCleared() bool

GitlabRefreshTokenCleared returns if the "gitlab_refresh_token" field was cleared in this mutation.

func (*UserMutation) GitlabUserID

func (m *UserMutation) GitlabUserID() (r int, exists bool)

GitlabUserID returns the value of the "gitlab_user_id" field in the mutation.

func (*UserMutation) GitlabUserIDCleared

func (m *UserMutation) GitlabUserIDCleared() bool

GitlabUserIDCleared returns if the "gitlab_user_id" field was cleared in this mutation.

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

func (m *UserMutation) OldEmail(ctx context.Context) (v string, err error)

OldEmail returns the old "email" 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) OldGithubAccessToken

func (m *UserMutation) OldGithubAccessToken(ctx context.Context) (v string, err error)

OldGithubAccessToken returns the old "github_access_token" field's value of the User entity. If the User object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*UserMutation) OldGithubUserID

func (m *UserMutation) OldGithubUserID(ctx context.Context) (v int64, err error)

OldGithubUserID returns the old "github_user_id" field's value of the User entity. If the User object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*UserMutation) OldGitlabAccessToken

func (m *UserMutation) OldGitlabAccessToken(ctx context.Context) (v string, err error)

OldGitlabAccessToken returns the old "gitlab_access_token" field's value of the User entity. If the User object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*UserMutation) OldGitlabAccessTokenExpiresAt

func (m *UserMutation) OldGitlabAccessTokenExpiresAt(ctx context.Context) (v time.Time, err error)

OldGitlabAccessTokenExpiresAt returns the old "gitlab_access_token_expires_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) OldGitlabRefreshToken

func (m *UserMutation) OldGitlabRefreshToken(ctx context.Context) (v string, err error)

OldGitlabRefreshToken returns the old "gitlab_refresh_token" field's value of the User entity. If the User object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*UserMutation) OldGitlabUserID

func (m *UserMutation) OldGitlabUserID(ctx context.Context) (v int, err error)

OldGitlabUserID returns the old "gitlab_user_id" field's value of the User entity. If the User object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*UserMutation) OldPassword

func (m *UserMutation) OldPassword(ctx context.Context) (v string, err error)

OldPassword returns the old "password" field's value of the User entity. If the User object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*UserMutation) Op

func (m *UserMutation) Op() Op

Op returns the operation name.

func (*UserMutation) Password

func (m *UserMutation) Password() (r string, exists bool)

Password returns the value of the "password" field in the mutation.

func (*UserMutation) PasswordCleared

func (m *UserMutation) PasswordCleared() bool

PasswordCleared returns if the "password" field was cleared in this mutation.

func (*UserMutation) RemoveSubmissionIDs

func (m *UserMutation) RemoveSubmissionIDs(ids ...uuid.UUID)

RemoveSubmissionIDs removes the "submissions" edge to the Submission entity by IDs.

func (*UserMutation) RemoveTokenIDs

func (m *UserMutation) RemoveTokenIDs(ids ...uuid.UUID)

RemoveTokenIDs removes the "tokens" edge to the Token entity by IDs.

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

func (m *UserMutation) RemovedSubmissionsIDs() (ids []uuid.UUID)

RemovedSubmissions returns the removed IDs of the "submissions" edge to the Submission entity.

func (*UserMutation) RemovedTokensIDs

func (m *UserMutation) RemovedTokensIDs() (ids []uuid.UUID)

RemovedTokens returns the removed IDs of the "tokens" edge to the Token entity.

func (*UserMutation) ResetCreatedAt

func (m *UserMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*UserMutation) ResetEdge

func (m *UserMutation) ResetEdge(name string) error

ResetEdge resets all changes to the edge with the given name in this mutation. It returns an error if the edge is not defined in the schema.

func (*UserMutation) ResetEmail

func (m *UserMutation) ResetEmail()

ResetEmail resets all changes to the "email" 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) ResetGithubAccessToken

func (m *UserMutation) ResetGithubAccessToken()

ResetGithubAccessToken resets all changes to the "github_access_token" field.

func (*UserMutation) ResetGithubUserID

func (m *UserMutation) ResetGithubUserID()

ResetGithubUserID resets all changes to the "github_user_id" field.

func (*UserMutation) ResetGitlabAccessToken

func (m *UserMutation) ResetGitlabAccessToken()

ResetGitlabAccessToken resets all changes to the "gitlab_access_token" field.

func (*UserMutation) ResetGitlabAccessTokenExpiresAt

func (m *UserMutation) ResetGitlabAccessTokenExpiresAt()

ResetGitlabAccessTokenExpiresAt resets all changes to the "gitlab_access_token_expires_at" field.

func (*UserMutation) ResetGitlabRefreshToken

func (m *UserMutation) ResetGitlabRefreshToken()

ResetGitlabRefreshToken resets all changes to the "gitlab_refresh_token" field.

func (*UserMutation) ResetGitlabUserID

func (m *UserMutation) ResetGitlabUserID()

ResetGitlabUserID resets all changes to the "gitlab_user_id" field.

func (*UserMutation) ResetPassword

func (m *UserMutation) ResetPassword()

ResetPassword resets all changes to the "password" field.

func (*UserMutation) ResetSubmissions

func (m *UserMutation) ResetSubmissions()

ResetSubmissions resets all changes to the "submissions" edge.

func (*UserMutation) ResetSubscription

func (m *UserMutation) ResetSubscription()

ResetSubscription resets all changes to the "subscription" edge.

func (*UserMutation) ResetTokens

func (m *UserMutation) ResetTokens()

ResetTokens resets all changes to the "tokens" edge.

func (*UserMutation) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*UserMutation) SetEmail

func (m *UserMutation) SetEmail(s string)

SetEmail sets the "email" 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) SetGithubAccessToken

func (m *UserMutation) SetGithubAccessToken(s string)

SetGithubAccessToken sets the "github_access_token" field.

func (*UserMutation) SetGithubUserID

func (m *UserMutation) SetGithubUserID(i int64)

SetGithubUserID sets the "github_user_id" field.

func (*UserMutation) SetGitlabAccessToken

func (m *UserMutation) SetGitlabAccessToken(s string)

SetGitlabAccessToken sets the "gitlab_access_token" field.

func (*UserMutation) SetGitlabAccessTokenExpiresAt

func (m *UserMutation) SetGitlabAccessTokenExpiresAt(t time.Time)

SetGitlabAccessTokenExpiresAt sets the "gitlab_access_token_expires_at" field.

func (*UserMutation) SetGitlabRefreshToken

func (m *UserMutation) SetGitlabRefreshToken(s string)

SetGitlabRefreshToken sets the "gitlab_refresh_token" field.

func (*UserMutation) SetGitlabUserID

func (m *UserMutation) SetGitlabUserID(i int)

SetGitlabUserID sets the "gitlab_user_id" field.

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

func (m *UserMutation) SetPassword(s string)

SetPassword sets the "password" field.

func (*UserMutation) SetSubscriptionID

func (m *UserMutation) SetSubscriptionID(id uuid.UUID)

SetSubscriptionID sets the "subscription" edge to the Subscription entity by id.

func (*UserMutation) SubmissionsCleared

func (m *UserMutation) SubmissionsCleared() bool

SubmissionsCleared reports if the "submissions" edge to the Submission entity was cleared.

func (*UserMutation) SubmissionsIDs

func (m *UserMutation) SubmissionsIDs() (ids []uuid.UUID)

SubmissionsIDs returns the "submissions" edge IDs in the mutation.

func (*UserMutation) SubscriptionCleared

func (m *UserMutation) SubscriptionCleared() bool

SubscriptionCleared reports if the "subscription" edge to the Subscription entity was cleared.

func (*UserMutation) SubscriptionID

func (m *UserMutation) SubscriptionID() (id uuid.UUID, exists bool)

SubscriptionID returns the "subscription" edge ID in the mutation.

func (*UserMutation) SubscriptionIDs

func (m *UserMutation) SubscriptionIDs() (ids []uuid.UUID)

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

func (*UserMutation) TokensCleared

func (m *UserMutation) TokensCleared() bool

TokensCleared reports if the "tokens" edge to the Token entity was cleared.

func (*UserMutation) TokensIDs

func (m *UserMutation) TokensIDs() (ids []uuid.UUID)

TokensIDs returns the "tokens" edge IDs in the mutation.

func (UserMutation) Tx

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

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

func (*UserMutation) Type

func (m *UserMutation) Type() string

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

func (*UserMutation) Where

func (m *UserMutation) Where(ps ...predicate.User)

Where appends a list predicates to the UserMutation builder.

type UserQuery

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

UserQuery is the builder for querying User entities.

func (*UserQuery) All

func (uq *UserQuery) All(ctx context.Context) ([]*User, error)

All executes the query and returns a list of Users.

func (*UserQuery) AllX

func (uq *UserQuery) AllX(ctx context.Context) []*User

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

func (*UserQuery) Clone

func (uq *UserQuery) Clone() *UserQuery

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

func (*UserQuery) Count

func (uq *UserQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*UserQuery) CountX

func (uq *UserQuery) CountX(ctx context.Context) int

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

func (*UserQuery) Exist

func (uq *UserQuery) Exist(ctx context.Context) (bool, error)

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

func (*UserQuery) ExistX

func (uq *UserQuery) ExistX(ctx context.Context) bool

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

func (*UserQuery) First

func (uq *UserQuery) First(ctx context.Context) (*User, error)

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

func (*UserQuery) FirstID

func (uq *UserQuery) FirstID(ctx context.Context) (id 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 {
	Email string `json:"email,omitempty"`
	Count int `json:"count,omitempty"`
}

client.User.Query().
	GroupBy(user.FieldEmail).
	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 more than one User entity is found. Returns a *NotFoundError when no User entities are found.

func (*UserQuery) OnlyID

func (uq *UserQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

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

func (*UserQuery) OnlyIDX

func (uq *UserQuery) OnlyIDX(ctx context.Context) 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) QuerySubmissions

func (uq *UserQuery) QuerySubmissions() *SubmissionQuery

QuerySubmissions chains the current query on the "submissions" edge.

func (*UserQuery) QuerySubscription

func (uq *UserQuery) QuerySubscription() *SubscriptionQuery

QuerySubscription chains the current query on the "subscription" edge.

func (*UserQuery) QueryTokens

func (uq *UserQuery) QueryTokens() *TokenQuery

QueryTokens chains the current query on the "tokens" 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 {
	Email string `json:"email,omitempty"`
}

client.User.Query().
	Select(user.FieldEmail).
	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) WithSubmissions

func (uq *UserQuery) WithSubmissions(opts ...func(*SubmissionQuery)) *UserQuery

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

func (*UserQuery) WithSubscription

func (uq *UserQuery) WithSubscription(opts ...func(*SubscriptionQuery)) *UserQuery

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

func (*UserQuery) WithTokens

func (uq *UserQuery) WithTokens(opts ...func(*TokenQuery)) *UserQuery

WithTokens tells the query-builder to eager-load the nodes that are connected to the "tokens" 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) AddGithubUserID

func (uu *UserUpdate) AddGithubUserID(i int64) *UserUpdate

AddGithubUserID adds i to the "github_user_id" field.

func (*UserUpdate) AddGitlabUserID

func (uu *UserUpdate) AddGitlabUserID(i int) *UserUpdate

AddGitlabUserID adds i to the "gitlab_user_id" field.

func (*UserUpdate) AddSubmissionIDs

func (uu *UserUpdate) AddSubmissionIDs(ids ...uuid.UUID) *UserUpdate

AddSubmissionIDs adds the "submissions" edge to the Submission entity by IDs.

func (*UserUpdate) AddSubmissions

func (uu *UserUpdate) AddSubmissions(s ...*Submission) *UserUpdate

AddSubmissions adds the "submissions" edges to the Submission entity.

func (*UserUpdate) AddTokenIDs

func (uu *UserUpdate) AddTokenIDs(ids ...uuid.UUID) *UserUpdate

AddTokenIDs adds the "tokens" edge to the Token entity by IDs.

func (*UserUpdate) AddTokens

func (uu *UserUpdate) AddTokens(t ...*Token) *UserUpdate

AddTokens adds the "tokens" edges to the Token entity.

func (*UserUpdate) ClearGithubAccessToken

func (uu *UserUpdate) ClearGithubAccessToken() *UserUpdate

ClearGithubAccessToken clears the value of the "github_access_token" field.

func (*UserUpdate) ClearGithubUserID

func (uu *UserUpdate) ClearGithubUserID() *UserUpdate

ClearGithubUserID clears the value of the "github_user_id" field.

func (*UserUpdate) ClearGitlabAccessToken

func (uu *UserUpdate) ClearGitlabAccessToken() *UserUpdate

ClearGitlabAccessToken clears the value of the "gitlab_access_token" field.

func (*UserUpdate) ClearGitlabAccessTokenExpiresAt

func (uu *UserUpdate) ClearGitlabAccessTokenExpiresAt() *UserUpdate

ClearGitlabAccessTokenExpiresAt clears the value of the "gitlab_access_token_expires_at" field.

func (*UserUpdate) ClearGitlabRefreshToken

func (uu *UserUpdate) ClearGitlabRefreshToken() *UserUpdate

ClearGitlabRefreshToken clears the value of the "gitlab_refresh_token" field.

func (*UserUpdate) ClearGitlabUserID

func (uu *UserUpdate) ClearGitlabUserID() *UserUpdate

ClearGitlabUserID clears the value of the "gitlab_user_id" field.

func (*UserUpdate) ClearPassword

func (uu *UserUpdate) ClearPassword() *UserUpdate

ClearPassword clears the value of the "password" field.

func (*UserUpdate) ClearSubmissions

func (uu *UserUpdate) ClearSubmissions() *UserUpdate

ClearSubmissions clears all "submissions" edges to the Submission entity.

func (*UserUpdate) ClearSubscription

func (uu *UserUpdate) ClearSubscription() *UserUpdate

ClearSubscription clears the "subscription" edge to the Subscription entity.

func (*UserUpdate) ClearTokens

func (uu *UserUpdate) ClearTokens() *UserUpdate

ClearTokens clears all "tokens" edges to the Token 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) RemoveSubmissionIDs

func (uu *UserUpdate) RemoveSubmissionIDs(ids ...uuid.UUID) *UserUpdate

RemoveSubmissionIDs removes the "submissions" edge to Submission entities by IDs.

func (*UserUpdate) RemoveSubmissions

func (uu *UserUpdate) RemoveSubmissions(s ...*Submission) *UserUpdate

RemoveSubmissions removes "submissions" edges to Submission entities.

func (*UserUpdate) RemoveTokenIDs

func (uu *UserUpdate) RemoveTokenIDs(ids ...uuid.UUID) *UserUpdate

RemoveTokenIDs removes the "tokens" edge to Token entities by IDs.

func (*UserUpdate) RemoveTokens

func (uu *UserUpdate) RemoveTokens(t ...*Token) *UserUpdate

RemoveTokens removes "tokens" edges to Token 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) SetCreatedAt

func (uu *UserUpdate) SetCreatedAt(t time.Time) *UserUpdate

SetCreatedAt sets the "created_at" field.

func (*UserUpdate) SetEmail

func (uu *UserUpdate) SetEmail(s string) *UserUpdate

SetEmail sets the "email" field.

func (*UserUpdate) SetGithubAccessToken

func (uu *UserUpdate) SetGithubAccessToken(s string) *UserUpdate

SetGithubAccessToken sets the "github_access_token" field.

func (*UserUpdate) SetGithubUserID

func (uu *UserUpdate) SetGithubUserID(i int64) *UserUpdate

SetGithubUserID sets the "github_user_id" field.

func (*UserUpdate) SetGitlabAccessToken

func (uu *UserUpdate) SetGitlabAccessToken(s string) *UserUpdate

SetGitlabAccessToken sets the "gitlab_access_token" field.

func (*UserUpdate) SetGitlabAccessTokenExpiresAt

func (uu *UserUpdate) SetGitlabAccessTokenExpiresAt(t time.Time) *UserUpdate

SetGitlabAccessTokenExpiresAt sets the "gitlab_access_token_expires_at" field.

func (*UserUpdate) SetGitlabRefreshToken

func (uu *UserUpdate) SetGitlabRefreshToken(s string) *UserUpdate

SetGitlabRefreshToken sets the "gitlab_refresh_token" field.

func (*UserUpdate) SetGitlabUserID

func (uu *UserUpdate) SetGitlabUserID(i int) *UserUpdate

SetGitlabUserID sets the "gitlab_user_id" field.

func (*UserUpdate) SetNillableCreatedAt

func (uu *UserUpdate) SetNillableCreatedAt(t *time.Time) *UserUpdate

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

func (*UserUpdate) SetNillableGithubAccessToken

func (uu *UserUpdate) SetNillableGithubAccessToken(s *string) *UserUpdate

SetNillableGithubAccessToken sets the "github_access_token" field if the given value is not nil.

func (*UserUpdate) SetNillableGithubUserID

func (uu *UserUpdate) SetNillableGithubUserID(i *int64) *UserUpdate

SetNillableGithubUserID sets the "github_user_id" field if the given value is not nil.

func (*UserUpdate) SetNillableGitlabAccessToken

func (uu *UserUpdate) SetNillableGitlabAccessToken(s *string) *UserUpdate

SetNillableGitlabAccessToken sets the "gitlab_access_token" field if the given value is not nil.

func (*UserUpdate) SetNillableGitlabAccessTokenExpiresAt

func (uu *UserUpdate) SetNillableGitlabAccessTokenExpiresAt(t *time.Time) *UserUpdate

SetNillableGitlabAccessTokenExpiresAt sets the "gitlab_access_token_expires_at" field if the given value is not nil.

func (*UserUpdate) SetNillableGitlabRefreshToken

func (uu *UserUpdate) SetNillableGitlabRefreshToken(s *string) *UserUpdate

SetNillableGitlabRefreshToken sets the "gitlab_refresh_token" field if the given value is not nil.

func (*UserUpdate) SetNillableGitlabUserID

func (uu *UserUpdate) SetNillableGitlabUserID(i *int) *UserUpdate

SetNillableGitlabUserID sets the "gitlab_user_id" field if the given value is not nil.

func (*UserUpdate) SetNillablePassword

func (uu *UserUpdate) SetNillablePassword(s *string) *UserUpdate

SetNillablePassword sets the "password" field if the given value is not nil.

func (*UserUpdate) SetNillableSubscriptionID

func (uu *UserUpdate) SetNillableSubscriptionID(id *uuid.UUID) *UserUpdate

SetNillableSubscriptionID sets the "subscription" edge to the Subscription entity by ID if the given value is not nil.

func (*UserUpdate) SetPassword

func (uu *UserUpdate) SetPassword(s string) *UserUpdate

SetPassword sets the "password" field.

func (*UserUpdate) SetSubscription

func (uu *UserUpdate) SetSubscription(s *Subscription) *UserUpdate

SetSubscription sets the "subscription" edge to the Subscription entity.

func (*UserUpdate) SetSubscriptionID

func (uu *UserUpdate) SetSubscriptionID(id uuid.UUID) *UserUpdate

SetSubscriptionID sets the "subscription" edge to the Subscription entity by ID.

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

func (uuo *UserUpdateOne) AddGithubUserID(i int64) *UserUpdateOne

AddGithubUserID adds i to the "github_user_id" field.

func (*UserUpdateOne) AddGitlabUserID

func (uuo *UserUpdateOne) AddGitlabUserID(i int) *UserUpdateOne

AddGitlabUserID adds i to the "gitlab_user_id" field.

func (*UserUpdateOne) AddSubmissionIDs

func (uuo *UserUpdateOne) AddSubmissionIDs(ids ...uuid.UUID) *UserUpdateOne

AddSubmissionIDs adds the "submissions" edge to the Submission entity by IDs.

func (*UserUpdateOne) AddSubmissions

func (uuo *UserUpdateOne) AddSubmissions(s ...*Submission) *UserUpdateOne

AddSubmissions adds the "submissions" edges to the Submission entity.

func (*UserUpdateOne) AddTokenIDs

func (uuo *UserUpdateOne) AddTokenIDs(ids ...uuid.UUID) *UserUpdateOne

AddTokenIDs adds the "tokens" edge to the Token entity by IDs.

func (*UserUpdateOne) AddTokens

func (uuo *UserUpdateOne) AddTokens(t ...*Token) *UserUpdateOne

AddTokens adds the "tokens" edges to the Token entity.

func (*UserUpdateOne) ClearGithubAccessToken

func (uuo *UserUpdateOne) ClearGithubAccessToken() *UserUpdateOne

ClearGithubAccessToken clears the value of the "github_access_token" field.

func (*UserUpdateOne) ClearGithubUserID

func (uuo *UserUpdateOne) ClearGithubUserID() *UserUpdateOne

ClearGithubUserID clears the value of the "github_user_id" field.

func (*UserUpdateOne) ClearGitlabAccessToken

func (uuo *UserUpdateOne) ClearGitlabAccessToken() *UserUpdateOne

ClearGitlabAccessToken clears the value of the "gitlab_access_token" field.

func (*UserUpdateOne) ClearGitlabAccessTokenExpiresAt

func (uuo *UserUpdateOne) ClearGitlabAccessTokenExpiresAt() *UserUpdateOne

ClearGitlabAccessTokenExpiresAt clears the value of the "gitlab_access_token_expires_at" field.

func (*UserUpdateOne) ClearGitlabRefreshToken

func (uuo *UserUpdateOne) ClearGitlabRefreshToken() *UserUpdateOne

ClearGitlabRefreshToken clears the value of the "gitlab_refresh_token" field.

func (*UserUpdateOne) ClearGitlabUserID

func (uuo *UserUpdateOne) ClearGitlabUserID() *UserUpdateOne

ClearGitlabUserID clears the value of the "gitlab_user_id" field.

func (*UserUpdateOne) ClearPassword

func (uuo *UserUpdateOne) ClearPassword() *UserUpdateOne

ClearPassword clears the value of the "password" field.

func (*UserUpdateOne) ClearSubmissions

func (uuo *UserUpdateOne) ClearSubmissions() *UserUpdateOne

ClearSubmissions clears all "submissions" edges to the Submission entity.

func (*UserUpdateOne) ClearSubscription

func (uuo *UserUpdateOne) ClearSubscription() *UserUpdateOne

ClearSubscription clears the "subscription" edge to the Subscription entity.

func (*UserUpdateOne) ClearTokens

func (uuo *UserUpdateOne) ClearTokens() *UserUpdateOne

ClearTokens clears all "tokens" edges to the Token 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) RemoveSubmissionIDs

func (uuo *UserUpdateOne) RemoveSubmissionIDs(ids ...uuid.UUID) *UserUpdateOne

RemoveSubmissionIDs removes the "submissions" edge to Submission entities by IDs.

func (*UserUpdateOne) RemoveSubmissions

func (uuo *UserUpdateOne) RemoveSubmissions(s ...*Submission) *UserUpdateOne

RemoveSubmissions removes "submissions" edges to Submission entities.

func (*UserUpdateOne) RemoveTokenIDs

func (uuo *UserUpdateOne) RemoveTokenIDs(ids ...uuid.UUID) *UserUpdateOne

RemoveTokenIDs removes the "tokens" edge to Token entities by IDs.

func (*UserUpdateOne) RemoveTokens

func (uuo *UserUpdateOne) RemoveTokens(t ...*Token) *UserUpdateOne

RemoveTokens removes "tokens" edges to Token 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) SetCreatedAt

func (uuo *UserUpdateOne) SetCreatedAt(t time.Time) *UserUpdateOne

SetCreatedAt sets the "created_at" field.

func (*UserUpdateOne) SetEmail

func (uuo *UserUpdateOne) SetEmail(s string) *UserUpdateOne

SetEmail sets the "email" field.

func (*UserUpdateOne) SetGithubAccessToken

func (uuo *UserUpdateOne) SetGithubAccessToken(s string) *UserUpdateOne

SetGithubAccessToken sets the "github_access_token" field.

func (*UserUpdateOne) SetGithubUserID

func (uuo *UserUpdateOne) SetGithubUserID(i int64) *UserUpdateOne

SetGithubUserID sets the "github_user_id" field.

func (*UserUpdateOne) SetGitlabAccessToken

func (uuo *UserUpdateOne) SetGitlabAccessToken(s string) *UserUpdateOne

SetGitlabAccessToken sets the "gitlab_access_token" field.

func (*UserUpdateOne) SetGitlabAccessTokenExpiresAt

func (uuo *UserUpdateOne) SetGitlabAccessTokenExpiresAt(t time.Time) *UserUpdateOne

SetGitlabAccessTokenExpiresAt sets the "gitlab_access_token_expires_at" field.

func (*UserUpdateOne) SetGitlabRefreshToken

func (uuo *UserUpdateOne) SetGitlabRefreshToken(s string) *UserUpdateOne

SetGitlabRefreshToken sets the "gitlab_refresh_token" field.

func (*UserUpdateOne) SetGitlabUserID

func (uuo *UserUpdateOne) SetGitlabUserID(i int) *UserUpdateOne

SetGitlabUserID sets the "gitlab_user_id" field.

func (*UserUpdateOne) SetNillableCreatedAt

func (uuo *UserUpdateOne) SetNillableCreatedAt(t *time.Time) *UserUpdateOne

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

func (*UserUpdateOne) SetNillableGithubAccessToken

func (uuo *UserUpdateOne) SetNillableGithubAccessToken(s *string) *UserUpdateOne

SetNillableGithubAccessToken sets the "github_access_token" field if the given value is not nil.

func (*UserUpdateOne) SetNillableGithubUserID

func (uuo *UserUpdateOne) SetNillableGithubUserID(i *int64) *UserUpdateOne

SetNillableGithubUserID sets the "github_user_id" field if the given value is not nil.

func (*UserUpdateOne) SetNillableGitlabAccessToken

func (uuo *UserUpdateOne) SetNillableGitlabAccessToken(s *string) *UserUpdateOne

SetNillableGitlabAccessToken sets the "gitlab_access_token" field if the given value is not nil.

func (*UserUpdateOne) SetNillableGitlabAccessTokenExpiresAt

func (uuo *UserUpdateOne) SetNillableGitlabAccessTokenExpiresAt(t *time.Time) *UserUpdateOne

SetNillableGitlabAccessTokenExpiresAt sets the "gitlab_access_token_expires_at" field if the given value is not nil.

func (*UserUpdateOne) SetNillableGitlabRefreshToken

func (uuo *UserUpdateOne) SetNillableGitlabRefreshToken(s *string) *UserUpdateOne

SetNillableGitlabRefreshToken sets the "gitlab_refresh_token" field if the given value is not nil.

func (*UserUpdateOne) SetNillableGitlabUserID

func (uuo *UserUpdateOne) SetNillableGitlabUserID(i *int) *UserUpdateOne

SetNillableGitlabUserID sets the "gitlab_user_id" field if the given value is not nil.

func (*UserUpdateOne) SetNillablePassword

func (uuo *UserUpdateOne) SetNillablePassword(s *string) *UserUpdateOne

SetNillablePassword sets the "password" field if the given value is not nil.

func (*UserUpdateOne) SetNillableSubscriptionID

func (uuo *UserUpdateOne) SetNillableSubscriptionID(id *uuid.UUID) *UserUpdateOne

SetNillableSubscriptionID sets the "subscription" edge to the Subscription entity by ID if the given value is not nil.

func (*UserUpdateOne) SetPassword

func (uuo *UserUpdateOne) SetPassword(s string) *UserUpdateOne

SetPassword sets the "password" field.

func (*UserUpdateOne) SetSubscription

func (uuo *UserUpdateOne) SetSubscription(s *Subscription) *UserUpdateOne

SetSubscription sets the "subscription" edge to the Subscription entity.

func (*UserUpdateOne) SetSubscriptionID

func (uuo *UserUpdateOne) SetSubscriptionID(id uuid.UUID) *UserUpdateOne

SetSubscriptionID sets the "subscription" edge to the Subscription entity by ID.

type UserUpsert

type UserUpsert struct {
	*sql.UpdateSet
}

UserUpsert is the "OnConflict" setter.

func (*UserUpsert) AddGithubUserID

func (u *UserUpsert) AddGithubUserID(v int64) *UserUpsert

AddGithubUserID adds v to the "github_user_id" field.

func (*UserUpsert) AddGitlabUserID

func (u *UserUpsert) AddGitlabUserID(v int) *UserUpsert

AddGitlabUserID adds v to the "gitlab_user_id" field.

func (*UserUpsert) ClearGithubAccessToken

func (u *UserUpsert) ClearGithubAccessToken() *UserUpsert

ClearGithubAccessToken clears the value of the "github_access_token" field.

func (*UserUpsert) ClearGithubUserID

func (u *UserUpsert) ClearGithubUserID() *UserUpsert

ClearGithubUserID clears the value of the "github_user_id" field.

func (*UserUpsert) ClearGitlabAccessToken

func (u *UserUpsert) ClearGitlabAccessToken() *UserUpsert

ClearGitlabAccessToken clears the value of the "gitlab_access_token" field.

func (*UserUpsert) ClearGitlabAccessTokenExpiresAt

func (u *UserUpsert) ClearGitlabAccessTokenExpiresAt() *UserUpsert

ClearGitlabAccessTokenExpiresAt clears the value of the "gitlab_access_token_expires_at" field.

func (*UserUpsert) ClearGitlabRefreshToken

func (u *UserUpsert) ClearGitlabRefreshToken() *UserUpsert

ClearGitlabRefreshToken clears the value of the "gitlab_refresh_token" field.

func (*UserUpsert) ClearGitlabUserID

func (u *UserUpsert) ClearGitlabUserID() *UserUpsert

ClearGitlabUserID clears the value of the "gitlab_user_id" field.

func (*UserUpsert) ClearPassword

func (u *UserUpsert) ClearPassword() *UserUpsert

ClearPassword clears the value of the "password" field.

func (*UserUpsert) SetCreatedAt

func (u *UserUpsert) SetCreatedAt(v time.Time) *UserUpsert

SetCreatedAt sets the "created_at" field.

func (*UserUpsert) SetEmail

func (u *UserUpsert) SetEmail(v string) *UserUpsert

SetEmail sets the "email" field.

func (*UserUpsert) SetGithubAccessToken

func (u *UserUpsert) SetGithubAccessToken(v string) *UserUpsert

SetGithubAccessToken sets the "github_access_token" field.

func (*UserUpsert) SetGithubUserID

func (u *UserUpsert) SetGithubUserID(v int64) *UserUpsert

SetGithubUserID sets the "github_user_id" field.

func (*UserUpsert) SetGitlabAccessToken

func (u *UserUpsert) SetGitlabAccessToken(v string) *UserUpsert

SetGitlabAccessToken sets the "gitlab_access_token" field.

func (*UserUpsert) SetGitlabAccessTokenExpiresAt

func (u *UserUpsert) SetGitlabAccessTokenExpiresAt(v time.Time) *UserUpsert

SetGitlabAccessTokenExpiresAt sets the "gitlab_access_token_expires_at" field.

func (*UserUpsert) SetGitlabRefreshToken

func (u *UserUpsert) SetGitlabRefreshToken(v string) *UserUpsert

SetGitlabRefreshToken sets the "gitlab_refresh_token" field.

func (*UserUpsert) SetGitlabUserID

func (u *UserUpsert) SetGitlabUserID(v int) *UserUpsert

SetGitlabUserID sets the "gitlab_user_id" field.

func (*UserUpsert) SetPassword

func (u *UserUpsert) SetPassword(v string) *UserUpsert

SetPassword sets the "password" 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) UpdateEmail

func (u *UserUpsert) UpdateEmail() *UserUpsert

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

func (*UserUpsert) UpdateGithubAccessToken

func (u *UserUpsert) UpdateGithubAccessToken() *UserUpsert

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

func (*UserUpsert) UpdateGithubUserID

func (u *UserUpsert) UpdateGithubUserID() *UserUpsert

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

func (*UserUpsert) UpdateGitlabAccessToken

func (u *UserUpsert) UpdateGitlabAccessToken() *UserUpsert

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

func (*UserUpsert) UpdateGitlabAccessTokenExpiresAt

func (u *UserUpsert) UpdateGitlabAccessTokenExpiresAt() *UserUpsert

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

func (*UserUpsert) UpdateGitlabRefreshToken

func (u *UserUpsert) UpdateGitlabRefreshToken() *UserUpsert

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

func (*UserUpsert) UpdateGitlabUserID

func (u *UserUpsert) UpdateGitlabUserID() *UserUpsert

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

func (*UserUpsert) UpdatePassword

func (u *UserUpsert) UpdatePassword() *UserUpsert

UpdatePassword sets the "password" 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) AddGithubUserID

func (u *UserUpsertBulk) AddGithubUserID(v int64) *UserUpsertBulk

AddGithubUserID adds v to the "github_user_id" field.

func (*UserUpsertBulk) AddGitlabUserID

func (u *UserUpsertBulk) AddGitlabUserID(v int) *UserUpsertBulk

AddGitlabUserID adds v to the "gitlab_user_id" field.

func (*UserUpsertBulk) ClearGithubAccessToken

func (u *UserUpsertBulk) ClearGithubAccessToken() *UserUpsertBulk

ClearGithubAccessToken clears the value of the "github_access_token" field.

func (*UserUpsertBulk) ClearGithubUserID

func (u *UserUpsertBulk) ClearGithubUserID() *UserUpsertBulk

ClearGithubUserID clears the value of the "github_user_id" field.

func (*UserUpsertBulk) ClearGitlabAccessToken

func (u *UserUpsertBulk) ClearGitlabAccessToken() *UserUpsertBulk

ClearGitlabAccessToken clears the value of the "gitlab_access_token" field.

func (*UserUpsertBulk) ClearGitlabAccessTokenExpiresAt

func (u *UserUpsertBulk) ClearGitlabAccessTokenExpiresAt() *UserUpsertBulk

ClearGitlabAccessTokenExpiresAt clears the value of the "gitlab_access_token_expires_at" field.

func (*UserUpsertBulk) ClearGitlabRefreshToken

func (u *UserUpsertBulk) ClearGitlabRefreshToken() *UserUpsertBulk

ClearGitlabRefreshToken clears the value of the "gitlab_refresh_token" field.

func (*UserUpsertBulk) ClearGitlabUserID

func (u *UserUpsertBulk) ClearGitlabUserID() *UserUpsertBulk

ClearGitlabUserID clears the value of the "gitlab_user_id" field.

func (*UserUpsertBulk) ClearPassword

func (u *UserUpsertBulk) ClearPassword() *UserUpsertBulk

ClearPassword clears the value of the "password" field.

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

func (u *UserUpsertBulk) SetEmail(v string) *UserUpsertBulk

SetEmail sets the "email" field.

func (*UserUpsertBulk) SetGithubAccessToken

func (u *UserUpsertBulk) SetGithubAccessToken(v string) *UserUpsertBulk

SetGithubAccessToken sets the "github_access_token" field.

func (*UserUpsertBulk) SetGithubUserID

func (u *UserUpsertBulk) SetGithubUserID(v int64) *UserUpsertBulk

SetGithubUserID sets the "github_user_id" field.

func (*UserUpsertBulk) SetGitlabAccessToken

func (u *UserUpsertBulk) SetGitlabAccessToken(v string) *UserUpsertBulk

SetGitlabAccessToken sets the "gitlab_access_token" field.

func (*UserUpsertBulk) SetGitlabAccessTokenExpiresAt

func (u *UserUpsertBulk) SetGitlabAccessTokenExpiresAt(v time.Time) *UserUpsertBulk

SetGitlabAccessTokenExpiresAt sets the "gitlab_access_token_expires_at" field.

func (*UserUpsertBulk) SetGitlabRefreshToken

func (u *UserUpsertBulk) SetGitlabRefreshToken(v string) *UserUpsertBulk

SetGitlabRefreshToken sets the "gitlab_refresh_token" field.

func (*UserUpsertBulk) SetGitlabUserID

func (u *UserUpsertBulk) SetGitlabUserID(v int) *UserUpsertBulk

SetGitlabUserID sets the "gitlab_user_id" field.

func (*UserUpsertBulk) SetPassword

func (u *UserUpsertBulk) SetPassword(v string) *UserUpsertBulk

SetPassword sets the "password" 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) UpdateEmail

func (u *UserUpsertBulk) UpdateEmail() *UserUpsertBulk

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

func (*UserUpsertBulk) UpdateGithubAccessToken

func (u *UserUpsertBulk) UpdateGithubAccessToken() *UserUpsertBulk

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

func (*UserUpsertBulk) UpdateGithubUserID

func (u *UserUpsertBulk) UpdateGithubUserID() *UserUpsertBulk

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

func (*UserUpsertBulk) UpdateGitlabAccessToken

func (u *UserUpsertBulk) UpdateGitlabAccessToken() *UserUpsertBulk

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

func (*UserUpsertBulk) UpdateGitlabAccessTokenExpiresAt

func (u *UserUpsertBulk) UpdateGitlabAccessTokenExpiresAt() *UserUpsertBulk

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

func (*UserUpsertBulk) UpdateGitlabRefreshToken

func (u *UserUpsertBulk) UpdateGitlabRefreshToken() *UserUpsertBulk

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

func (*UserUpsertBulk) UpdateGitlabUserID

func (u *UserUpsertBulk) UpdateGitlabUserID() *UserUpsertBulk

UpdateGitlabUserID sets the "gitlab_user_id" 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) UpdatePassword

func (u *UserUpsertBulk) UpdatePassword() *UserUpsertBulk

UpdatePassword sets the "password" 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) AddGithubUserID

func (u *UserUpsertOne) AddGithubUserID(v int64) *UserUpsertOne

AddGithubUserID adds v to the "github_user_id" field.

func (*UserUpsertOne) AddGitlabUserID

func (u *UserUpsertOne) AddGitlabUserID(v int) *UserUpsertOne

AddGitlabUserID adds v to the "gitlab_user_id" field.

func (*UserUpsertOne) ClearGithubAccessToken

func (u *UserUpsertOne) ClearGithubAccessToken() *UserUpsertOne

ClearGithubAccessToken clears the value of the "github_access_token" field.

func (*UserUpsertOne) ClearGithubUserID

func (u *UserUpsertOne) ClearGithubUserID() *UserUpsertOne

ClearGithubUserID clears the value of the "github_user_id" field.

func (*UserUpsertOne) ClearGitlabAccessToken

func (u *UserUpsertOne) ClearGitlabAccessToken() *UserUpsertOne

ClearGitlabAccessToken clears the value of the "gitlab_access_token" field.

func (*UserUpsertOne) ClearGitlabAccessTokenExpiresAt

func (u *UserUpsertOne) ClearGitlabAccessTokenExpiresAt() *UserUpsertOne

ClearGitlabAccessTokenExpiresAt clears the value of the "gitlab_access_token_expires_at" field.

func (*UserUpsertOne) ClearGitlabRefreshToken

func (u *UserUpsertOne) ClearGitlabRefreshToken() *UserUpsertOne

ClearGitlabRefreshToken clears the value of the "gitlab_refresh_token" field.

func (*UserUpsertOne) ClearGitlabUserID

func (u *UserUpsertOne) ClearGitlabUserID() *UserUpsertOne

ClearGitlabUserID clears the value of the "gitlab_user_id" field.

func (*UserUpsertOne) ClearPassword

func (u *UserUpsertOne) ClearPassword() *UserUpsertOne

ClearPassword clears the value of the "password" field.

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

func (u *UserUpsertOne) SetEmail(v string) *UserUpsertOne

SetEmail sets the "email" field.

func (*UserUpsertOne) SetGithubAccessToken

func (u *UserUpsertOne) SetGithubAccessToken(v string) *UserUpsertOne

SetGithubAccessToken sets the "github_access_token" field.

func (*UserUpsertOne) SetGithubUserID

func (u *UserUpsertOne) SetGithubUserID(v int64) *UserUpsertOne

SetGithubUserID sets the "github_user_id" field.

func (*UserUpsertOne) SetGitlabAccessToken

func (u *UserUpsertOne) SetGitlabAccessToken(v string) *UserUpsertOne

SetGitlabAccessToken sets the "gitlab_access_token" field.

func (*UserUpsertOne) SetGitlabAccessTokenExpiresAt

func (u *UserUpsertOne) SetGitlabAccessTokenExpiresAt(v time.Time) *UserUpsertOne

SetGitlabAccessTokenExpiresAt sets the "gitlab_access_token_expires_at" field.

func (*UserUpsertOne) SetGitlabRefreshToken

func (u *UserUpsertOne) SetGitlabRefreshToken(v string) *UserUpsertOne

SetGitlabRefreshToken sets the "gitlab_refresh_token" field.

func (*UserUpsertOne) SetGitlabUserID

func (u *UserUpsertOne) SetGitlabUserID(v int) *UserUpsertOne

SetGitlabUserID sets the "gitlab_user_id" field.

func (*UserUpsertOne) SetPassword

func (u *UserUpsertOne) SetPassword(v string) *UserUpsertOne

SetPassword sets the "password" 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) UpdateEmail

func (u *UserUpsertOne) UpdateEmail() *UserUpsertOne

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

func (*UserUpsertOne) UpdateGithubAccessToken

func (u *UserUpsertOne) UpdateGithubAccessToken() *UserUpsertOne

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

func (*UserUpsertOne) UpdateGithubUserID

func (u *UserUpsertOne) UpdateGithubUserID() *UserUpsertOne

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

func (*UserUpsertOne) UpdateGitlabAccessToken

func (u *UserUpsertOne) UpdateGitlabAccessToken() *UserUpsertOne

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

func (*UserUpsertOne) UpdateGitlabAccessTokenExpiresAt

func (u *UserUpsertOne) UpdateGitlabAccessTokenExpiresAt() *UserUpsertOne

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

func (*UserUpsertOne) UpdateGitlabRefreshToken

func (u *UserUpsertOne) UpdateGitlabRefreshToken() *UserUpsertOne

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

func (*UserUpsertOne) UpdateGitlabUserID

func (u *UserUpsertOne) UpdateGitlabUserID() *UserUpsertOne

UpdateGitlabUserID sets the "gitlab_user_id" 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) UpdatePassword

func (u *UserUpsertOne) UpdatePassword() *UserUpsertOne

UpdatePassword sets the "password" 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