ent

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2022 License: Apache-2.0 Imports: 23 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.
	TypeProject = "Project"
	TypeRequest = "Request"
	TypeReview  = "Review"
	TypeService = "Service"
)

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
	// Project is the client for interacting with the Project builders.
	Project *ProjectClient
	// Request is the client for interacting with the Request builders.
	Request *RequestClient
	// Review is the client for interacting with the Review builders.
	Review *ReviewClient
	// Service is the client for interacting with the Service builders.
	Service *ServiceClient
	// 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().
	Project.
	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(...any)) Option

Log sets the logging function for debug mode.

type OrderFunc

type OrderFunc func(*sql.Selector)

OrderFunc applies an ordering on the sql selector.

func Asc

func Asc(fields ...string) OrderFunc

Asc applies the given fields in ASC order.

func Desc

func Desc(fields ...string) OrderFunc

Desc applies the given fields in DESC order.

type Policy

type Policy = ent.Policy

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

type Project

type Project struct {

	// ID of the ent.
	ID uuid.UUID `json:"id,omitempty"`
	// CreateTime holds the value of the "create_time" field.
	CreateTime time.Time `json:"create_time,omitempty"`
	// UpdateTime holds the value of the "update_time" field.
	UpdateTime time.Time `json:"update_time,omitempty"`
	// Name holds the value of the "name" field.
	Name string `json:"name,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the ProjectQuery when eager-loading is set.
	Edges ProjectEdges `json:"edges"`
	// contains filtered or unexported fields
}

Project is the model entity for the Project schema.

func (*Project) QueryRequests

func (pr *Project) QueryRequests() *RequestQuery

QueryRequests queries the "Requests" edge of the Project entity.

func (*Project) String

func (pr *Project) String() string

String implements the fmt.Stringer.

func (*Project) Unwrap

func (pr *Project) Unwrap() *Project

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

func (pr *Project) Update() *ProjectUpdateOne

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

type ProjectClient

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

ProjectClient is a client for the Project schema.

func NewProjectClient

func NewProjectClient(c config) *ProjectClient

NewProjectClient returns a client for the Project from the given config.

func (*ProjectClient) Create

func (c *ProjectClient) Create() *ProjectCreate

Create returns a builder for creating a Project entity.

func (*ProjectClient) CreateBulk

func (c *ProjectClient) CreateBulk(builders ...*ProjectCreate) *ProjectCreateBulk

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

func (*ProjectClient) Delete

func (c *ProjectClient) Delete() *ProjectDelete

Delete returns a delete builder for Project.

func (*ProjectClient) DeleteOne

func (c *ProjectClient) DeleteOne(pr *Project) *ProjectDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*ProjectClient) DeleteOneID

func (c *ProjectClient) DeleteOneID(id uuid.UUID) *ProjectDeleteOne

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

func (*ProjectClient) Get

func (c *ProjectClient) Get(ctx context.Context, id uuid.UUID) (*Project, error)

Get returns a Project entity by its id.

func (*ProjectClient) GetX

func (c *ProjectClient) GetX(ctx context.Context, id uuid.UUID) *Project

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

func (*ProjectClient) Hooks

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

Hooks returns the client hooks.

func (*ProjectClient) Query

func (c *ProjectClient) Query() *ProjectQuery

Query returns a query builder for Project.

func (*ProjectClient) QueryRequests

func (c *ProjectClient) QueryRequests(pr *Project) *RequestQuery

QueryRequests queries the Requests edge of a Project.

func (*ProjectClient) Update

func (c *ProjectClient) Update() *ProjectUpdate

Update returns an update builder for Project.

func (*ProjectClient) UpdateOne

func (c *ProjectClient) UpdateOne(pr *Project) *ProjectUpdateOne

UpdateOne returns an update builder for the given entity.

func (*ProjectClient) UpdateOneID

func (c *ProjectClient) UpdateOneID(id uuid.UUID) *ProjectUpdateOne

UpdateOneID returns an update builder for the given id.

func (*ProjectClient) Use

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

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

type ProjectCreate

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

ProjectCreate is the builder for creating a Project entity.

func (*ProjectCreate) AddRequestIDs

func (pc *ProjectCreate) AddRequestIDs(ids ...uuid.UUID) *ProjectCreate

AddRequestIDs adds the "Requests" edge to the Request entity by IDs.

func (*ProjectCreate) AddRequests

func (pc *ProjectCreate) AddRequests(r ...*Request) *ProjectCreate

AddRequests adds the "Requests" edges to the Request entity.

func (*ProjectCreate) Exec

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

Exec executes the query.

func (*ProjectCreate) ExecX

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

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

func (*ProjectCreate) Mutation

func (pc *ProjectCreate) Mutation() *ProjectMutation

Mutation returns the ProjectMutation object of the builder.

func (*ProjectCreate) Save

func (pc *ProjectCreate) Save(ctx context.Context) (*Project, error)

Save creates the Project in the database.

func (*ProjectCreate) SaveX

func (pc *ProjectCreate) SaveX(ctx context.Context) *Project

SaveX calls Save and panics if Save returns an error.

func (*ProjectCreate) SetCreateTime

func (pc *ProjectCreate) SetCreateTime(t time.Time) *ProjectCreate

SetCreateTime sets the "create_time" field.

func (*ProjectCreate) SetID

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

SetID sets the "id" field.

func (*ProjectCreate) SetName

func (pc *ProjectCreate) SetName(s string) *ProjectCreate

SetName sets the "name" field.

func (*ProjectCreate) SetNillableCreateTime

func (pc *ProjectCreate) SetNillableCreateTime(t *time.Time) *ProjectCreate

SetNillableCreateTime sets the "create_time" field if the given value is not nil.

func (*ProjectCreate) SetNillableID

func (pc *ProjectCreate) SetNillableID(u *uuid.UUID) *ProjectCreate

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

func (*ProjectCreate) SetNillableUpdateTime

func (pc *ProjectCreate) SetNillableUpdateTime(t *time.Time) *ProjectCreate

SetNillableUpdateTime sets the "update_time" field if the given value is not nil.

func (*ProjectCreate) SetUpdateTime

func (pc *ProjectCreate) SetUpdateTime(t time.Time) *ProjectCreate

SetUpdateTime sets the "update_time" field.

type ProjectCreateBulk

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

ProjectCreateBulk is the builder for creating many Project entities in bulk.

func (*ProjectCreateBulk) Exec

func (pcb *ProjectCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*ProjectCreateBulk) ExecX

func (pcb *ProjectCreateBulk) ExecX(ctx context.Context)

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

func (*ProjectCreateBulk) Save

func (pcb *ProjectCreateBulk) Save(ctx context.Context) ([]*Project, error)

Save creates the Project entities in the database.

func (*ProjectCreateBulk) SaveX

func (pcb *ProjectCreateBulk) SaveX(ctx context.Context) []*Project

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

type ProjectDelete

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

ProjectDelete is the builder for deleting a Project entity.

func (*ProjectDelete) Exec

func (pd *ProjectDelete) Exec(ctx context.Context) (int, error)

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

func (*ProjectDelete) ExecX

func (pd *ProjectDelete) ExecX(ctx context.Context) int

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

func (*ProjectDelete) Where

func (pd *ProjectDelete) Where(ps ...predicate.Project) *ProjectDelete

Where appends a list predicates to the ProjectDelete builder.

type ProjectDeleteOne

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

ProjectDeleteOne is the builder for deleting a single Project entity.

func (*ProjectDeleteOne) Exec

func (pdo *ProjectDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*ProjectDeleteOne) ExecX

func (pdo *ProjectDeleteOne) ExecX(ctx context.Context)

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

type ProjectEdges

type ProjectEdges struct {
	// Requests holds the value of the Requests edge.
	Requests []*Request `json:"Requests,omitempty"`
	// contains filtered or unexported fields
}

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

func (ProjectEdges) RequestsOrErr

func (e ProjectEdges) RequestsOrErr() ([]*Request, error)

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

type ProjectGroupBy

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

ProjectGroupBy is the group-by builder for Project entities.

func (*ProjectGroupBy) Aggregate

func (pgb *ProjectGroupBy) Aggregate(fns ...AggregateFunc) *ProjectGroupBy

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

func (*ProjectGroupBy) Bool

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

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

func (*ProjectGroupBy) BoolX

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

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

func (*ProjectGroupBy) Bools

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

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

func (*ProjectGroupBy) BoolsX

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

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

func (*ProjectGroupBy) Float64

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

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

func (*ProjectGroupBy) Float64X

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

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

func (*ProjectGroupBy) Float64s

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

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

func (*ProjectGroupBy) Float64sX

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

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

func (*ProjectGroupBy) Int

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

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

func (*ProjectGroupBy) IntX

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

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

func (*ProjectGroupBy) Ints

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

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

func (*ProjectGroupBy) IntsX

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

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

func (*ProjectGroupBy) Scan

func (pgb *ProjectGroupBy) Scan(ctx context.Context, v any) error

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

func (*ProjectGroupBy) ScanX

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

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

func (*ProjectGroupBy) String

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

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

func (*ProjectGroupBy) StringX

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

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

func (*ProjectGroupBy) Strings

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

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

func (*ProjectGroupBy) StringsX

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

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

type ProjectMutation

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

ProjectMutation represents an operation that mutates the Project nodes in the graph.

func (*ProjectMutation) AddField

func (m *ProjectMutation) 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 (*ProjectMutation) AddRequestIDs

func (m *ProjectMutation) AddRequestIDs(ids ...uuid.UUID)

AddRequestIDs adds the "Requests" edge to the Request entity by ids.

func (*ProjectMutation) AddedEdges

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

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

func (*ProjectMutation) AddedField

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

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

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

func (*ProjectMutation) AddedIDs

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

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

func (*ProjectMutation) ClearEdge

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

func (m *ProjectMutation) 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 (*ProjectMutation) ClearRequests

func (m *ProjectMutation) ClearRequests()

ClearRequests clears the "Requests" edge to the Request entity.

func (*ProjectMutation) ClearedEdges

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

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

func (*ProjectMutation) ClearedFields

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

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

func (ProjectMutation) Client

func (m ProjectMutation) 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 (*ProjectMutation) CreateTime

func (m *ProjectMutation) CreateTime() (r time.Time, exists bool)

CreateTime returns the value of the "create_time" field in the mutation.

func (*ProjectMutation) EdgeCleared

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

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

func (*ProjectMutation) Field

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

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

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

func (*ProjectMutation) Fields

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

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

func (m *ProjectMutation) 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 (*ProjectMutation) Name

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

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

func (*ProjectMutation) OldCreateTime

func (m *ProjectMutation) OldCreateTime(ctx context.Context) (v time.Time, err error)

OldCreateTime returns the old "create_time" field's value of the Project entity. If the Project 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 (*ProjectMutation) OldField

func (m *ProjectMutation) 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 (*ProjectMutation) OldName

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

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

func (m *ProjectMutation) OldUpdateTime(ctx context.Context) (v time.Time, err error)

OldUpdateTime returns the old "update_time" field's value of the Project entity. If the Project 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 (*ProjectMutation) Op

func (m *ProjectMutation) Op() Op

Op returns the operation name.

func (*ProjectMutation) RemoveRequestIDs

func (m *ProjectMutation) RemoveRequestIDs(ids ...uuid.UUID)

RemoveRequestIDs removes the "Requests" edge to the Request entity by IDs.

func (*ProjectMutation) RemovedEdges

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

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

func (*ProjectMutation) RemovedIDs

func (m *ProjectMutation) 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 (*ProjectMutation) RemovedRequestsIDs

func (m *ProjectMutation) RemovedRequestsIDs() (ids []uuid.UUID)

RemovedRequests returns the removed IDs of the "Requests" edge to the Request entity.

func (*ProjectMutation) RequestsCleared

func (m *ProjectMutation) RequestsCleared() bool

RequestsCleared reports if the "Requests" edge to the Request entity was cleared.

func (*ProjectMutation) RequestsIDs

func (m *ProjectMutation) RequestsIDs() (ids []uuid.UUID)

RequestsIDs returns the "Requests" edge IDs in the mutation.

func (*ProjectMutation) ResetCreateTime

func (m *ProjectMutation) ResetCreateTime()

ResetCreateTime resets all changes to the "create_time" field.

func (*ProjectMutation) ResetEdge

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

func (m *ProjectMutation) 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 (*ProjectMutation) ResetName

func (m *ProjectMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*ProjectMutation) ResetRequests

func (m *ProjectMutation) ResetRequests()

ResetRequests resets all changes to the "Requests" edge.

func (*ProjectMutation) ResetUpdateTime

func (m *ProjectMutation) ResetUpdateTime()

ResetUpdateTime resets all changes to the "update_time" field.

func (*ProjectMutation) SetCreateTime

func (m *ProjectMutation) SetCreateTime(t time.Time)

SetCreateTime sets the "create_time" field.

func (*ProjectMutation) SetField

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

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

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

func (*ProjectMutation) SetName

func (m *ProjectMutation) SetName(s string)

SetName sets the "name" field.

func (*ProjectMutation) SetUpdateTime

func (m *ProjectMutation) SetUpdateTime(t time.Time)

SetUpdateTime sets the "update_time" field.

func (ProjectMutation) Tx

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

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

func (*ProjectMutation) Type

func (m *ProjectMutation) Type() string

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

func (*ProjectMutation) UpdateTime

func (m *ProjectMutation) UpdateTime() (r time.Time, exists bool)

UpdateTime returns the value of the "update_time" field in the mutation.

func (*ProjectMutation) Where

func (m *ProjectMutation) Where(ps ...predicate.Project)

Where appends a list predicates to the ProjectMutation builder.

type ProjectQuery

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

ProjectQuery is the builder for querying Project entities.

func (*ProjectQuery) All

func (pq *ProjectQuery) All(ctx context.Context) ([]*Project, error)

All executes the query and returns a list of Projects.

func (*ProjectQuery) AllX

func (pq *ProjectQuery) AllX(ctx context.Context) []*Project

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

func (*ProjectQuery) Clone

func (pq *ProjectQuery) Clone() *ProjectQuery

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

func (*ProjectQuery) Count

func (pq *ProjectQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*ProjectQuery) CountX

func (pq *ProjectQuery) CountX(ctx context.Context) int

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

func (*ProjectQuery) Exist

func (pq *ProjectQuery) Exist(ctx context.Context) (bool, error)

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

func (*ProjectQuery) ExistX

func (pq *ProjectQuery) ExistX(ctx context.Context) bool

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

func (*ProjectQuery) First

func (pq *ProjectQuery) First(ctx context.Context) (*Project, error)

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

func (*ProjectQuery) FirstID

func (pq *ProjectQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

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

func (*ProjectQuery) FirstIDX

func (pq *ProjectQuery) FirstIDX(ctx context.Context) uuid.UUID

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

func (*ProjectQuery) FirstX

func (pq *ProjectQuery) FirstX(ctx context.Context) *Project

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

func (*ProjectQuery) GroupBy

func (pq *ProjectQuery) GroupBy(field string, fields ...string) *ProjectGroupBy

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 {
	CreateTime time.Time `json:"create_time,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Project.Query().
	GroupBy(project.FieldCreateTime).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*ProjectQuery) IDs

func (pq *ProjectQuery) IDs(ctx context.Context) ([]uuid.UUID, error)

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

func (*ProjectQuery) IDsX

func (pq *ProjectQuery) IDsX(ctx context.Context) []uuid.UUID

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

func (*ProjectQuery) Limit

func (pq *ProjectQuery) Limit(limit int) *ProjectQuery

Limit adds a limit step to the query.

func (*ProjectQuery) Offset

func (pq *ProjectQuery) Offset(offset int) *ProjectQuery

Offset adds an offset step to the query.

func (*ProjectQuery) Only

func (pq *ProjectQuery) Only(ctx context.Context) (*Project, error)

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

func (*ProjectQuery) OnlyID

func (pq *ProjectQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

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

func (*ProjectQuery) OnlyIDX

func (pq *ProjectQuery) OnlyIDX(ctx context.Context) uuid.UUID

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

func (*ProjectQuery) OnlyX

func (pq *ProjectQuery) OnlyX(ctx context.Context) *Project

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

func (*ProjectQuery) Order

func (pq *ProjectQuery) Order(o ...OrderFunc) *ProjectQuery

Order adds an order step to the query.

func (*ProjectQuery) QueryRequests

func (pq *ProjectQuery) QueryRequests() *RequestQuery

QueryRequests chains the current query on the "Requests" edge.

func (*ProjectQuery) Select

func (pq *ProjectQuery) Select(fields ...string) *ProjectSelect

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 {
	CreateTime time.Time `json:"create_time,omitempty"`
}

client.Project.Query().
	Select(project.FieldCreateTime).
	Scan(ctx, &v)

func (*ProjectQuery) Unique

func (pq *ProjectQuery) Unique(unique bool) *ProjectQuery

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

func (pq *ProjectQuery) Where(ps ...predicate.Project) *ProjectQuery

Where adds a new predicate for the ProjectQuery builder.

func (*ProjectQuery) WithRequests

func (pq *ProjectQuery) WithRequests(opts ...func(*RequestQuery)) *ProjectQuery

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

type ProjectSelect

type ProjectSelect struct {
	*ProjectQuery
	// contains filtered or unexported fields
}

ProjectSelect is the builder for selecting fields of Project entities.

func (*ProjectSelect) Bool

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

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

func (*ProjectSelect) BoolX

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

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

func (*ProjectSelect) Bools

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

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

func (*ProjectSelect) BoolsX

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

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

func (*ProjectSelect) Float64

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

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

func (*ProjectSelect) Float64X

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

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

func (*ProjectSelect) Float64s

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

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

func (*ProjectSelect) Float64sX

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

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

func (*ProjectSelect) Int

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

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

func (*ProjectSelect) IntX

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

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

func (*ProjectSelect) Ints

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

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

func (*ProjectSelect) IntsX

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

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

func (*ProjectSelect) Scan

func (ps *ProjectSelect) Scan(ctx context.Context, v any) error

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

func (*ProjectSelect) ScanX

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

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

func (*ProjectSelect) String

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

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

func (*ProjectSelect) StringX

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

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

func (*ProjectSelect) Strings

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

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

func (*ProjectSelect) StringsX

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

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

type ProjectUpdate

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

ProjectUpdate is the builder for updating Project entities.

func (*ProjectUpdate) AddRequestIDs

func (pu *ProjectUpdate) AddRequestIDs(ids ...uuid.UUID) *ProjectUpdate

AddRequestIDs adds the "Requests" edge to the Request entity by IDs.

func (*ProjectUpdate) AddRequests

func (pu *ProjectUpdate) AddRequests(r ...*Request) *ProjectUpdate

AddRequests adds the "Requests" edges to the Request entity.

func (*ProjectUpdate) ClearRequests

func (pu *ProjectUpdate) ClearRequests() *ProjectUpdate

ClearRequests clears all "Requests" edges to the Request entity.

func (*ProjectUpdate) Exec

func (pu *ProjectUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*ProjectUpdate) ExecX

func (pu *ProjectUpdate) ExecX(ctx context.Context)

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

func (*ProjectUpdate) Mutation

func (pu *ProjectUpdate) Mutation() *ProjectMutation

Mutation returns the ProjectMutation object of the builder.

func (*ProjectUpdate) RemoveRequestIDs

func (pu *ProjectUpdate) RemoveRequestIDs(ids ...uuid.UUID) *ProjectUpdate

RemoveRequestIDs removes the "Requests" edge to Request entities by IDs.

func (*ProjectUpdate) RemoveRequests

func (pu *ProjectUpdate) RemoveRequests(r ...*Request) *ProjectUpdate

RemoveRequests removes "Requests" edges to Request entities.

func (*ProjectUpdate) Save

func (pu *ProjectUpdate) Save(ctx context.Context) (int, error)

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

func (*ProjectUpdate) SaveX

func (pu *ProjectUpdate) SaveX(ctx context.Context) int

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

func (*ProjectUpdate) SetName

func (pu *ProjectUpdate) SetName(s string) *ProjectUpdate

SetName sets the "name" field.

func (*ProjectUpdate) SetUpdateTime

func (pu *ProjectUpdate) SetUpdateTime(t time.Time) *ProjectUpdate

SetUpdateTime sets the "update_time" field.

func (*ProjectUpdate) Where

func (pu *ProjectUpdate) Where(ps ...predicate.Project) *ProjectUpdate

Where appends a list predicates to the ProjectUpdate builder.

type ProjectUpdateOne

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

ProjectUpdateOne is the builder for updating a single Project entity.

func (*ProjectUpdateOne) AddRequestIDs

func (puo *ProjectUpdateOne) AddRequestIDs(ids ...uuid.UUID) *ProjectUpdateOne

AddRequestIDs adds the "Requests" edge to the Request entity by IDs.

func (*ProjectUpdateOne) AddRequests

func (puo *ProjectUpdateOne) AddRequests(r ...*Request) *ProjectUpdateOne

AddRequests adds the "Requests" edges to the Request entity.

func (*ProjectUpdateOne) ClearRequests

func (puo *ProjectUpdateOne) ClearRequests() *ProjectUpdateOne

ClearRequests clears all "Requests" edges to the Request entity.

func (*ProjectUpdateOne) Exec

func (puo *ProjectUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*ProjectUpdateOne) ExecX

func (puo *ProjectUpdateOne) ExecX(ctx context.Context)

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

func (*ProjectUpdateOne) Mutation

func (puo *ProjectUpdateOne) Mutation() *ProjectMutation

Mutation returns the ProjectMutation object of the builder.

func (*ProjectUpdateOne) RemoveRequestIDs

func (puo *ProjectUpdateOne) RemoveRequestIDs(ids ...uuid.UUID) *ProjectUpdateOne

RemoveRequestIDs removes the "Requests" edge to Request entities by IDs.

func (*ProjectUpdateOne) RemoveRequests

func (puo *ProjectUpdateOne) RemoveRequests(r ...*Request) *ProjectUpdateOne

RemoveRequests removes "Requests" edges to Request entities.

func (*ProjectUpdateOne) Save

func (puo *ProjectUpdateOne) Save(ctx context.Context) (*Project, error)

Save executes the query and returns the updated Project entity.

func (*ProjectUpdateOne) SaveX

func (puo *ProjectUpdateOne) SaveX(ctx context.Context) *Project

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

func (*ProjectUpdateOne) Select

func (puo *ProjectUpdateOne) Select(field string, fields ...string) *ProjectUpdateOne

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

func (*ProjectUpdateOne) SetName

func (puo *ProjectUpdateOne) SetName(s string) *ProjectUpdateOne

SetName sets the "name" field.

func (*ProjectUpdateOne) SetUpdateTime

func (puo *ProjectUpdateOne) SetUpdateTime(t time.Time) *ProjectUpdateOne

SetUpdateTime sets the "update_time" field.

type Projects

type Projects []*Project

Projects is a parsable slice of Project.

type Query

type Query = ent.Query

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

type Request

type Request struct {

	// ID of the ent.
	ID uuid.UUID `json:"id,omitempty"`
	// CreateTime holds the value of the "create_time" field.
	CreateTime time.Time `json:"create_time,omitempty"`
	// UpdateTime holds the value of the "update_time" field.
	UpdateTime time.Time `json:"update_time,omitempty"`
	// Type holds the value of the "type" field.
	Type string `json:"type,omitempty"`
	// RequestedBy holds the value of the "requested_by" field.
	RequestedBy string `json:"requested_by,omitempty"`
	// Status holds the value of the "status" field.
	Status request.Status `json:"status,omitempty"`
	// Spec holds the value of the "spec" field.
	Spec schema.RequestSpec `json:"spec,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the RequestQuery when eager-loading is set.
	Edges RequestEdges `json:"edges"`
	// contains filtered or unexported fields
}

Request is the model entity for the Request schema.

func (*Request) QueryProject

func (r *Request) QueryProject() *ProjectQuery

QueryProject queries the "Project" edge of the Request entity.

func (*Request) QueryReviews

func (r *Request) QueryReviews() *ReviewQuery

QueryReviews queries the "Reviews" edge of the Request entity.

func (*Request) QueryService

func (r *Request) QueryService() *ServiceQuery

QueryService queries the "Service" edge of the Request entity.

func (*Request) String

func (r *Request) String() string

String implements the fmt.Stringer.

func (*Request) Unwrap

func (r *Request) Unwrap() *Request

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

func (r *Request) Update() *RequestUpdateOne

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

type RequestClient

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

RequestClient is a client for the Request schema.

func NewRequestClient

func NewRequestClient(c config) *RequestClient

NewRequestClient returns a client for the Request from the given config.

func (*RequestClient) Create

func (c *RequestClient) Create() *RequestCreate

Create returns a builder for creating a Request entity.

func (*RequestClient) CreateBulk

func (c *RequestClient) CreateBulk(builders ...*RequestCreate) *RequestCreateBulk

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

func (*RequestClient) Delete

func (c *RequestClient) Delete() *RequestDelete

Delete returns a delete builder for Request.

func (*RequestClient) DeleteOne

func (c *RequestClient) DeleteOne(r *Request) *RequestDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*RequestClient) DeleteOneID

func (c *RequestClient) DeleteOneID(id uuid.UUID) *RequestDeleteOne

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

func (*RequestClient) Get

func (c *RequestClient) Get(ctx context.Context, id uuid.UUID) (*Request, error)

Get returns a Request entity by its id.

func (*RequestClient) GetX

func (c *RequestClient) GetX(ctx context.Context, id uuid.UUID) *Request

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

func (*RequestClient) Hooks

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

Hooks returns the client hooks.

func (*RequestClient) Query

func (c *RequestClient) Query() *RequestQuery

Query returns a query builder for Request.

func (*RequestClient) QueryProject

func (c *RequestClient) QueryProject(r *Request) *ProjectQuery

QueryProject queries the Project edge of a Request.

func (*RequestClient) QueryReviews

func (c *RequestClient) QueryReviews(r *Request) *ReviewQuery

QueryReviews queries the Reviews edge of a Request.

func (*RequestClient) QueryService

func (c *RequestClient) QueryService(r *Request) *ServiceQuery

QueryService queries the Service edge of a Request.

func (*RequestClient) Update

func (c *RequestClient) Update() *RequestUpdate

Update returns an update builder for Request.

func (*RequestClient) UpdateOne

func (c *RequestClient) UpdateOne(r *Request) *RequestUpdateOne

UpdateOne returns an update builder for the given entity.

func (*RequestClient) UpdateOneID

func (c *RequestClient) UpdateOneID(id uuid.UUID) *RequestUpdateOne

UpdateOneID returns an update builder for the given id.

func (*RequestClient) Use

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

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

type RequestCreate

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

RequestCreate is the builder for creating a Request entity.

func (*RequestCreate) AddReviewIDs

func (rc *RequestCreate) AddReviewIDs(ids ...uuid.UUID) *RequestCreate

AddReviewIDs adds the "Reviews" edge to the Review entity by IDs.

func (*RequestCreate) AddReviews

func (rc *RequestCreate) AddReviews(r ...*Review) *RequestCreate

AddReviews adds the "Reviews" edges to the Review entity.

func (*RequestCreate) Exec

func (rc *RequestCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*RequestCreate) ExecX

func (rc *RequestCreate) ExecX(ctx context.Context)

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

func (*RequestCreate) Mutation

func (rc *RequestCreate) Mutation() *RequestMutation

Mutation returns the RequestMutation object of the builder.

func (*RequestCreate) Save

func (rc *RequestCreate) Save(ctx context.Context) (*Request, error)

Save creates the Request in the database.

func (*RequestCreate) SaveX

func (rc *RequestCreate) SaveX(ctx context.Context) *Request

SaveX calls Save and panics if Save returns an error.

func (*RequestCreate) SetCreateTime

func (rc *RequestCreate) SetCreateTime(t time.Time) *RequestCreate

SetCreateTime sets the "create_time" field.

func (*RequestCreate) SetID

func (rc *RequestCreate) SetID(u uuid.UUID) *RequestCreate

SetID sets the "id" field.

func (*RequestCreate) SetNillableCreateTime

func (rc *RequestCreate) SetNillableCreateTime(t *time.Time) *RequestCreate

SetNillableCreateTime sets the "create_time" field if the given value is not nil.

func (*RequestCreate) SetNillableID

func (rc *RequestCreate) SetNillableID(u *uuid.UUID) *RequestCreate

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

func (*RequestCreate) SetNillableStatus

func (rc *RequestCreate) SetNillableStatus(r *request.Status) *RequestCreate

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

func (*RequestCreate) SetNillableUpdateTime

func (rc *RequestCreate) SetNillableUpdateTime(t *time.Time) *RequestCreate

SetNillableUpdateTime sets the "update_time" field if the given value is not nil.

func (*RequestCreate) SetProject

func (rc *RequestCreate) SetProject(p *Project) *RequestCreate

SetProject sets the "Project" edge to the Project entity.

func (*RequestCreate) SetProjectID

func (rc *RequestCreate) SetProjectID(id uuid.UUID) *RequestCreate

SetProjectID sets the "Project" edge to the Project entity by ID.

func (*RequestCreate) SetRequestedBy

func (rc *RequestCreate) SetRequestedBy(s string) *RequestCreate

SetRequestedBy sets the "requested_by" field.

func (*RequestCreate) SetService

func (rc *RequestCreate) SetService(s *Service) *RequestCreate

SetService sets the "Service" edge to the Service entity.

func (*RequestCreate) SetServiceID

func (rc *RequestCreate) SetServiceID(id uuid.UUID) *RequestCreate

SetServiceID sets the "Service" edge to the Service entity by ID.

func (*RequestCreate) SetSpec

func (rc *RequestCreate) SetSpec(ss schema.RequestSpec) *RequestCreate

SetSpec sets the "spec" field.

func (*RequestCreate) SetStatus

func (rc *RequestCreate) SetStatus(r request.Status) *RequestCreate

SetStatus sets the "status" field.

func (*RequestCreate) SetType

func (rc *RequestCreate) SetType(s string) *RequestCreate

SetType sets the "type" field.

func (*RequestCreate) SetUpdateTime

func (rc *RequestCreate) SetUpdateTime(t time.Time) *RequestCreate

SetUpdateTime sets the "update_time" field.

type RequestCreateBulk

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

RequestCreateBulk is the builder for creating many Request entities in bulk.

func (*RequestCreateBulk) Exec

func (rcb *RequestCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*RequestCreateBulk) ExecX

func (rcb *RequestCreateBulk) ExecX(ctx context.Context)

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

func (*RequestCreateBulk) Save

func (rcb *RequestCreateBulk) Save(ctx context.Context) ([]*Request, error)

Save creates the Request entities in the database.

func (*RequestCreateBulk) SaveX

func (rcb *RequestCreateBulk) SaveX(ctx context.Context) []*Request

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

type RequestDelete

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

RequestDelete is the builder for deleting a Request entity.

func (*RequestDelete) Exec

func (rd *RequestDelete) Exec(ctx context.Context) (int, error)

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

func (*RequestDelete) ExecX

func (rd *RequestDelete) ExecX(ctx context.Context) int

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

func (*RequestDelete) Where

func (rd *RequestDelete) Where(ps ...predicate.Request) *RequestDelete

Where appends a list predicates to the RequestDelete builder.

type RequestDeleteOne

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

RequestDeleteOne is the builder for deleting a single Request entity.

func (*RequestDeleteOne) Exec

func (rdo *RequestDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*RequestDeleteOne) ExecX

func (rdo *RequestDeleteOne) ExecX(ctx context.Context)

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

type RequestEdges

type RequestEdges struct {
	// Project holds the value of the Project edge.
	Project *Project `json:"Project,omitempty"`
	// Service holds the value of the Service edge.
	Service *Service `json:"Service,omitempty"`
	// Reviews holds the value of the Reviews edge.
	Reviews []*Review `json:"Reviews,omitempty"`
	// contains filtered or unexported fields
}

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

func (RequestEdges) ProjectOrErr

func (e RequestEdges) ProjectOrErr() (*Project, error)

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

func (RequestEdges) ReviewsOrErr

func (e RequestEdges) ReviewsOrErr() ([]*Review, error)

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

func (RequestEdges) ServiceOrErr

func (e RequestEdges) ServiceOrErr() (*Service, error)

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

type RequestGroupBy

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

RequestGroupBy is the group-by builder for Request entities.

func (*RequestGroupBy) Aggregate

func (rgb *RequestGroupBy) Aggregate(fns ...AggregateFunc) *RequestGroupBy

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

func (*RequestGroupBy) Bool

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

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

func (*RequestGroupBy) BoolX

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

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

func (*RequestGroupBy) Bools

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

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

func (*RequestGroupBy) BoolsX

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

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

func (*RequestGroupBy) Float64

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

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

func (*RequestGroupBy) Float64X

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

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

func (*RequestGroupBy) Float64s

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

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

func (*RequestGroupBy) Float64sX

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

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

func (*RequestGroupBy) Int

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

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

func (*RequestGroupBy) IntX

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

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

func (*RequestGroupBy) Ints

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

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

func (*RequestGroupBy) IntsX

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

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

func (*RequestGroupBy) Scan

func (rgb *RequestGroupBy) Scan(ctx context.Context, v any) error

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

func (*RequestGroupBy) ScanX

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

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

func (*RequestGroupBy) String

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

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

func (*RequestGroupBy) StringX

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

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

func (*RequestGroupBy) Strings

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

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

func (*RequestGroupBy) StringsX

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

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

type RequestMutation

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

RequestMutation represents an operation that mutates the Request nodes in the graph.

func (*RequestMutation) AddField

func (m *RequestMutation) 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 (*RequestMutation) AddReviewIDs

func (m *RequestMutation) AddReviewIDs(ids ...uuid.UUID)

AddReviewIDs adds the "Reviews" edge to the Review entity by ids.

func (*RequestMutation) AddedEdges

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

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

func (*RequestMutation) AddedField

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

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

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

func (*RequestMutation) AddedIDs

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

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

func (*RequestMutation) ClearEdge

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

func (m *RequestMutation) 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 (*RequestMutation) ClearProject

func (m *RequestMutation) ClearProject()

ClearProject clears the "Project" edge to the Project entity.

func (*RequestMutation) ClearReviews

func (m *RequestMutation) ClearReviews()

ClearReviews clears the "Reviews" edge to the Review entity.

func (*RequestMutation) ClearService

func (m *RequestMutation) ClearService()

ClearService clears the "Service" edge to the Service entity.

func (*RequestMutation) ClearedEdges

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

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

func (*RequestMutation) ClearedFields

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

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

func (RequestMutation) Client

func (m RequestMutation) 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 (*RequestMutation) CreateTime

func (m *RequestMutation) CreateTime() (r time.Time, exists bool)

CreateTime returns the value of the "create_time" field in the mutation.

func (*RequestMutation) EdgeCleared

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

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

func (*RequestMutation) Field

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

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

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

func (*RequestMutation) Fields

func (m *RequestMutation) 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 (*RequestMutation) GetType

func (m *RequestMutation) GetType() (r string, exists bool)

GetType returns the value of the "type" field in the mutation.

func (*RequestMutation) ID

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

func (m *RequestMutation) 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 (*RequestMutation) OldCreateTime

func (m *RequestMutation) OldCreateTime(ctx context.Context) (v time.Time, err error)

OldCreateTime returns the old "create_time" field's value of the Request entity. If the Request 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 (*RequestMutation) OldField

func (m *RequestMutation) 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 (*RequestMutation) OldRequestedBy

func (m *RequestMutation) OldRequestedBy(ctx context.Context) (v string, err error)

OldRequestedBy returns the old "requested_by" field's value of the Request entity. If the Request 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 (*RequestMutation) OldSpec

func (m *RequestMutation) OldSpec(ctx context.Context) (v schema.RequestSpec, err error)

OldSpec returns the old "spec" field's value of the Request entity. If the Request 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 (*RequestMutation) OldStatus

func (m *RequestMutation) OldStatus(ctx context.Context) (v request.Status, err error)

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

func (m *RequestMutation) OldType(ctx context.Context) (v string, err error)

OldType returns the old "type" field's value of the Request entity. If the Request 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 (*RequestMutation) OldUpdateTime

func (m *RequestMutation) OldUpdateTime(ctx context.Context) (v time.Time, err error)

OldUpdateTime returns the old "update_time" field's value of the Request entity. If the Request 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 (*RequestMutation) Op

func (m *RequestMutation) Op() Op

Op returns the operation name.

func (*RequestMutation) ProjectCleared

func (m *RequestMutation) ProjectCleared() bool

ProjectCleared reports if the "Project" edge to the Project entity was cleared.

func (*RequestMutation) ProjectID

func (m *RequestMutation) ProjectID() (id uuid.UUID, exists bool)

ProjectID returns the "Project" edge ID in the mutation.

func (*RequestMutation) ProjectIDs

func (m *RequestMutation) ProjectIDs() (ids []uuid.UUID)

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

func (*RequestMutation) RemoveReviewIDs

func (m *RequestMutation) RemoveReviewIDs(ids ...uuid.UUID)

RemoveReviewIDs removes the "Reviews" edge to the Review entity by IDs.

func (*RequestMutation) RemovedEdges

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

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

func (*RequestMutation) RemovedIDs

func (m *RequestMutation) 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 (*RequestMutation) RemovedReviewsIDs

func (m *RequestMutation) RemovedReviewsIDs() (ids []uuid.UUID)

RemovedReviews returns the removed IDs of the "Reviews" edge to the Review entity.

func (*RequestMutation) RequestedBy

func (m *RequestMutation) RequestedBy() (r string, exists bool)

RequestedBy returns the value of the "requested_by" field in the mutation.

func (*RequestMutation) ResetCreateTime

func (m *RequestMutation) ResetCreateTime()

ResetCreateTime resets all changes to the "create_time" field.

func (*RequestMutation) ResetEdge

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

func (m *RequestMutation) 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 (*RequestMutation) ResetProject

func (m *RequestMutation) ResetProject()

ResetProject resets all changes to the "Project" edge.

func (*RequestMutation) ResetRequestedBy

func (m *RequestMutation) ResetRequestedBy()

ResetRequestedBy resets all changes to the "requested_by" field.

func (*RequestMutation) ResetReviews

func (m *RequestMutation) ResetReviews()

ResetReviews resets all changes to the "Reviews" edge.

func (*RequestMutation) ResetService

func (m *RequestMutation) ResetService()

ResetService resets all changes to the "Service" edge.

func (*RequestMutation) ResetSpec

func (m *RequestMutation) ResetSpec()

ResetSpec resets all changes to the "spec" field.

func (*RequestMutation) ResetStatus

func (m *RequestMutation) ResetStatus()

ResetStatus resets all changes to the "status" field.

func (*RequestMutation) ResetType

func (m *RequestMutation) ResetType()

ResetType resets all changes to the "type" field.

func (*RequestMutation) ResetUpdateTime

func (m *RequestMutation) ResetUpdateTime()

ResetUpdateTime resets all changes to the "update_time" field.

func (*RequestMutation) ReviewsCleared

func (m *RequestMutation) ReviewsCleared() bool

ReviewsCleared reports if the "Reviews" edge to the Review entity was cleared.

func (*RequestMutation) ReviewsIDs

func (m *RequestMutation) ReviewsIDs() (ids []uuid.UUID)

ReviewsIDs returns the "Reviews" edge IDs in the mutation.

func (*RequestMutation) ServiceCleared

func (m *RequestMutation) ServiceCleared() bool

ServiceCleared reports if the "Service" edge to the Service entity was cleared.

func (*RequestMutation) ServiceID

func (m *RequestMutation) ServiceID() (id uuid.UUID, exists bool)

ServiceID returns the "Service" edge ID in the mutation.

func (*RequestMutation) ServiceIDs

func (m *RequestMutation) ServiceIDs() (ids []uuid.UUID)

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

func (*RequestMutation) SetCreateTime

func (m *RequestMutation) SetCreateTime(t time.Time)

SetCreateTime sets the "create_time" field.

func (*RequestMutation) SetField

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

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

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

func (*RequestMutation) SetProjectID

func (m *RequestMutation) SetProjectID(id uuid.UUID)

SetProjectID sets the "Project" edge to the Project entity by id.

func (*RequestMutation) SetRequestedBy

func (m *RequestMutation) SetRequestedBy(s string)

SetRequestedBy sets the "requested_by" field.

func (*RequestMutation) SetServiceID

func (m *RequestMutation) SetServiceID(id uuid.UUID)

SetServiceID sets the "Service" edge to the Service entity by id.

func (*RequestMutation) SetSpec

func (m *RequestMutation) SetSpec(ss schema.RequestSpec)

SetSpec sets the "spec" field.

func (*RequestMutation) SetStatus

func (m *RequestMutation) SetStatus(r request.Status)

SetStatus sets the "status" field.

func (*RequestMutation) SetType

func (m *RequestMutation) SetType(s string)

SetType sets the "type" field.

func (*RequestMutation) SetUpdateTime

func (m *RequestMutation) SetUpdateTime(t time.Time)

SetUpdateTime sets the "update_time" field.

func (*RequestMutation) Spec

func (m *RequestMutation) Spec() (r schema.RequestSpec, exists bool)

Spec returns the value of the "spec" field in the mutation.

func (*RequestMutation) Status

func (m *RequestMutation) Status() (r request.Status, exists bool)

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

func (RequestMutation) Tx

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

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

func (*RequestMutation) Type

func (m *RequestMutation) Type() string

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

func (*RequestMutation) UpdateTime

func (m *RequestMutation) UpdateTime() (r time.Time, exists bool)

UpdateTime returns the value of the "update_time" field in the mutation.

func (*RequestMutation) Where

func (m *RequestMutation) Where(ps ...predicate.Request)

Where appends a list predicates to the RequestMutation builder.

type RequestQuery

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

RequestQuery is the builder for querying Request entities.

func (*RequestQuery) All

func (rq *RequestQuery) All(ctx context.Context) ([]*Request, error)

All executes the query and returns a list of Requests.

func (*RequestQuery) AllX

func (rq *RequestQuery) AllX(ctx context.Context) []*Request

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

func (*RequestQuery) Clone

func (rq *RequestQuery) Clone() *RequestQuery

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

func (*RequestQuery) Count

func (rq *RequestQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*RequestQuery) CountX

func (rq *RequestQuery) CountX(ctx context.Context) int

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

func (*RequestQuery) Exist

func (rq *RequestQuery) Exist(ctx context.Context) (bool, error)

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

func (*RequestQuery) ExistX

func (rq *RequestQuery) ExistX(ctx context.Context) bool

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

func (*RequestQuery) First

func (rq *RequestQuery) First(ctx context.Context) (*Request, error)

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

func (*RequestQuery) FirstID

func (rq *RequestQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

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

func (*RequestQuery) FirstIDX

func (rq *RequestQuery) FirstIDX(ctx context.Context) uuid.UUID

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

func (*RequestQuery) FirstX

func (rq *RequestQuery) FirstX(ctx context.Context) *Request

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

func (*RequestQuery) GroupBy

func (rq *RequestQuery) GroupBy(field string, fields ...string) *RequestGroupBy

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 {
	CreateTime time.Time `json:"create_time,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Request.Query().
	GroupBy(request.FieldCreateTime).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*RequestQuery) IDs

func (rq *RequestQuery) IDs(ctx context.Context) ([]uuid.UUID, error)

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

func (*RequestQuery) IDsX

func (rq *RequestQuery) IDsX(ctx context.Context) []uuid.UUID

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

func (*RequestQuery) Limit

func (rq *RequestQuery) Limit(limit int) *RequestQuery

Limit adds a limit step to the query.

func (*RequestQuery) Offset

func (rq *RequestQuery) Offset(offset int) *RequestQuery

Offset adds an offset step to the query.

func (*RequestQuery) Only

func (rq *RequestQuery) Only(ctx context.Context) (*Request, error)

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

func (*RequestQuery) OnlyID

func (rq *RequestQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

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

func (*RequestQuery) OnlyIDX

func (rq *RequestQuery) OnlyIDX(ctx context.Context) uuid.UUID

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

func (*RequestQuery) OnlyX

func (rq *RequestQuery) OnlyX(ctx context.Context) *Request

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

func (*RequestQuery) Order

func (rq *RequestQuery) Order(o ...OrderFunc) *RequestQuery

Order adds an order step to the query.

func (*RequestQuery) QueryProject

func (rq *RequestQuery) QueryProject() *ProjectQuery

QueryProject chains the current query on the "Project" edge.

func (*RequestQuery) QueryReviews

func (rq *RequestQuery) QueryReviews() *ReviewQuery

QueryReviews chains the current query on the "Reviews" edge.

func (*RequestQuery) QueryService

func (rq *RequestQuery) QueryService() *ServiceQuery

QueryService chains the current query on the "Service" edge.

func (*RequestQuery) Select

func (rq *RequestQuery) Select(fields ...string) *RequestSelect

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 {
	CreateTime time.Time `json:"create_time,omitempty"`
}

client.Request.Query().
	Select(request.FieldCreateTime).
	Scan(ctx, &v)

func (*RequestQuery) Unique

func (rq *RequestQuery) Unique(unique bool) *RequestQuery

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

func (rq *RequestQuery) Where(ps ...predicate.Request) *RequestQuery

Where adds a new predicate for the RequestQuery builder.

func (*RequestQuery) WithProject

func (rq *RequestQuery) WithProject(opts ...func(*ProjectQuery)) *RequestQuery

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

func (*RequestQuery) WithReviews

func (rq *RequestQuery) WithReviews(opts ...func(*ReviewQuery)) *RequestQuery

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

func (*RequestQuery) WithService

func (rq *RequestQuery) WithService(opts ...func(*ServiceQuery)) *RequestQuery

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

type RequestSelect

type RequestSelect struct {
	*RequestQuery
	// contains filtered or unexported fields
}

RequestSelect is the builder for selecting fields of Request entities.

func (*RequestSelect) Bool

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

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

func (*RequestSelect) BoolX

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

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

func (*RequestSelect) Bools

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

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

func (*RequestSelect) BoolsX

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

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

func (*RequestSelect) Float64

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

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

func (*RequestSelect) Float64X

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

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

func (*RequestSelect) Float64s

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

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

func (*RequestSelect) Float64sX

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

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

func (*RequestSelect) Int

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

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

func (*RequestSelect) IntX

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

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

func (*RequestSelect) Ints

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

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

func (*RequestSelect) IntsX

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

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

func (*RequestSelect) Scan

func (rs *RequestSelect) Scan(ctx context.Context, v any) error

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

func (*RequestSelect) ScanX

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

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

func (*RequestSelect) String

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

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

func (*RequestSelect) StringX

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

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

func (*RequestSelect) Strings

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

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

func (*RequestSelect) StringsX

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

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

type RequestUpdate

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

RequestUpdate is the builder for updating Request entities.

func (*RequestUpdate) AddReviewIDs

func (ru *RequestUpdate) AddReviewIDs(ids ...uuid.UUID) *RequestUpdate

AddReviewIDs adds the "Reviews" edge to the Review entity by IDs.

func (*RequestUpdate) AddReviews

func (ru *RequestUpdate) AddReviews(r ...*Review) *RequestUpdate

AddReviews adds the "Reviews" edges to the Review entity.

func (*RequestUpdate) ClearProject

func (ru *RequestUpdate) ClearProject() *RequestUpdate

ClearProject clears the "Project" edge to the Project entity.

func (*RequestUpdate) ClearReviews

func (ru *RequestUpdate) ClearReviews() *RequestUpdate

ClearReviews clears all "Reviews" edges to the Review entity.

func (*RequestUpdate) ClearService

func (ru *RequestUpdate) ClearService() *RequestUpdate

ClearService clears the "Service" edge to the Service entity.

func (*RequestUpdate) Exec

func (ru *RequestUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*RequestUpdate) ExecX

func (ru *RequestUpdate) ExecX(ctx context.Context)

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

func (*RequestUpdate) Mutation

func (ru *RequestUpdate) Mutation() *RequestMutation

Mutation returns the RequestMutation object of the builder.

func (*RequestUpdate) RemoveReviewIDs

func (ru *RequestUpdate) RemoveReviewIDs(ids ...uuid.UUID) *RequestUpdate

RemoveReviewIDs removes the "Reviews" edge to Review entities by IDs.

func (*RequestUpdate) RemoveReviews

func (ru *RequestUpdate) RemoveReviews(r ...*Review) *RequestUpdate

RemoveReviews removes "Reviews" edges to Review entities.

func (*RequestUpdate) Save

func (ru *RequestUpdate) Save(ctx context.Context) (int, error)

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

func (*RequestUpdate) SaveX

func (ru *RequestUpdate) SaveX(ctx context.Context) int

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

func (*RequestUpdate) SetNillableStatus

func (ru *RequestUpdate) SetNillableStatus(r *request.Status) *RequestUpdate

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

func (*RequestUpdate) SetProject

func (ru *RequestUpdate) SetProject(p *Project) *RequestUpdate

SetProject sets the "Project" edge to the Project entity.

func (*RequestUpdate) SetProjectID

func (ru *RequestUpdate) SetProjectID(id uuid.UUID) *RequestUpdate

SetProjectID sets the "Project" edge to the Project entity by ID.

func (*RequestUpdate) SetRequestedBy

func (ru *RequestUpdate) SetRequestedBy(s string) *RequestUpdate

SetRequestedBy sets the "requested_by" field.

func (*RequestUpdate) SetService

func (ru *RequestUpdate) SetService(s *Service) *RequestUpdate

SetService sets the "Service" edge to the Service entity.

func (*RequestUpdate) SetServiceID

func (ru *RequestUpdate) SetServiceID(id uuid.UUID) *RequestUpdate

SetServiceID sets the "Service" edge to the Service entity by ID.

func (*RequestUpdate) SetSpec

func (ru *RequestUpdate) SetSpec(ss schema.RequestSpec) *RequestUpdate

SetSpec sets the "spec" field.

func (*RequestUpdate) SetStatus

func (ru *RequestUpdate) SetStatus(r request.Status) *RequestUpdate

SetStatus sets the "status" field.

func (*RequestUpdate) SetType

func (ru *RequestUpdate) SetType(s string) *RequestUpdate

SetType sets the "type" field.

func (*RequestUpdate) SetUpdateTime

func (ru *RequestUpdate) SetUpdateTime(t time.Time) *RequestUpdate

SetUpdateTime sets the "update_time" field.

func (*RequestUpdate) Where

func (ru *RequestUpdate) Where(ps ...predicate.Request) *RequestUpdate

Where appends a list predicates to the RequestUpdate builder.

type RequestUpdateOne

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

RequestUpdateOne is the builder for updating a single Request entity.

func (*RequestUpdateOne) AddReviewIDs

func (ruo *RequestUpdateOne) AddReviewIDs(ids ...uuid.UUID) *RequestUpdateOne

AddReviewIDs adds the "Reviews" edge to the Review entity by IDs.

func (*RequestUpdateOne) AddReviews

func (ruo *RequestUpdateOne) AddReviews(r ...*Review) *RequestUpdateOne

AddReviews adds the "Reviews" edges to the Review entity.

func (*RequestUpdateOne) ClearProject

func (ruo *RequestUpdateOne) ClearProject() *RequestUpdateOne

ClearProject clears the "Project" edge to the Project entity.

func (*RequestUpdateOne) ClearReviews

func (ruo *RequestUpdateOne) ClearReviews() *RequestUpdateOne

ClearReviews clears all "Reviews" edges to the Review entity.

func (*RequestUpdateOne) ClearService

func (ruo *RequestUpdateOne) ClearService() *RequestUpdateOne

ClearService clears the "Service" edge to the Service entity.

func (*RequestUpdateOne) Exec

func (ruo *RequestUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*RequestUpdateOne) ExecX

func (ruo *RequestUpdateOne) ExecX(ctx context.Context)

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

func (*RequestUpdateOne) Mutation

func (ruo *RequestUpdateOne) Mutation() *RequestMutation

Mutation returns the RequestMutation object of the builder.

func (*RequestUpdateOne) RemoveReviewIDs

func (ruo *RequestUpdateOne) RemoveReviewIDs(ids ...uuid.UUID) *RequestUpdateOne

RemoveReviewIDs removes the "Reviews" edge to Review entities by IDs.

func (*RequestUpdateOne) RemoveReviews

func (ruo *RequestUpdateOne) RemoveReviews(r ...*Review) *RequestUpdateOne

RemoveReviews removes "Reviews" edges to Review entities.

func (*RequestUpdateOne) Save

func (ruo *RequestUpdateOne) Save(ctx context.Context) (*Request, error)

Save executes the query and returns the updated Request entity.

func (*RequestUpdateOne) SaveX

func (ruo *RequestUpdateOne) SaveX(ctx context.Context) *Request

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

func (*RequestUpdateOne) Select

func (ruo *RequestUpdateOne) Select(field string, fields ...string) *RequestUpdateOne

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

func (*RequestUpdateOne) SetNillableStatus

func (ruo *RequestUpdateOne) SetNillableStatus(r *request.Status) *RequestUpdateOne

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

func (*RequestUpdateOne) SetProject

func (ruo *RequestUpdateOne) SetProject(p *Project) *RequestUpdateOne

SetProject sets the "Project" edge to the Project entity.

func (*RequestUpdateOne) SetProjectID

func (ruo *RequestUpdateOne) SetProjectID(id uuid.UUID) *RequestUpdateOne

SetProjectID sets the "Project" edge to the Project entity by ID.

func (*RequestUpdateOne) SetRequestedBy

func (ruo *RequestUpdateOne) SetRequestedBy(s string) *RequestUpdateOne

SetRequestedBy sets the "requested_by" field.

func (*RequestUpdateOne) SetService

func (ruo *RequestUpdateOne) SetService(s *Service) *RequestUpdateOne

SetService sets the "Service" edge to the Service entity.

func (*RequestUpdateOne) SetServiceID

func (ruo *RequestUpdateOne) SetServiceID(id uuid.UUID) *RequestUpdateOne

SetServiceID sets the "Service" edge to the Service entity by ID.

func (*RequestUpdateOne) SetSpec

SetSpec sets the "spec" field.

func (*RequestUpdateOne) SetStatus

func (ruo *RequestUpdateOne) SetStatus(r request.Status) *RequestUpdateOne

SetStatus sets the "status" field.

func (*RequestUpdateOne) SetType

func (ruo *RequestUpdateOne) SetType(s string) *RequestUpdateOne

SetType sets the "type" field.

func (*RequestUpdateOne) SetUpdateTime

func (ruo *RequestUpdateOne) SetUpdateTime(t time.Time) *RequestUpdateOne

SetUpdateTime sets the "update_time" field.

type Requests

type Requests []*Request

Requests is a parsable slice of Request.

type Review

type Review struct {

	// ID of the ent.
	ID uuid.UUID `json:"id,omitempty"`
	// CreateTime holds the value of the "create_time" field.
	CreateTime time.Time `json:"create_time,omitempty"`
	// UpdateTime holds the value of the "update_time" field.
	UpdateTime time.Time `json:"update_time,omitempty"`
	// Status holds the value of the "status" field.
	Status review.Status `json:"status,omitempty"`
	// Type holds the value of the "type" field.
	Type review.Type `json:"type,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the ReviewQuery when eager-loading is set.
	Edges ReviewEdges `json:"edges"`
	// contains filtered or unexported fields
}

Review is the model entity for the Review schema.

func (*Review) QueryRequest

func (r *Review) QueryRequest() *RequestQuery

QueryRequest queries the "Request" edge of the Review entity.

func (*Review) String

func (r *Review) String() string

String implements the fmt.Stringer.

func (*Review) Unwrap

func (r *Review) Unwrap() *Review

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

func (r *Review) Update() *ReviewUpdateOne

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

type ReviewClient

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

ReviewClient is a client for the Review schema.

func NewReviewClient

func NewReviewClient(c config) *ReviewClient

NewReviewClient returns a client for the Review from the given config.

func (*ReviewClient) Create

func (c *ReviewClient) Create() *ReviewCreate

Create returns a builder for creating a Review entity.

func (*ReviewClient) CreateBulk

func (c *ReviewClient) CreateBulk(builders ...*ReviewCreate) *ReviewCreateBulk

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

func (*ReviewClient) Delete

func (c *ReviewClient) Delete() *ReviewDelete

Delete returns a delete builder for Review.

func (*ReviewClient) DeleteOne

func (c *ReviewClient) DeleteOne(r *Review) *ReviewDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*ReviewClient) DeleteOneID

func (c *ReviewClient) DeleteOneID(id uuid.UUID) *ReviewDeleteOne

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

func (*ReviewClient) Get

func (c *ReviewClient) Get(ctx context.Context, id uuid.UUID) (*Review, error)

Get returns a Review entity by its id.

func (*ReviewClient) GetX

func (c *ReviewClient) GetX(ctx context.Context, id uuid.UUID) *Review

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

func (*ReviewClient) Hooks

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

Hooks returns the client hooks.

func (*ReviewClient) Query

func (c *ReviewClient) Query() *ReviewQuery

Query returns a query builder for Review.

func (*ReviewClient) QueryRequest

func (c *ReviewClient) QueryRequest(r *Review) *RequestQuery

QueryRequest queries the Request edge of a Review.

func (*ReviewClient) Update

func (c *ReviewClient) Update() *ReviewUpdate

Update returns an update builder for Review.

func (*ReviewClient) UpdateOne

func (c *ReviewClient) UpdateOne(r *Review) *ReviewUpdateOne

UpdateOne returns an update builder for the given entity.

func (*ReviewClient) UpdateOneID

func (c *ReviewClient) UpdateOneID(id uuid.UUID) *ReviewUpdateOne

UpdateOneID returns an update builder for the given id.

func (*ReviewClient) Use

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

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

type ReviewCreate

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

ReviewCreate is the builder for creating a Review entity.

func (*ReviewCreate) Exec

func (rc *ReviewCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*ReviewCreate) ExecX

func (rc *ReviewCreate) ExecX(ctx context.Context)

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

func (*ReviewCreate) Mutation

func (rc *ReviewCreate) Mutation() *ReviewMutation

Mutation returns the ReviewMutation object of the builder.

func (*ReviewCreate) Save

func (rc *ReviewCreate) Save(ctx context.Context) (*Review, error)

Save creates the Review in the database.

func (*ReviewCreate) SaveX

func (rc *ReviewCreate) SaveX(ctx context.Context) *Review

SaveX calls Save and panics if Save returns an error.

func (*ReviewCreate) SetCreateTime

func (rc *ReviewCreate) SetCreateTime(t time.Time) *ReviewCreate

SetCreateTime sets the "create_time" field.

func (*ReviewCreate) SetID

func (rc *ReviewCreate) SetID(u uuid.UUID) *ReviewCreate

SetID sets the "id" field.

func (*ReviewCreate) SetNillableCreateTime

func (rc *ReviewCreate) SetNillableCreateTime(t *time.Time) *ReviewCreate

SetNillableCreateTime sets the "create_time" field if the given value is not nil.

func (*ReviewCreate) SetNillableID

func (rc *ReviewCreate) SetNillableID(u *uuid.UUID) *ReviewCreate

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

func (*ReviewCreate) SetNillableType

func (rc *ReviewCreate) SetNillableType(r *review.Type) *ReviewCreate

SetNillableType sets the "type" field if the given value is not nil.

func (*ReviewCreate) SetNillableUpdateTime

func (rc *ReviewCreate) SetNillableUpdateTime(t *time.Time) *ReviewCreate

SetNillableUpdateTime sets the "update_time" field if the given value is not nil.

func (*ReviewCreate) SetRequest

func (rc *ReviewCreate) SetRequest(r *Request) *ReviewCreate

SetRequest sets the "Request" edge to the Request entity.

func (*ReviewCreate) SetRequestID

func (rc *ReviewCreate) SetRequestID(id uuid.UUID) *ReviewCreate

SetRequestID sets the "Request" edge to the Request entity by ID.

func (*ReviewCreate) SetStatus

func (rc *ReviewCreate) SetStatus(r review.Status) *ReviewCreate

SetStatus sets the "status" field.

func (*ReviewCreate) SetType

func (rc *ReviewCreate) SetType(r review.Type) *ReviewCreate

SetType sets the "type" field.

func (*ReviewCreate) SetUpdateTime

func (rc *ReviewCreate) SetUpdateTime(t time.Time) *ReviewCreate

SetUpdateTime sets the "update_time" field.

type ReviewCreateBulk

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

ReviewCreateBulk is the builder for creating many Review entities in bulk.

func (*ReviewCreateBulk) Exec

func (rcb *ReviewCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*ReviewCreateBulk) ExecX

func (rcb *ReviewCreateBulk) ExecX(ctx context.Context)

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

func (*ReviewCreateBulk) Save

func (rcb *ReviewCreateBulk) Save(ctx context.Context) ([]*Review, error)

Save creates the Review entities in the database.

func (*ReviewCreateBulk) SaveX

func (rcb *ReviewCreateBulk) SaveX(ctx context.Context) []*Review

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

type ReviewDelete

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

ReviewDelete is the builder for deleting a Review entity.

func (*ReviewDelete) Exec

func (rd *ReviewDelete) Exec(ctx context.Context) (int, error)

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

func (*ReviewDelete) ExecX

func (rd *ReviewDelete) ExecX(ctx context.Context) int

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

func (*ReviewDelete) Where

func (rd *ReviewDelete) Where(ps ...predicate.Review) *ReviewDelete

Where appends a list predicates to the ReviewDelete builder.

type ReviewDeleteOne

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

ReviewDeleteOne is the builder for deleting a single Review entity.

func (*ReviewDeleteOne) Exec

func (rdo *ReviewDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*ReviewDeleteOne) ExecX

func (rdo *ReviewDeleteOne) ExecX(ctx context.Context)

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

type ReviewEdges

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

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

func (ReviewEdges) RequestOrErr

func (e ReviewEdges) RequestOrErr() (*Request, error)

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

type ReviewGroupBy

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

ReviewGroupBy is the group-by builder for Review entities.

func (*ReviewGroupBy) Aggregate

func (rgb *ReviewGroupBy) Aggregate(fns ...AggregateFunc) *ReviewGroupBy

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

func (*ReviewGroupBy) Bool

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

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

func (*ReviewGroupBy) BoolX

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

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

func (*ReviewGroupBy) Bools

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

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

func (*ReviewGroupBy) BoolsX

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

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

func (*ReviewGroupBy) Float64

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

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

func (*ReviewGroupBy) Float64X

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

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

func (*ReviewGroupBy) Float64s

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

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

func (*ReviewGroupBy) Float64sX

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

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

func (*ReviewGroupBy) Int

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

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

func (*ReviewGroupBy) IntX

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

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

func (*ReviewGroupBy) Ints

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

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

func (*ReviewGroupBy) IntsX

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

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

func (*ReviewGroupBy) Scan

func (rgb *ReviewGroupBy) Scan(ctx context.Context, v any) error

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

func (*ReviewGroupBy) ScanX

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

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

func (*ReviewGroupBy) String

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

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

func (*ReviewGroupBy) StringX

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

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

func (*ReviewGroupBy) Strings

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

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

func (*ReviewGroupBy) StringsX

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

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

type ReviewMutation

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

ReviewMutation represents an operation that mutates the Review nodes in the graph.

func (*ReviewMutation) AddField

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

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

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

func (*ReviewMutation) AddedField

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

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

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

func (*ReviewMutation) AddedIDs

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

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

func (*ReviewMutation) ClearEdge

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

func (m *ReviewMutation) 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 (*ReviewMutation) ClearRequest

func (m *ReviewMutation) ClearRequest()

ClearRequest clears the "Request" edge to the Request entity.

func (*ReviewMutation) ClearedEdges

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

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

func (*ReviewMutation) ClearedFields

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

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

func (ReviewMutation) Client

func (m ReviewMutation) 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 (*ReviewMutation) CreateTime

func (m *ReviewMutation) CreateTime() (r time.Time, exists bool)

CreateTime returns the value of the "create_time" field in the mutation.

func (*ReviewMutation) EdgeCleared

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

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

func (*ReviewMutation) Field

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

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

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

func (*ReviewMutation) Fields

func (m *ReviewMutation) 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 (*ReviewMutation) GetType

func (m *ReviewMutation) GetType() (r review.Type, exists bool)

GetType returns the value of the "type" field in the mutation.

func (*ReviewMutation) ID

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

func (m *ReviewMutation) 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 (*ReviewMutation) OldCreateTime

func (m *ReviewMutation) OldCreateTime(ctx context.Context) (v time.Time, err error)

OldCreateTime returns the old "create_time" field's value of the Review entity. If the Review 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 (*ReviewMutation) OldField

func (m *ReviewMutation) 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 (*ReviewMutation) OldStatus

func (m *ReviewMutation) OldStatus(ctx context.Context) (v review.Status, err error)

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

func (m *ReviewMutation) OldType(ctx context.Context) (v review.Type, err error)

OldType returns the old "type" field's value of the Review entity. If the Review 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 (*ReviewMutation) OldUpdateTime

func (m *ReviewMutation) OldUpdateTime(ctx context.Context) (v time.Time, err error)

OldUpdateTime returns the old "update_time" field's value of the Review entity. If the Review 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 (*ReviewMutation) Op

func (m *ReviewMutation) Op() Op

Op returns the operation name.

func (*ReviewMutation) RemovedEdges

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

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

func (*ReviewMutation) RemovedIDs

func (m *ReviewMutation) 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 (*ReviewMutation) RequestCleared

func (m *ReviewMutation) RequestCleared() bool

RequestCleared reports if the "Request" edge to the Request entity was cleared.

func (*ReviewMutation) RequestID

func (m *ReviewMutation) RequestID() (id uuid.UUID, exists bool)

RequestID returns the "Request" edge ID in the mutation.

func (*ReviewMutation) RequestIDs

func (m *ReviewMutation) RequestIDs() (ids []uuid.UUID)

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

func (*ReviewMutation) ResetCreateTime

func (m *ReviewMutation) ResetCreateTime()

ResetCreateTime resets all changes to the "create_time" field.

func (*ReviewMutation) ResetEdge

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

func (m *ReviewMutation) 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 (*ReviewMutation) ResetRequest

func (m *ReviewMutation) ResetRequest()

ResetRequest resets all changes to the "Request" edge.

func (*ReviewMutation) ResetStatus

func (m *ReviewMutation) ResetStatus()

ResetStatus resets all changes to the "status" field.

func (*ReviewMutation) ResetType

func (m *ReviewMutation) ResetType()

ResetType resets all changes to the "type" field.

func (*ReviewMutation) ResetUpdateTime

func (m *ReviewMutation) ResetUpdateTime()

ResetUpdateTime resets all changes to the "update_time" field.

func (*ReviewMutation) SetCreateTime

func (m *ReviewMutation) SetCreateTime(t time.Time)

SetCreateTime sets the "create_time" field.

func (*ReviewMutation) SetField

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

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

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

func (*ReviewMutation) SetRequestID

func (m *ReviewMutation) SetRequestID(id uuid.UUID)

SetRequestID sets the "Request" edge to the Request entity by id.

func (*ReviewMutation) SetStatus

func (m *ReviewMutation) SetStatus(r review.Status)

SetStatus sets the "status" field.

func (*ReviewMutation) SetType

func (m *ReviewMutation) SetType(r review.Type)

SetType sets the "type" field.

func (*ReviewMutation) SetUpdateTime

func (m *ReviewMutation) SetUpdateTime(t time.Time)

SetUpdateTime sets the "update_time" field.

func (*ReviewMutation) Status

func (m *ReviewMutation) Status() (r review.Status, exists bool)

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

func (ReviewMutation) Tx

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

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

func (*ReviewMutation) Type

func (m *ReviewMutation) Type() string

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

func (*ReviewMutation) UpdateTime

func (m *ReviewMutation) UpdateTime() (r time.Time, exists bool)

UpdateTime returns the value of the "update_time" field in the mutation.

func (*ReviewMutation) Where

func (m *ReviewMutation) Where(ps ...predicate.Review)

Where appends a list predicates to the ReviewMutation builder.

type ReviewQuery

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

ReviewQuery is the builder for querying Review entities.

func (*ReviewQuery) All

func (rq *ReviewQuery) All(ctx context.Context) ([]*Review, error)

All executes the query and returns a list of Reviews.

func (*ReviewQuery) AllX

func (rq *ReviewQuery) AllX(ctx context.Context) []*Review

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

func (*ReviewQuery) Clone

func (rq *ReviewQuery) Clone() *ReviewQuery

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

func (*ReviewQuery) Count

func (rq *ReviewQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*ReviewQuery) CountX

func (rq *ReviewQuery) CountX(ctx context.Context) int

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

func (*ReviewQuery) Exist

func (rq *ReviewQuery) Exist(ctx context.Context) (bool, error)

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

func (*ReviewQuery) ExistX

func (rq *ReviewQuery) ExistX(ctx context.Context) bool

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

func (*ReviewQuery) First

func (rq *ReviewQuery) First(ctx context.Context) (*Review, error)

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

func (*ReviewQuery) FirstID

func (rq *ReviewQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

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

func (*ReviewQuery) FirstIDX

func (rq *ReviewQuery) FirstIDX(ctx context.Context) uuid.UUID

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

func (*ReviewQuery) FirstX

func (rq *ReviewQuery) FirstX(ctx context.Context) *Review

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

func (*ReviewQuery) GroupBy

func (rq *ReviewQuery) GroupBy(field string, fields ...string) *ReviewGroupBy

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 {
	CreateTime time.Time `json:"create_time,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Review.Query().
	GroupBy(review.FieldCreateTime).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*ReviewQuery) IDs

func (rq *ReviewQuery) IDs(ctx context.Context) ([]uuid.UUID, error)

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

func (*ReviewQuery) IDsX

func (rq *ReviewQuery) IDsX(ctx context.Context) []uuid.UUID

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

func (*ReviewQuery) Limit

func (rq *ReviewQuery) Limit(limit int) *ReviewQuery

Limit adds a limit step to the query.

func (*ReviewQuery) Offset

func (rq *ReviewQuery) Offset(offset int) *ReviewQuery

Offset adds an offset step to the query.

func (*ReviewQuery) Only

func (rq *ReviewQuery) Only(ctx context.Context) (*Review, error)

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

func (*ReviewQuery) OnlyID

func (rq *ReviewQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

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

func (*ReviewQuery) OnlyIDX

func (rq *ReviewQuery) OnlyIDX(ctx context.Context) uuid.UUID

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

func (*ReviewQuery) OnlyX

func (rq *ReviewQuery) OnlyX(ctx context.Context) *Review

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

func (*ReviewQuery) Order

func (rq *ReviewQuery) Order(o ...OrderFunc) *ReviewQuery

Order adds an order step to the query.

func (*ReviewQuery) QueryRequest

func (rq *ReviewQuery) QueryRequest() *RequestQuery

QueryRequest chains the current query on the "Request" edge.

func (*ReviewQuery) Select

func (rq *ReviewQuery) Select(fields ...string) *ReviewSelect

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 {
	CreateTime time.Time `json:"create_time,omitempty"`
}

client.Review.Query().
	Select(review.FieldCreateTime).
	Scan(ctx, &v)

func (*ReviewQuery) Unique

func (rq *ReviewQuery) Unique(unique bool) *ReviewQuery

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

func (rq *ReviewQuery) Where(ps ...predicate.Review) *ReviewQuery

Where adds a new predicate for the ReviewQuery builder.

func (*ReviewQuery) WithRequest

func (rq *ReviewQuery) WithRequest(opts ...func(*RequestQuery)) *ReviewQuery

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

type ReviewSelect

type ReviewSelect struct {
	*ReviewQuery
	// contains filtered or unexported fields
}

ReviewSelect is the builder for selecting fields of Review entities.

func (*ReviewSelect) Bool

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

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

func (*ReviewSelect) BoolX

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

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

func (*ReviewSelect) Bools

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

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

func (*ReviewSelect) BoolsX

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

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

func (*ReviewSelect) Float64

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

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

func (*ReviewSelect) Float64X

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

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

func (*ReviewSelect) Float64s

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

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

func (*ReviewSelect) Float64sX

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

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

func (*ReviewSelect) Int

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

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

func (*ReviewSelect) IntX

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

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

func (*ReviewSelect) Ints

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

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

func (*ReviewSelect) IntsX

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

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

func (*ReviewSelect) Scan

func (rs *ReviewSelect) Scan(ctx context.Context, v any) error

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

func (*ReviewSelect) ScanX

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

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

func (*ReviewSelect) String

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

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

func (*ReviewSelect) StringX

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

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

func (*ReviewSelect) Strings

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

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

func (*ReviewSelect) StringsX

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

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

type ReviewUpdate

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

ReviewUpdate is the builder for updating Review entities.

func (*ReviewUpdate) ClearRequest

func (ru *ReviewUpdate) ClearRequest() *ReviewUpdate

ClearRequest clears the "Request" edge to the Request entity.

func (*ReviewUpdate) Exec

func (ru *ReviewUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*ReviewUpdate) ExecX

func (ru *ReviewUpdate) ExecX(ctx context.Context)

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

func (*ReviewUpdate) Mutation

func (ru *ReviewUpdate) Mutation() *ReviewMutation

Mutation returns the ReviewMutation object of the builder.

func (*ReviewUpdate) Save

func (ru *ReviewUpdate) Save(ctx context.Context) (int, error)

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

func (*ReviewUpdate) SaveX

func (ru *ReviewUpdate) SaveX(ctx context.Context) int

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

func (*ReviewUpdate) SetNillableType

func (ru *ReviewUpdate) SetNillableType(r *review.Type) *ReviewUpdate

SetNillableType sets the "type" field if the given value is not nil.

func (*ReviewUpdate) SetRequest

func (ru *ReviewUpdate) SetRequest(r *Request) *ReviewUpdate

SetRequest sets the "Request" edge to the Request entity.

func (*ReviewUpdate) SetRequestID

func (ru *ReviewUpdate) SetRequestID(id uuid.UUID) *ReviewUpdate

SetRequestID sets the "Request" edge to the Request entity by ID.

func (*ReviewUpdate) SetStatus

func (ru *ReviewUpdate) SetStatus(r review.Status) *ReviewUpdate

SetStatus sets the "status" field.

func (*ReviewUpdate) SetType

func (ru *ReviewUpdate) SetType(r review.Type) *ReviewUpdate

SetType sets the "type" field.

func (*ReviewUpdate) SetUpdateTime

func (ru *ReviewUpdate) SetUpdateTime(t time.Time) *ReviewUpdate

SetUpdateTime sets the "update_time" field.

func (*ReviewUpdate) Where

func (ru *ReviewUpdate) Where(ps ...predicate.Review) *ReviewUpdate

Where appends a list predicates to the ReviewUpdate builder.

type ReviewUpdateOne

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

ReviewUpdateOne is the builder for updating a single Review entity.

func (*ReviewUpdateOne) ClearRequest

func (ruo *ReviewUpdateOne) ClearRequest() *ReviewUpdateOne

ClearRequest clears the "Request" edge to the Request entity.

func (*ReviewUpdateOne) Exec

func (ruo *ReviewUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*ReviewUpdateOne) ExecX

func (ruo *ReviewUpdateOne) ExecX(ctx context.Context)

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

func (*ReviewUpdateOne) Mutation

func (ruo *ReviewUpdateOne) Mutation() *ReviewMutation

Mutation returns the ReviewMutation object of the builder.

func (*ReviewUpdateOne) Save

func (ruo *ReviewUpdateOne) Save(ctx context.Context) (*Review, error)

Save executes the query and returns the updated Review entity.

func (*ReviewUpdateOne) SaveX

func (ruo *ReviewUpdateOne) SaveX(ctx context.Context) *Review

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

func (*ReviewUpdateOne) Select

func (ruo *ReviewUpdateOne) Select(field string, fields ...string) *ReviewUpdateOne

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

func (*ReviewUpdateOne) SetNillableType

func (ruo *ReviewUpdateOne) SetNillableType(r *review.Type) *ReviewUpdateOne

SetNillableType sets the "type" field if the given value is not nil.

func (*ReviewUpdateOne) SetRequest

func (ruo *ReviewUpdateOne) SetRequest(r *Request) *ReviewUpdateOne

SetRequest sets the "Request" edge to the Request entity.

func (*ReviewUpdateOne) SetRequestID

func (ruo *ReviewUpdateOne) SetRequestID(id uuid.UUID) *ReviewUpdateOne

SetRequestID sets the "Request" edge to the Request entity by ID.

func (*ReviewUpdateOne) SetStatus

func (ruo *ReviewUpdateOne) SetStatus(r review.Status) *ReviewUpdateOne

SetStatus sets the "status" field.

func (*ReviewUpdateOne) SetType

func (ruo *ReviewUpdateOne) SetType(r review.Type) *ReviewUpdateOne

SetType sets the "type" field.

func (*ReviewUpdateOne) SetUpdateTime

func (ruo *ReviewUpdateOne) SetUpdateTime(t time.Time) *ReviewUpdateOne

SetUpdateTime sets the "update_time" field.

type Reviews

type Reviews []*Review

Reviews is a parsable slice of Review.

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 Service

type Service struct {

	// ID of the ent.
	ID uuid.UUID `json:"id,omitempty"`
	// CreateTime holds the value of the "create_time" field.
	CreateTime time.Time `json:"create_time,omitempty"`
	// UpdateTime holds the value of the "update_time" field.
	UpdateTime time.Time `json:"update_time,omitempty"`
	// Name holds the value of the "name" field.
	Name string `json:"name,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the ServiceQuery when eager-loading is set.
	Edges ServiceEdges `json:"edges"`
	// contains filtered or unexported fields
}

Service is the model entity for the Service schema.

func (*Service) QueryRequests

func (s *Service) QueryRequests() *RequestQuery

QueryRequests queries the "Requests" edge of the Service entity.

func (*Service) String

func (s *Service) String() string

String implements the fmt.Stringer.

func (*Service) Unwrap

func (s *Service) Unwrap() *Service

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

func (s *Service) Update() *ServiceUpdateOne

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

type ServiceClient

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

ServiceClient is a client for the Service schema.

func NewServiceClient

func NewServiceClient(c config) *ServiceClient

NewServiceClient returns a client for the Service from the given config.

func (*ServiceClient) Create

func (c *ServiceClient) Create() *ServiceCreate

Create returns a builder for creating a Service entity.

func (*ServiceClient) CreateBulk

func (c *ServiceClient) CreateBulk(builders ...*ServiceCreate) *ServiceCreateBulk

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

func (*ServiceClient) Delete

func (c *ServiceClient) Delete() *ServiceDelete

Delete returns a delete builder for Service.

func (*ServiceClient) DeleteOne

func (c *ServiceClient) DeleteOne(s *Service) *ServiceDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*ServiceClient) DeleteOneID

func (c *ServiceClient) DeleteOneID(id uuid.UUID) *ServiceDeleteOne

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

func (*ServiceClient) Get

func (c *ServiceClient) Get(ctx context.Context, id uuid.UUID) (*Service, error)

Get returns a Service entity by its id.

func (*ServiceClient) GetX

func (c *ServiceClient) GetX(ctx context.Context, id uuid.UUID) *Service

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

func (*ServiceClient) Hooks

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

Hooks returns the client hooks.

func (*ServiceClient) Query

func (c *ServiceClient) Query() *ServiceQuery

Query returns a query builder for Service.

func (*ServiceClient) QueryRequests

func (c *ServiceClient) QueryRequests(s *Service) *RequestQuery

QueryRequests queries the Requests edge of a Service.

func (*ServiceClient) Update

func (c *ServiceClient) Update() *ServiceUpdate

Update returns an update builder for Service.

func (*ServiceClient) UpdateOne

func (c *ServiceClient) UpdateOne(s *Service) *ServiceUpdateOne

UpdateOne returns an update builder for the given entity.

func (*ServiceClient) UpdateOneID

func (c *ServiceClient) UpdateOneID(id uuid.UUID) *ServiceUpdateOne

UpdateOneID returns an update builder for the given id.

func (*ServiceClient) Use

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

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

type ServiceCreate

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

ServiceCreate is the builder for creating a Service entity.

func (*ServiceCreate) AddRequestIDs

func (sc *ServiceCreate) AddRequestIDs(ids ...uuid.UUID) *ServiceCreate

AddRequestIDs adds the "Requests" edge to the Request entity by IDs.

func (*ServiceCreate) AddRequests

func (sc *ServiceCreate) AddRequests(r ...*Request) *ServiceCreate

AddRequests adds the "Requests" edges to the Request entity.

func (*ServiceCreate) Exec

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

Exec executes the query.

func (*ServiceCreate) ExecX

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

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

func (*ServiceCreate) Mutation

func (sc *ServiceCreate) Mutation() *ServiceMutation

Mutation returns the ServiceMutation object of the builder.

func (*ServiceCreate) Save

func (sc *ServiceCreate) Save(ctx context.Context) (*Service, error)

Save creates the Service in the database.

func (*ServiceCreate) SaveX

func (sc *ServiceCreate) SaveX(ctx context.Context) *Service

SaveX calls Save and panics if Save returns an error.

func (*ServiceCreate) SetCreateTime

func (sc *ServiceCreate) SetCreateTime(t time.Time) *ServiceCreate

SetCreateTime sets the "create_time" field.

func (*ServiceCreate) SetID

func (sc *ServiceCreate) SetID(u uuid.UUID) *ServiceCreate

SetID sets the "id" field.

func (*ServiceCreate) SetName

func (sc *ServiceCreate) SetName(s string) *ServiceCreate

SetName sets the "name" field.

func (*ServiceCreate) SetNillableCreateTime

func (sc *ServiceCreate) SetNillableCreateTime(t *time.Time) *ServiceCreate

SetNillableCreateTime sets the "create_time" field if the given value is not nil.

func (*ServiceCreate) SetNillableID

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

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

func (*ServiceCreate) SetNillableUpdateTime

func (sc *ServiceCreate) SetNillableUpdateTime(t *time.Time) *ServiceCreate

SetNillableUpdateTime sets the "update_time" field if the given value is not nil.

func (*ServiceCreate) SetUpdateTime

func (sc *ServiceCreate) SetUpdateTime(t time.Time) *ServiceCreate

SetUpdateTime sets the "update_time" field.

type ServiceCreateBulk

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

ServiceCreateBulk is the builder for creating many Service entities in bulk.

func (*ServiceCreateBulk) Exec

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

Exec executes the query.

func (*ServiceCreateBulk) ExecX

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

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

func (*ServiceCreateBulk) Save

func (scb *ServiceCreateBulk) Save(ctx context.Context) ([]*Service, error)

Save creates the Service entities in the database.

func (*ServiceCreateBulk) SaveX

func (scb *ServiceCreateBulk) SaveX(ctx context.Context) []*Service

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

type ServiceDelete

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

ServiceDelete is the builder for deleting a Service entity.

func (*ServiceDelete) Exec

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

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

func (*ServiceDelete) ExecX

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

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

func (*ServiceDelete) Where

func (sd *ServiceDelete) Where(ps ...predicate.Service) *ServiceDelete

Where appends a list predicates to the ServiceDelete builder.

type ServiceDeleteOne

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

ServiceDeleteOne is the builder for deleting a single Service entity.

func (*ServiceDeleteOne) Exec

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

Exec executes the deletion query.

func (*ServiceDeleteOne) ExecX

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

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

type ServiceEdges

type ServiceEdges struct {
	// Requests holds the value of the Requests edge.
	Requests []*Request `json:"Requests,omitempty"`
	// contains filtered or unexported fields
}

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

func (ServiceEdges) RequestsOrErr

func (e ServiceEdges) RequestsOrErr() ([]*Request, error)

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

type ServiceGroupBy

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

ServiceGroupBy is the group-by builder for Service entities.

func (*ServiceGroupBy) Aggregate

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

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

func (*ServiceGroupBy) Bool

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

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

func (*ServiceGroupBy) BoolX

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

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

func (*ServiceGroupBy) Bools

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

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

func (*ServiceGroupBy) BoolsX

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

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

func (*ServiceGroupBy) Float64

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

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

func (*ServiceGroupBy) Float64X

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

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

func (*ServiceGroupBy) Float64s

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

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

func (*ServiceGroupBy) Float64sX

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

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

func (*ServiceGroupBy) Int

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

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

func (*ServiceGroupBy) IntX

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

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

func (*ServiceGroupBy) Ints

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

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

func (*ServiceGroupBy) IntsX

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

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

func (*ServiceGroupBy) Scan

func (sgb *ServiceGroupBy) Scan(ctx context.Context, v any) error

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

func (*ServiceGroupBy) ScanX

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

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

func (*ServiceGroupBy) String

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

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

func (*ServiceGroupBy) StringX

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

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

func (*ServiceGroupBy) Strings

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

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

func (*ServiceGroupBy) StringsX

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

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

type ServiceMutation

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

ServiceMutation represents an operation that mutates the Service nodes in the graph.

func (*ServiceMutation) AddField

func (m *ServiceMutation) 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 (*ServiceMutation) AddRequestIDs

func (m *ServiceMutation) AddRequestIDs(ids ...uuid.UUID)

AddRequestIDs adds the "Requests" edge to the Request entity by ids.

func (*ServiceMutation) AddedEdges

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

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

func (*ServiceMutation) AddedField

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

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

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

func (*ServiceMutation) AddedIDs

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

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

func (*ServiceMutation) ClearEdge

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

func (m *ServiceMutation) 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 (*ServiceMutation) ClearRequests

func (m *ServiceMutation) ClearRequests()

ClearRequests clears the "Requests" edge to the Request entity.

func (*ServiceMutation) ClearedEdges

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

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

func (*ServiceMutation) ClearedFields

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

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

func (ServiceMutation) Client

func (m ServiceMutation) 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 (*ServiceMutation) CreateTime

func (m *ServiceMutation) CreateTime() (r time.Time, exists bool)

CreateTime returns the value of the "create_time" field in the mutation.

func (*ServiceMutation) EdgeCleared

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

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

func (*ServiceMutation) Field

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

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

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

func (*ServiceMutation) Fields

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

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

func (m *ServiceMutation) 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 (*ServiceMutation) Name

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

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

func (*ServiceMutation) OldCreateTime

func (m *ServiceMutation) OldCreateTime(ctx context.Context) (v time.Time, err error)

OldCreateTime returns the old "create_time" field's value of the Service entity. If the Service 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 (*ServiceMutation) OldField

func (m *ServiceMutation) 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 (*ServiceMutation) OldName

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

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

func (m *ServiceMutation) OldUpdateTime(ctx context.Context) (v time.Time, err error)

OldUpdateTime returns the old "update_time" field's value of the Service entity. If the Service 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 (*ServiceMutation) Op

func (m *ServiceMutation) Op() Op

Op returns the operation name.

func (*ServiceMutation) RemoveRequestIDs

func (m *ServiceMutation) RemoveRequestIDs(ids ...uuid.UUID)

RemoveRequestIDs removes the "Requests" edge to the Request entity by IDs.

func (*ServiceMutation) RemovedEdges

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

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

func (*ServiceMutation) RemovedIDs

func (m *ServiceMutation) 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 (*ServiceMutation) RemovedRequestsIDs

func (m *ServiceMutation) RemovedRequestsIDs() (ids []uuid.UUID)

RemovedRequests returns the removed IDs of the "Requests" edge to the Request entity.

func (*ServiceMutation) RequestsCleared

func (m *ServiceMutation) RequestsCleared() bool

RequestsCleared reports if the "Requests" edge to the Request entity was cleared.

func (*ServiceMutation) RequestsIDs

func (m *ServiceMutation) RequestsIDs() (ids []uuid.UUID)

RequestsIDs returns the "Requests" edge IDs in the mutation.

func (*ServiceMutation) ResetCreateTime

func (m *ServiceMutation) ResetCreateTime()

ResetCreateTime resets all changes to the "create_time" field.

func (*ServiceMutation) ResetEdge

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

func (m *ServiceMutation) 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 (*ServiceMutation) ResetName

func (m *ServiceMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*ServiceMutation) ResetRequests

func (m *ServiceMutation) ResetRequests()

ResetRequests resets all changes to the "Requests" edge.

func (*ServiceMutation) ResetUpdateTime

func (m *ServiceMutation) ResetUpdateTime()

ResetUpdateTime resets all changes to the "update_time" field.

func (*ServiceMutation) SetCreateTime

func (m *ServiceMutation) SetCreateTime(t time.Time)

SetCreateTime sets the "create_time" field.

func (*ServiceMutation) SetField

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

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

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

func (*ServiceMutation) SetName

func (m *ServiceMutation) SetName(s string)

SetName sets the "name" field.

func (*ServiceMutation) SetUpdateTime

func (m *ServiceMutation) SetUpdateTime(t time.Time)

SetUpdateTime sets the "update_time" field.

func (ServiceMutation) Tx

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

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

func (*ServiceMutation) Type

func (m *ServiceMutation) Type() string

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

func (*ServiceMutation) UpdateTime

func (m *ServiceMutation) UpdateTime() (r time.Time, exists bool)

UpdateTime returns the value of the "update_time" field in the mutation.

func (*ServiceMutation) Where

func (m *ServiceMutation) Where(ps ...predicate.Service)

Where appends a list predicates to the ServiceMutation builder.

type ServiceQuery

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

ServiceQuery is the builder for querying Service entities.

func (*ServiceQuery) All

func (sq *ServiceQuery) All(ctx context.Context) ([]*Service, error)

All executes the query and returns a list of Services.

func (*ServiceQuery) AllX

func (sq *ServiceQuery) AllX(ctx context.Context) []*Service

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

func (*ServiceQuery) Clone

func (sq *ServiceQuery) Clone() *ServiceQuery

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

func (*ServiceQuery) Count

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

Count returns the count of the given query.

func (*ServiceQuery) CountX

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

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

func (*ServiceQuery) Exist

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

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

func (*ServiceQuery) ExistX

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

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

func (*ServiceQuery) First

func (sq *ServiceQuery) First(ctx context.Context) (*Service, error)

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

func (*ServiceQuery) FirstID

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

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

func (*ServiceQuery) FirstIDX

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

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

func (*ServiceQuery) FirstX

func (sq *ServiceQuery) FirstX(ctx context.Context) *Service

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

func (*ServiceQuery) GroupBy

func (sq *ServiceQuery) GroupBy(field string, fields ...string) *ServiceGroupBy

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 {
	CreateTime time.Time `json:"create_time,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Service.Query().
	GroupBy(service.FieldCreateTime).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*ServiceQuery) IDs

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

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

func (*ServiceQuery) IDsX

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

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

func (*ServiceQuery) Limit

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

Limit adds a limit step to the query.

func (*ServiceQuery) Offset

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

Offset adds an offset step to the query.

func (*ServiceQuery) Only

func (sq *ServiceQuery) Only(ctx context.Context) (*Service, error)

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

func (*ServiceQuery) OnlyID

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

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

func (*ServiceQuery) OnlyIDX

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

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

func (*ServiceQuery) OnlyX

func (sq *ServiceQuery) OnlyX(ctx context.Context) *Service

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

func (*ServiceQuery) Order

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

Order adds an order step to the query.

func (*ServiceQuery) QueryRequests

func (sq *ServiceQuery) QueryRequests() *RequestQuery

QueryRequests chains the current query on the "Requests" edge.

func (*ServiceQuery) Select

func (sq *ServiceQuery) Select(fields ...string) *ServiceSelect

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 {
	CreateTime time.Time `json:"create_time,omitempty"`
}

client.Service.Query().
	Select(service.FieldCreateTime).
	Scan(ctx, &v)

func (*ServiceQuery) Unique

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

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

func (sq *ServiceQuery) Where(ps ...predicate.Service) *ServiceQuery

Where adds a new predicate for the ServiceQuery builder.

func (*ServiceQuery) WithRequests

func (sq *ServiceQuery) WithRequests(opts ...func(*RequestQuery)) *ServiceQuery

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

type ServiceSelect

type ServiceSelect struct {
	*ServiceQuery
	// contains filtered or unexported fields
}

ServiceSelect is the builder for selecting fields of Service entities.

func (*ServiceSelect) Bool

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

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

func (*ServiceSelect) BoolX

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

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

func (*ServiceSelect) Bools

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

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

func (*ServiceSelect) BoolsX

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

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

func (*ServiceSelect) Float64

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

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

func (*ServiceSelect) Float64X

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

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

func (*ServiceSelect) Float64s

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

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

func (*ServiceSelect) Float64sX

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

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

func (*ServiceSelect) Int

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

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

func (*ServiceSelect) IntX

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

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

func (*ServiceSelect) Ints

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

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

func (*ServiceSelect) IntsX

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

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

func (*ServiceSelect) Scan

func (ss *ServiceSelect) Scan(ctx context.Context, v any) error

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

func (*ServiceSelect) ScanX

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

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

func (*ServiceSelect) String

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

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

func (*ServiceSelect) StringX

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

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

func (*ServiceSelect) Strings

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

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

func (*ServiceSelect) StringsX

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

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

type ServiceUpdate

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

ServiceUpdate is the builder for updating Service entities.

func (*ServiceUpdate) AddRequestIDs

func (su *ServiceUpdate) AddRequestIDs(ids ...uuid.UUID) *ServiceUpdate

AddRequestIDs adds the "Requests" edge to the Request entity by IDs.

func (*ServiceUpdate) AddRequests

func (su *ServiceUpdate) AddRequests(r ...*Request) *ServiceUpdate

AddRequests adds the "Requests" edges to the Request entity.

func (*ServiceUpdate) ClearRequests

func (su *ServiceUpdate) ClearRequests() *ServiceUpdate

ClearRequests clears all "Requests" edges to the Request entity.

func (*ServiceUpdate) Exec

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

Exec executes the query.

func (*ServiceUpdate) ExecX

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

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

func (*ServiceUpdate) Mutation

func (su *ServiceUpdate) Mutation() *ServiceMutation

Mutation returns the ServiceMutation object of the builder.

func (*ServiceUpdate) RemoveRequestIDs

func (su *ServiceUpdate) RemoveRequestIDs(ids ...uuid.UUID) *ServiceUpdate

RemoveRequestIDs removes the "Requests" edge to Request entities by IDs.

func (*ServiceUpdate) RemoveRequests

func (su *ServiceUpdate) RemoveRequests(r ...*Request) *ServiceUpdate

RemoveRequests removes "Requests" edges to Request entities.

func (*ServiceUpdate) Save

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

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

func (*ServiceUpdate) SaveX

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

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

func (*ServiceUpdate) SetName

func (su *ServiceUpdate) SetName(s string) *ServiceUpdate

SetName sets the "name" field.

func (*ServiceUpdate) SetUpdateTime

func (su *ServiceUpdate) SetUpdateTime(t time.Time) *ServiceUpdate

SetUpdateTime sets the "update_time" field.

func (*ServiceUpdate) Where

func (su *ServiceUpdate) Where(ps ...predicate.Service) *ServiceUpdate

Where appends a list predicates to the ServiceUpdate builder.

type ServiceUpdateOne

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

ServiceUpdateOne is the builder for updating a single Service entity.

func (*ServiceUpdateOne) AddRequestIDs

func (suo *ServiceUpdateOne) AddRequestIDs(ids ...uuid.UUID) *ServiceUpdateOne

AddRequestIDs adds the "Requests" edge to the Request entity by IDs.

func (*ServiceUpdateOne) AddRequests

func (suo *ServiceUpdateOne) AddRequests(r ...*Request) *ServiceUpdateOne

AddRequests adds the "Requests" edges to the Request entity.

func (*ServiceUpdateOne) ClearRequests

func (suo *ServiceUpdateOne) ClearRequests() *ServiceUpdateOne

ClearRequests clears all "Requests" edges to the Request entity.

func (*ServiceUpdateOne) Exec

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

Exec executes the query on the entity.

func (*ServiceUpdateOne) ExecX

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

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

func (*ServiceUpdateOne) Mutation

func (suo *ServiceUpdateOne) Mutation() *ServiceMutation

Mutation returns the ServiceMutation object of the builder.

func (*ServiceUpdateOne) RemoveRequestIDs

func (suo *ServiceUpdateOne) RemoveRequestIDs(ids ...uuid.UUID) *ServiceUpdateOne

RemoveRequestIDs removes the "Requests" edge to Request entities by IDs.

func (*ServiceUpdateOne) RemoveRequests

func (suo *ServiceUpdateOne) RemoveRequests(r ...*Request) *ServiceUpdateOne

RemoveRequests removes "Requests" edges to Request entities.

func (*ServiceUpdateOne) Save

func (suo *ServiceUpdateOne) Save(ctx context.Context) (*Service, error)

Save executes the query and returns the updated Service entity.

func (*ServiceUpdateOne) SaveX

func (suo *ServiceUpdateOne) SaveX(ctx context.Context) *Service

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

func (*ServiceUpdateOne) Select

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

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

func (*ServiceUpdateOne) SetName

func (suo *ServiceUpdateOne) SetName(s string) *ServiceUpdateOne

SetName sets the "name" field.

func (*ServiceUpdateOne) SetUpdateTime

func (suo *ServiceUpdateOne) SetUpdateTime(t time.Time) *ServiceUpdateOne

SetUpdateTime sets the "update_time" field.

type Services

type Services []*Service

Services is a parsable slice of Service.

type Tx

type Tx struct {

	// Project is the client for interacting with the Project builders.
	Project *ProjectClient
	// Request is the client for interacting with the Request builders.
	Request *RequestClient
	// Review is the client for interacting with the Review builders.
	Review *ReviewClient
	// Service is the client for interacting with the Service builders.
	Service *ServiceClient
	// contains filtered or unexported fields
}

Tx is a transactional client that is created by calling Client.Tx().

func TxFromContext

func TxFromContext(ctx context.Context) *Tx

TxFromContext returns a Tx stored inside a context, or nil if there isn't one.

func (*Tx) Client

func (tx *Tx) Client() *Client

Client returns a Client that binds to current transaction.

func (*Tx) Commit

func (tx *Tx) Commit() error

Commit commits the transaction.

func (*Tx) OnCommit

func (tx *Tx) OnCommit(f CommitHook)

OnCommit adds a hook to call on commit.

func (*Tx) OnRollback

func (tx *Tx) OnRollback(f RollbackHook)

OnRollback adds a hook to call on rollback.

func (*Tx) Rollback

func (tx *Tx) Rollback() error

Rollback rollbacks the transaction.

type ValidationError

type ValidationError struct {
	Name string // Field or edge name.
	// contains filtered or unexported fields
}

ValidationError returns when validating a field or edge fails.

func (*ValidationError) Error

func (e *ValidationError) Error() string

Error implements the error interface.

func (*ValidationError) Unwrap

func (e *ValidationError) Unwrap() error

Unwrap implements the errors.Wrapper interface.

type Value

type Value = ent.Value

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL