ent

package
v0.0.0-...-aa737f3 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2023 License: MIT Imports: 25 Imported by: 0

Documentation

Index

Constants

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

	// Node types.
	TypeDocument        = "Document"
	TypeDocumentHistory = "DocumentHistory"
	TypeDocumentSearch  = "DocumentSearch"
	TypeUser            = "User"
	TypeUserHistory     = "UserHistory"
)

Variables

View Source
var (
	MismatchedRefError    = errors.New("cannot take diff of histories with different Refs")
	IdenticalHistoryError = errors.New("cannot take diff of identical history")
)

Functions

func EntOpToHistoryOp

func EntOpToHistoryOp(op ent.Op) enthistory.OpType

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 Change

type Change struct {
	FieldName string
	Old       any
	New       any
}

func NewChange

func NewChange(fieldName string, old, new any) Change

type Client

type Client struct {

	// Schema is the client for creating, migrating and dropping schema.
	Schema *migrate.Schema
	// Document is the client for interacting with the Document builders.
	Document *DocumentClient
	// DocumentHistory is the client for interacting with the DocumentHistory builders.
	DocumentHistory *DocumentHistoryClient
	// DocumentSearch is the client for interacting with the DocumentSearch builders.
	DocumentSearch *DocumentSearchClient
	// User is the client for interacting with the User builders.
	User *UserClient
	// UserHistory is the client for interacting with the UserHistory builders.
	UserHistory *UserHistoryClient
	// 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().
	Document.
	Query().
	Count(ctx)

func (*Client) Intercept

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

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

func (*Client) Mutate

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

Mutate implements the ent.Mutator interface.

func (*Client) Tx

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

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

func (*Client) Use

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

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

func (*Client) WithHistory

func (c *Client) WithHistory()

withHistory adds the history hooks to the appropriate schemas - generated by enthistory

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 Document

type Document struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// UUID holds the value of the "uuid" field.
	UUID uuid.UUID `json:"uuid,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// UpdatedAt holds the value of the "updated_at" field.
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	// Title holds the value of the "title" field.
	Title string `json:"title,omitempty"`
	// Description holds the value of the "description" field.
	Description string `json:"description,omitempty"`
	// Filename holds the value of the "filename" field.
	Filename string `json:"filename,omitempty"`
	// Filetype holds the value of the "filetype" field.
	Filetype types.Filetype `json:"filetype,omitempty"`
	// Content holds the value of the "content" field.
	Content *string `json:"content,omitempty"`
	// ContentHash holds the value of the "content_hash" field.
	ContentHash string `json:"content_hash,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the DocumentQuery when eager-loading is set.
	Edges DocumentEdges `json:"edges"`
	// contains filtered or unexported fields
}

Document is the model entity for the Document schema.

func (*Document) History

func (d *Document) History() *DocumentHistoryQuery

func (*Document) QuerySearch

func (d *Document) QuerySearch() *DocumentSearchQuery

QuerySearch queries the "search" edge of the Document entity.

func (*Document) QueryUser

func (d *Document) QueryUser() *UserQuery

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

func (*Document) String

func (d *Document) String() string

String implements the fmt.Stringer.

func (*Document) Unwrap

func (d *Document) Unwrap() *Document

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

func (d *Document) Update() *DocumentUpdateOne

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

type DocumentClient

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

DocumentClient is a client for the Document schema.

func NewDocumentClient

func NewDocumentClient(c config) *DocumentClient

NewDocumentClient returns a client for the Document from the given config.

func (*DocumentClient) Create

func (c *DocumentClient) Create() *DocumentCreate

Create returns a builder for creating a Document entity.

func (*DocumentClient) CreateBulk

func (c *DocumentClient) CreateBulk(builders ...*DocumentCreate) *DocumentCreateBulk

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

func (*DocumentClient) Delete

func (c *DocumentClient) Delete() *DocumentDelete

Delete returns a delete builder for Document.

func (*DocumentClient) DeleteOne

func (c *DocumentClient) DeleteOne(d *Document) *DocumentDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*DocumentClient) DeleteOneID

func (c *DocumentClient) DeleteOneID(id int) *DocumentDeleteOne

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

func (*DocumentClient) Get

func (c *DocumentClient) Get(ctx context.Context, id int) (*Document, error)

Get returns a Document entity by its id.

func (*DocumentClient) GetX

func (c *DocumentClient) GetX(ctx context.Context, id int) *Document

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

func (*DocumentClient) Hooks

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

Hooks returns the client hooks.

func (*DocumentClient) Intercept

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

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

func (*DocumentClient) Interceptors

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

Interceptors returns the client interceptors.

func (*DocumentClient) Query

func (c *DocumentClient) Query() *DocumentQuery

Query returns a query builder for Document.

func (*DocumentClient) QuerySearch

func (c *DocumentClient) QuerySearch(d *Document) *DocumentSearchQuery

QuerySearch queries the search edge of a Document.

func (*DocumentClient) QueryUser

func (c *DocumentClient) QueryUser(d *Document) *UserQuery

QueryUser queries the user edge of a Document.

func (*DocumentClient) Update

func (c *DocumentClient) Update() *DocumentUpdate

Update returns an update builder for Document.

func (*DocumentClient) UpdateOne

func (c *DocumentClient) UpdateOne(d *Document) *DocumentUpdateOne

UpdateOne returns an update builder for the given entity.

func (*DocumentClient) UpdateOneID

func (c *DocumentClient) UpdateOneID(id int) *DocumentUpdateOne

UpdateOneID returns an update builder for the given id.

func (*DocumentClient) Use

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

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

type DocumentCreate

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

DocumentCreate is the builder for creating a Document entity.

func (*DocumentCreate) Exec

func (dc *DocumentCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*DocumentCreate) ExecX

func (dc *DocumentCreate) ExecX(ctx context.Context)

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

func (*DocumentCreate) Mutation

func (dc *DocumentCreate) Mutation() *DocumentMutation

Mutation returns the DocumentMutation object of the builder.

func (*DocumentCreate) Save

func (dc *DocumentCreate) Save(ctx context.Context) (*Document, error)

Save creates the Document in the database.

func (*DocumentCreate) SaveX

func (dc *DocumentCreate) SaveX(ctx context.Context) *Document

SaveX calls Save and panics if Save returns an error.

func (*DocumentCreate) SetContent

func (dc *DocumentCreate) SetContent(s string) *DocumentCreate

SetContent sets the "content" field.

func (*DocumentCreate) SetContentHash

func (dc *DocumentCreate) SetContentHash(s string) *DocumentCreate

SetContentHash sets the "content_hash" field.

func (*DocumentCreate) SetCreatedAt

func (dc *DocumentCreate) SetCreatedAt(t time.Time) *DocumentCreate

SetCreatedAt sets the "created_at" field.

func (*DocumentCreate) SetDescription

func (dc *DocumentCreate) SetDescription(s string) *DocumentCreate

SetDescription sets the "description" field.

func (*DocumentCreate) SetFilename

func (dc *DocumentCreate) SetFilename(s string) *DocumentCreate

SetFilename sets the "filename" field.

func (*DocumentCreate) SetFiletype

func (dc *DocumentCreate) SetFiletype(t types.Filetype) *DocumentCreate

SetFiletype sets the "filetype" field.

func (*DocumentCreate) SetNillableContent

func (dc *DocumentCreate) SetNillableContent(s *string) *DocumentCreate

SetNillableContent sets the "content" field if the given value is not nil.

func (*DocumentCreate) SetNillableContentHash

func (dc *DocumentCreate) SetNillableContentHash(s *string) *DocumentCreate

SetNillableContentHash sets the "content_hash" field if the given value is not nil.

func (*DocumentCreate) SetNillableCreatedAt

func (dc *DocumentCreate) SetNillableCreatedAt(t *time.Time) *DocumentCreate

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

func (*DocumentCreate) SetNillableSearchID

func (dc *DocumentCreate) SetNillableSearchID(id *int) *DocumentCreate

SetNillableSearchID sets the "search" edge to the DocumentSearch entity by ID if the given value is not nil.

func (*DocumentCreate) SetNillableUUID

func (dc *DocumentCreate) SetNillableUUID(u *uuid.UUID) *DocumentCreate

SetNillableUUID sets the "uuid" field if the given value is not nil.

func (*DocumentCreate) SetNillableUpdatedAt

func (dc *DocumentCreate) SetNillableUpdatedAt(t *time.Time) *DocumentCreate

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

func (*DocumentCreate) SetSearch

func (dc *DocumentCreate) SetSearch(d *DocumentSearch) *DocumentCreate

SetSearch sets the "search" edge to the DocumentSearch entity.

func (*DocumentCreate) SetSearchID

func (dc *DocumentCreate) SetSearchID(id int) *DocumentCreate

SetSearchID sets the "search" edge to the DocumentSearch entity by ID.

func (*DocumentCreate) SetTitle

func (dc *DocumentCreate) SetTitle(s string) *DocumentCreate

SetTitle sets the "title" field.

func (*DocumentCreate) SetUUID

func (dc *DocumentCreate) SetUUID(u uuid.UUID) *DocumentCreate

SetUUID sets the "uuid" field.

func (*DocumentCreate) SetUpdatedAt

func (dc *DocumentCreate) SetUpdatedAt(t time.Time) *DocumentCreate

SetUpdatedAt sets the "updated_at" field.

func (*DocumentCreate) SetUser

func (dc *DocumentCreate) SetUser(u *User) *DocumentCreate

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

func (*DocumentCreate) SetUserID

func (dc *DocumentCreate) SetUserID(id int) *DocumentCreate

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

type DocumentCreateBulk

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

DocumentCreateBulk is the builder for creating many Document entities in bulk.

func (*DocumentCreateBulk) Exec

func (dcb *DocumentCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*DocumentCreateBulk) ExecX

func (dcb *DocumentCreateBulk) ExecX(ctx context.Context)

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

func (*DocumentCreateBulk) Save

func (dcb *DocumentCreateBulk) Save(ctx context.Context) ([]*Document, error)

Save creates the Document entities in the database.

func (*DocumentCreateBulk) SaveX

func (dcb *DocumentCreateBulk) SaveX(ctx context.Context) []*Document

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

type DocumentDelete

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

DocumentDelete is the builder for deleting a Document entity.

func (*DocumentDelete) Exec

func (dd *DocumentDelete) Exec(ctx context.Context) (int, error)

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

func (*DocumentDelete) ExecX

func (dd *DocumentDelete) ExecX(ctx context.Context) int

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

func (*DocumentDelete) Where

func (dd *DocumentDelete) Where(ps ...predicate.Document) *DocumentDelete

Where appends a list predicates to the DocumentDelete builder.

type DocumentDeleteOne

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

DocumentDeleteOne is the builder for deleting a single Document entity.

func (*DocumentDeleteOne) Exec

func (ddo *DocumentDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*DocumentDeleteOne) ExecX

func (ddo *DocumentDeleteOne) ExecX(ctx context.Context)

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

func (*DocumentDeleteOne) Where

Where appends a list predicates to the DocumentDelete builder.

type DocumentEdges

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

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

func (DocumentEdges) SearchOrErr

func (e DocumentEdges) SearchOrErr() (*DocumentSearch, error)

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

func (DocumentEdges) UserOrErr

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

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

type DocumentGroupBy

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

DocumentGroupBy is the group-by builder for Document entities.

func (*DocumentGroupBy) Aggregate

func (dgb *DocumentGroupBy) Aggregate(fns ...AggregateFunc) *DocumentGroupBy

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

func (*DocumentGroupBy) Bool

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

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

func (*DocumentGroupBy) BoolX

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

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

func (*DocumentGroupBy) Bools

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

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

func (*DocumentGroupBy) BoolsX

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

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

func (*DocumentGroupBy) Float64

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

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

func (*DocumentGroupBy) Float64X

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

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

func (*DocumentGroupBy) Float64s

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

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

func (*DocumentGroupBy) Float64sX

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

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

func (*DocumentGroupBy) Int

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

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

func (*DocumentGroupBy) IntX

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

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

func (*DocumentGroupBy) Ints

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

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

func (*DocumentGroupBy) IntsX

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

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

func (*DocumentGroupBy) Scan

func (dgb *DocumentGroupBy) Scan(ctx context.Context, v any) error

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

func (*DocumentGroupBy) ScanX

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

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

func (*DocumentGroupBy) String

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

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

func (*DocumentGroupBy) StringX

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

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

func (*DocumentGroupBy) Strings

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

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

func (*DocumentGroupBy) StringsX

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

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

type DocumentHistories

type DocumentHistories []*DocumentHistory

DocumentHistories is a parsable slice of DocumentHistory.

type DocumentHistory

type DocumentHistory struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// HistoryTime holds the value of the "history_time" field.
	HistoryTime time.Time `json:"history_time,omitempty"`
	// Ref holds the value of the "ref" field.
	Ref int `json:"ref,omitempty"`
	// Operation holds the value of the "operation" field.
	Operation enthistory.OpType `json:"operation,omitempty"`
	// UpdatedBy holds the value of the "updated_by" field.
	UpdatedBy *string `json:"updated_by,omitempty"`
	// UUID holds the value of the "uuid" field.
	UUID uuid.UUID `json:"uuid,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// UpdatedAt holds the value of the "updated_at" field.
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	// Title holds the value of the "title" field.
	Title string `json:"title,omitempty"`
	// Description holds the value of the "description" field.
	Description string `json:"description,omitempty"`
	// Filename holds the value of the "filename" field.
	Filename string `json:"filename,omitempty"`
	// Filetype holds the value of the "filetype" field.
	Filetype types.Filetype `json:"filetype,omitempty"`
	// Content holds the value of the "content" field.
	Content *string `json:"content,omitempty"`
	// ContentHash holds the value of the "content_hash" field.
	ContentHash string `json:"content_hash,omitempty"`
	// contains filtered or unexported fields
}

DocumentHistory is the model entity for the DocumentHistory schema.

func (*DocumentHistory) Diff

func (*DocumentHistory) Next

func (*DocumentHistory) Prev

func (*DocumentHistory) Restore

func (dh *DocumentHistory) Restore(ctx context.Context) (*Document, error)

func (*DocumentHistory) String

func (dh *DocumentHistory) String() string

String implements the fmt.Stringer.

func (*DocumentHistory) Unwrap

func (dh *DocumentHistory) Unwrap() *DocumentHistory

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

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

type DocumentHistoryClient

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

DocumentHistoryClient is a client for the DocumentHistory schema.

func NewDocumentHistoryClient

func NewDocumentHistoryClient(c config) *DocumentHistoryClient

NewDocumentHistoryClient returns a client for the DocumentHistory from the given config.

func (*DocumentHistoryClient) Create

Create returns a builder for creating a DocumentHistory entity.

func (*DocumentHistoryClient) CreateBulk

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

func (*DocumentHistoryClient) Delete

Delete returns a delete builder for DocumentHistory.

func (*DocumentHistoryClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*DocumentHistoryClient) DeleteOneID

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

func (*DocumentHistoryClient) Get

Get returns a DocumentHistory entity by its id.

func (*DocumentHistoryClient) GetX

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

func (*DocumentHistoryClient) Hooks

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

Hooks returns the client hooks.

func (*DocumentHistoryClient) Intercept

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

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

func (*DocumentHistoryClient) Interceptors

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

Interceptors returns the client interceptors.

func (*DocumentHistoryClient) Query

Query returns a query builder for DocumentHistory.

func (*DocumentHistoryClient) Update

Update returns an update builder for DocumentHistory.

func (*DocumentHistoryClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*DocumentHistoryClient) UpdateOneID

UpdateOneID returns an update builder for the given id.

func (*DocumentHistoryClient) Use

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

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

type DocumentHistoryCreate

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

DocumentHistoryCreate is the builder for creating a DocumentHistory entity.

func (*DocumentHistoryCreate) Exec

func (dhc *DocumentHistoryCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*DocumentHistoryCreate) ExecX

func (dhc *DocumentHistoryCreate) ExecX(ctx context.Context)

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

func (*DocumentHistoryCreate) Mutation

Mutation returns the DocumentHistoryMutation object of the builder.

func (*DocumentHistoryCreate) Save

Save creates the DocumentHistory in the database.

func (*DocumentHistoryCreate) SaveX

SaveX calls Save and panics if Save returns an error.

func (*DocumentHistoryCreate) SetContent

SetContent sets the "content" field.

func (*DocumentHistoryCreate) SetContentHash

func (dhc *DocumentHistoryCreate) SetContentHash(s string) *DocumentHistoryCreate

SetContentHash sets the "content_hash" field.

func (*DocumentHistoryCreate) SetCreatedAt

func (dhc *DocumentHistoryCreate) SetCreatedAt(t time.Time) *DocumentHistoryCreate

SetCreatedAt sets the "created_at" field.

func (*DocumentHistoryCreate) SetDescription

func (dhc *DocumentHistoryCreate) SetDescription(s string) *DocumentHistoryCreate

SetDescription sets the "description" field.

func (*DocumentHistoryCreate) SetFilename

func (dhc *DocumentHistoryCreate) SetFilename(s string) *DocumentHistoryCreate

SetFilename sets the "filename" field.

func (*DocumentHistoryCreate) SetFiletype

SetFiletype sets the "filetype" field.

func (*DocumentHistoryCreate) SetHistoryTime

func (dhc *DocumentHistoryCreate) SetHistoryTime(t time.Time) *DocumentHistoryCreate

SetHistoryTime sets the "history_time" field.

func (*DocumentHistoryCreate) SetNillableContent

func (dhc *DocumentHistoryCreate) SetNillableContent(s *string) *DocumentHistoryCreate

SetNillableContent sets the "content" field if the given value is not nil.

func (*DocumentHistoryCreate) SetNillableContentHash

func (dhc *DocumentHistoryCreate) SetNillableContentHash(s *string) *DocumentHistoryCreate

SetNillableContentHash sets the "content_hash" field if the given value is not nil.

func (*DocumentHistoryCreate) SetNillableCreatedAt

func (dhc *DocumentHistoryCreate) SetNillableCreatedAt(t *time.Time) *DocumentHistoryCreate

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

func (*DocumentHistoryCreate) SetNillableHistoryTime

func (dhc *DocumentHistoryCreate) SetNillableHistoryTime(t *time.Time) *DocumentHistoryCreate

SetNillableHistoryTime sets the "history_time" field if the given value is not nil.

func (*DocumentHistoryCreate) SetNillableRef

func (dhc *DocumentHistoryCreate) SetNillableRef(i *int) *DocumentHistoryCreate

SetNillableRef sets the "ref" field if the given value is not nil.

func (*DocumentHistoryCreate) SetNillableUUID

func (dhc *DocumentHistoryCreate) SetNillableUUID(u *uuid.UUID) *DocumentHistoryCreate

SetNillableUUID sets the "uuid" field if the given value is not nil.

func (*DocumentHistoryCreate) SetNillableUpdatedAt

func (dhc *DocumentHistoryCreate) SetNillableUpdatedAt(t *time.Time) *DocumentHistoryCreate

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

func (*DocumentHistoryCreate) SetNillableUpdatedBy

func (dhc *DocumentHistoryCreate) SetNillableUpdatedBy(s *string) *DocumentHistoryCreate

SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil.

func (*DocumentHistoryCreate) SetOperation

SetOperation sets the "operation" field.

func (*DocumentHistoryCreate) SetRef

SetRef sets the "ref" field.

func (*DocumentHistoryCreate) SetTitle

SetTitle sets the "title" field.

func (*DocumentHistoryCreate) SetUUID

SetUUID sets the "uuid" field.

func (*DocumentHistoryCreate) SetUpdatedAt

func (dhc *DocumentHistoryCreate) SetUpdatedAt(t time.Time) *DocumentHistoryCreate

SetUpdatedAt sets the "updated_at" field.

func (*DocumentHistoryCreate) SetUpdatedBy

func (dhc *DocumentHistoryCreate) SetUpdatedBy(s string) *DocumentHistoryCreate

SetUpdatedBy sets the "updated_by" field.

type DocumentHistoryCreateBulk

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

DocumentHistoryCreateBulk is the builder for creating many DocumentHistory entities in bulk.

func (*DocumentHistoryCreateBulk) Exec

Exec executes the query.

func (*DocumentHistoryCreateBulk) ExecX

func (dhcb *DocumentHistoryCreateBulk) ExecX(ctx context.Context)

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

func (*DocumentHistoryCreateBulk) Save

Save creates the DocumentHistory entities in the database.

func (*DocumentHistoryCreateBulk) SaveX

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

type DocumentHistoryDelete

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

DocumentHistoryDelete is the builder for deleting a DocumentHistory entity.

func (*DocumentHistoryDelete) Exec

func (dhd *DocumentHistoryDelete) Exec(ctx context.Context) (int, error)

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

func (*DocumentHistoryDelete) ExecX

func (dhd *DocumentHistoryDelete) ExecX(ctx context.Context) int

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

func (*DocumentHistoryDelete) Where

Where appends a list predicates to the DocumentHistoryDelete builder.

type DocumentHistoryDeleteOne

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

DocumentHistoryDeleteOne is the builder for deleting a single DocumentHistory entity.

func (*DocumentHistoryDeleteOne) Exec

Exec executes the deletion query.

func (*DocumentHistoryDeleteOne) ExecX

func (dhdo *DocumentHistoryDeleteOne) ExecX(ctx context.Context)

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

func (*DocumentHistoryDeleteOne) Where

Where appends a list predicates to the DocumentHistoryDelete builder.

type DocumentHistoryGroupBy

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

DocumentHistoryGroupBy is the group-by builder for DocumentHistory entities.

func (*DocumentHistoryGroupBy) Aggregate

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

func (*DocumentHistoryGroupBy) Bool

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

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

func (*DocumentHistoryGroupBy) BoolX

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

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

func (*DocumentHistoryGroupBy) Bools

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

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

func (*DocumentHistoryGroupBy) BoolsX

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

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

func (*DocumentHistoryGroupBy) Float64

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

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

func (*DocumentHistoryGroupBy) Float64X

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

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

func (*DocumentHistoryGroupBy) Float64s

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

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

func (*DocumentHistoryGroupBy) Float64sX

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

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

func (*DocumentHistoryGroupBy) Int

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

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

func (*DocumentHistoryGroupBy) IntX

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

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

func (*DocumentHistoryGroupBy) Ints

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

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

func (*DocumentHistoryGroupBy) IntsX

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

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

func (*DocumentHistoryGroupBy) Scan

func (dhgb *DocumentHistoryGroupBy) Scan(ctx context.Context, v any) error

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

func (*DocumentHistoryGroupBy) ScanX

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

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

func (*DocumentHistoryGroupBy) String

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

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

func (*DocumentHistoryGroupBy) StringX

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

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

func (*DocumentHistoryGroupBy) Strings

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

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

func (*DocumentHistoryGroupBy) StringsX

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

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

type DocumentHistoryMutation

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

DocumentHistoryMutation represents an operation that mutates the DocumentHistory nodes in the graph.

func (*DocumentHistoryMutation) AddField

func (m *DocumentHistoryMutation) 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 (*DocumentHistoryMutation) AddRef

func (m *DocumentHistoryMutation) AddRef(i int)

AddRef adds i to the "ref" field.

func (*DocumentHistoryMutation) AddedEdges

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

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

func (*DocumentHistoryMutation) AddedField

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

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

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

func (*DocumentHistoryMutation) AddedIDs

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

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

func (*DocumentHistoryMutation) AddedRef

func (m *DocumentHistoryMutation) AddedRef() (r int, exists bool)

AddedRef returns the value that was added to the "ref" field in this mutation.

func (*DocumentHistoryMutation) ClearContent

func (m *DocumentHistoryMutation) ClearContent()

ClearContent clears the value of the "content" field.

func (*DocumentHistoryMutation) ClearContentHash

func (m *DocumentHistoryMutation) ClearContentHash()

ClearContentHash clears the value of the "content_hash" field.

func (*DocumentHistoryMutation) ClearEdge

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

func (m *DocumentHistoryMutation) 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 (*DocumentHistoryMutation) ClearRef

func (m *DocumentHistoryMutation) ClearRef()

ClearRef clears the value of the "ref" field.

func (*DocumentHistoryMutation) ClearUpdatedBy

func (m *DocumentHistoryMutation) ClearUpdatedBy()

ClearUpdatedBy clears the value of the "updated_by" field.

func (*DocumentHistoryMutation) ClearedEdges

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

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

func (*DocumentHistoryMutation) ClearedFields

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

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

func (DocumentHistoryMutation) Client

func (m DocumentHistoryMutation) 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 (*DocumentHistoryMutation) Content

func (m *DocumentHistoryMutation) Content() (r string, exists bool)

Content returns the value of the "content" field in the mutation.

func (*DocumentHistoryMutation) ContentCleared

func (m *DocumentHistoryMutation) ContentCleared() bool

ContentCleared returns if the "content" field was cleared in this mutation.

func (*DocumentHistoryMutation) ContentHash

func (m *DocumentHistoryMutation) ContentHash() (r string, exists bool)

ContentHash returns the value of the "content_hash" field in the mutation.

func (*DocumentHistoryMutation) ContentHashCleared

func (m *DocumentHistoryMutation) ContentHashCleared() bool

ContentHashCleared returns if the "content_hash" field was cleared in this mutation.

func (*DocumentHistoryMutation) CreatedAt

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

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

func (*DocumentHistoryMutation) Description

func (m *DocumentHistoryMutation) Description() (r string, exists bool)

Description returns the value of the "description" field in the mutation.

func (*DocumentHistoryMutation) EdgeCleared

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

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

func (*DocumentHistoryMutation) Field

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

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

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

func (*DocumentHistoryMutation) Fields

func (m *DocumentHistoryMutation) 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 (*DocumentHistoryMutation) Filename

func (m *DocumentHistoryMutation) Filename() (r string, exists bool)

Filename returns the value of the "filename" field in the mutation.

func (*DocumentHistoryMutation) Filetype

func (m *DocumentHistoryMutation) Filetype() (r types.Filetype, exists bool)

Filetype returns the value of the "filetype" field in the mutation.

func (*DocumentHistoryMutation) HistoryTime

func (m *DocumentHistoryMutation) HistoryTime() (r time.Time, exists bool)

HistoryTime returns the value of the "history_time" field in the mutation.

func (*DocumentHistoryMutation) ID

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

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

func (*DocumentHistoryMutation) IDs

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

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

func (*DocumentHistoryMutation) OldContent

func (m *DocumentHistoryMutation) OldContent(ctx context.Context) (v *string, err error)

OldContent returns the old "content" field's value of the DocumentHistory entity. If the DocumentHistory 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 (*DocumentHistoryMutation) OldContentHash

func (m *DocumentHistoryMutation) OldContentHash(ctx context.Context) (v string, err error)

OldContentHash returns the old "content_hash" field's value of the DocumentHistory entity. If the DocumentHistory 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 (*DocumentHistoryMutation) OldCreatedAt

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

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

func (m *DocumentHistoryMutation) OldDescription(ctx context.Context) (v string, err error)

OldDescription returns the old "description" field's value of the DocumentHistory entity. If the DocumentHistory 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 (*DocumentHistoryMutation) OldField

func (m *DocumentHistoryMutation) 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 (*DocumentHistoryMutation) OldFilename

func (m *DocumentHistoryMutation) OldFilename(ctx context.Context) (v string, err error)

OldFilename returns the old "filename" field's value of the DocumentHistory entity. If the DocumentHistory 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 (*DocumentHistoryMutation) OldFiletype

func (m *DocumentHistoryMutation) OldFiletype(ctx context.Context) (v types.Filetype, err error)

OldFiletype returns the old "filetype" field's value of the DocumentHistory entity. If the DocumentHistory 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 (*DocumentHistoryMutation) OldHistoryTime

func (m *DocumentHistoryMutation) OldHistoryTime(ctx context.Context) (v time.Time, err error)

OldHistoryTime returns the old "history_time" field's value of the DocumentHistory entity. If the DocumentHistory 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 (*DocumentHistoryMutation) OldOperation

func (m *DocumentHistoryMutation) OldOperation(ctx context.Context) (v enthistory.OpType, err error)

OldOperation returns the old "operation" field's value of the DocumentHistory entity. If the DocumentHistory 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 (*DocumentHistoryMutation) OldRef

func (m *DocumentHistoryMutation) OldRef(ctx context.Context) (v int, err error)

OldRef returns the old "ref" field's value of the DocumentHistory entity. If the DocumentHistory 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 (*DocumentHistoryMutation) OldTitle

func (m *DocumentHistoryMutation) OldTitle(ctx context.Context) (v string, err error)

OldTitle returns the old "title" field's value of the DocumentHistory entity. If the DocumentHistory 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 (*DocumentHistoryMutation) OldUUID

func (m *DocumentHistoryMutation) OldUUID(ctx context.Context) (v uuid.UUID, err error)

OldUUID returns the old "uuid" field's value of the DocumentHistory entity. If the DocumentHistory 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 (*DocumentHistoryMutation) OldUpdatedAt

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

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

func (m *DocumentHistoryMutation) OldUpdatedBy(ctx context.Context) (v *string, err error)

OldUpdatedBy returns the old "updated_by" field's value of the DocumentHistory entity. If the DocumentHistory 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 (*DocumentHistoryMutation) Op

func (m *DocumentHistoryMutation) Op() Op

Op returns the operation name.

func (*DocumentHistoryMutation) Operation

func (m *DocumentHistoryMutation) Operation() (r enthistory.OpType, exists bool)

Operation returns the value of the "operation" field in the mutation.

func (*DocumentHistoryMutation) Ref

func (m *DocumentHistoryMutation) Ref() (r int, exists bool)

Ref returns the value of the "ref" field in the mutation.

func (*DocumentHistoryMutation) RefCleared

func (m *DocumentHistoryMutation) RefCleared() bool

RefCleared returns if the "ref" field was cleared in this mutation.

func (*DocumentHistoryMutation) RemovedEdges

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

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

func (*DocumentHistoryMutation) RemovedIDs

func (m *DocumentHistoryMutation) 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 (*DocumentHistoryMutation) ResetContent

func (m *DocumentHistoryMutation) ResetContent()

ResetContent resets all changes to the "content" field.

func (*DocumentHistoryMutation) ResetContentHash

func (m *DocumentHistoryMutation) ResetContentHash()

ResetContentHash resets all changes to the "content_hash" field.

func (*DocumentHistoryMutation) ResetCreatedAt

func (m *DocumentHistoryMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*DocumentHistoryMutation) ResetDescription

func (m *DocumentHistoryMutation) ResetDescription()

ResetDescription resets all changes to the "description" field.

func (*DocumentHistoryMutation) ResetEdge

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

func (m *DocumentHistoryMutation) 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 (*DocumentHistoryMutation) ResetFilename

func (m *DocumentHistoryMutation) ResetFilename()

ResetFilename resets all changes to the "filename" field.

func (*DocumentHistoryMutation) ResetFiletype

func (m *DocumentHistoryMutation) ResetFiletype()

ResetFiletype resets all changes to the "filetype" field.

func (*DocumentHistoryMutation) ResetHistoryTime

func (m *DocumentHistoryMutation) ResetHistoryTime()

ResetHistoryTime resets all changes to the "history_time" field.

func (*DocumentHistoryMutation) ResetOperation

func (m *DocumentHistoryMutation) ResetOperation()

ResetOperation resets all changes to the "operation" field.

func (*DocumentHistoryMutation) ResetRef

func (m *DocumentHistoryMutation) ResetRef()

ResetRef resets all changes to the "ref" field.

func (*DocumentHistoryMutation) ResetTitle

func (m *DocumentHistoryMutation) ResetTitle()

ResetTitle resets all changes to the "title" field.

func (*DocumentHistoryMutation) ResetUUID

func (m *DocumentHistoryMutation) ResetUUID()

ResetUUID resets all changes to the "uuid" field.

func (*DocumentHistoryMutation) ResetUpdatedAt

func (m *DocumentHistoryMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*DocumentHistoryMutation) ResetUpdatedBy

func (m *DocumentHistoryMutation) ResetUpdatedBy()

ResetUpdatedBy resets all changes to the "updated_by" field.

func (*DocumentHistoryMutation) SetContent

func (m *DocumentHistoryMutation) SetContent(s string)

SetContent sets the "content" field.

func (*DocumentHistoryMutation) SetContentHash

func (m *DocumentHistoryMutation) SetContentHash(s string)

SetContentHash sets the "content_hash" field.

func (*DocumentHistoryMutation) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*DocumentHistoryMutation) SetDescription

func (m *DocumentHistoryMutation) SetDescription(s string)

SetDescription sets the "description" field.

func (*DocumentHistoryMutation) SetField

func (m *DocumentHistoryMutation) 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 (*DocumentHistoryMutation) SetFilename

func (m *DocumentHistoryMutation) SetFilename(s string)

SetFilename sets the "filename" field.

func (*DocumentHistoryMutation) SetFiletype

func (m *DocumentHistoryMutation) SetFiletype(t types.Filetype)

SetFiletype sets the "filetype" field.

func (*DocumentHistoryMutation) SetHistoryTime

func (m *DocumentHistoryMutation) SetHistoryTime(t time.Time)

SetHistoryTime sets the "history_time" field.

func (*DocumentHistoryMutation) SetOp

func (m *DocumentHistoryMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*DocumentHistoryMutation) SetOperation

func (m *DocumentHistoryMutation) SetOperation(et enthistory.OpType)

SetOperation sets the "operation" field.

func (*DocumentHistoryMutation) SetRef

func (m *DocumentHistoryMutation) SetRef(i int)

SetRef sets the "ref" field.

func (*DocumentHistoryMutation) SetTitle

func (m *DocumentHistoryMutation) SetTitle(s string)

SetTitle sets the "title" field.

func (*DocumentHistoryMutation) SetUUID

func (m *DocumentHistoryMutation) SetUUID(u uuid.UUID)

SetUUID sets the "uuid" field.

func (*DocumentHistoryMutation) SetUpdatedAt

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

SetUpdatedAt sets the "updated_at" field.

func (*DocumentHistoryMutation) SetUpdatedBy

func (m *DocumentHistoryMutation) SetUpdatedBy(s string)

SetUpdatedBy sets the "updated_by" field.

func (*DocumentHistoryMutation) Title

func (m *DocumentHistoryMutation) Title() (r string, exists bool)

Title returns the value of the "title" field in the mutation.

func (DocumentHistoryMutation) Tx

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

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

func (*DocumentHistoryMutation) Type

func (m *DocumentHistoryMutation) Type() string

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

func (*DocumentHistoryMutation) UUID

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

UUID returns the value of the "uuid" field in the mutation.

func (*DocumentHistoryMutation) UpdatedAt

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

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

func (*DocumentHistoryMutation) UpdatedBy

func (m *DocumentHistoryMutation) UpdatedBy() (r string, exists bool)

UpdatedBy returns the value of the "updated_by" field in the mutation.

func (*DocumentHistoryMutation) UpdatedByCleared

func (m *DocumentHistoryMutation) UpdatedByCleared() bool

UpdatedByCleared returns if the "updated_by" field was cleared in this mutation.

func (*DocumentHistoryMutation) Where

Where appends a list predicates to the DocumentHistoryMutation builder.

func (*DocumentHistoryMutation) WhereP

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

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

type DocumentHistoryQuery

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

DocumentHistoryQuery is the builder for querying DocumentHistory entities.

func (*DocumentHistoryQuery) Aggregate

Aggregate returns a DocumentHistorySelect configured with the given aggregations.

func (*DocumentHistoryQuery) All

All executes the query and returns a list of DocumentHistories.

func (*DocumentHistoryQuery) AllX

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

func (*DocumentHistoryQuery) AsOf

func (*DocumentHistoryQuery) Clone

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

func (*DocumentHistoryQuery) Count

func (dhq *DocumentHistoryQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*DocumentHistoryQuery) CountX

func (dhq *DocumentHistoryQuery) CountX(ctx context.Context) int

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

func (*DocumentHistoryQuery) Earliest

func (dhq *DocumentHistoryQuery) Earliest(ctx context.Context) (*DocumentHistory, error)

func (*DocumentHistoryQuery) Exist

func (dhq *DocumentHistoryQuery) Exist(ctx context.Context) (bool, error)

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

func (*DocumentHistoryQuery) ExistX

func (dhq *DocumentHistoryQuery) ExistX(ctx context.Context) bool

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

func (*DocumentHistoryQuery) First

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

func (*DocumentHistoryQuery) FirstID

func (dhq *DocumentHistoryQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*DocumentHistoryQuery) FirstIDX

func (dhq *DocumentHistoryQuery) FirstIDX(ctx context.Context) int

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

func (*DocumentHistoryQuery) FirstX

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

func (*DocumentHistoryQuery) GroupBy

func (dhq *DocumentHistoryQuery) GroupBy(field string, fields ...string) *DocumentHistoryGroupBy

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

client.DocumentHistory.Query().
	GroupBy(documenthistory.FieldHistoryTime).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*DocumentHistoryQuery) IDs

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

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

func (*DocumentHistoryQuery) IDsX

func (dhq *DocumentHistoryQuery) IDsX(ctx context.Context) []int

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

func (*DocumentHistoryQuery) Latest

func (*DocumentHistoryQuery) Limit

func (dhq *DocumentHistoryQuery) Limit(limit int) *DocumentHistoryQuery

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

func (*DocumentHistoryQuery) Modify

func (dhq *DocumentHistoryQuery) Modify(modifiers ...func(s *sql.Selector)) *DocumentHistorySelect

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

func (*DocumentHistoryQuery) Offset

func (dhq *DocumentHistoryQuery) Offset(offset int) *DocumentHistoryQuery

Offset to start from.

func (*DocumentHistoryQuery) Only

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

func (*DocumentHistoryQuery) OnlyID

func (dhq *DocumentHistoryQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*DocumentHistoryQuery) OnlyIDX

func (dhq *DocumentHistoryQuery) OnlyIDX(ctx context.Context) int

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

func (*DocumentHistoryQuery) OnlyX

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

func (*DocumentHistoryQuery) Order

Order specifies how the records should be ordered.

func (*DocumentHistoryQuery) Select

func (dhq *DocumentHistoryQuery) Select(fields ...string) *DocumentHistorySelect

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

client.DocumentHistory.Query().
	Select(documenthistory.FieldHistoryTime).
	Scan(ctx, &v)

func (*DocumentHistoryQuery) Unique

func (dhq *DocumentHistoryQuery) Unique(unique bool) *DocumentHistoryQuery

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

Where adds a new predicate for the DocumentHistoryQuery builder.

type DocumentHistorySelect

type DocumentHistorySelect struct {
	*DocumentHistoryQuery
	// contains filtered or unexported fields
}

DocumentHistorySelect is the builder for selecting fields of DocumentHistory entities.

func (*DocumentHistorySelect) Aggregate

Aggregate adds the given aggregation functions to the selector query.

func (*DocumentHistorySelect) Bool

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

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

func (*DocumentHistorySelect) BoolX

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

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

func (*DocumentHistorySelect) Bools

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

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

func (*DocumentHistorySelect) BoolsX

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

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

func (*DocumentHistorySelect) Float64

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

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

func (*DocumentHistorySelect) Float64X

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

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

func (*DocumentHistorySelect) Float64s

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

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

func (*DocumentHistorySelect) Float64sX

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

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

func (*DocumentHistorySelect) Int

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

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

func (*DocumentHistorySelect) IntX

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

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

func (*DocumentHistorySelect) Ints

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

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

func (*DocumentHistorySelect) IntsX

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

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

func (*DocumentHistorySelect) Modify

func (dhs *DocumentHistorySelect) Modify(modifiers ...func(s *sql.Selector)) *DocumentHistorySelect

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

func (*DocumentHistorySelect) Scan

func (dhs *DocumentHistorySelect) Scan(ctx context.Context, v any) error

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

func (*DocumentHistorySelect) ScanX

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

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

func (*DocumentHistorySelect) String

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

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

func (*DocumentHistorySelect) StringX

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

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

func (*DocumentHistorySelect) Strings

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

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

func (*DocumentHistorySelect) StringsX

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

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

type DocumentHistoryUpdate

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

DocumentHistoryUpdate is the builder for updating DocumentHistory entities.

func (*DocumentHistoryUpdate) ClearContent

func (dhu *DocumentHistoryUpdate) ClearContent() *DocumentHistoryUpdate

ClearContent clears the value of the "content" field.

func (*DocumentHistoryUpdate) ClearContentHash

func (dhu *DocumentHistoryUpdate) ClearContentHash() *DocumentHistoryUpdate

ClearContentHash clears the value of the "content_hash" field.

func (*DocumentHistoryUpdate) Exec

func (dhu *DocumentHistoryUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*DocumentHistoryUpdate) ExecX

func (dhu *DocumentHistoryUpdate) ExecX(ctx context.Context)

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

func (*DocumentHistoryUpdate) Modify

func (dhu *DocumentHistoryUpdate) Modify(modifiers ...func(u *sql.UpdateBuilder)) *DocumentHistoryUpdate

Modify adds a statement modifier for attaching custom logic to the UPDATE statement.

func (*DocumentHistoryUpdate) Mutation

Mutation returns the DocumentHistoryMutation object of the builder.

func (*DocumentHistoryUpdate) Save

func (dhu *DocumentHistoryUpdate) Save(ctx context.Context) (int, error)

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

func (*DocumentHistoryUpdate) SaveX

func (dhu *DocumentHistoryUpdate) SaveX(ctx context.Context) int

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

func (*DocumentHistoryUpdate) SetContent

SetContent sets the "content" field.

func (*DocumentHistoryUpdate) SetContentHash

func (dhu *DocumentHistoryUpdate) SetContentHash(s string) *DocumentHistoryUpdate

SetContentHash sets the "content_hash" field.

func (*DocumentHistoryUpdate) SetDescription

func (dhu *DocumentHistoryUpdate) SetDescription(s string) *DocumentHistoryUpdate

SetDescription sets the "description" field.

func (*DocumentHistoryUpdate) SetFilename

func (dhu *DocumentHistoryUpdate) SetFilename(s string) *DocumentHistoryUpdate

SetFilename sets the "filename" field.

func (*DocumentHistoryUpdate) SetFiletype

SetFiletype sets the "filetype" field.

func (*DocumentHistoryUpdate) SetNillableContent

func (dhu *DocumentHistoryUpdate) SetNillableContent(s *string) *DocumentHistoryUpdate

SetNillableContent sets the "content" field if the given value is not nil.

func (*DocumentHistoryUpdate) SetNillableContentHash

func (dhu *DocumentHistoryUpdate) SetNillableContentHash(s *string) *DocumentHistoryUpdate

SetNillableContentHash sets the "content_hash" field if the given value is not nil.

func (*DocumentHistoryUpdate) SetNillableUUID

func (dhu *DocumentHistoryUpdate) SetNillableUUID(u *uuid.UUID) *DocumentHistoryUpdate

SetNillableUUID sets the "uuid" field if the given value is not nil.

func (*DocumentHistoryUpdate) SetTitle

SetTitle sets the "title" field.

func (*DocumentHistoryUpdate) SetUUID

SetUUID sets the "uuid" field.

func (*DocumentHistoryUpdate) SetUpdatedAt

func (dhu *DocumentHistoryUpdate) SetUpdatedAt(t time.Time) *DocumentHistoryUpdate

SetUpdatedAt sets the "updated_at" field.

func (*DocumentHistoryUpdate) Where

Where appends a list predicates to the DocumentHistoryUpdate builder.

type DocumentHistoryUpdateOne

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

DocumentHistoryUpdateOne is the builder for updating a single DocumentHistory entity.

func (*DocumentHistoryUpdateOne) ClearContent

func (dhuo *DocumentHistoryUpdateOne) ClearContent() *DocumentHistoryUpdateOne

ClearContent clears the value of the "content" field.

func (*DocumentHistoryUpdateOne) ClearContentHash

func (dhuo *DocumentHistoryUpdateOne) ClearContentHash() *DocumentHistoryUpdateOne

ClearContentHash clears the value of the "content_hash" field.

func (*DocumentHistoryUpdateOne) Exec

Exec executes the query on the entity.

func (*DocumentHistoryUpdateOne) ExecX

func (dhuo *DocumentHistoryUpdateOne) ExecX(ctx context.Context)

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

func (*DocumentHistoryUpdateOne) Modify

func (dhuo *DocumentHistoryUpdateOne) Modify(modifiers ...func(u *sql.UpdateBuilder)) *DocumentHistoryUpdateOne

Modify adds a statement modifier for attaching custom logic to the UPDATE statement.

func (*DocumentHistoryUpdateOne) Mutation

Mutation returns the DocumentHistoryMutation object of the builder.

func (*DocumentHistoryUpdateOne) Save

Save executes the query and returns the updated DocumentHistory entity.

func (*DocumentHistoryUpdateOne) SaveX

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

func (*DocumentHistoryUpdateOne) Select

func (dhuo *DocumentHistoryUpdateOne) Select(field string, fields ...string) *DocumentHistoryUpdateOne

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

func (*DocumentHistoryUpdateOne) SetContent

SetContent sets the "content" field.

func (*DocumentHistoryUpdateOne) SetContentHash

func (dhuo *DocumentHistoryUpdateOne) SetContentHash(s string) *DocumentHistoryUpdateOne

SetContentHash sets the "content_hash" field.

func (*DocumentHistoryUpdateOne) SetDescription

func (dhuo *DocumentHistoryUpdateOne) SetDescription(s string) *DocumentHistoryUpdateOne

SetDescription sets the "description" field.

func (*DocumentHistoryUpdateOne) SetFilename

SetFilename sets the "filename" field.

func (*DocumentHistoryUpdateOne) SetFiletype

SetFiletype sets the "filetype" field.

func (*DocumentHistoryUpdateOne) SetNillableContent

func (dhuo *DocumentHistoryUpdateOne) SetNillableContent(s *string) *DocumentHistoryUpdateOne

SetNillableContent sets the "content" field if the given value is not nil.

func (*DocumentHistoryUpdateOne) SetNillableContentHash

func (dhuo *DocumentHistoryUpdateOne) SetNillableContentHash(s *string) *DocumentHistoryUpdateOne

SetNillableContentHash sets the "content_hash" field if the given value is not nil.

func (*DocumentHistoryUpdateOne) SetNillableUUID

func (dhuo *DocumentHistoryUpdateOne) SetNillableUUID(u *uuid.UUID) *DocumentHistoryUpdateOne

SetNillableUUID sets the "uuid" field if the given value is not nil.

func (*DocumentHistoryUpdateOne) SetTitle

SetTitle sets the "title" field.

func (*DocumentHistoryUpdateOne) SetUUID

SetUUID sets the "uuid" field.

func (*DocumentHistoryUpdateOne) SetUpdatedAt

SetUpdatedAt sets the "updated_at" field.

func (*DocumentHistoryUpdateOne) Where

Where appends a list predicates to the DocumentHistoryUpdate builder.

type DocumentMutation

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

DocumentMutation represents an operation that mutates the Document nodes in the graph.

func (*DocumentMutation) AddField

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

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

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

func (*DocumentMutation) AddedField

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

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

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

func (*DocumentMutation) AddedIDs

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

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

func (*DocumentMutation) ClearContent

func (m *DocumentMutation) ClearContent()

ClearContent clears the value of the "content" field.

func (*DocumentMutation) ClearContentHash

func (m *DocumentMutation) ClearContentHash()

ClearContentHash clears the value of the "content_hash" field.

func (*DocumentMutation) ClearEdge

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

func (m *DocumentMutation) 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 (*DocumentMutation) ClearSearch

func (m *DocumentMutation) ClearSearch()

ClearSearch clears the "search" edge to the DocumentSearch entity.

func (*DocumentMutation) ClearUser

func (m *DocumentMutation) ClearUser()

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

func (*DocumentMutation) ClearedEdges

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

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

func (*DocumentMutation) ClearedFields

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

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

func (DocumentMutation) Client

func (m DocumentMutation) 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 (*DocumentMutation) Content

func (m *DocumentMutation) Content() (r string, exists bool)

Content returns the value of the "content" field in the mutation.

func (*DocumentMutation) ContentCleared

func (m *DocumentMutation) ContentCleared() bool

ContentCleared returns if the "content" field was cleared in this mutation.

func (*DocumentMutation) ContentHash

func (m *DocumentMutation) ContentHash() (r string, exists bool)

ContentHash returns the value of the "content_hash" field in the mutation.

func (*DocumentMutation) ContentHashCleared

func (m *DocumentMutation) ContentHashCleared() bool

ContentHashCleared returns if the "content_hash" field was cleared in this mutation.

func (*DocumentMutation) CreateHistoryFromCreate

func (m *DocumentMutation) CreateHistoryFromCreate(ctx context.Context) error

func (*DocumentMutation) CreateHistoryFromDelete

func (m *DocumentMutation) CreateHistoryFromDelete(ctx context.Context) error

func (*DocumentMutation) CreateHistoryFromUpdate

func (m *DocumentMutation) CreateHistoryFromUpdate(ctx context.Context) error

func (*DocumentMutation) CreatedAt

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

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

func (*DocumentMutation) Description

func (m *DocumentMutation) Description() (r string, exists bool)

Description returns the value of the "description" field in the mutation.

func (*DocumentMutation) EdgeCleared

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

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

func (*DocumentMutation) Field

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

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

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

func (*DocumentMutation) Fields

func (m *DocumentMutation) 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 (*DocumentMutation) Filename

func (m *DocumentMutation) Filename() (r string, exists bool)

Filename returns the value of the "filename" field in the mutation.

func (*DocumentMutation) Filetype

func (m *DocumentMutation) Filetype() (r types.Filetype, exists bool)

Filetype returns the value of the "filetype" field in the mutation.

func (*DocumentMutation) ID

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

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

func (*DocumentMutation) IDs

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

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

func (*DocumentMutation) OldContent

func (m *DocumentMutation) OldContent(ctx context.Context) (v *string, err error)

OldContent returns the old "content" field's value of the Document entity. If the Document 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 (*DocumentMutation) OldContentHash

func (m *DocumentMutation) OldContentHash(ctx context.Context) (v string, err error)

OldContentHash returns the old "content_hash" field's value of the Document entity. If the Document 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 (*DocumentMutation) OldCreatedAt

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

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

func (m *DocumentMutation) OldDescription(ctx context.Context) (v string, err error)

OldDescription returns the old "description" field's value of the Document entity. If the Document 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 (*DocumentMutation) OldField

func (m *DocumentMutation) 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 (*DocumentMutation) OldFilename

func (m *DocumentMutation) OldFilename(ctx context.Context) (v string, err error)

OldFilename returns the old "filename" field's value of the Document entity. If the Document 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 (*DocumentMutation) OldFiletype

func (m *DocumentMutation) OldFiletype(ctx context.Context) (v types.Filetype, err error)

OldFiletype returns the old "filetype" field's value of the Document entity. If the Document 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 (*DocumentMutation) OldTitle

func (m *DocumentMutation) OldTitle(ctx context.Context) (v string, err error)

OldTitle returns the old "title" field's value of the Document entity. If the Document 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 (*DocumentMutation) OldUUID

func (m *DocumentMutation) OldUUID(ctx context.Context) (v uuid.UUID, err error)

OldUUID returns the old "uuid" field's value of the Document entity. If the Document 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 (*DocumentMutation) OldUpdatedAt

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

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

func (m *DocumentMutation) Op() Op

Op returns the operation name.

func (*DocumentMutation) RemovedEdges

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

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

func (*DocumentMutation) RemovedIDs

func (m *DocumentMutation) 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 (*DocumentMutation) ResetContent

func (m *DocumentMutation) ResetContent()

ResetContent resets all changes to the "content" field.

func (*DocumentMutation) ResetContentHash

func (m *DocumentMutation) ResetContentHash()

ResetContentHash resets all changes to the "content_hash" field.

func (*DocumentMutation) ResetCreatedAt

func (m *DocumentMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*DocumentMutation) ResetDescription

func (m *DocumentMutation) ResetDescription()

ResetDescription resets all changes to the "description" field.

func (*DocumentMutation) ResetEdge

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

func (m *DocumentMutation) 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 (*DocumentMutation) ResetFilename

func (m *DocumentMutation) ResetFilename()

ResetFilename resets all changes to the "filename" field.

func (*DocumentMutation) ResetFiletype

func (m *DocumentMutation) ResetFiletype()

ResetFiletype resets all changes to the "filetype" field.

func (*DocumentMutation) ResetSearch

func (m *DocumentMutation) ResetSearch()

ResetSearch resets all changes to the "search" edge.

func (*DocumentMutation) ResetTitle

func (m *DocumentMutation) ResetTitle()

ResetTitle resets all changes to the "title" field.

func (*DocumentMutation) ResetUUID

func (m *DocumentMutation) ResetUUID()

ResetUUID resets all changes to the "uuid" field.

func (*DocumentMutation) ResetUpdatedAt

func (m *DocumentMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*DocumentMutation) ResetUser

func (m *DocumentMutation) ResetUser()

ResetUser resets all changes to the "user" edge.

func (*DocumentMutation) SearchCleared

func (m *DocumentMutation) SearchCleared() bool

SearchCleared reports if the "search" edge to the DocumentSearch entity was cleared.

func (*DocumentMutation) SearchID

func (m *DocumentMutation) SearchID() (id int, exists bool)

SearchID returns the "search" edge ID in the mutation.

func (*DocumentMutation) SearchIDs

func (m *DocumentMutation) SearchIDs() (ids []int)

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

func (*DocumentMutation) SetContent

func (m *DocumentMutation) SetContent(s string)

SetContent sets the "content" field.

func (*DocumentMutation) SetContentHash

func (m *DocumentMutation) SetContentHash(s string)

SetContentHash sets the "content_hash" field.

func (*DocumentMutation) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*DocumentMutation) SetDescription

func (m *DocumentMutation) SetDescription(s string)

SetDescription sets the "description" field.

func (*DocumentMutation) SetField

func (m *DocumentMutation) 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 (*DocumentMutation) SetFilename

func (m *DocumentMutation) SetFilename(s string)

SetFilename sets the "filename" field.

func (*DocumentMutation) SetFiletype

func (m *DocumentMutation) SetFiletype(t types.Filetype)

SetFiletype sets the "filetype" field.

func (*DocumentMutation) SetOp

func (m *DocumentMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*DocumentMutation) SetSearchID

func (m *DocumentMutation) SetSearchID(id int)

SetSearchID sets the "search" edge to the DocumentSearch entity by id.

func (*DocumentMutation) SetTitle

func (m *DocumentMutation) SetTitle(s string)

SetTitle sets the "title" field.

func (*DocumentMutation) SetUUID

func (m *DocumentMutation) SetUUID(u uuid.UUID)

SetUUID sets the "uuid" field.

func (*DocumentMutation) SetUpdatedAt

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

SetUpdatedAt sets the "updated_at" field.

func (*DocumentMutation) SetUserID

func (m *DocumentMutation) SetUserID(id int)

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

func (*DocumentMutation) Title

func (m *DocumentMutation) Title() (r string, exists bool)

Title returns the value of the "title" field in the mutation.

func (DocumentMutation) Tx

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

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

func (*DocumentMutation) Type

func (m *DocumentMutation) Type() string

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

func (*DocumentMutation) UUID

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

UUID returns the value of the "uuid" field in the mutation.

func (*DocumentMutation) UpdatedAt

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

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

func (*DocumentMutation) UserCleared

func (m *DocumentMutation) UserCleared() bool

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

func (*DocumentMutation) UserID

func (m *DocumentMutation) UserID() (id int, exists bool)

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

func (*DocumentMutation) UserIDs

func (m *DocumentMutation) UserIDs() (ids []int)

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

func (*DocumentMutation) Where

func (m *DocumentMutation) Where(ps ...predicate.Document)

Where appends a list predicates to the DocumentMutation builder.

func (*DocumentMutation) WhereP

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

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

type DocumentQuery

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

DocumentQuery is the builder for querying Document entities.

func (*DocumentQuery) Aggregate

func (dq *DocumentQuery) Aggregate(fns ...AggregateFunc) *DocumentSelect

Aggregate returns a DocumentSelect configured with the given aggregations.

func (*DocumentQuery) All

func (dq *DocumentQuery) All(ctx context.Context) ([]*Document, error)

All executes the query and returns a list of Documents.

func (*DocumentQuery) AllX

func (dq *DocumentQuery) AllX(ctx context.Context) []*Document

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

func (*DocumentQuery) Clone

func (dq *DocumentQuery) Clone() *DocumentQuery

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

func (*DocumentQuery) Count

func (dq *DocumentQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*DocumentQuery) CountX

func (dq *DocumentQuery) CountX(ctx context.Context) int

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

func (*DocumentQuery) Exist

func (dq *DocumentQuery) Exist(ctx context.Context) (bool, error)

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

func (*DocumentQuery) ExistX

func (dq *DocumentQuery) ExistX(ctx context.Context) bool

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

func (*DocumentQuery) First

func (dq *DocumentQuery) First(ctx context.Context) (*Document, error)

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

func (*DocumentQuery) FirstID

func (dq *DocumentQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*DocumentQuery) FirstIDX

func (dq *DocumentQuery) FirstIDX(ctx context.Context) int

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

func (*DocumentQuery) FirstX

func (dq *DocumentQuery) FirstX(ctx context.Context) *Document

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

func (*DocumentQuery) GroupBy

func (dq *DocumentQuery) GroupBy(field string, fields ...string) *DocumentGroupBy

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

client.Document.Query().
	GroupBy(document.FieldUUID).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*DocumentQuery) IDs

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

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

func (*DocumentQuery) IDsX

func (dq *DocumentQuery) IDsX(ctx context.Context) []int

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

func (*DocumentQuery) Limit

func (dq *DocumentQuery) Limit(limit int) *DocumentQuery

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

func (*DocumentQuery) Modify

func (dq *DocumentQuery) Modify(modifiers ...func(s *sql.Selector)) *DocumentSelect

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

func (*DocumentQuery) Offset

func (dq *DocumentQuery) Offset(offset int) *DocumentQuery

Offset to start from.

func (*DocumentQuery) Only

func (dq *DocumentQuery) Only(ctx context.Context) (*Document, error)

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

func (*DocumentQuery) OnlyID

func (dq *DocumentQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*DocumentQuery) OnlyIDX

func (dq *DocumentQuery) OnlyIDX(ctx context.Context) int

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

func (*DocumentQuery) OnlyX

func (dq *DocumentQuery) OnlyX(ctx context.Context) *Document

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

func (*DocumentQuery) Order

func (dq *DocumentQuery) Order(o ...OrderFunc) *DocumentQuery

Order specifies how the records should be ordered.

func (*DocumentQuery) QuerySearch

func (dq *DocumentQuery) QuerySearch() *DocumentSearchQuery

QuerySearch chains the current query on the "search" edge.

func (*DocumentQuery) QueryUser

func (dq *DocumentQuery) QueryUser() *UserQuery

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

func (*DocumentQuery) Select

func (dq *DocumentQuery) Select(fields ...string) *DocumentSelect

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

client.Document.Query().
	Select(document.FieldUUID).
	Scan(ctx, &v)

func (*DocumentQuery) Unique

func (dq *DocumentQuery) Unique(unique bool) *DocumentQuery

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

func (dq *DocumentQuery) Where(ps ...predicate.Document) *DocumentQuery

Where adds a new predicate for the DocumentQuery builder.

func (*DocumentQuery) WithSearch

func (dq *DocumentQuery) WithSearch(opts ...func(*DocumentSearchQuery)) *DocumentQuery

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

func (*DocumentQuery) WithUser

func (dq *DocumentQuery) WithUser(opts ...func(*UserQuery)) *DocumentQuery

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

type DocumentSearch

type DocumentSearch struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// UUID holds the value of the "uuid" field.
	UUID uuid.UUID `json:"uuid,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// UpdatedAt holds the value of the "updated_at" field.
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	// DocumentID holds the value of the "document_id" field.
	DocumentID int `json:"document_id,omitempty"`
	// Ts holds the value of the "ts" field.
	Ts *types.TsVector `json:"ts,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the DocumentSearchQuery when eager-loading is set.
	Edges DocumentSearchEdges `json:"edges"`
	// contains filtered or unexported fields
}

DocumentSearch is the model entity for the DocumentSearch schema.

func (*DocumentSearch) QueryDocument

func (ds *DocumentSearch) QueryDocument() *DocumentQuery

QueryDocument queries the "document" edge of the DocumentSearch entity.

func (*DocumentSearch) String

func (ds *DocumentSearch) String() string

String implements the fmt.Stringer.

func (*DocumentSearch) Unwrap

func (ds *DocumentSearch) Unwrap() *DocumentSearch

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

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

type DocumentSearchClient

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

DocumentSearchClient is a client for the DocumentSearch schema.

func NewDocumentSearchClient

func NewDocumentSearchClient(c config) *DocumentSearchClient

NewDocumentSearchClient returns a client for the DocumentSearch from the given config.

func (*DocumentSearchClient) Create

Create returns a builder for creating a DocumentSearch entity.

func (*DocumentSearchClient) CreateBulk

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

func (*DocumentSearchClient) Delete

Delete returns a delete builder for DocumentSearch.

func (*DocumentSearchClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*DocumentSearchClient) DeleteOneID

func (c *DocumentSearchClient) DeleteOneID(id int) *DocumentSearchDeleteOne

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

func (*DocumentSearchClient) Get

Get returns a DocumentSearch entity by its id.

func (*DocumentSearchClient) GetX

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

func (*DocumentSearchClient) Hooks

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

Hooks returns the client hooks.

func (*DocumentSearchClient) Intercept

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

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

func (*DocumentSearchClient) Interceptors

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

Interceptors returns the client interceptors.

func (*DocumentSearchClient) Query

Query returns a query builder for DocumentSearch.

func (*DocumentSearchClient) QueryDocument

func (c *DocumentSearchClient) QueryDocument(ds *DocumentSearch) *DocumentQuery

QueryDocument queries the document edge of a DocumentSearch.

func (*DocumentSearchClient) Update

Update returns an update builder for DocumentSearch.

func (*DocumentSearchClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*DocumentSearchClient) UpdateOneID

func (c *DocumentSearchClient) UpdateOneID(id int) *DocumentSearchUpdateOne

UpdateOneID returns an update builder for the given id.

func (*DocumentSearchClient) Use

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

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

type DocumentSearchCreate

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

DocumentSearchCreate is the builder for creating a DocumentSearch entity.

func (*DocumentSearchCreate) Exec

func (dsc *DocumentSearchCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*DocumentSearchCreate) ExecX

func (dsc *DocumentSearchCreate) ExecX(ctx context.Context)

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

func (*DocumentSearchCreate) Mutation

Mutation returns the DocumentSearchMutation object of the builder.

func (*DocumentSearchCreate) Save

Save creates the DocumentSearch in the database.

func (*DocumentSearchCreate) SaveX

SaveX calls Save and panics if Save returns an error.

func (*DocumentSearchCreate) SetCreatedAt

func (dsc *DocumentSearchCreate) SetCreatedAt(t time.Time) *DocumentSearchCreate

SetCreatedAt sets the "created_at" field.

func (*DocumentSearchCreate) SetDocument

func (dsc *DocumentSearchCreate) SetDocument(d *Document) *DocumentSearchCreate

SetDocument sets the "document" edge to the Document entity.

func (*DocumentSearchCreate) SetDocumentID

func (dsc *DocumentSearchCreate) SetDocumentID(i int) *DocumentSearchCreate

SetDocumentID sets the "document_id" field.

func (*DocumentSearchCreate) SetNillableCreatedAt

func (dsc *DocumentSearchCreate) SetNillableCreatedAt(t *time.Time) *DocumentSearchCreate

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

func (*DocumentSearchCreate) SetNillableUUID

func (dsc *DocumentSearchCreate) SetNillableUUID(u *uuid.UUID) *DocumentSearchCreate

SetNillableUUID sets the "uuid" field if the given value is not nil.

func (*DocumentSearchCreate) SetNillableUpdatedAt

func (dsc *DocumentSearchCreate) SetNillableUpdatedAt(t *time.Time) *DocumentSearchCreate

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

func (*DocumentSearchCreate) SetTs

SetTs sets the "ts" field.

func (*DocumentSearchCreate) SetUUID

SetUUID sets the "uuid" field.

func (*DocumentSearchCreate) SetUpdatedAt

func (dsc *DocumentSearchCreate) SetUpdatedAt(t time.Time) *DocumentSearchCreate

SetUpdatedAt sets the "updated_at" field.

type DocumentSearchCreateBulk

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

DocumentSearchCreateBulk is the builder for creating many DocumentSearch entities in bulk.

func (*DocumentSearchCreateBulk) Exec

Exec executes the query.

func (*DocumentSearchCreateBulk) ExecX

func (dscb *DocumentSearchCreateBulk) ExecX(ctx context.Context)

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

func (*DocumentSearchCreateBulk) Save

Save creates the DocumentSearch entities in the database.

func (*DocumentSearchCreateBulk) SaveX

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

type DocumentSearchDelete

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

DocumentSearchDelete is the builder for deleting a DocumentSearch entity.

func (*DocumentSearchDelete) Exec

func (dsd *DocumentSearchDelete) Exec(ctx context.Context) (int, error)

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

func (*DocumentSearchDelete) ExecX

func (dsd *DocumentSearchDelete) ExecX(ctx context.Context) int

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

func (*DocumentSearchDelete) Where

Where appends a list predicates to the DocumentSearchDelete builder.

type DocumentSearchDeleteOne

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

DocumentSearchDeleteOne is the builder for deleting a single DocumentSearch entity.

func (*DocumentSearchDeleteOne) Exec

func (dsdo *DocumentSearchDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*DocumentSearchDeleteOne) ExecX

func (dsdo *DocumentSearchDeleteOne) ExecX(ctx context.Context)

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

func (*DocumentSearchDeleteOne) Where

Where appends a list predicates to the DocumentSearchDelete builder.

type DocumentSearchEdges

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

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

func (DocumentSearchEdges) DocumentOrErr

func (e DocumentSearchEdges) DocumentOrErr() (*Document, error)

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

type DocumentSearchGroupBy

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

DocumentSearchGroupBy is the group-by builder for DocumentSearch entities.

func (*DocumentSearchGroupBy) Aggregate

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

func (*DocumentSearchGroupBy) Bool

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

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

func (*DocumentSearchGroupBy) BoolX

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

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

func (*DocumentSearchGroupBy) Bools

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

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

func (*DocumentSearchGroupBy) BoolsX

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

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

func (*DocumentSearchGroupBy) Float64

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

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

func (*DocumentSearchGroupBy) Float64X

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

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

func (*DocumentSearchGroupBy) Float64s

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

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

func (*DocumentSearchGroupBy) Float64sX

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

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

func (*DocumentSearchGroupBy) Int

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

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

func (*DocumentSearchGroupBy) IntX

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

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

func (*DocumentSearchGroupBy) Ints

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

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

func (*DocumentSearchGroupBy) IntsX

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

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

func (*DocumentSearchGroupBy) Scan

func (dsgb *DocumentSearchGroupBy) Scan(ctx context.Context, v any) error

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

func (*DocumentSearchGroupBy) ScanX

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

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

func (*DocumentSearchGroupBy) String

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

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

func (*DocumentSearchGroupBy) StringX

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

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

func (*DocumentSearchGroupBy) Strings

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

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

func (*DocumentSearchGroupBy) StringsX

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

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

type DocumentSearchMutation

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

DocumentSearchMutation represents an operation that mutates the DocumentSearch nodes in the graph.

func (*DocumentSearchMutation) AddField

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

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

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

func (*DocumentSearchMutation) AddedField

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

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

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

func (*DocumentSearchMutation) AddedIDs

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

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

func (*DocumentSearchMutation) ClearDocument

func (m *DocumentSearchMutation) ClearDocument()

ClearDocument clears the "document" edge to the Document entity.

func (*DocumentSearchMutation) ClearEdge

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

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

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

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

func (*DocumentSearchMutation) ClearedFields

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

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

func (DocumentSearchMutation) Client

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

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

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

func (*DocumentSearchMutation) DocumentCleared

func (m *DocumentSearchMutation) DocumentCleared() bool

DocumentCleared reports if the "document" edge to the Document entity was cleared.

func (*DocumentSearchMutation) DocumentID

func (m *DocumentSearchMutation) DocumentID() (r int, exists bool)

DocumentID returns the value of the "document_id" field in the mutation.

func (*DocumentSearchMutation) DocumentIDs

func (m *DocumentSearchMutation) DocumentIDs() (ids []int)

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

func (*DocumentSearchMutation) EdgeCleared

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

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

func (*DocumentSearchMutation) Field

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

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

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

func (*DocumentSearchMutation) Fields

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

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

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

func (*DocumentSearchMutation) IDs

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

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

func (*DocumentSearchMutation) OldCreatedAt

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

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

func (m *DocumentSearchMutation) OldDocumentID(ctx context.Context) (v int, err error)

OldDocumentID returns the old "document_id" field's value of the DocumentSearch entity. If the DocumentSearch 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 (*DocumentSearchMutation) OldField

func (m *DocumentSearchMutation) 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 (*DocumentSearchMutation) OldTs

func (m *DocumentSearchMutation) OldTs(ctx context.Context) (v *types.TsVector, err error)

OldTs returns the old "ts" field's value of the DocumentSearch entity. If the DocumentSearch 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 (*DocumentSearchMutation) OldUUID

func (m *DocumentSearchMutation) OldUUID(ctx context.Context) (v uuid.UUID, err error)

OldUUID returns the old "uuid" field's value of the DocumentSearch entity. If the DocumentSearch 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 (*DocumentSearchMutation) OldUpdatedAt

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

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

func (m *DocumentSearchMutation) Op() Op

Op returns the operation name.

func (*DocumentSearchMutation) RemovedEdges

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

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

func (*DocumentSearchMutation) RemovedIDs

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

func (m *DocumentSearchMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*DocumentSearchMutation) ResetDocument

func (m *DocumentSearchMutation) ResetDocument()

ResetDocument resets all changes to the "document" edge.

func (*DocumentSearchMutation) ResetDocumentID

func (m *DocumentSearchMutation) ResetDocumentID()

ResetDocumentID resets all changes to the "document_id" field.

func (*DocumentSearchMutation) ResetEdge

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

func (m *DocumentSearchMutation) 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 (*DocumentSearchMutation) ResetTs

func (m *DocumentSearchMutation) ResetTs()

ResetTs resets all changes to the "ts" field.

func (*DocumentSearchMutation) ResetUUID

func (m *DocumentSearchMutation) ResetUUID()

ResetUUID resets all changes to the "uuid" field.

func (*DocumentSearchMutation) ResetUpdatedAt

func (m *DocumentSearchMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*DocumentSearchMutation) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*DocumentSearchMutation) SetDocumentID

func (m *DocumentSearchMutation) SetDocumentID(i int)

SetDocumentID sets the "document_id" field.

func (*DocumentSearchMutation) SetField

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

func (m *DocumentSearchMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*DocumentSearchMutation) SetTs

func (m *DocumentSearchMutation) SetTs(tv *types.TsVector)

SetTs sets the "ts" field.

func (*DocumentSearchMutation) SetUUID

func (m *DocumentSearchMutation) SetUUID(u uuid.UUID)

SetUUID sets the "uuid" field.

func (*DocumentSearchMutation) SetUpdatedAt

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

SetUpdatedAt sets the "updated_at" field.

func (*DocumentSearchMutation) Ts

func (m *DocumentSearchMutation) Ts() (r *types.TsVector, exists bool)

Ts returns the value of the "ts" field in the mutation.

func (DocumentSearchMutation) Tx

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

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

func (*DocumentSearchMutation) Type

func (m *DocumentSearchMutation) Type() string

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

func (*DocumentSearchMutation) UUID

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

UUID returns the value of the "uuid" field in the mutation.

func (*DocumentSearchMutation) UpdatedAt

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

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

func (*DocumentSearchMutation) Where

Where appends a list predicates to the DocumentSearchMutation builder.

func (*DocumentSearchMutation) WhereP

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

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

type DocumentSearchQuery

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

DocumentSearchQuery is the builder for querying DocumentSearch entities.

func (*DocumentSearchQuery) Aggregate

func (dsq *DocumentSearchQuery) Aggregate(fns ...AggregateFunc) *DocumentSearchSelect

Aggregate returns a DocumentSearchSelect configured with the given aggregations.

func (*DocumentSearchQuery) All

All executes the query and returns a list of DocumentSearches.

func (*DocumentSearchQuery) AllX

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

func (*DocumentSearchQuery) Clone

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

func (*DocumentSearchQuery) Count

func (dsq *DocumentSearchQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*DocumentSearchQuery) CountX

func (dsq *DocumentSearchQuery) CountX(ctx context.Context) int

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

func (*DocumentSearchQuery) Exist

func (dsq *DocumentSearchQuery) Exist(ctx context.Context) (bool, error)

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

func (*DocumentSearchQuery) ExistX

func (dsq *DocumentSearchQuery) ExistX(ctx context.Context) bool

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

func (*DocumentSearchQuery) First

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

func (*DocumentSearchQuery) FirstID

func (dsq *DocumentSearchQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*DocumentSearchQuery) FirstIDX

func (dsq *DocumentSearchQuery) FirstIDX(ctx context.Context) int

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

func (*DocumentSearchQuery) FirstX

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

func (*DocumentSearchQuery) GroupBy

func (dsq *DocumentSearchQuery) GroupBy(field string, fields ...string) *DocumentSearchGroupBy

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

client.DocumentSearch.Query().
	GroupBy(documentsearch.FieldUUID).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*DocumentSearchQuery) IDs

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

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

func (*DocumentSearchQuery) IDsX

func (dsq *DocumentSearchQuery) IDsX(ctx context.Context) []int

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

func (*DocumentSearchQuery) Limit

func (dsq *DocumentSearchQuery) Limit(limit int) *DocumentSearchQuery

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

func (*DocumentSearchQuery) Modify

func (dsq *DocumentSearchQuery) Modify(modifiers ...func(s *sql.Selector)) *DocumentSearchSelect

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

func (*DocumentSearchQuery) Offset

func (dsq *DocumentSearchQuery) Offset(offset int) *DocumentSearchQuery

Offset to start from.

func (*DocumentSearchQuery) Only

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

func (*DocumentSearchQuery) OnlyID

func (dsq *DocumentSearchQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*DocumentSearchQuery) OnlyIDX

func (dsq *DocumentSearchQuery) OnlyIDX(ctx context.Context) int

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

func (*DocumentSearchQuery) OnlyX

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

func (*DocumentSearchQuery) Order

Order specifies how the records should be ordered.

func (*DocumentSearchQuery) QueryDocument

func (dsq *DocumentSearchQuery) QueryDocument() *DocumentQuery

QueryDocument chains the current query on the "document" edge.

func (*DocumentSearchQuery) Select

func (dsq *DocumentSearchQuery) Select(fields ...string) *DocumentSearchSelect

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

client.DocumentSearch.Query().
	Select(documentsearch.FieldUUID).
	Scan(ctx, &v)

func (*DocumentSearchQuery) Unique

func (dsq *DocumentSearchQuery) Unique(unique bool) *DocumentSearchQuery

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

Where adds a new predicate for the DocumentSearchQuery builder.

func (*DocumentSearchQuery) WithDocument

func (dsq *DocumentSearchQuery) WithDocument(opts ...func(*DocumentQuery)) *DocumentSearchQuery

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

type DocumentSearchSelect

type DocumentSearchSelect struct {
	*DocumentSearchQuery
	// contains filtered or unexported fields
}

DocumentSearchSelect is the builder for selecting fields of DocumentSearch entities.

func (*DocumentSearchSelect) Aggregate

Aggregate adds the given aggregation functions to the selector query.

func (*DocumentSearchSelect) Bool

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

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

func (*DocumentSearchSelect) BoolX

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

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

func (*DocumentSearchSelect) Bools

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

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

func (*DocumentSearchSelect) BoolsX

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

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

func (*DocumentSearchSelect) Float64

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

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

func (*DocumentSearchSelect) Float64X

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

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

func (*DocumentSearchSelect) Float64s

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

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

func (*DocumentSearchSelect) Float64sX

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

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

func (*DocumentSearchSelect) Int

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

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

func (*DocumentSearchSelect) IntX

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

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

func (*DocumentSearchSelect) Ints

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

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

func (*DocumentSearchSelect) IntsX

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

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

func (*DocumentSearchSelect) Modify

func (dss *DocumentSearchSelect) Modify(modifiers ...func(s *sql.Selector)) *DocumentSearchSelect

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

func (*DocumentSearchSelect) Scan

func (dss *DocumentSearchSelect) Scan(ctx context.Context, v any) error

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

func (*DocumentSearchSelect) ScanX

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

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

func (*DocumentSearchSelect) String

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

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

func (*DocumentSearchSelect) StringX

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

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

func (*DocumentSearchSelect) Strings

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

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

func (*DocumentSearchSelect) StringsX

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

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

type DocumentSearchUpdate

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

DocumentSearchUpdate is the builder for updating DocumentSearch entities.

func (*DocumentSearchUpdate) ClearDocument

func (dsu *DocumentSearchUpdate) ClearDocument() *DocumentSearchUpdate

ClearDocument clears the "document" edge to the Document entity.

func (*DocumentSearchUpdate) Exec

func (dsu *DocumentSearchUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*DocumentSearchUpdate) ExecX

func (dsu *DocumentSearchUpdate) ExecX(ctx context.Context)

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

func (*DocumentSearchUpdate) Modify

func (dsu *DocumentSearchUpdate) Modify(modifiers ...func(u *sql.UpdateBuilder)) *DocumentSearchUpdate

Modify adds a statement modifier for attaching custom logic to the UPDATE statement.

func (*DocumentSearchUpdate) Mutation

Mutation returns the DocumentSearchMutation object of the builder.

func (*DocumentSearchUpdate) Save

func (dsu *DocumentSearchUpdate) Save(ctx context.Context) (int, error)

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

func (*DocumentSearchUpdate) SaveX

func (dsu *DocumentSearchUpdate) SaveX(ctx context.Context) int

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

func (*DocumentSearchUpdate) SetDocument

func (dsu *DocumentSearchUpdate) SetDocument(d *Document) *DocumentSearchUpdate

SetDocument sets the "document" edge to the Document entity.

func (*DocumentSearchUpdate) SetDocumentID

func (dsu *DocumentSearchUpdate) SetDocumentID(i int) *DocumentSearchUpdate

SetDocumentID sets the "document_id" field.

func (*DocumentSearchUpdate) SetNillableUUID

func (dsu *DocumentSearchUpdate) SetNillableUUID(u *uuid.UUID) *DocumentSearchUpdate

SetNillableUUID sets the "uuid" field if the given value is not nil.

func (*DocumentSearchUpdate) SetTs

SetTs sets the "ts" field.

func (*DocumentSearchUpdate) SetUUID

SetUUID sets the "uuid" field.

func (*DocumentSearchUpdate) SetUpdatedAt

func (dsu *DocumentSearchUpdate) SetUpdatedAt(t time.Time) *DocumentSearchUpdate

SetUpdatedAt sets the "updated_at" field.

func (*DocumentSearchUpdate) Where

Where appends a list predicates to the DocumentSearchUpdate builder.

type DocumentSearchUpdateOne

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

DocumentSearchUpdateOne is the builder for updating a single DocumentSearch entity.

func (*DocumentSearchUpdateOne) ClearDocument

func (dsuo *DocumentSearchUpdateOne) ClearDocument() *DocumentSearchUpdateOne

ClearDocument clears the "document" edge to the Document entity.

func (*DocumentSearchUpdateOne) Exec

func (dsuo *DocumentSearchUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*DocumentSearchUpdateOne) ExecX

func (dsuo *DocumentSearchUpdateOne) ExecX(ctx context.Context)

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

func (*DocumentSearchUpdateOne) Modify

func (dsuo *DocumentSearchUpdateOne) Modify(modifiers ...func(u *sql.UpdateBuilder)) *DocumentSearchUpdateOne

Modify adds a statement modifier for attaching custom logic to the UPDATE statement.

func (*DocumentSearchUpdateOne) Mutation

Mutation returns the DocumentSearchMutation object of the builder.

func (*DocumentSearchUpdateOne) Save

Save executes the query and returns the updated DocumentSearch entity.

func (*DocumentSearchUpdateOne) SaveX

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

func (*DocumentSearchUpdateOne) Select

func (dsuo *DocumentSearchUpdateOne) Select(field string, fields ...string) *DocumentSearchUpdateOne

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

func (*DocumentSearchUpdateOne) SetDocument

SetDocument sets the "document" edge to the Document entity.

func (*DocumentSearchUpdateOne) SetDocumentID

func (dsuo *DocumentSearchUpdateOne) SetDocumentID(i int) *DocumentSearchUpdateOne

SetDocumentID sets the "document_id" field.

func (*DocumentSearchUpdateOne) SetNillableUUID

func (dsuo *DocumentSearchUpdateOne) SetNillableUUID(u *uuid.UUID) *DocumentSearchUpdateOne

SetNillableUUID sets the "uuid" field if the given value is not nil.

func (*DocumentSearchUpdateOne) SetTs

SetTs sets the "ts" field.

func (*DocumentSearchUpdateOne) SetUUID

SetUUID sets the "uuid" field.

func (*DocumentSearchUpdateOne) SetUpdatedAt

SetUpdatedAt sets the "updated_at" field.

func (*DocumentSearchUpdateOne) Where

Where appends a list predicates to the DocumentSearchUpdate builder.

type DocumentSearches

type DocumentSearches []*DocumentSearch

DocumentSearches is a parsable slice of DocumentSearch.

type DocumentSelect

type DocumentSelect struct {
	*DocumentQuery
	// contains filtered or unexported fields
}

DocumentSelect is the builder for selecting fields of Document entities.

func (*DocumentSelect) Aggregate

func (ds *DocumentSelect) Aggregate(fns ...AggregateFunc) *DocumentSelect

Aggregate adds the given aggregation functions to the selector query.

func (*DocumentSelect) Bool

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

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

func (*DocumentSelect) BoolX

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

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

func (*DocumentSelect) Bools

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

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

func (*DocumentSelect) BoolsX

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

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

func (*DocumentSelect) Float64

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

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

func (*DocumentSelect) Float64X

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

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

func (*DocumentSelect) Float64s

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

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

func (*DocumentSelect) Float64sX

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

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

func (*DocumentSelect) Int

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

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

func (*DocumentSelect) IntX

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

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

func (*DocumentSelect) Ints

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

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

func (*DocumentSelect) IntsX

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

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

func (*DocumentSelect) Modify

func (ds *DocumentSelect) Modify(modifiers ...func(s *sql.Selector)) *DocumentSelect

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

func (*DocumentSelect) Scan

func (ds *DocumentSelect) Scan(ctx context.Context, v any) error

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

func (*DocumentSelect) ScanX

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

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

func (*DocumentSelect) String

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

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

func (*DocumentSelect) StringX

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

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

func (*DocumentSelect) Strings

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

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

func (*DocumentSelect) StringsX

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

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

type DocumentUpdate

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

DocumentUpdate is the builder for updating Document entities.

func (*DocumentUpdate) ClearContent

func (du *DocumentUpdate) ClearContent() *DocumentUpdate

ClearContent clears the value of the "content" field.

func (*DocumentUpdate) ClearContentHash

func (du *DocumentUpdate) ClearContentHash() *DocumentUpdate

ClearContentHash clears the value of the "content_hash" field.

func (*DocumentUpdate) ClearSearch

func (du *DocumentUpdate) ClearSearch() *DocumentUpdate

ClearSearch clears the "search" edge to the DocumentSearch entity.

func (*DocumentUpdate) ClearUser

func (du *DocumentUpdate) ClearUser() *DocumentUpdate

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

func (*DocumentUpdate) Exec

func (du *DocumentUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*DocumentUpdate) ExecX

func (du *DocumentUpdate) ExecX(ctx context.Context)

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

func (*DocumentUpdate) Modify

func (du *DocumentUpdate) Modify(modifiers ...func(u *sql.UpdateBuilder)) *DocumentUpdate

Modify adds a statement modifier for attaching custom logic to the UPDATE statement.

func (*DocumentUpdate) Mutation

func (du *DocumentUpdate) Mutation() *DocumentMutation

Mutation returns the DocumentMutation object of the builder.

func (*DocumentUpdate) Save

func (du *DocumentUpdate) Save(ctx context.Context) (int, error)

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

func (*DocumentUpdate) SaveX

func (du *DocumentUpdate) SaveX(ctx context.Context) int

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

func (*DocumentUpdate) SetContent

func (du *DocumentUpdate) SetContent(s string) *DocumentUpdate

SetContent sets the "content" field.

func (*DocumentUpdate) SetContentHash

func (du *DocumentUpdate) SetContentHash(s string) *DocumentUpdate

SetContentHash sets the "content_hash" field.

func (*DocumentUpdate) SetDescription

func (du *DocumentUpdate) SetDescription(s string) *DocumentUpdate

SetDescription sets the "description" field.

func (*DocumentUpdate) SetFilename

func (du *DocumentUpdate) SetFilename(s string) *DocumentUpdate

SetFilename sets the "filename" field.

func (*DocumentUpdate) SetFiletype

func (du *DocumentUpdate) SetFiletype(t types.Filetype) *DocumentUpdate

SetFiletype sets the "filetype" field.

func (*DocumentUpdate) SetNillableContent

func (du *DocumentUpdate) SetNillableContent(s *string) *DocumentUpdate

SetNillableContent sets the "content" field if the given value is not nil.

func (*DocumentUpdate) SetNillableContentHash

func (du *DocumentUpdate) SetNillableContentHash(s *string) *DocumentUpdate

SetNillableContentHash sets the "content_hash" field if the given value is not nil.

func (*DocumentUpdate) SetNillableSearchID

func (du *DocumentUpdate) SetNillableSearchID(id *int) *DocumentUpdate

SetNillableSearchID sets the "search" edge to the DocumentSearch entity by ID if the given value is not nil.

func (*DocumentUpdate) SetNillableUUID

func (du *DocumentUpdate) SetNillableUUID(u *uuid.UUID) *DocumentUpdate

SetNillableUUID sets the "uuid" field if the given value is not nil.

func (*DocumentUpdate) SetSearch

func (du *DocumentUpdate) SetSearch(d *DocumentSearch) *DocumentUpdate

SetSearch sets the "search" edge to the DocumentSearch entity.

func (*DocumentUpdate) SetSearchID

func (du *DocumentUpdate) SetSearchID(id int) *DocumentUpdate

SetSearchID sets the "search" edge to the DocumentSearch entity by ID.

func (*DocumentUpdate) SetTitle

func (du *DocumentUpdate) SetTitle(s string) *DocumentUpdate

SetTitle sets the "title" field.

func (*DocumentUpdate) SetUUID

func (du *DocumentUpdate) SetUUID(u uuid.UUID) *DocumentUpdate

SetUUID sets the "uuid" field.

func (*DocumentUpdate) SetUpdatedAt

func (du *DocumentUpdate) SetUpdatedAt(t time.Time) *DocumentUpdate

SetUpdatedAt sets the "updated_at" field.

func (*DocumentUpdate) SetUser

func (du *DocumentUpdate) SetUser(u *User) *DocumentUpdate

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

func (*DocumentUpdate) SetUserID

func (du *DocumentUpdate) SetUserID(id int) *DocumentUpdate

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

func (*DocumentUpdate) Where

func (du *DocumentUpdate) Where(ps ...predicate.Document) *DocumentUpdate

Where appends a list predicates to the DocumentUpdate builder.

type DocumentUpdateOne

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

DocumentUpdateOne is the builder for updating a single Document entity.

func (*DocumentUpdateOne) ClearContent

func (duo *DocumentUpdateOne) ClearContent() *DocumentUpdateOne

ClearContent clears the value of the "content" field.

func (*DocumentUpdateOne) ClearContentHash

func (duo *DocumentUpdateOne) ClearContentHash() *DocumentUpdateOne

ClearContentHash clears the value of the "content_hash" field.

func (*DocumentUpdateOne) ClearSearch

func (duo *DocumentUpdateOne) ClearSearch() *DocumentUpdateOne

ClearSearch clears the "search" edge to the DocumentSearch entity.

func (*DocumentUpdateOne) ClearUser

func (duo *DocumentUpdateOne) ClearUser() *DocumentUpdateOne

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

func (*DocumentUpdateOne) Exec

func (duo *DocumentUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*DocumentUpdateOne) ExecX

func (duo *DocumentUpdateOne) ExecX(ctx context.Context)

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

func (*DocumentUpdateOne) Modify

func (duo *DocumentUpdateOne) Modify(modifiers ...func(u *sql.UpdateBuilder)) *DocumentUpdateOne

Modify adds a statement modifier for attaching custom logic to the UPDATE statement.

func (*DocumentUpdateOne) Mutation

func (duo *DocumentUpdateOne) Mutation() *DocumentMutation

Mutation returns the DocumentMutation object of the builder.

func (*DocumentUpdateOne) Save

func (duo *DocumentUpdateOne) Save(ctx context.Context) (*Document, error)

Save executes the query and returns the updated Document entity.

func (*DocumentUpdateOne) SaveX

func (duo *DocumentUpdateOne) SaveX(ctx context.Context) *Document

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

func (*DocumentUpdateOne) Select

func (duo *DocumentUpdateOne) Select(field string, fields ...string) *DocumentUpdateOne

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

func (*DocumentUpdateOne) SetContent

func (duo *DocumentUpdateOne) SetContent(s string) *DocumentUpdateOne

SetContent sets the "content" field.

func (*DocumentUpdateOne) SetContentHash

func (duo *DocumentUpdateOne) SetContentHash(s string) *DocumentUpdateOne

SetContentHash sets the "content_hash" field.

func (*DocumentUpdateOne) SetDescription

func (duo *DocumentUpdateOne) SetDescription(s string) *DocumentUpdateOne

SetDescription sets the "description" field.

func (*DocumentUpdateOne) SetFilename

func (duo *DocumentUpdateOne) SetFilename(s string) *DocumentUpdateOne

SetFilename sets the "filename" field.

func (*DocumentUpdateOne) SetFiletype

func (duo *DocumentUpdateOne) SetFiletype(t types.Filetype) *DocumentUpdateOne

SetFiletype sets the "filetype" field.

func (*DocumentUpdateOne) SetNillableContent

func (duo *DocumentUpdateOne) SetNillableContent(s *string) *DocumentUpdateOne

SetNillableContent sets the "content" field if the given value is not nil.

func (*DocumentUpdateOne) SetNillableContentHash

func (duo *DocumentUpdateOne) SetNillableContentHash(s *string) *DocumentUpdateOne

SetNillableContentHash sets the "content_hash" field if the given value is not nil.

func (*DocumentUpdateOne) SetNillableSearchID

func (duo *DocumentUpdateOne) SetNillableSearchID(id *int) *DocumentUpdateOne

SetNillableSearchID sets the "search" edge to the DocumentSearch entity by ID if the given value is not nil.

func (*DocumentUpdateOne) SetNillableUUID

func (duo *DocumentUpdateOne) SetNillableUUID(u *uuid.UUID) *DocumentUpdateOne

SetNillableUUID sets the "uuid" field if the given value is not nil.

func (*DocumentUpdateOne) SetSearch

SetSearch sets the "search" edge to the DocumentSearch entity.

func (*DocumentUpdateOne) SetSearchID

func (duo *DocumentUpdateOne) SetSearchID(id int) *DocumentUpdateOne

SetSearchID sets the "search" edge to the DocumentSearch entity by ID.

func (*DocumentUpdateOne) SetTitle

func (duo *DocumentUpdateOne) SetTitle(s string) *DocumentUpdateOne

SetTitle sets the "title" field.

func (*DocumentUpdateOne) SetUUID

func (duo *DocumentUpdateOne) SetUUID(u uuid.UUID) *DocumentUpdateOne

SetUUID sets the "uuid" field.

func (*DocumentUpdateOne) SetUpdatedAt

func (duo *DocumentUpdateOne) SetUpdatedAt(t time.Time) *DocumentUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*DocumentUpdateOne) SetUser

func (duo *DocumentUpdateOne) SetUser(u *User) *DocumentUpdateOne

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

func (*DocumentUpdateOne) SetUserID

func (duo *DocumentUpdateOne) SetUserID(id int) *DocumentUpdateOne

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

func (*DocumentUpdateOne) Where

Where appends a list predicates to the DocumentUpdate builder.

type Documents

type Documents []*Document

Documents is a parsable slice of Document.

type HistoryDiff

type HistoryDiff[T any] struct {
	Old     *T
	New     *T
	Changes []Change
}

type Hook

type Hook = ent.Hook

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

type InterceptFunc

type InterceptFunc = ent.InterceptFunc

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

type Interceptor

type Interceptor = ent.Interceptor

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

type MutateFunc

type MutateFunc = ent.MutateFunc

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

type Mutation

type Mutation = ent.Mutation

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

type Mutator

type Mutator = ent.Mutator

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

type 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 Querier

type Querier = ent.Querier

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

type QuerierFunc

type QuerierFunc = ent.QuerierFunc

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

type Query

type Query = ent.Query

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

type QueryContext

type QueryContext = ent.QueryContext

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

type RollbackFunc

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

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

func (RollbackFunc) Rollback

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

Rollback calls f(ctx, m).

type RollbackHook

type RollbackHook func(Rollbacker) Rollbacker

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

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

type Rollbacker

type Rollbacker interface {
	Rollback(context.Context, *Tx) error
}

Rollbacker is the interface that wraps the Rollback method.

type TraverseFunc

type TraverseFunc = ent.TraverseFunc

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

type Traverser

type Traverser = ent.Traverser

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

type Tx

type Tx struct {

	// Document is the client for interacting with the Document builders.
	Document *DocumentClient
	// DocumentHistory is the client for interacting with the DocumentHistory builders.
	DocumentHistory *DocumentHistoryClient
	// DocumentSearch is the client for interacting with the DocumentSearch builders.
	DocumentSearch *DocumentSearchClient
	// User is the client for interacting with the User builders.
	User *UserClient
	// UserHistory is the client for interacting with the UserHistory builders.
	UserHistory *UserHistoryClient
	// contains filtered or unexported fields
}

Tx is a transactional client that is created by calling Client.Tx().

func TxFromContext

func TxFromContext(ctx context.Context) *Tx

TxFromContext returns a Tx stored inside a context, or nil if there isn't one.

func (*Tx) Client

func (tx *Tx) Client() *Client

Client returns a Client that binds to current transaction.

func (*Tx) Commit

func (tx *Tx) Commit() error

Commit commits the transaction.

func (*Tx) OnCommit

func (tx *Tx) OnCommit(f CommitHook)

OnCommit adds a hook to call on commit.

func (*Tx) OnRollback

func (tx *Tx) OnRollback(f RollbackHook)

OnRollback adds a hook to call on rollback.

func (*Tx) Rollback

func (tx *Tx) Rollback() error

Rollback rollbacks the transaction.

type User

type User struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// UUID holds the value of the "uuid" field.
	UUID uuid.UUID `json:"uuid,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// UpdatedAt holds the value of the "updated_at" field.
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	// FirstName holds the value of the "first_name" field.
	FirstName string `json:"first_name,omitempty"`
	// LastName holds the value of the "last_name" field.
	LastName string `json:"last_name,omitempty"`
	// Username holds the value of the "username" field.
	Username string `json:"username,omitempty"`
	// Email holds the value of the "email" field.
	Email string `json:"email,omitempty"`
	// Password holds the value of the "password" field.
	Password string `json:"-"`
	// IsAdmin holds the value of the "is_admin" field.
	IsAdmin bool `json:"is_admin,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the UserQuery when eager-loading is set.
	Edges UserEdges `json:"edges"`
	// contains filtered or unexported fields
}

User is the model entity for the User schema.

func (*User) History

func (u *User) History() *UserHistoryQuery

func (*User) QueryDocuments

func (u *User) QueryDocuments() *DocumentQuery

QueryDocuments queries the "documents" edge of the User entity.

func (*User) String

func (u *User) String() string

String implements the fmt.Stringer.

func (*User) Unwrap

func (u *User) Unwrap() *User

Unwrap unwraps the User entity that was returned from a transaction after it was closed, so that all future queries will be executed through the driver which created the transaction.

func (*User) Update

func (u *User) Update() *UserUpdateOne

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

type UserClient

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

UserClient is a client for the User schema.

func NewUserClient

func NewUserClient(c config) *UserClient

NewUserClient returns a client for the User from the given config.

func (*UserClient) Create

func (c *UserClient) Create() *UserCreate

Create returns a builder for creating a User entity.

func (*UserClient) CreateBulk

func (c *UserClient) CreateBulk(builders ...*UserCreate) *UserCreateBulk

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

func (*UserClient) Delete

func (c *UserClient) Delete() *UserDelete

Delete returns a delete builder for User.

func (*UserClient) DeleteOne

func (c *UserClient) DeleteOne(u *User) *UserDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*UserClient) DeleteOneID

func (c *UserClient) DeleteOneID(id int) *UserDeleteOne

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

func (*UserClient) Get

func (c *UserClient) Get(ctx context.Context, id int) (*User, error)

Get returns a User entity by its id.

func (*UserClient) GetX

func (c *UserClient) GetX(ctx context.Context, id int) *User

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

func (*UserClient) Hooks

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

Hooks returns the client hooks.

func (*UserClient) Intercept

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

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

func (*UserClient) Interceptors

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

Interceptors returns the client interceptors.

func (*UserClient) Query

func (c *UserClient) Query() *UserQuery

Query returns a query builder for User.

func (*UserClient) QueryDocuments

func (c *UserClient) QueryDocuments(u *User) *DocumentQuery

QueryDocuments queries the documents edge of a User.

func (*UserClient) Update

func (c *UserClient) Update() *UserUpdate

Update returns an update builder for User.

func (*UserClient) UpdateOne

func (c *UserClient) UpdateOne(u *User) *UserUpdateOne

UpdateOne returns an update builder for the given entity.

func (*UserClient) UpdateOneID

func (c *UserClient) UpdateOneID(id int) *UserUpdateOne

UpdateOneID returns an update builder for the given id.

func (*UserClient) Use

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

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

type UserCreate

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

UserCreate is the builder for creating a User entity.

func (*UserCreate) AddDocumentIDs

func (uc *UserCreate) AddDocumentIDs(ids ...int) *UserCreate

AddDocumentIDs adds the "documents" edge to the Document entity by IDs.

func (*UserCreate) AddDocuments

func (uc *UserCreate) AddDocuments(d ...*Document) *UserCreate

AddDocuments adds the "documents" edges to the Document entity.

func (*UserCreate) Exec

func (uc *UserCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*UserCreate) ExecX

func (uc *UserCreate) ExecX(ctx context.Context)

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

func (*UserCreate) Mutation

func (uc *UserCreate) Mutation() *UserMutation

Mutation returns the UserMutation object of the builder.

func (*UserCreate) Save

func (uc *UserCreate) Save(ctx context.Context) (*User, error)

Save creates the User in the database.

func (*UserCreate) SaveX

func (uc *UserCreate) SaveX(ctx context.Context) *User

SaveX calls Save and panics if Save returns an error.

func (*UserCreate) SetCreatedAt

func (uc *UserCreate) SetCreatedAt(t time.Time) *UserCreate

SetCreatedAt sets the "created_at" field.

func (*UserCreate) SetEmail

func (uc *UserCreate) SetEmail(s string) *UserCreate

SetEmail sets the "email" field.

func (*UserCreate) SetFirstName

func (uc *UserCreate) SetFirstName(s string) *UserCreate

SetFirstName sets the "first_name" field.

func (*UserCreate) SetIsAdmin

func (uc *UserCreate) SetIsAdmin(b bool) *UserCreate

SetIsAdmin sets the "is_admin" field.

func (*UserCreate) SetLastName

func (uc *UserCreate) SetLastName(s string) *UserCreate

SetLastName sets the "last_name" field.

func (*UserCreate) SetNillableCreatedAt

func (uc *UserCreate) SetNillableCreatedAt(t *time.Time) *UserCreate

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

func (*UserCreate) SetNillableIsAdmin

func (uc *UserCreate) SetNillableIsAdmin(b *bool) *UserCreate

SetNillableIsAdmin sets the "is_admin" field if the given value is not nil.

func (*UserCreate) SetNillableUUID

func (uc *UserCreate) SetNillableUUID(u *uuid.UUID) *UserCreate

SetNillableUUID sets the "uuid" field if the given value is not nil.

func (*UserCreate) SetNillableUpdatedAt

func (uc *UserCreate) SetNillableUpdatedAt(t *time.Time) *UserCreate

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

func (*UserCreate) SetPassword

func (uc *UserCreate) SetPassword(s string) *UserCreate

SetPassword sets the "password" field.

func (*UserCreate) SetUUID

func (uc *UserCreate) SetUUID(u uuid.UUID) *UserCreate

SetUUID sets the "uuid" field.

func (*UserCreate) SetUpdatedAt

func (uc *UserCreate) SetUpdatedAt(t time.Time) *UserCreate

SetUpdatedAt sets the "updated_at" field.

func (*UserCreate) SetUsername

func (uc *UserCreate) SetUsername(s string) *UserCreate

SetUsername sets the "username" field.

type UserCreateBulk

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

UserCreateBulk is the builder for creating many User entities in bulk.

func (*UserCreateBulk) Exec

func (ucb *UserCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*UserCreateBulk) ExecX

func (ucb *UserCreateBulk) ExecX(ctx context.Context)

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

func (*UserCreateBulk) Save

func (ucb *UserCreateBulk) Save(ctx context.Context) ([]*User, error)

Save creates the User entities in the database.

func (*UserCreateBulk) SaveX

func (ucb *UserCreateBulk) SaveX(ctx context.Context) []*User

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

type UserDelete

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

UserDelete is the builder for deleting a User entity.

func (*UserDelete) Exec

func (ud *UserDelete) Exec(ctx context.Context) (int, error)

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

func (*UserDelete) ExecX

func (ud *UserDelete) ExecX(ctx context.Context) int

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

func (*UserDelete) Where

func (ud *UserDelete) Where(ps ...predicate.User) *UserDelete

Where appends a list predicates to the UserDelete builder.

type UserDeleteOne

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

UserDeleteOne is the builder for deleting a single User entity.

func (*UserDeleteOne) Exec

func (udo *UserDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*UserDeleteOne) ExecX

func (udo *UserDeleteOne) ExecX(ctx context.Context)

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

func (*UserDeleteOne) Where

func (udo *UserDeleteOne) Where(ps ...predicate.User) *UserDeleteOne

Where appends a list predicates to the UserDelete builder.

type UserEdges

type UserEdges struct {
	// Documents holds the value of the documents edge.
	Documents []*Document `json:"documents,omitempty"`
	// contains filtered or unexported fields
}

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

func (UserEdges) DocumentsOrErr

func (e UserEdges) DocumentsOrErr() ([]*Document, error)

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

type UserGroupBy

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

UserGroupBy is the group-by builder for User entities.

func (*UserGroupBy) Aggregate

func (ugb *UserGroupBy) Aggregate(fns ...AggregateFunc) *UserGroupBy

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

func (*UserGroupBy) Bool

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

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

func (*UserGroupBy) BoolX

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

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

func (*UserGroupBy) Bools

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

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

func (*UserGroupBy) BoolsX

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

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

func (*UserGroupBy) Float64

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

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

func (*UserGroupBy) Float64X

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

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

func (*UserGroupBy) Float64s

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

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

func (*UserGroupBy) Float64sX

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

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

func (*UserGroupBy) Int

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

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

func (*UserGroupBy) IntX

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

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

func (*UserGroupBy) Ints

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

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

func (*UserGroupBy) IntsX

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

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

func (*UserGroupBy) Scan

func (ugb *UserGroupBy) Scan(ctx context.Context, v any) error

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

func (*UserGroupBy) ScanX

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

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

func (*UserGroupBy) String

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

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

func (*UserGroupBy) StringX

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

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

func (*UserGroupBy) Strings

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

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

func (*UserGroupBy) StringsX

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

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

type UserHistories

type UserHistories []*UserHistory

UserHistories is a parsable slice of UserHistory.

type UserHistory

type UserHistory struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// HistoryTime holds the value of the "history_time" field.
	HistoryTime time.Time `json:"history_time,omitempty"`
	// Ref holds the value of the "ref" field.
	Ref int `json:"ref,omitempty"`
	// Operation holds the value of the "operation" field.
	Operation enthistory.OpType `json:"operation,omitempty"`
	// UpdatedBy holds the value of the "updated_by" field.
	UpdatedBy *string `json:"updated_by,omitempty"`
	// UUID holds the value of the "uuid" field.
	UUID uuid.UUID `json:"uuid,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// UpdatedAt holds the value of the "updated_at" field.
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	// FirstName holds the value of the "first_name" field.
	FirstName string `json:"first_name,omitempty"`
	// LastName holds the value of the "last_name" field.
	LastName string `json:"last_name,omitempty"`
	// Username holds the value of the "username" field.
	Username string `json:"username,omitempty"`
	// Email holds the value of the "email" field.
	Email string `json:"email,omitempty"`
	// Password holds the value of the "password" field.
	Password string `json:"-"`
	// IsAdmin holds the value of the "is_admin" field.
	IsAdmin bool `json:"is_admin,omitempty"`
	// contains filtered or unexported fields
}

UserHistory is the model entity for the UserHistory schema.

func (*UserHistory) Diff

func (uh *UserHistory) Diff(history *UserHistory) (*HistoryDiff[UserHistory], error)

func (*UserHistory) Next

func (uh *UserHistory) Next(ctx context.Context) (*UserHistory, error)

func (*UserHistory) Prev

func (uh *UserHistory) Prev(ctx context.Context) (*UserHistory, error)

func (*UserHistory) Restore

func (uh *UserHistory) Restore(ctx context.Context) (*User, error)

func (*UserHistory) String

func (uh *UserHistory) String() string

String implements the fmt.Stringer.

func (*UserHistory) Unwrap

func (uh *UserHistory) Unwrap() *UserHistory

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

func (uh *UserHistory) Update() *UserHistoryUpdateOne

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

type UserHistoryClient

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

UserHistoryClient is a client for the UserHistory schema.

func NewUserHistoryClient

func NewUserHistoryClient(c config) *UserHistoryClient

NewUserHistoryClient returns a client for the UserHistory from the given config.

func (*UserHistoryClient) Create

func (c *UserHistoryClient) Create() *UserHistoryCreate

Create returns a builder for creating a UserHistory entity.

func (*UserHistoryClient) CreateBulk

func (c *UserHistoryClient) CreateBulk(builders ...*UserHistoryCreate) *UserHistoryCreateBulk

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

func (*UserHistoryClient) Delete

func (c *UserHistoryClient) Delete() *UserHistoryDelete

Delete returns a delete builder for UserHistory.

func (*UserHistoryClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*UserHistoryClient) DeleteOneID

func (c *UserHistoryClient) DeleteOneID(id int) *UserHistoryDeleteOne

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

func (*UserHistoryClient) Get

func (c *UserHistoryClient) Get(ctx context.Context, id int) (*UserHistory, error)

Get returns a UserHistory entity by its id.

func (*UserHistoryClient) GetX

func (c *UserHistoryClient) GetX(ctx context.Context, id int) *UserHistory

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

func (*UserHistoryClient) Hooks

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

Hooks returns the client hooks.

func (*UserHistoryClient) Intercept

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

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

func (*UserHistoryClient) Interceptors

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

Interceptors returns the client interceptors.

func (*UserHistoryClient) Query

func (c *UserHistoryClient) Query() *UserHistoryQuery

Query returns a query builder for UserHistory.

func (*UserHistoryClient) Update

func (c *UserHistoryClient) Update() *UserHistoryUpdate

Update returns an update builder for UserHistory.

func (*UserHistoryClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*UserHistoryClient) UpdateOneID

func (c *UserHistoryClient) UpdateOneID(id int) *UserHistoryUpdateOne

UpdateOneID returns an update builder for the given id.

func (*UserHistoryClient) Use

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

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

type UserHistoryCreate

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

UserHistoryCreate is the builder for creating a UserHistory entity.

func (*UserHistoryCreate) Exec

func (uhc *UserHistoryCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*UserHistoryCreate) ExecX

func (uhc *UserHistoryCreate) ExecX(ctx context.Context)

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

func (*UserHistoryCreate) Mutation

func (uhc *UserHistoryCreate) Mutation() *UserHistoryMutation

Mutation returns the UserHistoryMutation object of the builder.

func (*UserHistoryCreate) Save

func (uhc *UserHistoryCreate) Save(ctx context.Context) (*UserHistory, error)

Save creates the UserHistory in the database.

func (*UserHistoryCreate) SaveX

func (uhc *UserHistoryCreate) SaveX(ctx context.Context) *UserHistory

SaveX calls Save and panics if Save returns an error.

func (*UserHistoryCreate) SetCreatedAt

func (uhc *UserHistoryCreate) SetCreatedAt(t time.Time) *UserHistoryCreate

SetCreatedAt sets the "created_at" field.

func (*UserHistoryCreate) SetEmail

func (uhc *UserHistoryCreate) SetEmail(s string) *UserHistoryCreate

SetEmail sets the "email" field.

func (*UserHistoryCreate) SetFirstName

func (uhc *UserHistoryCreate) SetFirstName(s string) *UserHistoryCreate

SetFirstName sets the "first_name" field.

func (*UserHistoryCreate) SetHistoryTime

func (uhc *UserHistoryCreate) SetHistoryTime(t time.Time) *UserHistoryCreate

SetHistoryTime sets the "history_time" field.

func (*UserHistoryCreate) SetIsAdmin

func (uhc *UserHistoryCreate) SetIsAdmin(b bool) *UserHistoryCreate

SetIsAdmin sets the "is_admin" field.

func (*UserHistoryCreate) SetLastName

func (uhc *UserHistoryCreate) SetLastName(s string) *UserHistoryCreate

SetLastName sets the "last_name" field.

func (*UserHistoryCreate) SetNillableCreatedAt

func (uhc *UserHistoryCreate) SetNillableCreatedAt(t *time.Time) *UserHistoryCreate

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

func (*UserHistoryCreate) SetNillableHistoryTime

func (uhc *UserHistoryCreate) SetNillableHistoryTime(t *time.Time) *UserHistoryCreate

SetNillableHistoryTime sets the "history_time" field if the given value is not nil.

func (*UserHistoryCreate) SetNillableIsAdmin

func (uhc *UserHistoryCreate) SetNillableIsAdmin(b *bool) *UserHistoryCreate

SetNillableIsAdmin sets the "is_admin" field if the given value is not nil.

func (*UserHistoryCreate) SetNillableRef

func (uhc *UserHistoryCreate) SetNillableRef(i *int) *UserHistoryCreate

SetNillableRef sets the "ref" field if the given value is not nil.

func (*UserHistoryCreate) SetNillableUUID

func (uhc *UserHistoryCreate) SetNillableUUID(u *uuid.UUID) *UserHistoryCreate

SetNillableUUID sets the "uuid" field if the given value is not nil.

func (*UserHistoryCreate) SetNillableUpdatedAt

func (uhc *UserHistoryCreate) SetNillableUpdatedAt(t *time.Time) *UserHistoryCreate

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

func (*UserHistoryCreate) SetNillableUpdatedBy

func (uhc *UserHistoryCreate) SetNillableUpdatedBy(s *string) *UserHistoryCreate

SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil.

func (*UserHistoryCreate) SetOperation

func (uhc *UserHistoryCreate) SetOperation(et enthistory.OpType) *UserHistoryCreate

SetOperation sets the "operation" field.

func (*UserHistoryCreate) SetPassword

func (uhc *UserHistoryCreate) SetPassword(s string) *UserHistoryCreate

SetPassword sets the "password" field.

func (*UserHistoryCreate) SetRef

func (uhc *UserHistoryCreate) SetRef(i int) *UserHistoryCreate

SetRef sets the "ref" field.

func (*UserHistoryCreate) SetUUID

func (uhc *UserHistoryCreate) SetUUID(u uuid.UUID) *UserHistoryCreate

SetUUID sets the "uuid" field.

func (*UserHistoryCreate) SetUpdatedAt

func (uhc *UserHistoryCreate) SetUpdatedAt(t time.Time) *UserHistoryCreate

SetUpdatedAt sets the "updated_at" field.

func (*UserHistoryCreate) SetUpdatedBy

func (uhc *UserHistoryCreate) SetUpdatedBy(s string) *UserHistoryCreate

SetUpdatedBy sets the "updated_by" field.

func (*UserHistoryCreate) SetUsername

func (uhc *UserHistoryCreate) SetUsername(s string) *UserHistoryCreate

SetUsername sets the "username" field.

type UserHistoryCreateBulk

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

UserHistoryCreateBulk is the builder for creating many UserHistory entities in bulk.

func (*UserHistoryCreateBulk) Exec

func (uhcb *UserHistoryCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*UserHistoryCreateBulk) ExecX

func (uhcb *UserHistoryCreateBulk) ExecX(ctx context.Context)

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

func (*UserHistoryCreateBulk) Save

func (uhcb *UserHistoryCreateBulk) Save(ctx context.Context) ([]*UserHistory, error)

Save creates the UserHistory entities in the database.

func (*UserHistoryCreateBulk) SaveX

func (uhcb *UserHistoryCreateBulk) SaveX(ctx context.Context) []*UserHistory

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

type UserHistoryDelete

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

UserHistoryDelete is the builder for deleting a UserHistory entity.

func (*UserHistoryDelete) Exec

func (uhd *UserHistoryDelete) Exec(ctx context.Context) (int, error)

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

func (*UserHistoryDelete) ExecX

func (uhd *UserHistoryDelete) ExecX(ctx context.Context) int

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

func (*UserHistoryDelete) Where

Where appends a list predicates to the UserHistoryDelete builder.

type UserHistoryDeleteOne

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

UserHistoryDeleteOne is the builder for deleting a single UserHistory entity.

func (*UserHistoryDeleteOne) Exec

func (uhdo *UserHistoryDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*UserHistoryDeleteOne) ExecX

func (uhdo *UserHistoryDeleteOne) ExecX(ctx context.Context)

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

func (*UserHistoryDeleteOne) Where

Where appends a list predicates to the UserHistoryDelete builder.

type UserHistoryGroupBy

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

UserHistoryGroupBy is the group-by builder for UserHistory entities.

func (*UserHistoryGroupBy) Aggregate

func (uhgb *UserHistoryGroupBy) Aggregate(fns ...AggregateFunc) *UserHistoryGroupBy

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

func (*UserHistoryGroupBy) Bool

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

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

func (*UserHistoryGroupBy) BoolX

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

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

func (*UserHistoryGroupBy) Bools

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

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

func (*UserHistoryGroupBy) BoolsX

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

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

func (*UserHistoryGroupBy) Float64

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

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

func (*UserHistoryGroupBy) Float64X

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

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

func (*UserHistoryGroupBy) Float64s

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

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

func (*UserHistoryGroupBy) Float64sX

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

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

func (*UserHistoryGroupBy) Int

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

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

func (*UserHistoryGroupBy) IntX

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

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

func (*UserHistoryGroupBy) Ints

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

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

func (*UserHistoryGroupBy) IntsX

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

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

func (*UserHistoryGroupBy) Scan

func (uhgb *UserHistoryGroupBy) Scan(ctx context.Context, v any) error

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

func (*UserHistoryGroupBy) ScanX

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

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

func (*UserHistoryGroupBy) String

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

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

func (*UserHistoryGroupBy) StringX

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

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

func (*UserHistoryGroupBy) Strings

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

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

func (*UserHistoryGroupBy) StringsX

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

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

type UserHistoryMutation

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

UserHistoryMutation represents an operation that mutates the UserHistory nodes in the graph.

func (*UserHistoryMutation) AddField

func (m *UserHistoryMutation) 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 (*UserHistoryMutation) AddRef

func (m *UserHistoryMutation) AddRef(i int)

AddRef adds i to the "ref" field.

func (*UserHistoryMutation) AddedEdges

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

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

func (*UserHistoryMutation) AddedField

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

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

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

func (*UserHistoryMutation) AddedIDs

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

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

func (*UserHistoryMutation) AddedRef

func (m *UserHistoryMutation) AddedRef() (r int, exists bool)

AddedRef returns the value that was added to the "ref" field in this mutation.

func (*UserHistoryMutation) ClearEdge

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

func (m *UserHistoryMutation) 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 (*UserHistoryMutation) ClearIsAdmin

func (m *UserHistoryMutation) ClearIsAdmin()

ClearIsAdmin clears the value of the "is_admin" field.

func (*UserHistoryMutation) ClearRef

func (m *UserHistoryMutation) ClearRef()

ClearRef clears the value of the "ref" field.

func (*UserHistoryMutation) ClearUpdatedBy

func (m *UserHistoryMutation) ClearUpdatedBy()

ClearUpdatedBy clears the value of the "updated_by" field.

func (*UserHistoryMutation) ClearedEdges

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

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

func (*UserHistoryMutation) ClearedFields

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

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

func (UserHistoryMutation) Client

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

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

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

func (*UserHistoryMutation) EdgeCleared

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

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

func (*UserHistoryMutation) Email

func (m *UserHistoryMutation) Email() (r string, exists bool)

Email returns the value of the "email" field in the mutation.

func (*UserHistoryMutation) Field

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

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

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

func (*UserHistoryMutation) Fields

func (m *UserHistoryMutation) 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 (*UserHistoryMutation) FirstName

func (m *UserHistoryMutation) FirstName() (r string, exists bool)

FirstName returns the value of the "first_name" field in the mutation.

func (*UserHistoryMutation) HistoryTime

func (m *UserHistoryMutation) HistoryTime() (r time.Time, exists bool)

HistoryTime returns the value of the "history_time" field in the mutation.

func (*UserHistoryMutation) ID

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

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

func (*UserHistoryMutation) IDs

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

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

func (*UserHistoryMutation) IsAdmin

func (m *UserHistoryMutation) IsAdmin() (r bool, exists bool)

IsAdmin returns the value of the "is_admin" field in the mutation.

func (*UserHistoryMutation) IsAdminCleared

func (m *UserHistoryMutation) IsAdminCleared() bool

IsAdminCleared returns if the "is_admin" field was cleared in this mutation.

func (*UserHistoryMutation) LastName

func (m *UserHistoryMutation) LastName() (r string, exists bool)

LastName returns the value of the "last_name" field in the mutation.

func (*UserHistoryMutation) OldCreatedAt

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

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

func (m *UserHistoryMutation) OldEmail(ctx context.Context) (v string, err error)

OldEmail returns the old "email" field's value of the UserHistory entity. If the UserHistory 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 (*UserHistoryMutation) OldField

func (m *UserHistoryMutation) 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 (*UserHistoryMutation) OldFirstName

func (m *UserHistoryMutation) OldFirstName(ctx context.Context) (v string, err error)

OldFirstName returns the old "first_name" field's value of the UserHistory entity. If the UserHistory 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 (*UserHistoryMutation) OldHistoryTime

func (m *UserHistoryMutation) OldHistoryTime(ctx context.Context) (v time.Time, err error)

OldHistoryTime returns the old "history_time" field's value of the UserHistory entity. If the UserHistory 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 (*UserHistoryMutation) OldIsAdmin

func (m *UserHistoryMutation) OldIsAdmin(ctx context.Context) (v bool, err error)

OldIsAdmin returns the old "is_admin" field's value of the UserHistory entity. If the UserHistory 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 (*UserHistoryMutation) OldLastName

func (m *UserHistoryMutation) OldLastName(ctx context.Context) (v string, err error)

OldLastName returns the old "last_name" field's value of the UserHistory entity. If the UserHistory 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 (*UserHistoryMutation) OldOperation

func (m *UserHistoryMutation) OldOperation(ctx context.Context) (v enthistory.OpType, err error)

OldOperation returns the old "operation" field's value of the UserHistory entity. If the UserHistory 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 (*UserHistoryMutation) OldPassword

func (m *UserHistoryMutation) OldPassword(ctx context.Context) (v string, err error)

OldPassword returns the old "password" field's value of the UserHistory entity. If the UserHistory 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 (*UserHistoryMutation) OldRef

func (m *UserHistoryMutation) OldRef(ctx context.Context) (v int, err error)

OldRef returns the old "ref" field's value of the UserHistory entity. If the UserHistory 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 (*UserHistoryMutation) OldUUID

func (m *UserHistoryMutation) OldUUID(ctx context.Context) (v uuid.UUID, err error)

OldUUID returns the old "uuid" field's value of the UserHistory entity. If the UserHistory 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 (*UserHistoryMutation) OldUpdatedAt

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

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

func (m *UserHistoryMutation) OldUpdatedBy(ctx context.Context) (v *string, err error)

OldUpdatedBy returns the old "updated_by" field's value of the UserHistory entity. If the UserHistory 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 (*UserHistoryMutation) OldUsername

func (m *UserHistoryMutation) OldUsername(ctx context.Context) (v string, err error)

OldUsername returns the old "username" field's value of the UserHistory entity. If the UserHistory 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 (*UserHistoryMutation) Op

func (m *UserHistoryMutation) Op() Op

Op returns the operation name.

func (*UserHistoryMutation) Operation

func (m *UserHistoryMutation) Operation() (r enthistory.OpType, exists bool)

Operation returns the value of the "operation" field in the mutation.

func (*UserHistoryMutation) Password

func (m *UserHistoryMutation) Password() (r string, exists bool)

Password returns the value of the "password" field in the mutation.

func (*UserHistoryMutation) Ref

func (m *UserHistoryMutation) Ref() (r int, exists bool)

Ref returns the value of the "ref" field in the mutation.

func (*UserHistoryMutation) RefCleared

func (m *UserHistoryMutation) RefCleared() bool

RefCleared returns if the "ref" field was cleared in this mutation.

func (*UserHistoryMutation) RemovedEdges

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

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

func (*UserHistoryMutation) RemovedIDs

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

func (m *UserHistoryMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*UserHistoryMutation) ResetEdge

func (m *UserHistoryMutation) 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 (*UserHistoryMutation) ResetEmail

func (m *UserHistoryMutation) ResetEmail()

ResetEmail resets all changes to the "email" field.

func (*UserHistoryMutation) ResetField

func (m *UserHistoryMutation) 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 (*UserHistoryMutation) ResetFirstName

func (m *UserHistoryMutation) ResetFirstName()

ResetFirstName resets all changes to the "first_name" field.

func (*UserHistoryMutation) ResetHistoryTime

func (m *UserHistoryMutation) ResetHistoryTime()

ResetHistoryTime resets all changes to the "history_time" field.

func (*UserHistoryMutation) ResetIsAdmin

func (m *UserHistoryMutation) ResetIsAdmin()

ResetIsAdmin resets all changes to the "is_admin" field.

func (*UserHistoryMutation) ResetLastName

func (m *UserHistoryMutation) ResetLastName()

ResetLastName resets all changes to the "last_name" field.

func (*UserHistoryMutation) ResetOperation

func (m *UserHistoryMutation) ResetOperation()

ResetOperation resets all changes to the "operation" field.

func (*UserHistoryMutation) ResetPassword

func (m *UserHistoryMutation) ResetPassword()

ResetPassword resets all changes to the "password" field.

func (*UserHistoryMutation) ResetRef

func (m *UserHistoryMutation) ResetRef()

ResetRef resets all changes to the "ref" field.

func (*UserHistoryMutation) ResetUUID

func (m *UserHistoryMutation) ResetUUID()

ResetUUID resets all changes to the "uuid" field.

func (*UserHistoryMutation) ResetUpdatedAt

func (m *UserHistoryMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*UserHistoryMutation) ResetUpdatedBy

func (m *UserHistoryMutation) ResetUpdatedBy()

ResetUpdatedBy resets all changes to the "updated_by" field.

func (*UserHistoryMutation) ResetUsername

func (m *UserHistoryMutation) ResetUsername()

ResetUsername resets all changes to the "username" field.

func (*UserHistoryMutation) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*UserHistoryMutation) SetEmail

func (m *UserHistoryMutation) SetEmail(s string)

SetEmail sets the "email" field.

func (*UserHistoryMutation) SetField

func (m *UserHistoryMutation) 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 (*UserHistoryMutation) SetFirstName

func (m *UserHistoryMutation) SetFirstName(s string)

SetFirstName sets the "first_name" field.

func (*UserHistoryMutation) SetHistoryTime

func (m *UserHistoryMutation) SetHistoryTime(t time.Time)

SetHistoryTime sets the "history_time" field.

func (*UserHistoryMutation) SetIsAdmin

func (m *UserHistoryMutation) SetIsAdmin(b bool)

SetIsAdmin sets the "is_admin" field.

func (*UserHistoryMutation) SetLastName

func (m *UserHistoryMutation) SetLastName(s string)

SetLastName sets the "last_name" field.

func (*UserHistoryMutation) SetOp

func (m *UserHistoryMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*UserHistoryMutation) SetOperation

func (m *UserHistoryMutation) SetOperation(et enthistory.OpType)

SetOperation sets the "operation" field.

func (*UserHistoryMutation) SetPassword

func (m *UserHistoryMutation) SetPassword(s string)

SetPassword sets the "password" field.

func (*UserHistoryMutation) SetRef

func (m *UserHistoryMutation) SetRef(i int)

SetRef sets the "ref" field.

func (*UserHistoryMutation) SetUUID

func (m *UserHistoryMutation) SetUUID(u uuid.UUID)

SetUUID sets the "uuid" field.

func (*UserHistoryMutation) SetUpdatedAt

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

SetUpdatedAt sets the "updated_at" field.

func (*UserHistoryMutation) SetUpdatedBy

func (m *UserHistoryMutation) SetUpdatedBy(s string)

SetUpdatedBy sets the "updated_by" field.

func (*UserHistoryMutation) SetUsername

func (m *UserHistoryMutation) SetUsername(s string)

SetUsername sets the "username" field.

func (UserHistoryMutation) Tx

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

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

func (*UserHistoryMutation) Type

func (m *UserHistoryMutation) Type() string

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

func (*UserHistoryMutation) UUID

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

UUID returns the value of the "uuid" field in the mutation.

func (*UserHistoryMutation) UpdatedAt

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

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

func (*UserHistoryMutation) UpdatedBy

func (m *UserHistoryMutation) UpdatedBy() (r string, exists bool)

UpdatedBy returns the value of the "updated_by" field in the mutation.

func (*UserHistoryMutation) UpdatedByCleared

func (m *UserHistoryMutation) UpdatedByCleared() bool

UpdatedByCleared returns if the "updated_by" field was cleared in this mutation.

func (*UserHistoryMutation) Username

func (m *UserHistoryMutation) Username() (r string, exists bool)

Username returns the value of the "username" field in the mutation.

func (*UserHistoryMutation) Where

func (m *UserHistoryMutation) Where(ps ...predicate.UserHistory)

Where appends a list predicates to the UserHistoryMutation builder.

func (*UserHistoryMutation) WhereP

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

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

type UserHistoryQuery

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

UserHistoryQuery is the builder for querying UserHistory entities.

func (*UserHistoryQuery) Aggregate

func (uhq *UserHistoryQuery) Aggregate(fns ...AggregateFunc) *UserHistorySelect

Aggregate returns a UserHistorySelect configured with the given aggregations.

func (*UserHistoryQuery) All

func (uhq *UserHistoryQuery) All(ctx context.Context) ([]*UserHistory, error)

All executes the query and returns a list of UserHistories.

func (*UserHistoryQuery) AllX

func (uhq *UserHistoryQuery) AllX(ctx context.Context) []*UserHistory

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

func (*UserHistoryQuery) AsOf

func (uhq *UserHistoryQuery) AsOf(ctx context.Context, time time.Time) (*UserHistory, error)

func (*UserHistoryQuery) Clone

func (uhq *UserHistoryQuery) Clone() *UserHistoryQuery

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

func (*UserHistoryQuery) Count

func (uhq *UserHistoryQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*UserHistoryQuery) CountX

func (uhq *UserHistoryQuery) CountX(ctx context.Context) int

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

func (*UserHistoryQuery) Earliest

func (uhq *UserHistoryQuery) Earliest(ctx context.Context) (*UserHistory, error)

func (*UserHistoryQuery) Exist

func (uhq *UserHistoryQuery) Exist(ctx context.Context) (bool, error)

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

func (*UserHistoryQuery) ExistX

func (uhq *UserHistoryQuery) ExistX(ctx context.Context) bool

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

func (*UserHistoryQuery) First

func (uhq *UserHistoryQuery) First(ctx context.Context) (*UserHistory, error)

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

func (*UserHistoryQuery) FirstID

func (uhq *UserHistoryQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*UserHistoryQuery) FirstIDX

func (uhq *UserHistoryQuery) FirstIDX(ctx context.Context) int

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

func (*UserHistoryQuery) FirstX

func (uhq *UserHistoryQuery) FirstX(ctx context.Context) *UserHistory

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

func (*UserHistoryQuery) GroupBy

func (uhq *UserHistoryQuery) GroupBy(field string, fields ...string) *UserHistoryGroupBy

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

client.UserHistory.Query().
	GroupBy(userhistory.FieldHistoryTime).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*UserHistoryQuery) IDs

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

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

func (*UserHistoryQuery) IDsX

func (uhq *UserHistoryQuery) IDsX(ctx context.Context) []int

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

func (*UserHistoryQuery) Latest

func (uhq *UserHistoryQuery) Latest(ctx context.Context) (*UserHistory, error)

func (*UserHistoryQuery) Limit

func (uhq *UserHistoryQuery) Limit(limit int) *UserHistoryQuery

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

func (*UserHistoryQuery) Modify

func (uhq *UserHistoryQuery) Modify(modifiers ...func(s *sql.Selector)) *UserHistorySelect

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

func (*UserHistoryQuery) Offset

func (uhq *UserHistoryQuery) Offset(offset int) *UserHistoryQuery

Offset to start from.

func (*UserHistoryQuery) Only

func (uhq *UserHistoryQuery) Only(ctx context.Context) (*UserHistory, error)

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

func (*UserHistoryQuery) OnlyID

func (uhq *UserHistoryQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*UserHistoryQuery) OnlyIDX

func (uhq *UserHistoryQuery) OnlyIDX(ctx context.Context) int

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

func (*UserHistoryQuery) OnlyX

func (uhq *UserHistoryQuery) OnlyX(ctx context.Context) *UserHistory

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

func (*UserHistoryQuery) Order

func (uhq *UserHistoryQuery) Order(o ...OrderFunc) *UserHistoryQuery

Order specifies how the records should be ordered.

func (*UserHistoryQuery) Select

func (uhq *UserHistoryQuery) Select(fields ...string) *UserHistorySelect

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

client.UserHistory.Query().
	Select(userhistory.FieldHistoryTime).
	Scan(ctx, &v)

func (*UserHistoryQuery) Unique

func (uhq *UserHistoryQuery) Unique(unique bool) *UserHistoryQuery

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

Where adds a new predicate for the UserHistoryQuery builder.

type UserHistorySelect

type UserHistorySelect struct {
	*UserHistoryQuery
	// contains filtered or unexported fields
}

UserHistorySelect is the builder for selecting fields of UserHistory entities.

func (*UserHistorySelect) Aggregate

func (uhs *UserHistorySelect) Aggregate(fns ...AggregateFunc) *UserHistorySelect

Aggregate adds the given aggregation functions to the selector query.

func (*UserHistorySelect) Bool

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

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

func (*UserHistorySelect) BoolX

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

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

func (*UserHistorySelect) Bools

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

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

func (*UserHistorySelect) BoolsX

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

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

func (*UserHistorySelect) Float64

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

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

func (*UserHistorySelect) Float64X

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

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

func (*UserHistorySelect) Float64s

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

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

func (*UserHistorySelect) Float64sX

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

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

func (*UserHistorySelect) Int

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

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

func (*UserHistorySelect) IntX

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

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

func (*UserHistorySelect) Ints

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

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

func (*UserHistorySelect) IntsX

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

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

func (*UserHistorySelect) Modify

func (uhs *UserHistorySelect) Modify(modifiers ...func(s *sql.Selector)) *UserHistorySelect

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

func (*UserHistorySelect) Scan

func (uhs *UserHistorySelect) Scan(ctx context.Context, v any) error

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

func (*UserHistorySelect) ScanX

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

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

func (*UserHistorySelect) String

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

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

func (*UserHistorySelect) StringX

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

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

func (*UserHistorySelect) Strings

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

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

func (*UserHistorySelect) StringsX

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

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

type UserHistoryUpdate

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

UserHistoryUpdate is the builder for updating UserHistory entities.

func (*UserHistoryUpdate) ClearIsAdmin

func (uhu *UserHistoryUpdate) ClearIsAdmin() *UserHistoryUpdate

ClearIsAdmin clears the value of the "is_admin" field.

func (*UserHistoryUpdate) Exec

func (uhu *UserHistoryUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*UserHistoryUpdate) ExecX

func (uhu *UserHistoryUpdate) ExecX(ctx context.Context)

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

func (*UserHistoryUpdate) Modify

func (uhu *UserHistoryUpdate) Modify(modifiers ...func(u *sql.UpdateBuilder)) *UserHistoryUpdate

Modify adds a statement modifier for attaching custom logic to the UPDATE statement.

func (*UserHistoryUpdate) Mutation

func (uhu *UserHistoryUpdate) Mutation() *UserHistoryMutation

Mutation returns the UserHistoryMutation object of the builder.

func (*UserHistoryUpdate) Save

func (uhu *UserHistoryUpdate) Save(ctx context.Context) (int, error)

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

func (*UserHistoryUpdate) SaveX

func (uhu *UserHistoryUpdate) SaveX(ctx context.Context) int

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

func (*UserHistoryUpdate) SetEmail

func (uhu *UserHistoryUpdate) SetEmail(s string) *UserHistoryUpdate

SetEmail sets the "email" field.

func (*UserHistoryUpdate) SetFirstName

func (uhu *UserHistoryUpdate) SetFirstName(s string) *UserHistoryUpdate

SetFirstName sets the "first_name" field.

func (*UserHistoryUpdate) SetIsAdmin

func (uhu *UserHistoryUpdate) SetIsAdmin(b bool) *UserHistoryUpdate

SetIsAdmin sets the "is_admin" field.

func (*UserHistoryUpdate) SetLastName

func (uhu *UserHistoryUpdate) SetLastName(s string) *UserHistoryUpdate

SetLastName sets the "last_name" field.

func (*UserHistoryUpdate) SetNillableIsAdmin

func (uhu *UserHistoryUpdate) SetNillableIsAdmin(b *bool) *UserHistoryUpdate

SetNillableIsAdmin sets the "is_admin" field if the given value is not nil.

func (*UserHistoryUpdate) SetNillableUUID

func (uhu *UserHistoryUpdate) SetNillableUUID(u *uuid.UUID) *UserHistoryUpdate

SetNillableUUID sets the "uuid" field if the given value is not nil.

func (*UserHistoryUpdate) SetPassword

func (uhu *UserHistoryUpdate) SetPassword(s string) *UserHistoryUpdate

SetPassword sets the "password" field.

func (*UserHistoryUpdate) SetUUID

func (uhu *UserHistoryUpdate) SetUUID(u uuid.UUID) *UserHistoryUpdate

SetUUID sets the "uuid" field.

func (*UserHistoryUpdate) SetUpdatedAt

func (uhu *UserHistoryUpdate) SetUpdatedAt(t time.Time) *UserHistoryUpdate

SetUpdatedAt sets the "updated_at" field.

func (*UserHistoryUpdate) SetUsername

func (uhu *UserHistoryUpdate) SetUsername(s string) *UserHistoryUpdate

SetUsername sets the "username" field.

func (*UserHistoryUpdate) Where

Where appends a list predicates to the UserHistoryUpdate builder.

type UserHistoryUpdateOne

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

UserHistoryUpdateOne is the builder for updating a single UserHistory entity.

func (*UserHistoryUpdateOne) ClearIsAdmin

func (uhuo *UserHistoryUpdateOne) ClearIsAdmin() *UserHistoryUpdateOne

ClearIsAdmin clears the value of the "is_admin" field.

func (*UserHistoryUpdateOne) Exec

func (uhuo *UserHistoryUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*UserHistoryUpdateOne) ExecX

func (uhuo *UserHistoryUpdateOne) ExecX(ctx context.Context)

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

func (*UserHistoryUpdateOne) Modify

func (uhuo *UserHistoryUpdateOne) Modify(modifiers ...func(u *sql.UpdateBuilder)) *UserHistoryUpdateOne

Modify adds a statement modifier for attaching custom logic to the UPDATE statement.

func (*UserHistoryUpdateOne) Mutation

func (uhuo *UserHistoryUpdateOne) Mutation() *UserHistoryMutation

Mutation returns the UserHistoryMutation object of the builder.

func (*UserHistoryUpdateOne) Save

Save executes the query and returns the updated UserHistory entity.

func (*UserHistoryUpdateOne) SaveX

func (uhuo *UserHistoryUpdateOne) SaveX(ctx context.Context) *UserHistory

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

func (*UserHistoryUpdateOne) Select

func (uhuo *UserHistoryUpdateOne) Select(field string, fields ...string) *UserHistoryUpdateOne

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

func (*UserHistoryUpdateOne) SetEmail

SetEmail sets the "email" field.

func (*UserHistoryUpdateOne) SetFirstName

func (uhuo *UserHistoryUpdateOne) SetFirstName(s string) *UserHistoryUpdateOne

SetFirstName sets the "first_name" field.

func (*UserHistoryUpdateOne) SetIsAdmin

func (uhuo *UserHistoryUpdateOne) SetIsAdmin(b bool) *UserHistoryUpdateOne

SetIsAdmin sets the "is_admin" field.

func (*UserHistoryUpdateOne) SetLastName

func (uhuo *UserHistoryUpdateOne) SetLastName(s string) *UserHistoryUpdateOne

SetLastName sets the "last_name" field.

func (*UserHistoryUpdateOne) SetNillableIsAdmin

func (uhuo *UserHistoryUpdateOne) SetNillableIsAdmin(b *bool) *UserHistoryUpdateOne

SetNillableIsAdmin sets the "is_admin" field if the given value is not nil.

func (*UserHistoryUpdateOne) SetNillableUUID

func (uhuo *UserHistoryUpdateOne) SetNillableUUID(u *uuid.UUID) *UserHistoryUpdateOne

SetNillableUUID sets the "uuid" field if the given value is not nil.

func (*UserHistoryUpdateOne) SetPassword

func (uhuo *UserHistoryUpdateOne) SetPassword(s string) *UserHistoryUpdateOne

SetPassword sets the "password" field.

func (*UserHistoryUpdateOne) SetUUID

SetUUID sets the "uuid" field.

func (*UserHistoryUpdateOne) SetUpdatedAt

func (uhuo *UserHistoryUpdateOne) SetUpdatedAt(t time.Time) *UserHistoryUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*UserHistoryUpdateOne) SetUsername

func (uhuo *UserHistoryUpdateOne) SetUsername(s string) *UserHistoryUpdateOne

SetUsername sets the "username" field.

func (*UserHistoryUpdateOne) Where

Where appends a list predicates to the UserHistoryUpdate builder.

type UserMutation

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

UserMutation represents an operation that mutates the User nodes in the graph.

func (*UserMutation) AddDocumentIDs

func (m *UserMutation) AddDocumentIDs(ids ...int)

AddDocumentIDs adds the "documents" edge to the Document entity by ids.

func (*UserMutation) AddField

func (m *UserMutation) AddField(name string, value ent.Value) error

AddField adds the value to the field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*UserMutation) AddedEdges

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

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

func (*UserMutation) AddedField

func (m *UserMutation) AddedField(name string) (ent.Value, bool)

AddedField returns the numeric value that was incremented/decremented on a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*UserMutation) AddedFields

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

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*UserMutation) AddedIDs

func (m *UserMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*UserMutation) ClearDocuments

func (m *UserMutation) ClearDocuments()

ClearDocuments clears the "documents" edge to the Document entity.

func (*UserMutation) ClearEdge

func (m *UserMutation) ClearEdge(name string) error

ClearEdge clears the value of the edge with the given name. It returns an error if that edge is not defined in the schema.

func (*UserMutation) ClearField

func (m *UserMutation) ClearField(name string) error

ClearField clears the value of the field with the given name. It returns an error if the field is not defined in the schema.

func (*UserMutation) ClearIsAdmin

func (m *UserMutation) ClearIsAdmin()

ClearIsAdmin clears the value of the "is_admin" field.

func (*UserMutation) ClearedEdges

func (m *UserMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*UserMutation) ClearedFields

func (m *UserMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (UserMutation) Client

func (m UserMutation) Client() *Client

Client returns a new `ent.Client` from the mutation. If the mutation was executed in a transaction (ent.Tx), a transactional client is returned.

func (*UserMutation) CreateHistoryFromCreate

func (m *UserMutation) CreateHistoryFromCreate(ctx context.Context) error

func (*UserMutation) CreateHistoryFromDelete

func (m *UserMutation) CreateHistoryFromDelete(ctx context.Context) error

func (*UserMutation) CreateHistoryFromUpdate

func (m *UserMutation) CreateHistoryFromUpdate(ctx context.Context) error

func (*UserMutation) CreatedAt

func (m *UserMutation) CreatedAt() (r time.Time, exists bool)

CreatedAt returns the value of the "created_at" field in the mutation.

func (*UserMutation) DocumentsCleared

func (m *UserMutation) DocumentsCleared() bool

DocumentsCleared reports if the "documents" edge to the Document entity was cleared.

func (*UserMutation) DocumentsIDs

func (m *UserMutation) DocumentsIDs() (ids []int)

DocumentsIDs returns the "documents" edge IDs in the mutation.

func (*UserMutation) EdgeCleared

func (m *UserMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*UserMutation) Email

func (m *UserMutation) Email() (r string, exists bool)

Email returns the value of the "email" field in the mutation.

func (*UserMutation) Field

func (m *UserMutation) Field(name string) (ent.Value, bool)

Field returns the value of a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*UserMutation) FieldCleared

func (m *UserMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*UserMutation) Fields

func (m *UserMutation) Fields() []string

Fields returns all fields that were changed during this mutation. Note that in order to get all numeric fields that were incremented/decremented, call AddedFields().

func (*UserMutation) FirstName

func (m *UserMutation) FirstName() (r string, exists bool)

FirstName returns the value of the "first_name" field in the mutation.

func (*UserMutation) ID

func (m *UserMutation) ID() (id int, exists bool)

ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.

func (*UserMutation) IDs

func (m *UserMutation) IDs(ctx context.Context) ([]int, error)

IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.

func (*UserMutation) IsAdmin

func (m *UserMutation) IsAdmin() (r bool, exists bool)

IsAdmin returns the value of the "is_admin" field in the mutation.

func (*UserMutation) IsAdminCleared

func (m *UserMutation) IsAdminCleared() bool

IsAdminCleared returns if the "is_admin" field was cleared in this mutation.

func (*UserMutation) LastName

func (m *UserMutation) LastName() (r string, exists bool)

LastName returns the value of the "last_name" field in the mutation.

func (*UserMutation) OldCreatedAt

func (m *UserMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)

OldCreatedAt returns the old "created_at" field's value of the User entity. If the User object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*UserMutation) OldEmail

func (m *UserMutation) OldEmail(ctx context.Context) (v string, err error)

OldEmail returns the old "email" field's value of the User entity. If the User object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*UserMutation) OldField

func (m *UserMutation) OldField(ctx context.Context, name string) (ent.Value, error)

OldField returns the old value of the field from the database. An error is returned if the mutation operation is not UpdateOne, or the query to the database failed.

func (*UserMutation) OldFirstName

func (m *UserMutation) OldFirstName(ctx context.Context) (v string, err error)

OldFirstName returns the old "first_name" field's value of the User entity. If the User object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*UserMutation) OldIsAdmin

func (m *UserMutation) OldIsAdmin(ctx context.Context) (v bool, err error)

OldIsAdmin returns the old "is_admin" field's value of the User entity. If the User object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*UserMutation) OldLastName

func (m *UserMutation) OldLastName(ctx context.Context) (v string, err error)

OldLastName returns the old "last_name" field's value of the User entity. If the User object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*UserMutation) OldPassword

func (m *UserMutation) OldPassword(ctx context.Context) (v string, err error)

OldPassword returns the old "password" field's value of the User entity. If the User object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*UserMutation) OldUUID

func (m *UserMutation) OldUUID(ctx context.Context) (v uuid.UUID, err error)

OldUUID returns the old "uuid" field's value of the User entity. If the User object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*UserMutation) OldUpdatedAt

func (m *UserMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)

OldUpdatedAt returns the old "updated_at" field's value of the User entity. If the User object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*UserMutation) OldUsername

func (m *UserMutation) OldUsername(ctx context.Context) (v string, err error)

OldUsername returns the old "username" field's value of the User entity. If the User object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*UserMutation) Op

func (m *UserMutation) Op() Op

Op returns the operation name.

func (*UserMutation) Password

func (m *UserMutation) Password() (r string, exists bool)

Password returns the value of the "password" field in the mutation.

func (*UserMutation) RemoveDocumentIDs

func (m *UserMutation) RemoveDocumentIDs(ids ...int)

RemoveDocumentIDs removes the "documents" edge to the Document entity by IDs.

func (*UserMutation) RemovedDocumentsIDs

func (m *UserMutation) RemovedDocumentsIDs() (ids []int)

RemovedDocuments returns the removed IDs of the "documents" edge to the Document entity.

func (*UserMutation) RemovedEdges

func (m *UserMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*UserMutation) RemovedIDs

func (m *UserMutation) RemovedIDs(name string) []ent.Value

RemovedIDs returns all IDs (to other nodes) that were removed for the edge with the given name in this mutation.

func (*UserMutation) ResetCreatedAt

func (m *UserMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*UserMutation) ResetDocuments

func (m *UserMutation) ResetDocuments()

ResetDocuments resets all changes to the "documents" edge.

func (*UserMutation) ResetEdge

func (m *UserMutation) ResetEdge(name string) error

ResetEdge resets all changes to the edge with the given name in this mutation. It returns an error if the edge is not defined in the schema.

func (*UserMutation) ResetEmail

func (m *UserMutation) ResetEmail()

ResetEmail resets all changes to the "email" field.

func (*UserMutation) ResetField

func (m *UserMutation) ResetField(name string) error

ResetField resets all changes in the mutation for the field with the given name. It returns an error if the field is not defined in the schema.

func (*UserMutation) ResetFirstName

func (m *UserMutation) ResetFirstName()

ResetFirstName resets all changes to the "first_name" field.

func (*UserMutation) ResetIsAdmin

func (m *UserMutation) ResetIsAdmin()

ResetIsAdmin resets all changes to the "is_admin" field.

func (*UserMutation) ResetLastName

func (m *UserMutation) ResetLastName()

ResetLastName resets all changes to the "last_name" field.

func (*UserMutation) ResetPassword

func (m *UserMutation) ResetPassword()

ResetPassword resets all changes to the "password" field.

func (*UserMutation) ResetUUID

func (m *UserMutation) ResetUUID()

ResetUUID resets all changes to the "uuid" field.

func (*UserMutation) ResetUpdatedAt

func (m *UserMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*UserMutation) ResetUsername

func (m *UserMutation) ResetUsername()

ResetUsername resets all changes to the "username" field.

func (*UserMutation) SetCreatedAt

func (m *UserMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" field.

func (*UserMutation) SetEmail

func (m *UserMutation) SetEmail(s string)

SetEmail sets the "email" field.

func (*UserMutation) SetField

func (m *UserMutation) SetField(name string, value ent.Value) error

SetField sets the value of a field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*UserMutation) SetFirstName

func (m *UserMutation) SetFirstName(s string)

SetFirstName sets the "first_name" field.

func (*UserMutation) SetIsAdmin

func (m *UserMutation) SetIsAdmin(b bool)

SetIsAdmin sets the "is_admin" field.

func (*UserMutation) SetLastName

func (m *UserMutation) SetLastName(s string)

SetLastName sets the "last_name" field.

func (*UserMutation) SetOp

func (m *UserMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*UserMutation) SetPassword

func (m *UserMutation) SetPassword(s string)

SetPassword sets the "password" field.

func (*UserMutation) SetUUID

func (m *UserMutation) SetUUID(u uuid.UUID)

SetUUID sets the "uuid" field.

func (*UserMutation) SetUpdatedAt

func (m *UserMutation) SetUpdatedAt(t time.Time)

SetUpdatedAt sets the "updated_at" field.

func (*UserMutation) SetUsername

func (m *UserMutation) SetUsername(s string)

SetUsername sets the "username" field.

func (UserMutation) Tx

func (m UserMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*UserMutation) Type

func (m *UserMutation) Type() string

Type returns the node type of this mutation (User).

func (*UserMutation) UUID

func (m *UserMutation) UUID() (r uuid.UUID, exists bool)

UUID returns the value of the "uuid" field in the mutation.

func (*UserMutation) UpdatedAt

func (m *UserMutation) UpdatedAt() (r time.Time, exists bool)

UpdatedAt returns the value of the "updated_at" field in the mutation.

func (*UserMutation) Username

func (m *UserMutation) Username() (r string, exists bool)

Username returns the value of the "username" field in the mutation.

func (*UserMutation) Where

func (m *UserMutation) Where(ps ...predicate.User)

Where appends a list predicates to the UserMutation builder.

func (*UserMutation) WhereP

func (m *UserMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the UserMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type UserQuery

type UserQuery struct {
	// contains filtered or unexported fields
}

UserQuery is the builder for querying User entities.

func (*UserQuery) Aggregate

func (uq *UserQuery) Aggregate(fns ...AggregateFunc) *UserSelect

Aggregate returns a UserSelect configured with the given aggregations.

func (*UserQuery) All

func (uq *UserQuery) All(ctx context.Context) ([]*User, error)

All executes the query and returns a list of Users.

func (*UserQuery) AllX

func (uq *UserQuery) AllX(ctx context.Context) []*User

AllX is like All, but panics if an error occurs.

func (*UserQuery) Clone

func (uq *UserQuery) Clone() *UserQuery

Clone returns a duplicate of the UserQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*UserQuery) Count

func (uq *UserQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*UserQuery) CountX

func (uq *UserQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*UserQuery) Exist

func (uq *UserQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*UserQuery) ExistX

func (uq *UserQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*UserQuery) First

func (uq *UserQuery) First(ctx context.Context) (*User, error)

First returns the first User entity from the query. Returns a *NotFoundError when no User was found.

func (*UserQuery) FirstID

func (uq *UserQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first User ID from the query. Returns a *NotFoundError when no User ID was found.

func (*UserQuery) FirstIDX

func (uq *UserQuery) FirstIDX(ctx context.Context) int

FirstIDX is like FirstID, but panics if an error occurs.

func (*UserQuery) FirstX

func (uq *UserQuery) FirstX(ctx context.Context) *User

FirstX is like First, but panics if an error occurs.

func (*UserQuery) GroupBy

func (uq *UserQuery) GroupBy(field string, fields ...string) *UserGroupBy

GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.

Example:

var v []struct {
	UUID uuid.UUID `json:"uuid,omitempty"`
	Count int `json:"count,omitempty"`
}

client.User.Query().
	GroupBy(user.FieldUUID).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*UserQuery) IDs

func (uq *UserQuery) IDs(ctx context.Context) (ids []int, err error)

IDs executes the query and returns a list of User IDs.

func (*UserQuery) IDsX

func (uq *UserQuery) IDsX(ctx context.Context) []int

IDsX is like IDs, but panics if an error occurs.

func (*UserQuery) Limit

func (uq *UserQuery) Limit(limit int) *UserQuery

Limit the number of records to be returned by this query.

func (*UserQuery) Modify

func (uq *UserQuery) Modify(modifiers ...func(s *sql.Selector)) *UserSelect

Modify adds a query modifier for attaching custom logic to queries.

func (*UserQuery) Offset

func (uq *UserQuery) Offset(offset int) *UserQuery

Offset to start from.

func (*UserQuery) Only

func (uq *UserQuery) Only(ctx context.Context) (*User, error)

Only returns a single User entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one User entity is found. Returns a *NotFoundError when no User entities are found.

func (*UserQuery) OnlyID

func (uq *UserQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID is like Only, but returns the only User ID in the query. Returns a *NotSingularError when more than one User ID is found. Returns a *NotFoundError when no entities are found.

func (*UserQuery) OnlyIDX

func (uq *UserQuery) OnlyIDX(ctx context.Context) int

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*UserQuery) OnlyX

func (uq *UserQuery) OnlyX(ctx context.Context) *User

OnlyX is like Only, but panics if an error occurs.

func (*UserQuery) Order

func (uq *UserQuery) Order(o ...OrderFunc) *UserQuery

Order specifies how the records should be ordered.

func (*UserQuery) QueryDocuments

func (uq *UserQuery) QueryDocuments() *DocumentQuery

QueryDocuments chains the current query on the "documents" edge.

func (*UserQuery) Select

func (uq *UserQuery) Select(fields ...string) *UserSelect

Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.

Example:

var v []struct {
	UUID uuid.UUID `json:"uuid,omitempty"`
}

client.User.Query().
	Select(user.FieldUUID).
	Scan(ctx, &v)

func (*UserQuery) Unique

func (uq *UserQuery) Unique(unique bool) *UserQuery

Unique configures the query builder to filter duplicate records on query. By default, unique is set to true, and can be disabled using this method.

func (*UserQuery) Where

func (uq *UserQuery) Where(ps ...predicate.User) *UserQuery

Where adds a new predicate for the UserQuery builder.

func (*UserQuery) WithDocuments

func (uq *UserQuery) WithDocuments(opts ...func(*DocumentQuery)) *UserQuery

WithDocuments tells the query-builder to eager-load the nodes that are connected to the "documents" edge. The optional arguments are used to configure the query builder of the edge.

type UserSelect

type UserSelect struct {
	*UserQuery
	// contains filtered or unexported fields
}

UserSelect is the builder for selecting fields of User entities.

func (*UserSelect) Aggregate

func (us *UserSelect) Aggregate(fns ...AggregateFunc) *UserSelect

Aggregate adds the given aggregation functions to the selector query.

func (*UserSelect) Bool

func (s *UserSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*UserSelect) BoolX

func (s *UserSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*UserSelect) Bools

func (s *UserSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*UserSelect) BoolsX

func (s *UserSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*UserSelect) Float64

func (s *UserSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*UserSelect) Float64X

func (s *UserSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*UserSelect) Float64s

func (s *UserSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*UserSelect) Float64sX

func (s *UserSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*UserSelect) Int

func (s *UserSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*UserSelect) IntX

func (s *UserSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*UserSelect) Ints

func (s *UserSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*UserSelect) IntsX

func (s *UserSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*UserSelect) Modify

func (us *UserSelect) Modify(modifiers ...func(s *sql.Selector)) *UserSelect

Modify adds a query modifier for attaching custom logic to queries.

func (*UserSelect) Scan

func (us *UserSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*UserSelect) ScanX

func (s *UserSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*UserSelect) String

func (s *UserSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*UserSelect) StringX

func (s *UserSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*UserSelect) Strings

func (s *UserSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*UserSelect) StringsX

func (s *UserSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type UserUpdate

type UserUpdate struct {
	// contains filtered or unexported fields
}

UserUpdate is the builder for updating User entities.

func (*UserUpdate) AddDocumentIDs

func (uu *UserUpdate) AddDocumentIDs(ids ...int) *UserUpdate

AddDocumentIDs adds the "documents" edge to the Document entity by IDs.

func (*UserUpdate) AddDocuments

func (uu *UserUpdate) AddDocuments(d ...*Document) *UserUpdate

AddDocuments adds the "documents" edges to the Document entity.

func (*UserUpdate) ClearDocuments

func (uu *UserUpdate) ClearDocuments() *UserUpdate

ClearDocuments clears all "documents" edges to the Document entity.

func (*UserUpdate) ClearIsAdmin

func (uu *UserUpdate) ClearIsAdmin() *UserUpdate

ClearIsAdmin clears the value of the "is_admin" field.

func (*UserUpdate) Exec

func (uu *UserUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*UserUpdate) ExecX

func (uu *UserUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserUpdate) Modify

func (uu *UserUpdate) Modify(modifiers ...func(u *sql.UpdateBuilder)) *UserUpdate

Modify adds a statement modifier for attaching custom logic to the UPDATE statement.

func (*UserUpdate) Mutation

func (uu *UserUpdate) Mutation() *UserMutation

Mutation returns the UserMutation object of the builder.

func (*UserUpdate) RemoveDocumentIDs

func (uu *UserUpdate) RemoveDocumentIDs(ids ...int) *UserUpdate

RemoveDocumentIDs removes the "documents" edge to Document entities by IDs.

func (*UserUpdate) RemoveDocuments

func (uu *UserUpdate) RemoveDocuments(d ...*Document) *UserUpdate

RemoveDocuments removes "documents" edges to Document entities.

func (*UserUpdate) Save

func (uu *UserUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*UserUpdate) SaveX

func (uu *UserUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*UserUpdate) SetEmail

func (uu *UserUpdate) SetEmail(s string) *UserUpdate

SetEmail sets the "email" field.

func (*UserUpdate) SetFirstName

func (uu *UserUpdate) SetFirstName(s string) *UserUpdate

SetFirstName sets the "first_name" field.

func (*UserUpdate) SetIsAdmin

func (uu *UserUpdate) SetIsAdmin(b bool) *UserUpdate

SetIsAdmin sets the "is_admin" field.

func (*UserUpdate) SetLastName

func (uu *UserUpdate) SetLastName(s string) *UserUpdate

SetLastName sets the "last_name" field.

func (*UserUpdate) SetNillableIsAdmin

func (uu *UserUpdate) SetNillableIsAdmin(b *bool) *UserUpdate

SetNillableIsAdmin sets the "is_admin" field if the given value is not nil.

func (*UserUpdate) SetNillableUUID

func (uu *UserUpdate) SetNillableUUID(u *uuid.UUID) *UserUpdate

SetNillableUUID sets the "uuid" field if the given value is not nil.

func (*UserUpdate) SetPassword

func (uu *UserUpdate) SetPassword(s string) *UserUpdate

SetPassword sets the "password" field.

func (*UserUpdate) SetUUID

func (uu *UserUpdate) SetUUID(u uuid.UUID) *UserUpdate

SetUUID sets the "uuid" field.

func (*UserUpdate) SetUpdatedAt

func (uu *UserUpdate) SetUpdatedAt(t time.Time) *UserUpdate

SetUpdatedAt sets the "updated_at" field.

func (*UserUpdate) SetUsername

func (uu *UserUpdate) SetUsername(s string) *UserUpdate

SetUsername sets the "username" field.

func (*UserUpdate) Where

func (uu *UserUpdate) Where(ps ...predicate.User) *UserUpdate

Where appends a list predicates to the UserUpdate builder.

type UserUpdateOne

type UserUpdateOne struct {
	// contains filtered or unexported fields
}

UserUpdateOne is the builder for updating a single User entity.

func (*UserUpdateOne) AddDocumentIDs

func (uuo *UserUpdateOne) AddDocumentIDs(ids ...int) *UserUpdateOne

AddDocumentIDs adds the "documents" edge to the Document entity by IDs.

func (*UserUpdateOne) AddDocuments

func (uuo *UserUpdateOne) AddDocuments(d ...*Document) *UserUpdateOne

AddDocuments adds the "documents" edges to the Document entity.

func (*UserUpdateOne) ClearDocuments

func (uuo *UserUpdateOne) ClearDocuments() *UserUpdateOne

ClearDocuments clears all "documents" edges to the Document entity.

func (*UserUpdateOne) ClearIsAdmin

func (uuo *UserUpdateOne) ClearIsAdmin() *UserUpdateOne

ClearIsAdmin clears the value of the "is_admin" field.

func (*UserUpdateOne) Exec

func (uuo *UserUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*UserUpdateOne) ExecX

func (uuo *UserUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserUpdateOne) Modify

func (uuo *UserUpdateOne) Modify(modifiers ...func(u *sql.UpdateBuilder)) *UserUpdateOne

Modify adds a statement modifier for attaching custom logic to the UPDATE statement.

func (*UserUpdateOne) Mutation

func (uuo *UserUpdateOne) Mutation() *UserMutation

Mutation returns the UserMutation object of the builder.

func (*UserUpdateOne) RemoveDocumentIDs

func (uuo *UserUpdateOne) RemoveDocumentIDs(ids ...int) *UserUpdateOne

RemoveDocumentIDs removes the "documents" edge to Document entities by IDs.

func (*UserUpdateOne) RemoveDocuments

func (uuo *UserUpdateOne) RemoveDocuments(d ...*Document) *UserUpdateOne

RemoveDocuments removes "documents" edges to Document entities.

func (*UserUpdateOne) Save

func (uuo *UserUpdateOne) Save(ctx context.Context) (*User, error)

Save executes the query and returns the updated User entity.

func (*UserUpdateOne) SaveX

func (uuo *UserUpdateOne) SaveX(ctx context.Context) *User

SaveX is like Save, but panics if an error occurs.

func (*UserUpdateOne) Select

func (uuo *UserUpdateOne) Select(field string, fields ...string) *UserUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*UserUpdateOne) SetEmail

func (uuo *UserUpdateOne) SetEmail(s string) *UserUpdateOne

SetEmail sets the "email" field.

func (*UserUpdateOne) SetFirstName

func (uuo *UserUpdateOne) SetFirstName(s string) *UserUpdateOne

SetFirstName sets the "first_name" field.

func (*UserUpdateOne) SetIsAdmin

func (uuo *UserUpdateOne) SetIsAdmin(b bool) *UserUpdateOne

SetIsAdmin sets the "is_admin" field.

func (*UserUpdateOne) SetLastName

func (uuo *UserUpdateOne) SetLastName(s string) *UserUpdateOne

SetLastName sets the "last_name" field.

func (*UserUpdateOne) SetNillableIsAdmin

func (uuo *UserUpdateOne) SetNillableIsAdmin(b *bool) *UserUpdateOne

SetNillableIsAdmin sets the "is_admin" field if the given value is not nil.

func (*UserUpdateOne) SetNillableUUID

func (uuo *UserUpdateOne) SetNillableUUID(u *uuid.UUID) *UserUpdateOne

SetNillableUUID sets the "uuid" field if the given value is not nil.

func (*UserUpdateOne) SetPassword

func (uuo *UserUpdateOne) SetPassword(s string) *UserUpdateOne

SetPassword sets the "password" field.

func (*UserUpdateOne) SetUUID

func (uuo *UserUpdateOne) SetUUID(u uuid.UUID) *UserUpdateOne

SetUUID sets the "uuid" field.

func (*UserUpdateOne) SetUpdatedAt

func (uuo *UserUpdateOne) SetUpdatedAt(t time.Time) *UserUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*UserUpdateOne) SetUsername

func (uuo *UserUpdateOne) SetUsername(s string) *UserUpdateOne

SetUsername sets the "username" field.

func (*UserUpdateOne) Where

func (uuo *UserUpdateOne) Where(ps ...predicate.User) *UserUpdateOne

Where appends a list predicates to the UserUpdate builder.

type Users

type Users []*User

Users is a parsable slice of User.

type ValidationError

type ValidationError struct {
	Name string // Field or edge name.
	// contains filtered or unexported fields
}

ValidationError returns when validating a field or edge fails.

func (*ValidationError) Error

func (e *ValidationError) Error() string

Error implements the error interface.

func (*ValidationError) Unwrap

func (e *ValidationError) Unwrap() error

Unwrap implements the errors.Wrapper interface.

type Value

type Value = ent.Value

ent aliases to avoid import conflicts in user's code.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL