ent

package
v0.0.0-...-02ad720 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2024 License: AGPL-3.0 Imports: 28 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.
	TypeAttachment       = "Attachment"
	TypeFollow           = "Follow"
	TypeImage            = "Image"
	TypeInstanceMetadata = "InstanceMetadata"
	TypeNote             = "Note"
	TypeUser             = "User"
)

Variables

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

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

Functions

func Asc

func Asc(fields ...string) func(*sql.Selector)

Asc applies the given fields in ASC order.

func Desc

func Desc(fields ...string) func(*sql.Selector)

Desc applies the given fields in DESC order.

func IsConstraintError

func IsConstraintError(err error) bool

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

func IsNotFound

func IsNotFound(err error) bool

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

func IsNotLoaded

func IsNotLoaded(err error) bool

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

func IsNotSingular

func IsNotSingular(err error) bool

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

func IsValidationError

func IsValidationError(err error) bool

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

func MaskNotFound

func MaskNotFound(err error) error

MaskNotFound masks not found error.

func NewContext

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

NewContext returns a new context with the given Client attached.

func NewTxContext

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

NewTxContext returns a new context with the given Tx attached.

Types

type AggregateFunc

type AggregateFunc func(*sql.Selector) string

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

func As

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

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

func Count

func Count() AggregateFunc

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

func Max

func Max(field string) AggregateFunc

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

func Mean

func Mean(field string) AggregateFunc

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

func Min

func Min(field string) AggregateFunc

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

func Sum

func Sum(field string) AggregateFunc

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

type Attachment

type Attachment struct {

	// ID of the ent.
	ID uuid.UUID `json:"id,omitempty"`
	// IsRemote holds the value of the "isRemote" field.
	IsRemote bool `json:"isRemote,omitempty"`
	// URI holds the value of the "uri" field.
	URI string `json:"uri,omitempty"`
	// Extensions holds the value of the "extensions" field.
	Extensions versia.Extensions `json:"extensions,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"`
	// Description holds the value of the "description" field.
	Description string `json:"description,omitempty"`
	// Sha256 holds the value of the "sha256" field.
	Sha256 []byte `json:"sha256,omitempty"`
	// Size holds the value of the "size" field.
	Size int `json:"size,omitempty"`
	// Blurhash holds the value of the "blurhash" field.
	Blurhash *string `json:"blurhash,omitempty"`
	// Height holds the value of the "height" field.
	Height *int `json:"height,omitempty"`
	// Width holds the value of the "width" field.
	Width *int `json:"width,omitempty"`
	// Fps holds the value of the "fps" field.
	Fps *int `json:"fps,omitempty"`
	// MimeType holds the value of the "mimeType" field.
	MimeType string `json:"mimeType,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the AttachmentQuery when eager-loading is set.
	Edges AttachmentEdges `json:"edges"`
	// contains filtered or unexported fields
}

Attachment is the model entity for the Attachment schema.

func (*Attachment) QueryAuthor

func (a *Attachment) QueryAuthor() *UserQuery

QueryAuthor queries the "author" edge of the Attachment entity.

func (*Attachment) String

func (a *Attachment) String() string

String implements the fmt.Stringer.

func (*Attachment) Unwrap

func (a *Attachment) Unwrap() *Attachment

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

func (a *Attachment) Update() *AttachmentUpdateOne

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

func (*Attachment) Value

func (a *Attachment) Value(name string) (ent.Value, error)

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

type AttachmentClient

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

AttachmentClient is a client for the Attachment schema.

func NewAttachmentClient

func NewAttachmentClient(c config) *AttachmentClient

NewAttachmentClient returns a client for the Attachment from the given config.

func (*AttachmentClient) Create

func (c *AttachmentClient) Create() *AttachmentCreate

Create returns a builder for creating a Attachment entity.

func (*AttachmentClient) CreateBulk

func (c *AttachmentClient) CreateBulk(builders ...*AttachmentCreate) *AttachmentCreateBulk

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

func (*AttachmentClient) Delete

func (c *AttachmentClient) Delete() *AttachmentDelete

Delete returns a delete builder for Attachment.

func (*AttachmentClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*AttachmentClient) DeleteOneID

func (c *AttachmentClient) DeleteOneID(id uuid.UUID) *AttachmentDeleteOne

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

func (*AttachmentClient) Get

Get returns a Attachment entity by its id.

func (*AttachmentClient) GetX

func (c *AttachmentClient) GetX(ctx context.Context, id uuid.UUID) *Attachment

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

func (*AttachmentClient) Hooks

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

Hooks returns the client hooks.

func (*AttachmentClient) Intercept

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

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

func (*AttachmentClient) Interceptors

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

Interceptors returns the client interceptors.

func (*AttachmentClient) MapCreateBulk

func (c *AttachmentClient) MapCreateBulk(slice any, setFunc func(*AttachmentCreate, int)) *AttachmentCreateBulk

MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.

func (*AttachmentClient) Query

func (c *AttachmentClient) Query() *AttachmentQuery

Query returns a query builder for Attachment.

func (*AttachmentClient) QueryAuthor

func (c *AttachmentClient) QueryAuthor(a *Attachment) *UserQuery

QueryAuthor queries the author edge of a Attachment.

func (*AttachmentClient) Update

func (c *AttachmentClient) Update() *AttachmentUpdate

Update returns an update builder for Attachment.

func (*AttachmentClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*AttachmentClient) UpdateOneID

func (c *AttachmentClient) UpdateOneID(id uuid.UUID) *AttachmentUpdateOne

UpdateOneID returns an update builder for the given id.

func (*AttachmentClient) Use

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

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

type AttachmentCreate

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

AttachmentCreate is the builder for creating a Attachment entity.

func (*AttachmentCreate) Exec

func (ac *AttachmentCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*AttachmentCreate) ExecX

func (ac *AttachmentCreate) ExecX(ctx context.Context)

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

func (*AttachmentCreate) Mutation

func (ac *AttachmentCreate) Mutation() *AttachmentMutation

Mutation returns the AttachmentMutation object of the builder.

func (*AttachmentCreate) OnConflict

func (ac *AttachmentCreate) OnConflict(opts ...sql.ConflictOption) *AttachmentUpsertOne

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

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

func (*AttachmentCreate) OnConflictColumns

func (ac *AttachmentCreate) OnConflictColumns(columns ...string) *AttachmentUpsertOne

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

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

func (*AttachmentCreate) Save

func (ac *AttachmentCreate) Save(ctx context.Context) (*Attachment, error)

Save creates the Attachment in the database.

func (*AttachmentCreate) SaveX

func (ac *AttachmentCreate) SaveX(ctx context.Context) *Attachment

SaveX calls Save and panics if Save returns an error.

func (*AttachmentCreate) SetAuthor

func (ac *AttachmentCreate) SetAuthor(u *User) *AttachmentCreate

SetAuthor sets the "author" edge to the User entity.

func (*AttachmentCreate) SetAuthorID

func (ac *AttachmentCreate) SetAuthorID(id uuid.UUID) *AttachmentCreate

SetAuthorID sets the "author" edge to the User entity by ID.

func (*AttachmentCreate) SetBlurhash

func (ac *AttachmentCreate) SetBlurhash(s string) *AttachmentCreate

SetBlurhash sets the "blurhash" field.

func (*AttachmentCreate) SetCreatedAt

func (ac *AttachmentCreate) SetCreatedAt(t time.Time) *AttachmentCreate

SetCreatedAt sets the "created_at" field.

func (*AttachmentCreate) SetDescription

func (ac *AttachmentCreate) SetDescription(s string) *AttachmentCreate

SetDescription sets the "description" field.

func (*AttachmentCreate) SetExtensions

func (ac *AttachmentCreate) SetExtensions(v versia.Extensions) *AttachmentCreate

SetExtensions sets the "extensions" field.

func (*AttachmentCreate) SetFps

func (ac *AttachmentCreate) SetFps(i int) *AttachmentCreate

SetFps sets the "fps" field.

func (*AttachmentCreate) SetHeight

func (ac *AttachmentCreate) SetHeight(i int) *AttachmentCreate

SetHeight sets the "height" field.

func (*AttachmentCreate) SetID

SetID sets the "id" field.

func (*AttachmentCreate) SetIsRemote

func (ac *AttachmentCreate) SetIsRemote(b bool) *AttachmentCreate

SetIsRemote sets the "isRemote" field.

func (*AttachmentCreate) SetMimeType

func (ac *AttachmentCreate) SetMimeType(s string) *AttachmentCreate

SetMimeType sets the "mimeType" field.

func (*AttachmentCreate) SetNillableBlurhash

func (ac *AttachmentCreate) SetNillableBlurhash(s *string) *AttachmentCreate

SetNillableBlurhash sets the "blurhash" field if the given value is not nil.

func (*AttachmentCreate) SetNillableCreatedAt

func (ac *AttachmentCreate) SetNillableCreatedAt(t *time.Time) *AttachmentCreate

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

func (*AttachmentCreate) SetNillableFps

func (ac *AttachmentCreate) SetNillableFps(i *int) *AttachmentCreate

SetNillableFps sets the "fps" field if the given value is not nil.

func (*AttachmentCreate) SetNillableHeight

func (ac *AttachmentCreate) SetNillableHeight(i *int) *AttachmentCreate

SetNillableHeight sets the "height" field if the given value is not nil.

func (*AttachmentCreate) SetNillableID

func (ac *AttachmentCreate) SetNillableID(u *uuid.UUID) *AttachmentCreate

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

func (*AttachmentCreate) SetNillableUpdatedAt

func (ac *AttachmentCreate) SetNillableUpdatedAt(t *time.Time) *AttachmentCreate

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

func (*AttachmentCreate) SetNillableWidth

func (ac *AttachmentCreate) SetNillableWidth(i *int) *AttachmentCreate

SetNillableWidth sets the "width" field if the given value is not nil.

func (*AttachmentCreate) SetSha256

func (ac *AttachmentCreate) SetSha256(b []byte) *AttachmentCreate

SetSha256 sets the "sha256" field.

func (*AttachmentCreate) SetSize

func (ac *AttachmentCreate) SetSize(i int) *AttachmentCreate

SetSize sets the "size" field.

func (*AttachmentCreate) SetURI

func (ac *AttachmentCreate) SetURI(s string) *AttachmentCreate

SetURI sets the "uri" field.

func (*AttachmentCreate) SetUpdatedAt

func (ac *AttachmentCreate) SetUpdatedAt(t time.Time) *AttachmentCreate

SetUpdatedAt sets the "updated_at" field.

func (*AttachmentCreate) SetWidth

func (ac *AttachmentCreate) SetWidth(i int) *AttachmentCreate

SetWidth sets the "width" field.

type AttachmentCreateBulk

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

AttachmentCreateBulk is the builder for creating many Attachment entities in bulk.

func (*AttachmentCreateBulk) Exec

func (acb *AttachmentCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*AttachmentCreateBulk) ExecX

func (acb *AttachmentCreateBulk) ExecX(ctx context.Context)

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

func (*AttachmentCreateBulk) OnConflict

func (acb *AttachmentCreateBulk) OnConflict(opts ...sql.ConflictOption) *AttachmentUpsertBulk

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

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

func (*AttachmentCreateBulk) OnConflictColumns

func (acb *AttachmentCreateBulk) OnConflictColumns(columns ...string) *AttachmentUpsertBulk

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

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

func (*AttachmentCreateBulk) Save

func (acb *AttachmentCreateBulk) Save(ctx context.Context) ([]*Attachment, error)

Save creates the Attachment entities in the database.

func (*AttachmentCreateBulk) SaveX

func (acb *AttachmentCreateBulk) SaveX(ctx context.Context) []*Attachment

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

type AttachmentDelete

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

AttachmentDelete is the builder for deleting a Attachment entity.

func (*AttachmentDelete) Exec

func (ad *AttachmentDelete) Exec(ctx context.Context) (int, error)

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

func (*AttachmentDelete) ExecX

func (ad *AttachmentDelete) ExecX(ctx context.Context) int

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

func (*AttachmentDelete) Where

Where appends a list predicates to the AttachmentDelete builder.

type AttachmentDeleteOne

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

AttachmentDeleteOne is the builder for deleting a single Attachment entity.

func (*AttachmentDeleteOne) Exec

func (ado *AttachmentDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*AttachmentDeleteOne) ExecX

func (ado *AttachmentDeleteOne) ExecX(ctx context.Context)

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

func (*AttachmentDeleteOne) Where

Where appends a list predicates to the AttachmentDelete builder.

type AttachmentEdges

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

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

func (AttachmentEdges) AuthorOrErr

func (e AttachmentEdges) AuthorOrErr() (*User, error)

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

type AttachmentGroupBy

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

AttachmentGroupBy is the group-by builder for Attachment entities.

func (*AttachmentGroupBy) Aggregate

func (agb *AttachmentGroupBy) Aggregate(fns ...AggregateFunc) *AttachmentGroupBy

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

func (*AttachmentGroupBy) Bool

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

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

func (*AttachmentGroupBy) BoolX

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

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

func (*AttachmentGroupBy) Bools

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

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

func (*AttachmentGroupBy) BoolsX

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

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

func (*AttachmentGroupBy) Float64

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

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

func (*AttachmentGroupBy) Float64X

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

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

func (*AttachmentGroupBy) Float64s

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

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

func (*AttachmentGroupBy) Float64sX

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

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

func (*AttachmentGroupBy) Int

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

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

func (*AttachmentGroupBy) IntX

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

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

func (*AttachmentGroupBy) Ints

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

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

func (*AttachmentGroupBy) IntsX

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

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

func (*AttachmentGroupBy) Scan

func (agb *AttachmentGroupBy) Scan(ctx context.Context, v any) error

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

func (*AttachmentGroupBy) ScanX

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

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

func (*AttachmentGroupBy) String

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

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

func (*AttachmentGroupBy) StringX

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

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

func (*AttachmentGroupBy) Strings

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

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

func (*AttachmentGroupBy) StringsX

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

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

type AttachmentMutation

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

AttachmentMutation represents an operation that mutates the Attachment nodes in the graph.

func (*AttachmentMutation) AddField

func (m *AttachmentMutation) 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 (*AttachmentMutation) AddFps

func (m *AttachmentMutation) AddFps(i int)

AddFps adds i to the "fps" field.

func (*AttachmentMutation) AddHeight

func (m *AttachmentMutation) AddHeight(i int)

AddHeight adds i to the "height" field.

func (*AttachmentMutation) AddSize

func (m *AttachmentMutation) AddSize(i int)

AddSize adds i to the "size" field.

func (*AttachmentMutation) AddWidth

func (m *AttachmentMutation) AddWidth(i int)

AddWidth adds i to the "width" field.

func (*AttachmentMutation) AddedEdges

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

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

func (*AttachmentMutation) AddedField

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

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

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

func (*AttachmentMutation) AddedFps

func (m *AttachmentMutation) AddedFps() (r int, exists bool)

AddedFps returns the value that was added to the "fps" field in this mutation.

func (*AttachmentMutation) AddedHeight

func (m *AttachmentMutation) AddedHeight() (r int, exists bool)

AddedHeight returns the value that was added to the "height" field in this mutation.

func (*AttachmentMutation) AddedIDs

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

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

func (*AttachmentMutation) AddedSize

func (m *AttachmentMutation) AddedSize() (r int, exists bool)

AddedSize returns the value that was added to the "size" field in this mutation.

func (*AttachmentMutation) AddedWidth

func (m *AttachmentMutation) AddedWidth() (r int, exists bool)

AddedWidth returns the value that was added to the "width" field in this mutation.

func (*AttachmentMutation) AuthorCleared

func (m *AttachmentMutation) AuthorCleared() bool

AuthorCleared reports if the "author" edge to the User entity was cleared.

func (*AttachmentMutation) AuthorID

func (m *AttachmentMutation) AuthorID() (id uuid.UUID, exists bool)

AuthorID returns the "author" edge ID in the mutation.

func (*AttachmentMutation) AuthorIDs

func (m *AttachmentMutation) AuthorIDs() (ids []uuid.UUID)

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

func (*AttachmentMutation) Blurhash

func (m *AttachmentMutation) Blurhash() (r string, exists bool)

Blurhash returns the value of the "blurhash" field in the mutation.

func (*AttachmentMutation) BlurhashCleared

func (m *AttachmentMutation) BlurhashCleared() bool

BlurhashCleared returns if the "blurhash" field was cleared in this mutation.

func (*AttachmentMutation) ClearAuthor

func (m *AttachmentMutation) ClearAuthor()

ClearAuthor clears the "author" edge to the User entity.

func (*AttachmentMutation) ClearBlurhash

func (m *AttachmentMutation) ClearBlurhash()

ClearBlurhash clears the value of the "blurhash" field.

func (*AttachmentMutation) ClearEdge

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

func (m *AttachmentMutation) 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 (*AttachmentMutation) ClearFps

func (m *AttachmentMutation) ClearFps()

ClearFps clears the value of the "fps" field.

func (*AttachmentMutation) ClearHeight

func (m *AttachmentMutation) ClearHeight()

ClearHeight clears the value of the "height" field.

func (*AttachmentMutation) ClearWidth

func (m *AttachmentMutation) ClearWidth()

ClearWidth clears the value of the "width" field.

func (*AttachmentMutation) ClearedEdges

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

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

func (*AttachmentMutation) ClearedFields

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

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

func (AttachmentMutation) Client

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

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

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

func (*AttachmentMutation) Description

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

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

func (*AttachmentMutation) EdgeCleared

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

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

func (*AttachmentMutation) Extensions

func (m *AttachmentMutation) Extensions() (r versia.Extensions, exists bool)

Extensions returns the value of the "extensions" field in the mutation.

func (*AttachmentMutation) Field

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

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

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

func (*AttachmentMutation) Fields

func (m *AttachmentMutation) 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 (*AttachmentMutation) Fps

func (m *AttachmentMutation) Fps() (r int, exists bool)

Fps returns the value of the "fps" field in the mutation.

func (*AttachmentMutation) FpsCleared

func (m *AttachmentMutation) FpsCleared() bool

FpsCleared returns if the "fps" field was cleared in this mutation.

func (*AttachmentMutation) Height

func (m *AttachmentMutation) Height() (r int, exists bool)

Height returns the value of the "height" field in the mutation.

func (*AttachmentMutation) HeightCleared

func (m *AttachmentMutation) HeightCleared() bool

HeightCleared returns if the "height" field was cleared in this mutation.

func (*AttachmentMutation) ID

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

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

func (*AttachmentMutation) IDs

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

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

func (*AttachmentMutation) IsRemote

func (m *AttachmentMutation) IsRemote() (r bool, exists bool)

IsRemote returns the value of the "isRemote" field in the mutation.

func (*AttachmentMutation) MimeType

func (m *AttachmentMutation) MimeType() (r string, exists bool)

MimeType returns the value of the "mimeType" field in the mutation.

func (*AttachmentMutation) OldBlurhash

func (m *AttachmentMutation) OldBlurhash(ctx context.Context) (v *string, err error)

OldBlurhash returns the old "blurhash" field's value of the Attachment entity. If the Attachment 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 (*AttachmentMutation) OldCreatedAt

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

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

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

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

func (m *AttachmentMutation) OldExtensions(ctx context.Context) (v versia.Extensions, err error)

OldExtensions returns the old "extensions" field's value of the Attachment entity. If the Attachment 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 (*AttachmentMutation) OldField

func (m *AttachmentMutation) 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 (*AttachmentMutation) OldFps

func (m *AttachmentMutation) OldFps(ctx context.Context) (v *int, err error)

OldFps returns the old "fps" field's value of the Attachment entity. If the Attachment 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 (*AttachmentMutation) OldHeight

func (m *AttachmentMutation) OldHeight(ctx context.Context) (v *int, err error)

OldHeight returns the old "height" field's value of the Attachment entity. If the Attachment 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 (*AttachmentMutation) OldIsRemote

func (m *AttachmentMutation) OldIsRemote(ctx context.Context) (v bool, err error)

OldIsRemote returns the old "isRemote" field's value of the Attachment entity. If the Attachment 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 (*AttachmentMutation) OldMimeType

func (m *AttachmentMutation) OldMimeType(ctx context.Context) (v string, err error)

OldMimeType returns the old "mimeType" field's value of the Attachment entity. If the Attachment 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 (*AttachmentMutation) OldSha256

func (m *AttachmentMutation) OldSha256(ctx context.Context) (v []byte, err error)

OldSha256 returns the old "sha256" field's value of the Attachment entity. If the Attachment 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 (*AttachmentMutation) OldSize

func (m *AttachmentMutation) OldSize(ctx context.Context) (v int, err error)

OldSize returns the old "size" field's value of the Attachment entity. If the Attachment 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 (*AttachmentMutation) OldURI

func (m *AttachmentMutation) OldURI(ctx context.Context) (v string, err error)

OldURI returns the old "uri" field's value of the Attachment entity. If the Attachment 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 (*AttachmentMutation) OldUpdatedAt

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

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

func (m *AttachmentMutation) OldWidth(ctx context.Context) (v *int, err error)

OldWidth returns the old "width" field's value of the Attachment entity. If the Attachment 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 (*AttachmentMutation) Op

func (m *AttachmentMutation) Op() Op

Op returns the operation name.

func (*AttachmentMutation) RemovedEdges

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

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

func (*AttachmentMutation) RemovedIDs

func (m *AttachmentMutation) 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 (*AttachmentMutation) ResetAuthor

func (m *AttachmentMutation) ResetAuthor()

ResetAuthor resets all changes to the "author" edge.

func (*AttachmentMutation) ResetBlurhash

func (m *AttachmentMutation) ResetBlurhash()

ResetBlurhash resets all changes to the "blurhash" field.

func (*AttachmentMutation) ResetCreatedAt

func (m *AttachmentMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*AttachmentMutation) ResetDescription

func (m *AttachmentMutation) ResetDescription()

ResetDescription resets all changes to the "description" field.

func (*AttachmentMutation) ResetEdge

func (m *AttachmentMutation) 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 (*AttachmentMutation) ResetExtensions

func (m *AttachmentMutation) ResetExtensions()

ResetExtensions resets all changes to the "extensions" field.

func (*AttachmentMutation) ResetField

func (m *AttachmentMutation) 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 (*AttachmentMutation) ResetFps

func (m *AttachmentMutation) ResetFps()

ResetFps resets all changes to the "fps" field.

func (*AttachmentMutation) ResetHeight

func (m *AttachmentMutation) ResetHeight()

ResetHeight resets all changes to the "height" field.

func (*AttachmentMutation) ResetIsRemote

func (m *AttachmentMutation) ResetIsRemote()

ResetIsRemote resets all changes to the "isRemote" field.

func (*AttachmentMutation) ResetMimeType

func (m *AttachmentMutation) ResetMimeType()

ResetMimeType resets all changes to the "mimeType" field.

func (*AttachmentMutation) ResetSha256

func (m *AttachmentMutation) ResetSha256()

ResetSha256 resets all changes to the "sha256" field.

func (*AttachmentMutation) ResetSize

func (m *AttachmentMutation) ResetSize()

ResetSize resets all changes to the "size" field.

func (*AttachmentMutation) ResetURI

func (m *AttachmentMutation) ResetURI()

ResetURI resets all changes to the "uri" field.

func (*AttachmentMutation) ResetUpdatedAt

func (m *AttachmentMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*AttachmentMutation) ResetWidth

func (m *AttachmentMutation) ResetWidth()

ResetWidth resets all changes to the "width" field.

func (*AttachmentMutation) SetAuthorID

func (m *AttachmentMutation) SetAuthorID(id uuid.UUID)

SetAuthorID sets the "author" edge to the User entity by id.

func (*AttachmentMutation) SetBlurhash

func (m *AttachmentMutation) SetBlurhash(s string)

SetBlurhash sets the "blurhash" field.

func (*AttachmentMutation) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*AttachmentMutation) SetDescription

func (m *AttachmentMutation) SetDescription(s string)

SetDescription sets the "description" field.

func (*AttachmentMutation) SetExtensions

func (m *AttachmentMutation) SetExtensions(v versia.Extensions)

SetExtensions sets the "extensions" field.

func (*AttachmentMutation) SetField

func (m *AttachmentMutation) 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 (*AttachmentMutation) SetFps

func (m *AttachmentMutation) SetFps(i int)

SetFps sets the "fps" field.

func (*AttachmentMutation) SetHeight

func (m *AttachmentMutation) SetHeight(i int)

SetHeight sets the "height" field.

func (*AttachmentMutation) SetID

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

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

func (*AttachmentMutation) SetIsRemote

func (m *AttachmentMutation) SetIsRemote(b bool)

SetIsRemote sets the "isRemote" field.

func (*AttachmentMutation) SetMimeType

func (m *AttachmentMutation) SetMimeType(s string)

SetMimeType sets the "mimeType" field.

func (*AttachmentMutation) SetOp

func (m *AttachmentMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*AttachmentMutation) SetSha256

func (m *AttachmentMutation) SetSha256(b []byte)

SetSha256 sets the "sha256" field.

func (*AttachmentMutation) SetSize

func (m *AttachmentMutation) SetSize(i int)

SetSize sets the "size" field.

func (*AttachmentMutation) SetURI

func (m *AttachmentMutation) SetURI(s string)

SetURI sets the "uri" field.

func (*AttachmentMutation) SetUpdatedAt

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

SetUpdatedAt sets the "updated_at" field.

func (*AttachmentMutation) SetWidth

func (m *AttachmentMutation) SetWidth(i int)

SetWidth sets the "width" field.

func (*AttachmentMutation) Sha256

func (m *AttachmentMutation) Sha256() (r []byte, exists bool)

Sha256 returns the value of the "sha256" field in the mutation.

func (*AttachmentMutation) Size

func (m *AttachmentMutation) Size() (r int, exists bool)

Size returns the value of the "size" field in the mutation.

func (AttachmentMutation) Tx

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

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

func (*AttachmentMutation) Type

func (m *AttachmentMutation) Type() string

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

func (*AttachmentMutation) URI

func (m *AttachmentMutation) URI() (r string, exists bool)

URI returns the value of the "uri" field in the mutation.

func (*AttachmentMutation) UpdatedAt

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

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

func (*AttachmentMutation) Where

func (m *AttachmentMutation) Where(ps ...predicate.Attachment)

Where appends a list predicates to the AttachmentMutation builder.

func (*AttachmentMutation) WhereP

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

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

func (*AttachmentMutation) Width

func (m *AttachmentMutation) Width() (r int, exists bool)

Width returns the value of the "width" field in the mutation.

func (*AttachmentMutation) WidthCleared

func (m *AttachmentMutation) WidthCleared() bool

WidthCleared returns if the "width" field was cleared in this mutation.

type AttachmentQuery

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

AttachmentQuery is the builder for querying Attachment entities.

func (*AttachmentQuery) Aggregate

func (aq *AttachmentQuery) Aggregate(fns ...AggregateFunc) *AttachmentSelect

Aggregate returns a AttachmentSelect configured with the given aggregations.

func (*AttachmentQuery) All

func (aq *AttachmentQuery) All(ctx context.Context) ([]*Attachment, error)

All executes the query and returns a list of Attachments.

func (*AttachmentQuery) AllX

func (aq *AttachmentQuery) AllX(ctx context.Context) []*Attachment

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

func (*AttachmentQuery) Clone

func (aq *AttachmentQuery) Clone() *AttachmentQuery

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

func (*AttachmentQuery) Count

func (aq *AttachmentQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*AttachmentQuery) CountX

func (aq *AttachmentQuery) CountX(ctx context.Context) int

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

func (*AttachmentQuery) Exist

func (aq *AttachmentQuery) Exist(ctx context.Context) (bool, error)

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

func (*AttachmentQuery) ExistX

func (aq *AttachmentQuery) ExistX(ctx context.Context) bool

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

func (*AttachmentQuery) First

func (aq *AttachmentQuery) First(ctx context.Context) (*Attachment, error)

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

func (*AttachmentQuery) FirstID

func (aq *AttachmentQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

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

func (*AttachmentQuery) FirstIDX

func (aq *AttachmentQuery) FirstIDX(ctx context.Context) uuid.UUID

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

func (*AttachmentQuery) FirstX

func (aq *AttachmentQuery) FirstX(ctx context.Context) *Attachment

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

func (*AttachmentQuery) GroupBy

func (aq *AttachmentQuery) GroupBy(field string, fields ...string) *AttachmentGroupBy

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 {
	IsRemote bool `json:"isRemote,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Attachment.Query().
	GroupBy(attachment.FieldIsRemote).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*AttachmentQuery) IDs

func (aq *AttachmentQuery) IDs(ctx context.Context) (ids []uuid.UUID, err error)

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

func (*AttachmentQuery) IDsX

func (aq *AttachmentQuery) IDsX(ctx context.Context) []uuid.UUID

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

func (*AttachmentQuery) Limit

func (aq *AttachmentQuery) Limit(limit int) *AttachmentQuery

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

func (*AttachmentQuery) Offset

func (aq *AttachmentQuery) Offset(offset int) *AttachmentQuery

Offset to start from.

func (*AttachmentQuery) Only

func (aq *AttachmentQuery) Only(ctx context.Context) (*Attachment, error)

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

func (*AttachmentQuery) OnlyID

func (aq *AttachmentQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

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

func (*AttachmentQuery) OnlyIDX

func (aq *AttachmentQuery) OnlyIDX(ctx context.Context) uuid.UUID

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

func (*AttachmentQuery) OnlyX

func (aq *AttachmentQuery) OnlyX(ctx context.Context) *Attachment

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

func (*AttachmentQuery) Order

Order specifies how the records should be ordered.

func (*AttachmentQuery) QueryAuthor

func (aq *AttachmentQuery) QueryAuthor() *UserQuery

QueryAuthor chains the current query on the "author" edge.

func (*AttachmentQuery) Select

func (aq *AttachmentQuery) Select(fields ...string) *AttachmentSelect

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 {
	IsRemote bool `json:"isRemote,omitempty"`
}

client.Attachment.Query().
	Select(attachment.FieldIsRemote).
	Scan(ctx, &v)

func (*AttachmentQuery) Unique

func (aq *AttachmentQuery) Unique(unique bool) *AttachmentQuery

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

Where adds a new predicate for the AttachmentQuery builder.

func (*AttachmentQuery) WithAuthor

func (aq *AttachmentQuery) WithAuthor(opts ...func(*UserQuery)) *AttachmentQuery

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

type AttachmentSelect

type AttachmentSelect struct {
	*AttachmentQuery
	// contains filtered or unexported fields
}

AttachmentSelect is the builder for selecting fields of Attachment entities.

func (*AttachmentSelect) Aggregate

func (as *AttachmentSelect) Aggregate(fns ...AggregateFunc) *AttachmentSelect

Aggregate adds the given aggregation functions to the selector query.

func (*AttachmentSelect) Bool

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

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

func (*AttachmentSelect) BoolX

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

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

func (*AttachmentSelect) Bools

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

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

func (*AttachmentSelect) BoolsX

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

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

func (*AttachmentSelect) Float64

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

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

func (*AttachmentSelect) Float64X

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

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

func (*AttachmentSelect) Float64s

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

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

func (*AttachmentSelect) Float64sX

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

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

func (*AttachmentSelect) Int

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

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

func (*AttachmentSelect) IntX

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

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

func (*AttachmentSelect) Ints

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

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

func (*AttachmentSelect) IntsX

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

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

func (*AttachmentSelect) Scan

func (as *AttachmentSelect) Scan(ctx context.Context, v any) error

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

func (*AttachmentSelect) ScanX

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

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

func (*AttachmentSelect) String

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

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

func (*AttachmentSelect) StringX

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

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

func (*AttachmentSelect) Strings

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

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

func (*AttachmentSelect) StringsX

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

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

type AttachmentUpdate

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

AttachmentUpdate is the builder for updating Attachment entities.

func (*AttachmentUpdate) AddFps

func (au *AttachmentUpdate) AddFps(i int) *AttachmentUpdate

AddFps adds i to the "fps" field.

func (*AttachmentUpdate) AddHeight

func (au *AttachmentUpdate) AddHeight(i int) *AttachmentUpdate

AddHeight adds i to the "height" field.

func (*AttachmentUpdate) AddSize

func (au *AttachmentUpdate) AddSize(i int) *AttachmentUpdate

AddSize adds i to the "size" field.

func (*AttachmentUpdate) AddWidth

func (au *AttachmentUpdate) AddWidth(i int) *AttachmentUpdate

AddWidth adds i to the "width" field.

func (*AttachmentUpdate) ClearAuthor

func (au *AttachmentUpdate) ClearAuthor() *AttachmentUpdate

ClearAuthor clears the "author" edge to the User entity.

func (*AttachmentUpdate) ClearBlurhash

func (au *AttachmentUpdate) ClearBlurhash() *AttachmentUpdate

ClearBlurhash clears the value of the "blurhash" field.

func (*AttachmentUpdate) ClearFps

func (au *AttachmentUpdate) ClearFps() *AttachmentUpdate

ClearFps clears the value of the "fps" field.

func (*AttachmentUpdate) ClearHeight

func (au *AttachmentUpdate) ClearHeight() *AttachmentUpdate

ClearHeight clears the value of the "height" field.

func (*AttachmentUpdate) ClearWidth

func (au *AttachmentUpdate) ClearWidth() *AttachmentUpdate

ClearWidth clears the value of the "width" field.

func (*AttachmentUpdate) Exec

func (au *AttachmentUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*AttachmentUpdate) ExecX

func (au *AttachmentUpdate) ExecX(ctx context.Context)

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

func (*AttachmentUpdate) Mutation

func (au *AttachmentUpdate) Mutation() *AttachmentMutation

Mutation returns the AttachmentMutation object of the builder.

func (*AttachmentUpdate) Save

func (au *AttachmentUpdate) Save(ctx context.Context) (int, error)

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

func (*AttachmentUpdate) SaveX

func (au *AttachmentUpdate) SaveX(ctx context.Context) int

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

func (*AttachmentUpdate) SetAuthor

func (au *AttachmentUpdate) SetAuthor(u *User) *AttachmentUpdate

SetAuthor sets the "author" edge to the User entity.

func (*AttachmentUpdate) SetAuthorID

func (au *AttachmentUpdate) SetAuthorID(id uuid.UUID) *AttachmentUpdate

SetAuthorID sets the "author" edge to the User entity by ID.

func (*AttachmentUpdate) SetBlurhash

func (au *AttachmentUpdate) SetBlurhash(s string) *AttachmentUpdate

SetBlurhash sets the "blurhash" field.

func (*AttachmentUpdate) SetDescription

func (au *AttachmentUpdate) SetDescription(s string) *AttachmentUpdate

SetDescription sets the "description" field.

func (*AttachmentUpdate) SetExtensions

func (au *AttachmentUpdate) SetExtensions(v versia.Extensions) *AttachmentUpdate

SetExtensions sets the "extensions" field.

func (*AttachmentUpdate) SetFps

func (au *AttachmentUpdate) SetFps(i int) *AttachmentUpdate

SetFps sets the "fps" field.

func (*AttachmentUpdate) SetHeight

func (au *AttachmentUpdate) SetHeight(i int) *AttachmentUpdate

SetHeight sets the "height" field.

func (*AttachmentUpdate) SetIsRemote

func (au *AttachmentUpdate) SetIsRemote(b bool) *AttachmentUpdate

SetIsRemote sets the "isRemote" field.

func (*AttachmentUpdate) SetMimeType

func (au *AttachmentUpdate) SetMimeType(s string) *AttachmentUpdate

SetMimeType sets the "mimeType" field.

func (*AttachmentUpdate) SetNillableBlurhash

func (au *AttachmentUpdate) SetNillableBlurhash(s *string) *AttachmentUpdate

SetNillableBlurhash sets the "blurhash" field if the given value is not nil.

func (*AttachmentUpdate) SetNillableDescription

func (au *AttachmentUpdate) SetNillableDescription(s *string) *AttachmentUpdate

SetNillableDescription sets the "description" field if the given value is not nil.

func (*AttachmentUpdate) SetNillableFps

func (au *AttachmentUpdate) SetNillableFps(i *int) *AttachmentUpdate

SetNillableFps sets the "fps" field if the given value is not nil.

func (*AttachmentUpdate) SetNillableHeight

func (au *AttachmentUpdate) SetNillableHeight(i *int) *AttachmentUpdate

SetNillableHeight sets the "height" field if the given value is not nil.

func (*AttachmentUpdate) SetNillableIsRemote

func (au *AttachmentUpdate) SetNillableIsRemote(b *bool) *AttachmentUpdate

SetNillableIsRemote sets the "isRemote" field if the given value is not nil.

func (*AttachmentUpdate) SetNillableMimeType

func (au *AttachmentUpdate) SetNillableMimeType(s *string) *AttachmentUpdate

SetNillableMimeType sets the "mimeType" field if the given value is not nil.

func (*AttachmentUpdate) SetNillableSize

func (au *AttachmentUpdate) SetNillableSize(i *int) *AttachmentUpdate

SetNillableSize sets the "size" field if the given value is not nil.

func (*AttachmentUpdate) SetNillableURI

func (au *AttachmentUpdate) SetNillableURI(s *string) *AttachmentUpdate

SetNillableURI sets the "uri" field if the given value is not nil.

func (*AttachmentUpdate) SetNillableWidth

func (au *AttachmentUpdate) SetNillableWidth(i *int) *AttachmentUpdate

SetNillableWidth sets the "width" field if the given value is not nil.

func (*AttachmentUpdate) SetSha256

func (au *AttachmentUpdate) SetSha256(b []byte) *AttachmentUpdate

SetSha256 sets the "sha256" field.

func (*AttachmentUpdate) SetSize

func (au *AttachmentUpdate) SetSize(i int) *AttachmentUpdate

SetSize sets the "size" field.

func (*AttachmentUpdate) SetURI

func (au *AttachmentUpdate) SetURI(s string) *AttachmentUpdate

SetURI sets the "uri" field.

func (*AttachmentUpdate) SetUpdatedAt

func (au *AttachmentUpdate) SetUpdatedAt(t time.Time) *AttachmentUpdate

SetUpdatedAt sets the "updated_at" field.

func (*AttachmentUpdate) SetWidth

func (au *AttachmentUpdate) SetWidth(i int) *AttachmentUpdate

SetWidth sets the "width" field.

func (*AttachmentUpdate) Where

Where appends a list predicates to the AttachmentUpdate builder.

type AttachmentUpdateOne

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

AttachmentUpdateOne is the builder for updating a single Attachment entity.

func (*AttachmentUpdateOne) AddFps

AddFps adds i to the "fps" field.

func (*AttachmentUpdateOne) AddHeight

func (auo *AttachmentUpdateOne) AddHeight(i int) *AttachmentUpdateOne

AddHeight adds i to the "height" field.

func (*AttachmentUpdateOne) AddSize

func (auo *AttachmentUpdateOne) AddSize(i int) *AttachmentUpdateOne

AddSize adds i to the "size" field.

func (*AttachmentUpdateOne) AddWidth

func (auo *AttachmentUpdateOne) AddWidth(i int) *AttachmentUpdateOne

AddWidth adds i to the "width" field.

func (*AttachmentUpdateOne) ClearAuthor

func (auo *AttachmentUpdateOne) ClearAuthor() *AttachmentUpdateOne

ClearAuthor clears the "author" edge to the User entity.

func (*AttachmentUpdateOne) ClearBlurhash

func (auo *AttachmentUpdateOne) ClearBlurhash() *AttachmentUpdateOne

ClearBlurhash clears the value of the "blurhash" field.

func (*AttachmentUpdateOne) ClearFps

func (auo *AttachmentUpdateOne) ClearFps() *AttachmentUpdateOne

ClearFps clears the value of the "fps" field.

func (*AttachmentUpdateOne) ClearHeight

func (auo *AttachmentUpdateOne) ClearHeight() *AttachmentUpdateOne

ClearHeight clears the value of the "height" field.

func (*AttachmentUpdateOne) ClearWidth

func (auo *AttachmentUpdateOne) ClearWidth() *AttachmentUpdateOne

ClearWidth clears the value of the "width" field.

func (*AttachmentUpdateOne) Exec

func (auo *AttachmentUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*AttachmentUpdateOne) ExecX

func (auo *AttachmentUpdateOne) ExecX(ctx context.Context)

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

func (*AttachmentUpdateOne) Mutation

func (auo *AttachmentUpdateOne) Mutation() *AttachmentMutation

Mutation returns the AttachmentMutation object of the builder.

func (*AttachmentUpdateOne) Save

func (auo *AttachmentUpdateOne) Save(ctx context.Context) (*Attachment, error)

Save executes the query and returns the updated Attachment entity.

func (*AttachmentUpdateOne) SaveX

func (auo *AttachmentUpdateOne) SaveX(ctx context.Context) *Attachment

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

func (*AttachmentUpdateOne) Select

func (auo *AttachmentUpdateOne) Select(field string, fields ...string) *AttachmentUpdateOne

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

func (*AttachmentUpdateOne) SetAuthor

func (auo *AttachmentUpdateOne) SetAuthor(u *User) *AttachmentUpdateOne

SetAuthor sets the "author" edge to the User entity.

func (*AttachmentUpdateOne) SetAuthorID

func (auo *AttachmentUpdateOne) SetAuthorID(id uuid.UUID) *AttachmentUpdateOne

SetAuthorID sets the "author" edge to the User entity by ID.

func (*AttachmentUpdateOne) SetBlurhash

func (auo *AttachmentUpdateOne) SetBlurhash(s string) *AttachmentUpdateOne

SetBlurhash sets the "blurhash" field.

func (*AttachmentUpdateOne) SetDescription

func (auo *AttachmentUpdateOne) SetDescription(s string) *AttachmentUpdateOne

SetDescription sets the "description" field.

func (*AttachmentUpdateOne) SetExtensions

SetExtensions sets the "extensions" field.

func (*AttachmentUpdateOne) SetFps

SetFps sets the "fps" field.

func (*AttachmentUpdateOne) SetHeight

func (auo *AttachmentUpdateOne) SetHeight(i int) *AttachmentUpdateOne

SetHeight sets the "height" field.

func (*AttachmentUpdateOne) SetIsRemote

func (auo *AttachmentUpdateOne) SetIsRemote(b bool) *AttachmentUpdateOne

SetIsRemote sets the "isRemote" field.

func (*AttachmentUpdateOne) SetMimeType

func (auo *AttachmentUpdateOne) SetMimeType(s string) *AttachmentUpdateOne

SetMimeType sets the "mimeType" field.

func (*AttachmentUpdateOne) SetNillableBlurhash

func (auo *AttachmentUpdateOne) SetNillableBlurhash(s *string) *AttachmentUpdateOne

SetNillableBlurhash sets the "blurhash" field if the given value is not nil.

func (*AttachmentUpdateOne) SetNillableDescription

func (auo *AttachmentUpdateOne) SetNillableDescription(s *string) *AttachmentUpdateOne

SetNillableDescription sets the "description" field if the given value is not nil.

func (*AttachmentUpdateOne) SetNillableFps

func (auo *AttachmentUpdateOne) SetNillableFps(i *int) *AttachmentUpdateOne

SetNillableFps sets the "fps" field if the given value is not nil.

func (*AttachmentUpdateOne) SetNillableHeight

func (auo *AttachmentUpdateOne) SetNillableHeight(i *int) *AttachmentUpdateOne

SetNillableHeight sets the "height" field if the given value is not nil.

func (*AttachmentUpdateOne) SetNillableIsRemote

func (auo *AttachmentUpdateOne) SetNillableIsRemote(b *bool) *AttachmentUpdateOne

SetNillableIsRemote sets the "isRemote" field if the given value is not nil.

func (*AttachmentUpdateOne) SetNillableMimeType

func (auo *AttachmentUpdateOne) SetNillableMimeType(s *string) *AttachmentUpdateOne

SetNillableMimeType sets the "mimeType" field if the given value is not nil.

func (*AttachmentUpdateOne) SetNillableSize

func (auo *AttachmentUpdateOne) SetNillableSize(i *int) *AttachmentUpdateOne

SetNillableSize sets the "size" field if the given value is not nil.

func (*AttachmentUpdateOne) SetNillableURI

func (auo *AttachmentUpdateOne) SetNillableURI(s *string) *AttachmentUpdateOne

SetNillableURI sets the "uri" field if the given value is not nil.

func (*AttachmentUpdateOne) SetNillableWidth

func (auo *AttachmentUpdateOne) SetNillableWidth(i *int) *AttachmentUpdateOne

SetNillableWidth sets the "width" field if the given value is not nil.

func (*AttachmentUpdateOne) SetSha256

func (auo *AttachmentUpdateOne) SetSha256(b []byte) *AttachmentUpdateOne

SetSha256 sets the "sha256" field.

func (*AttachmentUpdateOne) SetSize

func (auo *AttachmentUpdateOne) SetSize(i int) *AttachmentUpdateOne

SetSize sets the "size" field.

func (*AttachmentUpdateOne) SetURI

SetURI sets the "uri" field.

func (*AttachmentUpdateOne) SetUpdatedAt

func (auo *AttachmentUpdateOne) SetUpdatedAt(t time.Time) *AttachmentUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*AttachmentUpdateOne) SetWidth

func (auo *AttachmentUpdateOne) SetWidth(i int) *AttachmentUpdateOne

SetWidth sets the "width" field.

func (*AttachmentUpdateOne) Where

Where appends a list predicates to the AttachmentUpdate builder.

type AttachmentUpsert

type AttachmentUpsert struct {
	*sql.UpdateSet
}

AttachmentUpsert is the "OnConflict" setter.

func (*AttachmentUpsert) AddFps

func (u *AttachmentUpsert) AddFps(v int) *AttachmentUpsert

AddFps adds v to the "fps" field.

func (*AttachmentUpsert) AddHeight

func (u *AttachmentUpsert) AddHeight(v int) *AttachmentUpsert

AddHeight adds v to the "height" field.

func (*AttachmentUpsert) AddSize

func (u *AttachmentUpsert) AddSize(v int) *AttachmentUpsert

AddSize adds v to the "size" field.

func (*AttachmentUpsert) AddWidth

func (u *AttachmentUpsert) AddWidth(v int) *AttachmentUpsert

AddWidth adds v to the "width" field.

func (*AttachmentUpsert) ClearBlurhash

func (u *AttachmentUpsert) ClearBlurhash() *AttachmentUpsert

ClearBlurhash clears the value of the "blurhash" field.

func (*AttachmentUpsert) ClearFps

func (u *AttachmentUpsert) ClearFps() *AttachmentUpsert

ClearFps clears the value of the "fps" field.

func (*AttachmentUpsert) ClearHeight

func (u *AttachmentUpsert) ClearHeight() *AttachmentUpsert

ClearHeight clears the value of the "height" field.

func (*AttachmentUpsert) ClearWidth

func (u *AttachmentUpsert) ClearWidth() *AttachmentUpsert

ClearWidth clears the value of the "width" field.

func (*AttachmentUpsert) SetBlurhash

func (u *AttachmentUpsert) SetBlurhash(v string) *AttachmentUpsert

SetBlurhash sets the "blurhash" field.

func (*AttachmentUpsert) SetDescription

func (u *AttachmentUpsert) SetDescription(v string) *AttachmentUpsert

SetDescription sets the "description" field.

func (*AttachmentUpsert) SetExtensions

func (u *AttachmentUpsert) SetExtensions(v versia.Extensions) *AttachmentUpsert

SetExtensions sets the "extensions" field.

func (*AttachmentUpsert) SetFps

func (u *AttachmentUpsert) SetFps(v int) *AttachmentUpsert

SetFps sets the "fps" field.

func (*AttachmentUpsert) SetHeight

func (u *AttachmentUpsert) SetHeight(v int) *AttachmentUpsert

SetHeight sets the "height" field.

func (*AttachmentUpsert) SetIsRemote

func (u *AttachmentUpsert) SetIsRemote(v bool) *AttachmentUpsert

SetIsRemote sets the "isRemote" field.

func (*AttachmentUpsert) SetMimeType

func (u *AttachmentUpsert) SetMimeType(v string) *AttachmentUpsert

SetMimeType sets the "mimeType" field.

func (*AttachmentUpsert) SetSha256

func (u *AttachmentUpsert) SetSha256(v []byte) *AttachmentUpsert

SetSha256 sets the "sha256" field.

func (*AttachmentUpsert) SetSize

func (u *AttachmentUpsert) SetSize(v int) *AttachmentUpsert

SetSize sets the "size" field.

func (*AttachmentUpsert) SetURI

SetURI sets the "uri" field.

func (*AttachmentUpsert) SetUpdatedAt

func (u *AttachmentUpsert) SetUpdatedAt(v time.Time) *AttachmentUpsert

SetUpdatedAt sets the "updated_at" field.

func (*AttachmentUpsert) SetWidth

func (u *AttachmentUpsert) SetWidth(v int) *AttachmentUpsert

SetWidth sets the "width" field.

func (*AttachmentUpsert) UpdateBlurhash

func (u *AttachmentUpsert) UpdateBlurhash() *AttachmentUpsert

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

func (*AttachmentUpsert) UpdateDescription

func (u *AttachmentUpsert) UpdateDescription() *AttachmentUpsert

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

func (*AttachmentUpsert) UpdateExtensions

func (u *AttachmentUpsert) UpdateExtensions() *AttachmentUpsert

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

func (*AttachmentUpsert) UpdateFps

func (u *AttachmentUpsert) UpdateFps() *AttachmentUpsert

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

func (*AttachmentUpsert) UpdateHeight

func (u *AttachmentUpsert) UpdateHeight() *AttachmentUpsert

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

func (*AttachmentUpsert) UpdateIsRemote

func (u *AttachmentUpsert) UpdateIsRemote() *AttachmentUpsert

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

func (*AttachmentUpsert) UpdateMimeType

func (u *AttachmentUpsert) UpdateMimeType() *AttachmentUpsert

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

func (*AttachmentUpsert) UpdateSha256

func (u *AttachmentUpsert) UpdateSha256() *AttachmentUpsert

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

func (*AttachmentUpsert) UpdateSize

func (u *AttachmentUpsert) UpdateSize() *AttachmentUpsert

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

func (*AttachmentUpsert) UpdateURI

func (u *AttachmentUpsert) UpdateURI() *AttachmentUpsert

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

func (*AttachmentUpsert) UpdateUpdatedAt

func (u *AttachmentUpsert) UpdateUpdatedAt() *AttachmentUpsert

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

func (*AttachmentUpsert) UpdateWidth

func (u *AttachmentUpsert) UpdateWidth() *AttachmentUpsert

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

type AttachmentUpsertBulk

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

AttachmentUpsertBulk is the builder for "upsert"-ing a bulk of Attachment nodes.

func (*AttachmentUpsertBulk) AddFps

AddFps adds v to the "fps" field.

func (*AttachmentUpsertBulk) AddHeight

AddHeight adds v to the "height" field.

func (*AttachmentUpsertBulk) AddSize

AddSize adds v to the "size" field.

func (*AttachmentUpsertBulk) AddWidth

AddWidth adds v to the "width" field.

func (*AttachmentUpsertBulk) ClearBlurhash

func (u *AttachmentUpsertBulk) ClearBlurhash() *AttachmentUpsertBulk

ClearBlurhash clears the value of the "blurhash" field.

func (*AttachmentUpsertBulk) ClearFps

ClearFps clears the value of the "fps" field.

func (*AttachmentUpsertBulk) ClearHeight

func (u *AttachmentUpsertBulk) ClearHeight() *AttachmentUpsertBulk

ClearHeight clears the value of the "height" field.

func (*AttachmentUpsertBulk) ClearWidth

func (u *AttachmentUpsertBulk) ClearWidth() *AttachmentUpsertBulk

ClearWidth clears the value of the "width" field.

func (*AttachmentUpsertBulk) DoNothing

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

func (*AttachmentUpsertBulk) Exec

Exec executes the query.

func (*AttachmentUpsertBulk) ExecX

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

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

func (*AttachmentUpsertBulk) Ignore

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

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

func (*AttachmentUpsertBulk) SetBlurhash

SetBlurhash sets the "blurhash" field.

func (*AttachmentUpsertBulk) SetDescription

func (u *AttachmentUpsertBulk) SetDescription(v string) *AttachmentUpsertBulk

SetDescription sets the "description" field.

func (*AttachmentUpsertBulk) SetExtensions

SetExtensions sets the "extensions" field.

func (*AttachmentUpsertBulk) SetFps

SetFps sets the "fps" field.

func (*AttachmentUpsertBulk) SetHeight

SetHeight sets the "height" field.

func (*AttachmentUpsertBulk) SetIsRemote

func (u *AttachmentUpsertBulk) SetIsRemote(v bool) *AttachmentUpsertBulk

SetIsRemote sets the "isRemote" field.

func (*AttachmentUpsertBulk) SetMimeType

SetMimeType sets the "mimeType" field.

func (*AttachmentUpsertBulk) SetSha256

func (u *AttachmentUpsertBulk) SetSha256(v []byte) *AttachmentUpsertBulk

SetSha256 sets the "sha256" field.

func (*AttachmentUpsertBulk) SetSize

SetSize sets the "size" field.

func (*AttachmentUpsertBulk) SetURI

SetURI sets the "uri" field.

func (*AttachmentUpsertBulk) SetUpdatedAt

func (u *AttachmentUpsertBulk) SetUpdatedAt(v time.Time) *AttachmentUpsertBulk

SetUpdatedAt sets the "updated_at" field.

func (*AttachmentUpsertBulk) SetWidth

SetWidth sets the "width" field.

func (*AttachmentUpsertBulk) Update

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

func (*AttachmentUpsertBulk) UpdateBlurhash

func (u *AttachmentUpsertBulk) UpdateBlurhash() *AttachmentUpsertBulk

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

func (*AttachmentUpsertBulk) UpdateDescription

func (u *AttachmentUpsertBulk) UpdateDescription() *AttachmentUpsertBulk

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

func (*AttachmentUpsertBulk) UpdateExtensions

func (u *AttachmentUpsertBulk) UpdateExtensions() *AttachmentUpsertBulk

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

func (*AttachmentUpsertBulk) UpdateFps

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

func (*AttachmentUpsertBulk) UpdateHeight

func (u *AttachmentUpsertBulk) UpdateHeight() *AttachmentUpsertBulk

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

func (*AttachmentUpsertBulk) UpdateIsRemote

func (u *AttachmentUpsertBulk) UpdateIsRemote() *AttachmentUpsertBulk

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

func (*AttachmentUpsertBulk) UpdateMimeType

func (u *AttachmentUpsertBulk) UpdateMimeType() *AttachmentUpsertBulk

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

func (*AttachmentUpsertBulk) UpdateNewValues

func (u *AttachmentUpsertBulk) UpdateNewValues() *AttachmentUpsertBulk

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

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

func (*AttachmentUpsertBulk) UpdateSha256

func (u *AttachmentUpsertBulk) UpdateSha256() *AttachmentUpsertBulk

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

func (*AttachmentUpsertBulk) UpdateSize

func (u *AttachmentUpsertBulk) UpdateSize() *AttachmentUpsertBulk

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

func (*AttachmentUpsertBulk) UpdateURI

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

func (*AttachmentUpsertBulk) UpdateUpdatedAt

func (u *AttachmentUpsertBulk) UpdateUpdatedAt() *AttachmentUpsertBulk

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

func (*AttachmentUpsertBulk) UpdateWidth

func (u *AttachmentUpsertBulk) UpdateWidth() *AttachmentUpsertBulk

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

type AttachmentUpsertOne

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

AttachmentUpsertOne is the builder for "upsert"-ing

one Attachment node.

func (*AttachmentUpsertOne) AddFps

AddFps adds v to the "fps" field.

func (*AttachmentUpsertOne) AddHeight

func (u *AttachmentUpsertOne) AddHeight(v int) *AttachmentUpsertOne

AddHeight adds v to the "height" field.

func (*AttachmentUpsertOne) AddSize

AddSize adds v to the "size" field.

func (*AttachmentUpsertOne) AddWidth

AddWidth adds v to the "width" field.

func (*AttachmentUpsertOne) ClearBlurhash

func (u *AttachmentUpsertOne) ClearBlurhash() *AttachmentUpsertOne

ClearBlurhash clears the value of the "blurhash" field.

func (*AttachmentUpsertOne) ClearFps

ClearFps clears the value of the "fps" field.

func (*AttachmentUpsertOne) ClearHeight

func (u *AttachmentUpsertOne) ClearHeight() *AttachmentUpsertOne

ClearHeight clears the value of the "height" field.

func (*AttachmentUpsertOne) ClearWidth

func (u *AttachmentUpsertOne) ClearWidth() *AttachmentUpsertOne

ClearWidth clears the value of the "width" field.

func (*AttachmentUpsertOne) DoNothing

func (u *AttachmentUpsertOne) DoNothing() *AttachmentUpsertOne

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

func (*AttachmentUpsertOne) Exec

Exec executes the query.

func (*AttachmentUpsertOne) ExecX

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

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

func (*AttachmentUpsertOne) ID

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

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

func (*AttachmentUpsertOne) IDX

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

func (*AttachmentUpsertOne) Ignore

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

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

func (*AttachmentUpsertOne) SetBlurhash

func (u *AttachmentUpsertOne) SetBlurhash(v string) *AttachmentUpsertOne

SetBlurhash sets the "blurhash" field.

func (*AttachmentUpsertOne) SetDescription

func (u *AttachmentUpsertOne) SetDescription(v string) *AttachmentUpsertOne

SetDescription sets the "description" field.

func (*AttachmentUpsertOne) SetExtensions

SetExtensions sets the "extensions" field.

func (*AttachmentUpsertOne) SetFps

SetFps sets the "fps" field.

func (*AttachmentUpsertOne) SetHeight

func (u *AttachmentUpsertOne) SetHeight(v int) *AttachmentUpsertOne

SetHeight sets the "height" field.

func (*AttachmentUpsertOne) SetIsRemote

func (u *AttachmentUpsertOne) SetIsRemote(v bool) *AttachmentUpsertOne

SetIsRemote sets the "isRemote" field.

func (*AttachmentUpsertOne) SetMimeType

func (u *AttachmentUpsertOne) SetMimeType(v string) *AttachmentUpsertOne

SetMimeType sets the "mimeType" field.

func (*AttachmentUpsertOne) SetSha256

func (u *AttachmentUpsertOne) SetSha256(v []byte) *AttachmentUpsertOne

SetSha256 sets the "sha256" field.

func (*AttachmentUpsertOne) SetSize

SetSize sets the "size" field.

func (*AttachmentUpsertOne) SetURI

SetURI sets the "uri" field.

func (*AttachmentUpsertOne) SetUpdatedAt

func (u *AttachmentUpsertOne) SetUpdatedAt(v time.Time) *AttachmentUpsertOne

SetUpdatedAt sets the "updated_at" field.

func (*AttachmentUpsertOne) SetWidth

SetWidth sets the "width" field.

func (*AttachmentUpsertOne) Update

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

func (*AttachmentUpsertOne) UpdateBlurhash

func (u *AttachmentUpsertOne) UpdateBlurhash() *AttachmentUpsertOne

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

func (*AttachmentUpsertOne) UpdateDescription

func (u *AttachmentUpsertOne) UpdateDescription() *AttachmentUpsertOne

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

func (*AttachmentUpsertOne) UpdateExtensions

func (u *AttachmentUpsertOne) UpdateExtensions() *AttachmentUpsertOne

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

func (*AttachmentUpsertOne) UpdateFps

func (u *AttachmentUpsertOne) UpdateFps() *AttachmentUpsertOne

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

func (*AttachmentUpsertOne) UpdateHeight

func (u *AttachmentUpsertOne) UpdateHeight() *AttachmentUpsertOne

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

func (*AttachmentUpsertOne) UpdateIsRemote

func (u *AttachmentUpsertOne) UpdateIsRemote() *AttachmentUpsertOne

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

func (*AttachmentUpsertOne) UpdateMimeType

func (u *AttachmentUpsertOne) UpdateMimeType() *AttachmentUpsertOne

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

func (*AttachmentUpsertOne) UpdateNewValues

func (u *AttachmentUpsertOne) UpdateNewValues() *AttachmentUpsertOne

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

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

func (*AttachmentUpsertOne) UpdateSha256

func (u *AttachmentUpsertOne) UpdateSha256() *AttachmentUpsertOne

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

func (*AttachmentUpsertOne) UpdateSize

func (u *AttachmentUpsertOne) UpdateSize() *AttachmentUpsertOne

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

func (*AttachmentUpsertOne) UpdateURI

func (u *AttachmentUpsertOne) UpdateURI() *AttachmentUpsertOne

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

func (*AttachmentUpsertOne) UpdateUpdatedAt

func (u *AttachmentUpsertOne) UpdateUpdatedAt() *AttachmentUpsertOne

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

func (*AttachmentUpsertOne) UpdateWidth

func (u *AttachmentUpsertOne) UpdateWidth() *AttachmentUpsertOne

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

type Attachments

type Attachments []*Attachment

Attachments is a parsable slice of Attachment.

type Client

type Client struct {

	// Schema is the client for creating, migrating and dropping schema.
	Schema *migrate.Schema
	// Attachment is the client for interacting with the Attachment builders.
	Attachment *AttachmentClient
	// Follow is the client for interacting with the Follow builders.
	Follow *FollowClient
	// Image is the client for interacting with the Image builders.
	Image *ImageClient
	// InstanceMetadata is the client for interacting with the InstanceMetadata builders.
	InstanceMetadata *InstanceMetadataClient
	// Note is the client for interacting with the Note builders.
	Note *NoteClient
	// User is the client for interacting with the User builders.
	User *UserClient
	// contains filtered or unexported fields
}

Client is the client that holds all ent builders.

func FromContext

func FromContext(ctx context.Context) *Client

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

func NewClient

func NewClient(opts ...Option) *Client

NewClient creates a new client configured with the given options.

func Open

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

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

func (*Client) BeginTx

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

BeginTx returns a transactional client with specified options.

func (*Client) Close

func (c *Client) Close() error

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

func (*Client) Debug

func (c *Client) Debug() *Client

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

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

func (*Client) GetClient

func (c *Client) GetClient() *sql.Driver

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) Ping

func (c *Client) Ping() error

func (*Client) Tx

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

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

func (*Client) Use

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

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

type CommitFunc

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

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

func (CommitFunc) Commit

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

Commit calls f(ctx, m).

type CommitHook

type CommitHook func(Committer) Committer

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

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

type Committer

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

Committer is the interface that wraps the Commit method.

type ConstraintError

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

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

func (ConstraintError) Error

func (e ConstraintError) Error() string

Error implements the error interface.

func (*ConstraintError) Unwrap

func (e *ConstraintError) Unwrap() error

Unwrap implements the errors.Wrapper interface.

type Follow

type Follow struct {

	// ID of the ent.
	ID uuid.UUID `json:"id,omitempty"`
	// IsRemote holds the value of the "isRemote" field.
	IsRemote bool `json:"isRemote,omitempty"`
	// URI holds the value of the "uri" field.
	URI string `json:"uri,omitempty"`
	// Extensions holds the value of the "extensions" field.
	Extensions versia.Extensions `json:"extensions,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"`
	// Status holds the value of the "status" field.
	Status follow.Status `json:"status,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the FollowQuery when eager-loading is set.
	Edges FollowEdges `json:"edges"`
	// contains filtered or unexported fields
}

Follow is the model entity for the Follow schema.

func (*Follow) QueryFollowee

func (f *Follow) QueryFollowee() *UserQuery

QueryFollowee queries the "followee" edge of the Follow entity.

func (*Follow) QueryFollower

func (f *Follow) QueryFollower() *UserQuery

QueryFollower queries the "follower" edge of the Follow entity.

func (*Follow) String

func (f *Follow) String() string

String implements the fmt.Stringer.

func (*Follow) Unwrap

func (f *Follow) Unwrap() *Follow

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

func (f *Follow) Update() *FollowUpdateOne

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

func (*Follow) Value

func (f *Follow) Value(name string) (ent.Value, error)

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

type FollowClient

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

FollowClient is a client for the Follow schema.

func NewFollowClient

func NewFollowClient(c config) *FollowClient

NewFollowClient returns a client for the Follow from the given config.

func (*FollowClient) Create

func (c *FollowClient) Create() *FollowCreate

Create returns a builder for creating a Follow entity.

func (*FollowClient) CreateBulk

func (c *FollowClient) CreateBulk(builders ...*FollowCreate) *FollowCreateBulk

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

func (*FollowClient) Delete

func (c *FollowClient) Delete() *FollowDelete

Delete returns a delete builder for Follow.

func (*FollowClient) DeleteOne

func (c *FollowClient) DeleteOne(f *Follow) *FollowDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*FollowClient) DeleteOneID

func (c *FollowClient) DeleteOneID(id uuid.UUID) *FollowDeleteOne

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

func (*FollowClient) Get

func (c *FollowClient) Get(ctx context.Context, id uuid.UUID) (*Follow, error)

Get returns a Follow entity by its id.

func (*FollowClient) GetX

func (c *FollowClient) GetX(ctx context.Context, id uuid.UUID) *Follow

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

func (*FollowClient) Hooks

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

Hooks returns the client hooks.

func (*FollowClient) Intercept

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

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

func (*FollowClient) Interceptors

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

Interceptors returns the client interceptors.

func (*FollowClient) MapCreateBulk

func (c *FollowClient) MapCreateBulk(slice any, setFunc func(*FollowCreate, int)) *FollowCreateBulk

MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.

func (*FollowClient) Query

func (c *FollowClient) Query() *FollowQuery

Query returns a query builder for Follow.

func (*FollowClient) QueryFollowee

func (c *FollowClient) QueryFollowee(f *Follow) *UserQuery

QueryFollowee queries the followee edge of a Follow.

func (*FollowClient) QueryFollower

func (c *FollowClient) QueryFollower(f *Follow) *UserQuery

QueryFollower queries the follower edge of a Follow.

func (*FollowClient) Update

func (c *FollowClient) Update() *FollowUpdate

Update returns an update builder for Follow.

func (*FollowClient) UpdateOne

func (c *FollowClient) UpdateOne(f *Follow) *FollowUpdateOne

UpdateOne returns an update builder for the given entity.

func (*FollowClient) UpdateOneID

func (c *FollowClient) UpdateOneID(id uuid.UUID) *FollowUpdateOne

UpdateOneID returns an update builder for the given id.

func (*FollowClient) Use

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

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

type FollowCreate

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

FollowCreate is the builder for creating a Follow entity.

func (*FollowCreate) Exec

func (fc *FollowCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*FollowCreate) ExecX

func (fc *FollowCreate) ExecX(ctx context.Context)

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

func (*FollowCreate) Mutation

func (fc *FollowCreate) Mutation() *FollowMutation

Mutation returns the FollowMutation object of the builder.

func (*FollowCreate) OnConflict

func (fc *FollowCreate) OnConflict(opts ...sql.ConflictOption) *FollowUpsertOne

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

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

func (*FollowCreate) OnConflictColumns

func (fc *FollowCreate) OnConflictColumns(columns ...string) *FollowUpsertOne

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

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

func (*FollowCreate) Save

func (fc *FollowCreate) Save(ctx context.Context) (*Follow, error)

Save creates the Follow in the database.

func (*FollowCreate) SaveX

func (fc *FollowCreate) SaveX(ctx context.Context) *Follow

SaveX calls Save and panics if Save returns an error.

func (*FollowCreate) SetCreatedAt

func (fc *FollowCreate) SetCreatedAt(t time.Time) *FollowCreate

SetCreatedAt sets the "created_at" field.

func (*FollowCreate) SetExtensions

func (fc *FollowCreate) SetExtensions(v versia.Extensions) *FollowCreate

SetExtensions sets the "extensions" field.

func (*FollowCreate) SetFollowee

func (fc *FollowCreate) SetFollowee(u *User) *FollowCreate

SetFollowee sets the "followee" edge to the User entity.

func (*FollowCreate) SetFolloweeID

func (fc *FollowCreate) SetFolloweeID(id uuid.UUID) *FollowCreate

SetFolloweeID sets the "followee" edge to the User entity by ID.

func (*FollowCreate) SetFollower

func (fc *FollowCreate) SetFollower(u *User) *FollowCreate

SetFollower sets the "follower" edge to the User entity.

func (*FollowCreate) SetFollowerID

func (fc *FollowCreate) SetFollowerID(id uuid.UUID) *FollowCreate

SetFollowerID sets the "follower" edge to the User entity by ID.

func (*FollowCreate) SetID

func (fc *FollowCreate) SetID(u uuid.UUID) *FollowCreate

SetID sets the "id" field.

func (*FollowCreate) SetIsRemote

func (fc *FollowCreate) SetIsRemote(b bool) *FollowCreate

SetIsRemote sets the "isRemote" field.

func (*FollowCreate) SetNillableCreatedAt

func (fc *FollowCreate) SetNillableCreatedAt(t *time.Time) *FollowCreate

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

func (*FollowCreate) SetNillableID

func (fc *FollowCreate) SetNillableID(u *uuid.UUID) *FollowCreate

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

func (*FollowCreate) SetNillableStatus

func (fc *FollowCreate) SetNillableStatus(f *follow.Status) *FollowCreate

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

func (*FollowCreate) SetNillableUpdatedAt

func (fc *FollowCreate) SetNillableUpdatedAt(t *time.Time) *FollowCreate

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

func (*FollowCreate) SetStatus

func (fc *FollowCreate) SetStatus(f follow.Status) *FollowCreate

SetStatus sets the "status" field.

func (*FollowCreate) SetURI

func (fc *FollowCreate) SetURI(s string) *FollowCreate

SetURI sets the "uri" field.

func (*FollowCreate) SetUpdatedAt

func (fc *FollowCreate) SetUpdatedAt(t time.Time) *FollowCreate

SetUpdatedAt sets the "updated_at" field.

type FollowCreateBulk

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

FollowCreateBulk is the builder for creating many Follow entities in bulk.

func (*FollowCreateBulk) Exec

func (fcb *FollowCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*FollowCreateBulk) ExecX

func (fcb *FollowCreateBulk) ExecX(ctx context.Context)

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

func (*FollowCreateBulk) OnConflict

func (fcb *FollowCreateBulk) OnConflict(opts ...sql.ConflictOption) *FollowUpsertBulk

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

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

func (*FollowCreateBulk) OnConflictColumns

func (fcb *FollowCreateBulk) OnConflictColumns(columns ...string) *FollowUpsertBulk

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

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

func (*FollowCreateBulk) Save

func (fcb *FollowCreateBulk) Save(ctx context.Context) ([]*Follow, error)

Save creates the Follow entities in the database.

func (*FollowCreateBulk) SaveX

func (fcb *FollowCreateBulk) SaveX(ctx context.Context) []*Follow

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

type FollowDelete

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

FollowDelete is the builder for deleting a Follow entity.

func (*FollowDelete) Exec

func (fd *FollowDelete) Exec(ctx context.Context) (int, error)

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

func (*FollowDelete) ExecX

func (fd *FollowDelete) ExecX(ctx context.Context) int

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

func (*FollowDelete) Where

func (fd *FollowDelete) Where(ps ...predicate.Follow) *FollowDelete

Where appends a list predicates to the FollowDelete builder.

type FollowDeleteOne

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

FollowDeleteOne is the builder for deleting a single Follow entity.

func (*FollowDeleteOne) Exec

func (fdo *FollowDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*FollowDeleteOne) ExecX

func (fdo *FollowDeleteOne) ExecX(ctx context.Context)

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

func (*FollowDeleteOne) Where

func (fdo *FollowDeleteOne) Where(ps ...predicate.Follow) *FollowDeleteOne

Where appends a list predicates to the FollowDelete builder.

type FollowEdges

type FollowEdges struct {
	// Follower holds the value of the follower edge.
	Follower *User `json:"follower,omitempty"`
	// Followee holds the value of the followee edge.
	Followee *User `json:"followee,omitempty"`
	// contains filtered or unexported fields
}

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

func (FollowEdges) FolloweeOrErr

func (e FollowEdges) FolloweeOrErr() (*User, error)

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

func (FollowEdges) FollowerOrErr

func (e FollowEdges) FollowerOrErr() (*User, error)

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

type FollowGroupBy

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

FollowGroupBy is the group-by builder for Follow entities.

func (*FollowGroupBy) Aggregate

func (fgb *FollowGroupBy) Aggregate(fns ...AggregateFunc) *FollowGroupBy

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

func (*FollowGroupBy) Bool

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

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

func (*FollowGroupBy) BoolX

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

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

func (*FollowGroupBy) Bools

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

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

func (*FollowGroupBy) BoolsX

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

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

func (*FollowGroupBy) Float64

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

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

func (*FollowGroupBy) Float64X

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

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

func (*FollowGroupBy) Float64s

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

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

func (*FollowGroupBy) Float64sX

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

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

func (*FollowGroupBy) Int

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

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

func (*FollowGroupBy) IntX

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

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

func (*FollowGroupBy) Ints

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

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

func (*FollowGroupBy) IntsX

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

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

func (*FollowGroupBy) Scan

func (fgb *FollowGroupBy) Scan(ctx context.Context, v any) error

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

func (*FollowGroupBy) ScanX

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

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

func (*FollowGroupBy) String

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

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

func (*FollowGroupBy) StringX

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

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

func (*FollowGroupBy) Strings

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

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

func (*FollowGroupBy) StringsX

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

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

type FollowMutation

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

FollowMutation represents an operation that mutates the Follow nodes in the graph.

func (*FollowMutation) AddField

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

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

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

func (*FollowMutation) AddedField

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

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

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

func (*FollowMutation) AddedIDs

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

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

func (*FollowMutation) ClearEdge

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

func (m *FollowMutation) 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 (*FollowMutation) ClearFollowee

func (m *FollowMutation) ClearFollowee()

ClearFollowee clears the "followee" edge to the User entity.

func (*FollowMutation) ClearFollower

func (m *FollowMutation) ClearFollower()

ClearFollower clears the "follower" edge to the User entity.

func (*FollowMutation) ClearedEdges

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

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

func (*FollowMutation) ClearedFields

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

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

func (FollowMutation) Client

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

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

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

func (*FollowMutation) EdgeCleared

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

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

func (*FollowMutation) Extensions

func (m *FollowMutation) Extensions() (r versia.Extensions, exists bool)

Extensions returns the value of the "extensions" field in the mutation.

func (*FollowMutation) Field

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

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

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

func (*FollowMutation) Fields

func (m *FollowMutation) 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 (*FollowMutation) FolloweeCleared

func (m *FollowMutation) FolloweeCleared() bool

FolloweeCleared reports if the "followee" edge to the User entity was cleared.

func (*FollowMutation) FolloweeID

func (m *FollowMutation) FolloweeID() (id uuid.UUID, exists bool)

FolloweeID returns the "followee" edge ID in the mutation.

func (*FollowMutation) FolloweeIDs

func (m *FollowMutation) FolloweeIDs() (ids []uuid.UUID)

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

func (*FollowMutation) FollowerCleared

func (m *FollowMutation) FollowerCleared() bool

FollowerCleared reports if the "follower" edge to the User entity was cleared.

func (*FollowMutation) FollowerID

func (m *FollowMutation) FollowerID() (id uuid.UUID, exists bool)

FollowerID returns the "follower" edge ID in the mutation.

func (*FollowMutation) FollowerIDs

func (m *FollowMutation) FollowerIDs() (ids []uuid.UUID)

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

func (*FollowMutation) ID

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

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

func (*FollowMutation) IDs

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

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

func (*FollowMutation) IsRemote

func (m *FollowMutation) IsRemote() (r bool, exists bool)

IsRemote returns the value of the "isRemote" field in the mutation.

func (*FollowMutation) OldCreatedAt

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

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

func (m *FollowMutation) OldExtensions(ctx context.Context) (v versia.Extensions, err error)

OldExtensions returns the old "extensions" field's value of the Follow entity. If the Follow 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 (*FollowMutation) OldField

func (m *FollowMutation) 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 (*FollowMutation) OldIsRemote

func (m *FollowMutation) OldIsRemote(ctx context.Context) (v bool, err error)

OldIsRemote returns the old "isRemote" field's value of the Follow entity. If the Follow 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 (*FollowMutation) OldStatus

func (m *FollowMutation) OldStatus(ctx context.Context) (v follow.Status, err error)

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

func (m *FollowMutation) OldURI(ctx context.Context) (v string, err error)

OldURI returns the old "uri" field's value of the Follow entity. If the Follow 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 (*FollowMutation) OldUpdatedAt

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

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

func (m *FollowMutation) Op() Op

Op returns the operation name.

func (*FollowMutation) RemovedEdges

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

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

func (*FollowMutation) RemovedIDs

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

func (m *FollowMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*FollowMutation) ResetEdge

func (m *FollowMutation) 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 (*FollowMutation) ResetExtensions

func (m *FollowMutation) ResetExtensions()

ResetExtensions resets all changes to the "extensions" field.

func (*FollowMutation) ResetField

func (m *FollowMutation) 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 (*FollowMutation) ResetFollowee

func (m *FollowMutation) ResetFollowee()

ResetFollowee resets all changes to the "followee" edge.

func (*FollowMutation) ResetFollower

func (m *FollowMutation) ResetFollower()

ResetFollower resets all changes to the "follower" edge.

func (*FollowMutation) ResetIsRemote

func (m *FollowMutation) ResetIsRemote()

ResetIsRemote resets all changes to the "isRemote" field.

func (*FollowMutation) ResetStatus

func (m *FollowMutation) ResetStatus()

ResetStatus resets all changes to the "status" field.

func (*FollowMutation) ResetURI

func (m *FollowMutation) ResetURI()

ResetURI resets all changes to the "uri" field.

func (*FollowMutation) ResetUpdatedAt

func (m *FollowMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*FollowMutation) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*FollowMutation) SetExtensions

func (m *FollowMutation) SetExtensions(v versia.Extensions)

SetExtensions sets the "extensions" field.

func (*FollowMutation) SetField

func (m *FollowMutation) 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 (*FollowMutation) SetFolloweeID

func (m *FollowMutation) SetFolloweeID(id uuid.UUID)

SetFolloweeID sets the "followee" edge to the User entity by id.

func (*FollowMutation) SetFollowerID

func (m *FollowMutation) SetFollowerID(id uuid.UUID)

SetFollowerID sets the "follower" edge to the User entity by id.

func (*FollowMutation) SetID

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

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

func (*FollowMutation) SetIsRemote

func (m *FollowMutation) SetIsRemote(b bool)

SetIsRemote sets the "isRemote" field.

func (*FollowMutation) SetOp

func (m *FollowMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*FollowMutation) SetStatus

func (m *FollowMutation) SetStatus(f follow.Status)

SetStatus sets the "status" field.

func (*FollowMutation) SetURI

func (m *FollowMutation) SetURI(s string)

SetURI sets the "uri" field.

func (*FollowMutation) SetUpdatedAt

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

SetUpdatedAt sets the "updated_at" field.

func (*FollowMutation) Status

func (m *FollowMutation) Status() (r follow.Status, exists bool)

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

func (FollowMutation) Tx

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

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

func (*FollowMutation) Type

func (m *FollowMutation) Type() string

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

func (*FollowMutation) URI

func (m *FollowMutation) URI() (r string, exists bool)

URI returns the value of the "uri" field in the mutation.

func (*FollowMutation) UpdatedAt

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

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

func (*FollowMutation) Where

func (m *FollowMutation) Where(ps ...predicate.Follow)

Where appends a list predicates to the FollowMutation builder.

func (*FollowMutation) WhereP

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

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

type FollowQuery

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

FollowQuery is the builder for querying Follow entities.

func (*FollowQuery) Aggregate

func (fq *FollowQuery) Aggregate(fns ...AggregateFunc) *FollowSelect

Aggregate returns a FollowSelect configured with the given aggregations.

func (*FollowQuery) All

func (fq *FollowQuery) All(ctx context.Context) ([]*Follow, error)

All executes the query and returns a list of Follows.

func (*FollowQuery) AllX

func (fq *FollowQuery) AllX(ctx context.Context) []*Follow

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

func (*FollowQuery) Clone

func (fq *FollowQuery) Clone() *FollowQuery

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

func (*FollowQuery) Count

func (fq *FollowQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*FollowQuery) CountX

func (fq *FollowQuery) CountX(ctx context.Context) int

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

func (*FollowQuery) Exist

func (fq *FollowQuery) Exist(ctx context.Context) (bool, error)

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

func (*FollowQuery) ExistX

func (fq *FollowQuery) ExistX(ctx context.Context) bool

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

func (*FollowQuery) First

func (fq *FollowQuery) First(ctx context.Context) (*Follow, error)

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

func (*FollowQuery) FirstID

func (fq *FollowQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

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

func (*FollowQuery) FirstIDX

func (fq *FollowQuery) FirstIDX(ctx context.Context) uuid.UUID

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

func (*FollowQuery) FirstX

func (fq *FollowQuery) FirstX(ctx context.Context) *Follow

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

func (*FollowQuery) GroupBy

func (fq *FollowQuery) GroupBy(field string, fields ...string) *FollowGroupBy

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 {
	IsRemote bool `json:"isRemote,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Follow.Query().
	GroupBy(follow.FieldIsRemote).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*FollowQuery) IDs

func (fq *FollowQuery) IDs(ctx context.Context) (ids []uuid.UUID, err error)

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

func (*FollowQuery) IDsX

func (fq *FollowQuery) IDsX(ctx context.Context) []uuid.UUID

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

func (*FollowQuery) Limit

func (fq *FollowQuery) Limit(limit int) *FollowQuery

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

func (*FollowQuery) Offset

func (fq *FollowQuery) Offset(offset int) *FollowQuery

Offset to start from.

func (*FollowQuery) Only

func (fq *FollowQuery) Only(ctx context.Context) (*Follow, error)

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

func (*FollowQuery) OnlyID

func (fq *FollowQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

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

func (*FollowQuery) OnlyIDX

func (fq *FollowQuery) OnlyIDX(ctx context.Context) uuid.UUID

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

func (*FollowQuery) OnlyX

func (fq *FollowQuery) OnlyX(ctx context.Context) *Follow

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

func (*FollowQuery) Order

func (fq *FollowQuery) Order(o ...follow.OrderOption) *FollowQuery

Order specifies how the records should be ordered.

func (*FollowQuery) QueryFollowee

func (fq *FollowQuery) QueryFollowee() *UserQuery

QueryFollowee chains the current query on the "followee" edge.

func (*FollowQuery) QueryFollower

func (fq *FollowQuery) QueryFollower() *UserQuery

QueryFollower chains the current query on the "follower" edge.

func (*FollowQuery) Select

func (fq *FollowQuery) Select(fields ...string) *FollowSelect

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 {
	IsRemote bool `json:"isRemote,omitempty"`
}

client.Follow.Query().
	Select(follow.FieldIsRemote).
	Scan(ctx, &v)

func (*FollowQuery) Unique

func (fq *FollowQuery) Unique(unique bool) *FollowQuery

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

func (fq *FollowQuery) Where(ps ...predicate.Follow) *FollowQuery

Where adds a new predicate for the FollowQuery builder.

func (*FollowQuery) WithFollowee

func (fq *FollowQuery) WithFollowee(opts ...func(*UserQuery)) *FollowQuery

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

func (*FollowQuery) WithFollower

func (fq *FollowQuery) WithFollower(opts ...func(*UserQuery)) *FollowQuery

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

type FollowSelect

type FollowSelect struct {
	*FollowQuery
	// contains filtered or unexported fields
}

FollowSelect is the builder for selecting fields of Follow entities.

func (*FollowSelect) Aggregate

func (fs *FollowSelect) Aggregate(fns ...AggregateFunc) *FollowSelect

Aggregate adds the given aggregation functions to the selector query.

func (*FollowSelect) Bool

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

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

func (*FollowSelect) BoolX

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

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

func (*FollowSelect) Bools

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

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

func (*FollowSelect) BoolsX

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

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

func (*FollowSelect) Float64

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

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

func (*FollowSelect) Float64X

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

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

func (*FollowSelect) Float64s

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

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

func (*FollowSelect) Float64sX

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

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

func (*FollowSelect) Int

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

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

func (*FollowSelect) IntX

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

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

func (*FollowSelect) Ints

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

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

func (*FollowSelect) IntsX

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

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

func (*FollowSelect) Scan

func (fs *FollowSelect) Scan(ctx context.Context, v any) error

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

func (*FollowSelect) ScanX

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

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

func (*FollowSelect) String

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

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

func (*FollowSelect) StringX

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

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

func (*FollowSelect) Strings

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

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

func (*FollowSelect) StringsX

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

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

type FollowUpdate

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

FollowUpdate is the builder for updating Follow entities.

func (*FollowUpdate) ClearFollowee

func (fu *FollowUpdate) ClearFollowee() *FollowUpdate

ClearFollowee clears the "followee" edge to the User entity.

func (*FollowUpdate) ClearFollower

func (fu *FollowUpdate) ClearFollower() *FollowUpdate

ClearFollower clears the "follower" edge to the User entity.

func (*FollowUpdate) Exec

func (fu *FollowUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*FollowUpdate) ExecX

func (fu *FollowUpdate) ExecX(ctx context.Context)

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

func (*FollowUpdate) Mutation

func (fu *FollowUpdate) Mutation() *FollowMutation

Mutation returns the FollowMutation object of the builder.

func (*FollowUpdate) Save

func (fu *FollowUpdate) Save(ctx context.Context) (int, error)

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

func (*FollowUpdate) SaveX

func (fu *FollowUpdate) SaveX(ctx context.Context) int

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

func (*FollowUpdate) SetExtensions

func (fu *FollowUpdate) SetExtensions(v versia.Extensions) *FollowUpdate

SetExtensions sets the "extensions" field.

func (*FollowUpdate) SetFollowee

func (fu *FollowUpdate) SetFollowee(u *User) *FollowUpdate

SetFollowee sets the "followee" edge to the User entity.

func (*FollowUpdate) SetFolloweeID

func (fu *FollowUpdate) SetFolloweeID(id uuid.UUID) *FollowUpdate

SetFolloweeID sets the "followee" edge to the User entity by ID.

func (*FollowUpdate) SetFollower

func (fu *FollowUpdate) SetFollower(u *User) *FollowUpdate

SetFollower sets the "follower" edge to the User entity.

func (*FollowUpdate) SetFollowerID

func (fu *FollowUpdate) SetFollowerID(id uuid.UUID) *FollowUpdate

SetFollowerID sets the "follower" edge to the User entity by ID.

func (*FollowUpdate) SetIsRemote

func (fu *FollowUpdate) SetIsRemote(b bool) *FollowUpdate

SetIsRemote sets the "isRemote" field.

func (*FollowUpdate) SetNillableIsRemote

func (fu *FollowUpdate) SetNillableIsRemote(b *bool) *FollowUpdate

SetNillableIsRemote sets the "isRemote" field if the given value is not nil.

func (*FollowUpdate) SetNillableStatus

func (fu *FollowUpdate) SetNillableStatus(f *follow.Status) *FollowUpdate

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

func (*FollowUpdate) SetNillableURI

func (fu *FollowUpdate) SetNillableURI(s *string) *FollowUpdate

SetNillableURI sets the "uri" field if the given value is not nil.

func (*FollowUpdate) SetStatus

func (fu *FollowUpdate) SetStatus(f follow.Status) *FollowUpdate

SetStatus sets the "status" field.

func (*FollowUpdate) SetURI

func (fu *FollowUpdate) SetURI(s string) *FollowUpdate

SetURI sets the "uri" field.

func (*FollowUpdate) SetUpdatedAt

func (fu *FollowUpdate) SetUpdatedAt(t time.Time) *FollowUpdate

SetUpdatedAt sets the "updated_at" field.

func (*FollowUpdate) Where

func (fu *FollowUpdate) Where(ps ...predicate.Follow) *FollowUpdate

Where appends a list predicates to the FollowUpdate builder.

type FollowUpdateOne

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

FollowUpdateOne is the builder for updating a single Follow entity.

func (*FollowUpdateOne) ClearFollowee

func (fuo *FollowUpdateOne) ClearFollowee() *FollowUpdateOne

ClearFollowee clears the "followee" edge to the User entity.

func (*FollowUpdateOne) ClearFollower

func (fuo *FollowUpdateOne) ClearFollower() *FollowUpdateOne

ClearFollower clears the "follower" edge to the User entity.

func (*FollowUpdateOne) Exec

func (fuo *FollowUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*FollowUpdateOne) ExecX

func (fuo *FollowUpdateOne) ExecX(ctx context.Context)

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

func (*FollowUpdateOne) Mutation

func (fuo *FollowUpdateOne) Mutation() *FollowMutation

Mutation returns the FollowMutation object of the builder.

func (*FollowUpdateOne) Save

func (fuo *FollowUpdateOne) Save(ctx context.Context) (*Follow, error)

Save executes the query and returns the updated Follow entity.

func (*FollowUpdateOne) SaveX

func (fuo *FollowUpdateOne) SaveX(ctx context.Context) *Follow

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

func (*FollowUpdateOne) Select

func (fuo *FollowUpdateOne) Select(field string, fields ...string) *FollowUpdateOne

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

func (*FollowUpdateOne) SetExtensions

func (fuo *FollowUpdateOne) SetExtensions(v versia.Extensions) *FollowUpdateOne

SetExtensions sets the "extensions" field.

func (*FollowUpdateOne) SetFollowee

func (fuo *FollowUpdateOne) SetFollowee(u *User) *FollowUpdateOne

SetFollowee sets the "followee" edge to the User entity.

func (*FollowUpdateOne) SetFolloweeID

func (fuo *FollowUpdateOne) SetFolloweeID(id uuid.UUID) *FollowUpdateOne

SetFolloweeID sets the "followee" edge to the User entity by ID.

func (*FollowUpdateOne) SetFollower

func (fuo *FollowUpdateOne) SetFollower(u *User) *FollowUpdateOne

SetFollower sets the "follower" edge to the User entity.

func (*FollowUpdateOne) SetFollowerID

func (fuo *FollowUpdateOne) SetFollowerID(id uuid.UUID) *FollowUpdateOne

SetFollowerID sets the "follower" edge to the User entity by ID.

func (*FollowUpdateOne) SetIsRemote

func (fuo *FollowUpdateOne) SetIsRemote(b bool) *FollowUpdateOne

SetIsRemote sets the "isRemote" field.

func (*FollowUpdateOne) SetNillableIsRemote

func (fuo *FollowUpdateOne) SetNillableIsRemote(b *bool) *FollowUpdateOne

SetNillableIsRemote sets the "isRemote" field if the given value is not nil.

func (*FollowUpdateOne) SetNillableStatus

func (fuo *FollowUpdateOne) SetNillableStatus(f *follow.Status) *FollowUpdateOne

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

func (*FollowUpdateOne) SetNillableURI

func (fuo *FollowUpdateOne) SetNillableURI(s *string) *FollowUpdateOne

SetNillableURI sets the "uri" field if the given value is not nil.

func (*FollowUpdateOne) SetStatus

func (fuo *FollowUpdateOne) SetStatus(f follow.Status) *FollowUpdateOne

SetStatus sets the "status" field.

func (*FollowUpdateOne) SetURI

func (fuo *FollowUpdateOne) SetURI(s string) *FollowUpdateOne

SetURI sets the "uri" field.

func (*FollowUpdateOne) SetUpdatedAt

func (fuo *FollowUpdateOne) SetUpdatedAt(t time.Time) *FollowUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*FollowUpdateOne) Where

func (fuo *FollowUpdateOne) Where(ps ...predicate.Follow) *FollowUpdateOne

Where appends a list predicates to the FollowUpdate builder.

type FollowUpsert

type FollowUpsert struct {
	*sql.UpdateSet
}

FollowUpsert is the "OnConflict" setter.

func (*FollowUpsert) SetExtensions

func (u *FollowUpsert) SetExtensions(v versia.Extensions) *FollowUpsert

SetExtensions sets the "extensions" field.

func (*FollowUpsert) SetIsRemote

func (u *FollowUpsert) SetIsRemote(v bool) *FollowUpsert

SetIsRemote sets the "isRemote" field.

func (*FollowUpsert) SetStatus

func (u *FollowUpsert) SetStatus(v follow.Status) *FollowUpsert

SetStatus sets the "status" field.

func (*FollowUpsert) SetURI

func (u *FollowUpsert) SetURI(v string) *FollowUpsert

SetURI sets the "uri" field.

func (*FollowUpsert) SetUpdatedAt

func (u *FollowUpsert) SetUpdatedAt(v time.Time) *FollowUpsert

SetUpdatedAt sets the "updated_at" field.

func (*FollowUpsert) UpdateExtensions

func (u *FollowUpsert) UpdateExtensions() *FollowUpsert

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

func (*FollowUpsert) UpdateIsRemote

func (u *FollowUpsert) UpdateIsRemote() *FollowUpsert

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

func (*FollowUpsert) UpdateStatus

func (u *FollowUpsert) UpdateStatus() *FollowUpsert

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

func (*FollowUpsert) UpdateURI

func (u *FollowUpsert) UpdateURI() *FollowUpsert

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

func (*FollowUpsert) UpdateUpdatedAt

func (u *FollowUpsert) UpdateUpdatedAt() *FollowUpsert

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

type FollowUpsertBulk

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

FollowUpsertBulk is the builder for "upsert"-ing a bulk of Follow nodes.

func (*FollowUpsertBulk) DoNothing

func (u *FollowUpsertBulk) DoNothing() *FollowUpsertBulk

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

func (*FollowUpsertBulk) Exec

func (u *FollowUpsertBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*FollowUpsertBulk) ExecX

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

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

func (*FollowUpsertBulk) Ignore

func (u *FollowUpsertBulk) Ignore() *FollowUpsertBulk

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

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

func (*FollowUpsertBulk) SetExtensions

func (u *FollowUpsertBulk) SetExtensions(v versia.Extensions) *FollowUpsertBulk

SetExtensions sets the "extensions" field.

func (*FollowUpsertBulk) SetIsRemote

func (u *FollowUpsertBulk) SetIsRemote(v bool) *FollowUpsertBulk

SetIsRemote sets the "isRemote" field.

func (*FollowUpsertBulk) SetStatus

SetStatus sets the "status" field.

func (*FollowUpsertBulk) SetURI

SetURI sets the "uri" field.

func (*FollowUpsertBulk) SetUpdatedAt

func (u *FollowUpsertBulk) SetUpdatedAt(v time.Time) *FollowUpsertBulk

SetUpdatedAt sets the "updated_at" field.

func (*FollowUpsertBulk) Update

func (u *FollowUpsertBulk) Update(set func(*FollowUpsert)) *FollowUpsertBulk

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

func (*FollowUpsertBulk) UpdateExtensions

func (u *FollowUpsertBulk) UpdateExtensions() *FollowUpsertBulk

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

func (*FollowUpsertBulk) UpdateIsRemote

func (u *FollowUpsertBulk) UpdateIsRemote() *FollowUpsertBulk

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

func (*FollowUpsertBulk) UpdateNewValues

func (u *FollowUpsertBulk) UpdateNewValues() *FollowUpsertBulk

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

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

func (*FollowUpsertBulk) UpdateStatus

func (u *FollowUpsertBulk) UpdateStatus() *FollowUpsertBulk

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

func (*FollowUpsertBulk) UpdateURI

func (u *FollowUpsertBulk) UpdateURI() *FollowUpsertBulk

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

func (*FollowUpsertBulk) UpdateUpdatedAt

func (u *FollowUpsertBulk) UpdateUpdatedAt() *FollowUpsertBulk

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

type FollowUpsertOne

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

FollowUpsertOne is the builder for "upsert"-ing

one Follow node.

func (*FollowUpsertOne) DoNothing

func (u *FollowUpsertOne) DoNothing() *FollowUpsertOne

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

func (*FollowUpsertOne) Exec

func (u *FollowUpsertOne) Exec(ctx context.Context) error

Exec executes the query.

func (*FollowUpsertOne) ExecX

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

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

func (*FollowUpsertOne) ID

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

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

func (*FollowUpsertOne) IDX

func (u *FollowUpsertOne) IDX(ctx context.Context) uuid.UUID

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

func (*FollowUpsertOne) Ignore

func (u *FollowUpsertOne) Ignore() *FollowUpsertOne

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

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

func (*FollowUpsertOne) SetExtensions

func (u *FollowUpsertOne) SetExtensions(v versia.Extensions) *FollowUpsertOne

SetExtensions sets the "extensions" field.

func (*FollowUpsertOne) SetIsRemote

func (u *FollowUpsertOne) SetIsRemote(v bool) *FollowUpsertOne

SetIsRemote sets the "isRemote" field.

func (*FollowUpsertOne) SetStatus

func (u *FollowUpsertOne) SetStatus(v follow.Status) *FollowUpsertOne

SetStatus sets the "status" field.

func (*FollowUpsertOne) SetURI

func (u *FollowUpsertOne) SetURI(v string) *FollowUpsertOne

SetURI sets the "uri" field.

func (*FollowUpsertOne) SetUpdatedAt

func (u *FollowUpsertOne) SetUpdatedAt(v time.Time) *FollowUpsertOne

SetUpdatedAt sets the "updated_at" field.

func (*FollowUpsertOne) Update

func (u *FollowUpsertOne) Update(set func(*FollowUpsert)) *FollowUpsertOne

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

func (*FollowUpsertOne) UpdateExtensions

func (u *FollowUpsertOne) UpdateExtensions() *FollowUpsertOne

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

func (*FollowUpsertOne) UpdateIsRemote

func (u *FollowUpsertOne) UpdateIsRemote() *FollowUpsertOne

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

func (*FollowUpsertOne) UpdateNewValues

func (u *FollowUpsertOne) UpdateNewValues() *FollowUpsertOne

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

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

func (*FollowUpsertOne) UpdateStatus

func (u *FollowUpsertOne) UpdateStatus() *FollowUpsertOne

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

func (*FollowUpsertOne) UpdateURI

func (u *FollowUpsertOne) UpdateURI() *FollowUpsertOne

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

func (*FollowUpsertOne) UpdateUpdatedAt

func (u *FollowUpsertOne) UpdateUpdatedAt() *FollowUpsertOne

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

type Follows

type Follows []*Follow

Follows is a parsable slice of Follow.

type Hook

type Hook = ent.Hook

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

type Image

type Image struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// URL holds the value of the "url" field.
	URL string `json:"url,omitempty"`
	// MimeType holds the value of the "mimeType" field.
	MimeType string `json:"mimeType,omitempty"`
	// contains filtered or unexported fields
}

Image is the model entity for the Image schema.

func (*Image) String

func (i *Image) String() string

String implements the fmt.Stringer.

func (*Image) Unwrap

func (i *Image) Unwrap() *Image

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

func (i *Image) Update() *ImageUpdateOne

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

func (*Image) Value

func (i *Image) Value(name string) (ent.Value, error)

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

type ImageClient

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

ImageClient is a client for the Image schema.

func NewImageClient

func NewImageClient(c config) *ImageClient

NewImageClient returns a client for the Image from the given config.

func (*ImageClient) Create

func (c *ImageClient) Create() *ImageCreate

Create returns a builder for creating a Image entity.

func (*ImageClient) CreateBulk

func (c *ImageClient) CreateBulk(builders ...*ImageCreate) *ImageCreateBulk

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

func (*ImageClient) Delete

func (c *ImageClient) Delete() *ImageDelete

Delete returns a delete builder for Image.

func (*ImageClient) DeleteOne

func (c *ImageClient) DeleteOne(i *Image) *ImageDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*ImageClient) DeleteOneID

func (c *ImageClient) DeleteOneID(id int) *ImageDeleteOne

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

func (*ImageClient) Get

func (c *ImageClient) Get(ctx context.Context, id int) (*Image, error)

Get returns a Image entity by its id.

func (*ImageClient) GetX

func (c *ImageClient) GetX(ctx context.Context, id int) *Image

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

func (*ImageClient) Hooks

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

Hooks returns the client hooks.

func (*ImageClient) Intercept

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

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

func (*ImageClient) Interceptors

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

Interceptors returns the client interceptors.

func (*ImageClient) MapCreateBulk

func (c *ImageClient) MapCreateBulk(slice any, setFunc func(*ImageCreate, int)) *ImageCreateBulk

MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.

func (*ImageClient) Query

func (c *ImageClient) Query() *ImageQuery

Query returns a query builder for Image.

func (*ImageClient) Update

func (c *ImageClient) Update() *ImageUpdate

Update returns an update builder for Image.

func (*ImageClient) UpdateOne

func (c *ImageClient) UpdateOne(i *Image) *ImageUpdateOne

UpdateOne returns an update builder for the given entity.

func (*ImageClient) UpdateOneID

func (c *ImageClient) UpdateOneID(id int) *ImageUpdateOne

UpdateOneID returns an update builder for the given id.

func (*ImageClient) Use

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

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

type ImageCreate

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

ImageCreate is the builder for creating a Image entity.

func (*ImageCreate) Exec

func (ic *ImageCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*ImageCreate) ExecX

func (ic *ImageCreate) ExecX(ctx context.Context)

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

func (*ImageCreate) Mutation

func (ic *ImageCreate) Mutation() *ImageMutation

Mutation returns the ImageMutation object of the builder.

func (*ImageCreate) OnConflict

func (ic *ImageCreate) OnConflict(opts ...sql.ConflictOption) *ImageUpsertOne

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

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

func (*ImageCreate) OnConflictColumns

func (ic *ImageCreate) OnConflictColumns(columns ...string) *ImageUpsertOne

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

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

func (*ImageCreate) Save

func (ic *ImageCreate) Save(ctx context.Context) (*Image, error)

Save creates the Image in the database.

func (*ImageCreate) SaveX

func (ic *ImageCreate) SaveX(ctx context.Context) *Image

SaveX calls Save and panics if Save returns an error.

func (*ImageCreate) SetMimeType

func (ic *ImageCreate) SetMimeType(s string) *ImageCreate

SetMimeType sets the "mimeType" field.

func (*ImageCreate) SetURL

func (ic *ImageCreate) SetURL(s string) *ImageCreate

SetURL sets the "url" field.

type ImageCreateBulk

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

ImageCreateBulk is the builder for creating many Image entities in bulk.

func (*ImageCreateBulk) Exec

func (icb *ImageCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*ImageCreateBulk) ExecX

func (icb *ImageCreateBulk) ExecX(ctx context.Context)

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

func (*ImageCreateBulk) OnConflict

func (icb *ImageCreateBulk) OnConflict(opts ...sql.ConflictOption) *ImageUpsertBulk

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

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

func (*ImageCreateBulk) OnConflictColumns

func (icb *ImageCreateBulk) OnConflictColumns(columns ...string) *ImageUpsertBulk

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

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

func (*ImageCreateBulk) Save

func (icb *ImageCreateBulk) Save(ctx context.Context) ([]*Image, error)

Save creates the Image entities in the database.

func (*ImageCreateBulk) SaveX

func (icb *ImageCreateBulk) SaveX(ctx context.Context) []*Image

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

type ImageDelete

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

ImageDelete is the builder for deleting a Image entity.

func (*ImageDelete) Exec

func (id *ImageDelete) Exec(ctx context.Context) (int, error)

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

func (*ImageDelete) ExecX

func (id *ImageDelete) ExecX(ctx context.Context) int

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

func (*ImageDelete) Where

func (id *ImageDelete) Where(ps ...predicate.Image) *ImageDelete

Where appends a list predicates to the ImageDelete builder.

type ImageDeleteOne

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

ImageDeleteOne is the builder for deleting a single Image entity.

func (*ImageDeleteOne) Exec

func (ido *ImageDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*ImageDeleteOne) ExecX

func (ido *ImageDeleteOne) ExecX(ctx context.Context)

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

func (*ImageDeleteOne) Where

func (ido *ImageDeleteOne) Where(ps ...predicate.Image) *ImageDeleteOne

Where appends a list predicates to the ImageDelete builder.

type ImageGroupBy

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

ImageGroupBy is the group-by builder for Image entities.

func (*ImageGroupBy) Aggregate

func (igb *ImageGroupBy) Aggregate(fns ...AggregateFunc) *ImageGroupBy

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

func (*ImageGroupBy) Bool

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

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

func (*ImageGroupBy) BoolX

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

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

func (*ImageGroupBy) Bools

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

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

func (*ImageGroupBy) BoolsX

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

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

func (*ImageGroupBy) Float64

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

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

func (*ImageGroupBy) Float64X

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

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

func (*ImageGroupBy) Float64s

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

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

func (*ImageGroupBy) Float64sX

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

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

func (*ImageGroupBy) Int

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

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

func (*ImageGroupBy) IntX

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

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

func (*ImageGroupBy) Ints

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

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

func (*ImageGroupBy) IntsX

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

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

func (*ImageGroupBy) Scan

func (igb *ImageGroupBy) Scan(ctx context.Context, v any) error

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

func (*ImageGroupBy) ScanX

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

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

func (*ImageGroupBy) String

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

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

func (*ImageGroupBy) StringX

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

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

func (*ImageGroupBy) Strings

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

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

func (*ImageGroupBy) StringsX

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

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

type ImageMutation

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

ImageMutation represents an operation that mutates the Image nodes in the graph.

func (*ImageMutation) AddField

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

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

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

func (*ImageMutation) AddedField

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

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

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

func (*ImageMutation) AddedIDs

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

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

func (*ImageMutation) ClearEdge

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

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

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

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

func (*ImageMutation) ClearedFields

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

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

func (ImageMutation) Client

func (m ImageMutation) 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 (*ImageMutation) EdgeCleared

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

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

func (*ImageMutation) Field

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

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

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

func (*ImageMutation) Fields

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

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

func (m *ImageMutation) 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 (*ImageMutation) MimeType

func (m *ImageMutation) MimeType() (r string, exists bool)

MimeType returns the value of the "mimeType" field in the mutation.

func (*ImageMutation) OldField

func (m *ImageMutation) 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 (*ImageMutation) OldMimeType

func (m *ImageMutation) OldMimeType(ctx context.Context) (v string, err error)

OldMimeType returns the old "mimeType" field's value of the Image entity. If the Image 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 (*ImageMutation) OldURL

func (m *ImageMutation) OldURL(ctx context.Context) (v string, err error)

OldURL returns the old "url" field's value of the Image entity. If the Image 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 (*ImageMutation) Op

func (m *ImageMutation) Op() Op

Op returns the operation name.

func (*ImageMutation) RemovedEdges

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

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

func (*ImageMutation) RemovedIDs

func (m *ImageMutation) 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 (*ImageMutation) ResetEdge

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

func (m *ImageMutation) 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 (*ImageMutation) ResetMimeType

func (m *ImageMutation) ResetMimeType()

ResetMimeType resets all changes to the "mimeType" field.

func (*ImageMutation) ResetURL

func (m *ImageMutation) ResetURL()

ResetURL resets all changes to the "url" field.

func (*ImageMutation) SetField

func (m *ImageMutation) 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 (*ImageMutation) SetMimeType

func (m *ImageMutation) SetMimeType(s string)

SetMimeType sets the "mimeType" field.

func (*ImageMutation) SetOp

func (m *ImageMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*ImageMutation) SetURL

func (m *ImageMutation) SetURL(s string)

SetURL sets the "url" field.

func (ImageMutation) Tx

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

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

func (*ImageMutation) Type

func (m *ImageMutation) Type() string

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

func (*ImageMutation) URL

func (m *ImageMutation) URL() (r string, exists bool)

URL returns the value of the "url" field in the mutation.

func (*ImageMutation) Where

func (m *ImageMutation) Where(ps ...predicate.Image)

Where appends a list predicates to the ImageMutation builder.

func (*ImageMutation) WhereP

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

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

type ImageQuery

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

ImageQuery is the builder for querying Image entities.

func (*ImageQuery) Aggregate

func (iq *ImageQuery) Aggregate(fns ...AggregateFunc) *ImageSelect

Aggregate returns a ImageSelect configured with the given aggregations.

func (*ImageQuery) All

func (iq *ImageQuery) All(ctx context.Context) ([]*Image, error)

All executes the query and returns a list of Images.

func (*ImageQuery) AllX

func (iq *ImageQuery) AllX(ctx context.Context) []*Image

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

func (*ImageQuery) Clone

func (iq *ImageQuery) Clone() *ImageQuery

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

func (*ImageQuery) Count

func (iq *ImageQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*ImageQuery) CountX

func (iq *ImageQuery) CountX(ctx context.Context) int

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

func (*ImageQuery) Exist

func (iq *ImageQuery) Exist(ctx context.Context) (bool, error)

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

func (*ImageQuery) ExistX

func (iq *ImageQuery) ExistX(ctx context.Context) bool

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

func (*ImageQuery) First

func (iq *ImageQuery) First(ctx context.Context) (*Image, error)

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

func (*ImageQuery) FirstID

func (iq *ImageQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*ImageQuery) FirstIDX

func (iq *ImageQuery) FirstIDX(ctx context.Context) int

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

func (*ImageQuery) FirstX

func (iq *ImageQuery) FirstX(ctx context.Context) *Image

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

func (*ImageQuery) GroupBy

func (iq *ImageQuery) GroupBy(field string, fields ...string) *ImageGroupBy

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

client.Image.Query().
	GroupBy(image.FieldURL).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*ImageQuery) IDs

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

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

func (*ImageQuery) IDsX

func (iq *ImageQuery) IDsX(ctx context.Context) []int

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

func (*ImageQuery) Limit

func (iq *ImageQuery) Limit(limit int) *ImageQuery

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

func (*ImageQuery) Offset

func (iq *ImageQuery) Offset(offset int) *ImageQuery

Offset to start from.

func (*ImageQuery) Only

func (iq *ImageQuery) Only(ctx context.Context) (*Image, error)

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

func (*ImageQuery) OnlyID

func (iq *ImageQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*ImageQuery) OnlyIDX

func (iq *ImageQuery) OnlyIDX(ctx context.Context) int

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

func (*ImageQuery) OnlyX

func (iq *ImageQuery) OnlyX(ctx context.Context) *Image

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

func (*ImageQuery) Order

func (iq *ImageQuery) Order(o ...image.OrderOption) *ImageQuery

Order specifies how the records should be ordered.

func (*ImageQuery) Select

func (iq *ImageQuery) Select(fields ...string) *ImageSelect

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

client.Image.Query().
	Select(image.FieldURL).
	Scan(ctx, &v)

func (*ImageQuery) Unique

func (iq *ImageQuery) Unique(unique bool) *ImageQuery

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

func (iq *ImageQuery) Where(ps ...predicate.Image) *ImageQuery

Where adds a new predicate for the ImageQuery builder.

type ImageSelect

type ImageSelect struct {
	*ImageQuery
	// contains filtered or unexported fields
}

ImageSelect is the builder for selecting fields of Image entities.

func (*ImageSelect) Aggregate

func (is *ImageSelect) Aggregate(fns ...AggregateFunc) *ImageSelect

Aggregate adds the given aggregation functions to the selector query.

func (*ImageSelect) Bool

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

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

func (*ImageSelect) BoolX

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

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

func (*ImageSelect) Bools

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

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

func (*ImageSelect) BoolsX

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

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

func (*ImageSelect) Float64

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

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

func (*ImageSelect) Float64X

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

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

func (*ImageSelect) Float64s

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

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

func (*ImageSelect) Float64sX

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

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

func (*ImageSelect) Int

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

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

func (*ImageSelect) IntX

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

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

func (*ImageSelect) Ints

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

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

func (*ImageSelect) IntsX

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

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

func (*ImageSelect) Scan

func (is *ImageSelect) Scan(ctx context.Context, v any) error

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

func (*ImageSelect) ScanX

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

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

func (*ImageSelect) String

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

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

func (*ImageSelect) StringX

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

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

func (*ImageSelect) Strings

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

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

func (*ImageSelect) StringsX

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

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

type ImageUpdate

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

ImageUpdate is the builder for updating Image entities.

func (*ImageUpdate) Exec

func (iu *ImageUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*ImageUpdate) ExecX

func (iu *ImageUpdate) ExecX(ctx context.Context)

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

func (*ImageUpdate) Mutation

func (iu *ImageUpdate) Mutation() *ImageMutation

Mutation returns the ImageMutation object of the builder.

func (*ImageUpdate) Save

func (iu *ImageUpdate) Save(ctx context.Context) (int, error)

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

func (*ImageUpdate) SaveX

func (iu *ImageUpdate) SaveX(ctx context.Context) int

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

func (*ImageUpdate) SetMimeType

func (iu *ImageUpdate) SetMimeType(s string) *ImageUpdate

SetMimeType sets the "mimeType" field.

func (*ImageUpdate) SetNillableMimeType

func (iu *ImageUpdate) SetNillableMimeType(s *string) *ImageUpdate

SetNillableMimeType sets the "mimeType" field if the given value is not nil.

func (*ImageUpdate) SetNillableURL

func (iu *ImageUpdate) SetNillableURL(s *string) *ImageUpdate

SetNillableURL sets the "url" field if the given value is not nil.

func (*ImageUpdate) SetURL

func (iu *ImageUpdate) SetURL(s string) *ImageUpdate

SetURL sets the "url" field.

func (*ImageUpdate) Where

func (iu *ImageUpdate) Where(ps ...predicate.Image) *ImageUpdate

Where appends a list predicates to the ImageUpdate builder.

type ImageUpdateOne

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

ImageUpdateOne is the builder for updating a single Image entity.

func (*ImageUpdateOne) Exec

func (iuo *ImageUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*ImageUpdateOne) ExecX

func (iuo *ImageUpdateOne) ExecX(ctx context.Context)

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

func (*ImageUpdateOne) Mutation

func (iuo *ImageUpdateOne) Mutation() *ImageMutation

Mutation returns the ImageMutation object of the builder.

func (*ImageUpdateOne) Save

func (iuo *ImageUpdateOne) Save(ctx context.Context) (*Image, error)

Save executes the query and returns the updated Image entity.

func (*ImageUpdateOne) SaveX

func (iuo *ImageUpdateOne) SaveX(ctx context.Context) *Image

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

func (*ImageUpdateOne) Select

func (iuo *ImageUpdateOne) Select(field string, fields ...string) *ImageUpdateOne

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

func (*ImageUpdateOne) SetMimeType

func (iuo *ImageUpdateOne) SetMimeType(s string) *ImageUpdateOne

SetMimeType sets the "mimeType" field.

func (*ImageUpdateOne) SetNillableMimeType

func (iuo *ImageUpdateOne) SetNillableMimeType(s *string) *ImageUpdateOne

SetNillableMimeType sets the "mimeType" field if the given value is not nil.

func (*ImageUpdateOne) SetNillableURL

func (iuo *ImageUpdateOne) SetNillableURL(s *string) *ImageUpdateOne

SetNillableURL sets the "url" field if the given value is not nil.

func (*ImageUpdateOne) SetURL

func (iuo *ImageUpdateOne) SetURL(s string) *ImageUpdateOne

SetURL sets the "url" field.

func (*ImageUpdateOne) Where

func (iuo *ImageUpdateOne) Where(ps ...predicate.Image) *ImageUpdateOne

Where appends a list predicates to the ImageUpdate builder.

type ImageUpsert

type ImageUpsert struct {
	*sql.UpdateSet
}

ImageUpsert is the "OnConflict" setter.

func (*ImageUpsert) SetMimeType

func (u *ImageUpsert) SetMimeType(v string) *ImageUpsert

SetMimeType sets the "mimeType" field.

func (*ImageUpsert) SetURL

func (u *ImageUpsert) SetURL(v string) *ImageUpsert

SetURL sets the "url" field.

func (*ImageUpsert) UpdateMimeType

func (u *ImageUpsert) UpdateMimeType() *ImageUpsert

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

func (*ImageUpsert) UpdateURL

func (u *ImageUpsert) UpdateURL() *ImageUpsert

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

type ImageUpsertBulk

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

ImageUpsertBulk is the builder for "upsert"-ing a bulk of Image nodes.

func (*ImageUpsertBulk) DoNothing

func (u *ImageUpsertBulk) DoNothing() *ImageUpsertBulk

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

func (*ImageUpsertBulk) Exec

func (u *ImageUpsertBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*ImageUpsertBulk) ExecX

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

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

func (*ImageUpsertBulk) Ignore

func (u *ImageUpsertBulk) Ignore() *ImageUpsertBulk

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

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

func (*ImageUpsertBulk) SetMimeType

func (u *ImageUpsertBulk) SetMimeType(v string) *ImageUpsertBulk

SetMimeType sets the "mimeType" field.

func (*ImageUpsertBulk) SetURL

func (u *ImageUpsertBulk) SetURL(v string) *ImageUpsertBulk

SetURL sets the "url" field.

func (*ImageUpsertBulk) Update

func (u *ImageUpsertBulk) Update(set func(*ImageUpsert)) *ImageUpsertBulk

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

func (*ImageUpsertBulk) UpdateMimeType

func (u *ImageUpsertBulk) UpdateMimeType() *ImageUpsertBulk

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

func (*ImageUpsertBulk) UpdateNewValues

func (u *ImageUpsertBulk) UpdateNewValues() *ImageUpsertBulk

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

client.Image.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
	).
	Exec(ctx)

func (*ImageUpsertBulk) UpdateURL

func (u *ImageUpsertBulk) UpdateURL() *ImageUpsertBulk

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

type ImageUpsertOne

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

ImageUpsertOne is the builder for "upsert"-ing

one Image node.

func (*ImageUpsertOne) DoNothing

func (u *ImageUpsertOne) DoNothing() *ImageUpsertOne

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

func (*ImageUpsertOne) Exec

func (u *ImageUpsertOne) Exec(ctx context.Context) error

Exec executes the query.

func (*ImageUpsertOne) ExecX

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

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

func (*ImageUpsertOne) ID

func (u *ImageUpsertOne) ID(ctx context.Context) (id int, err error)

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

func (*ImageUpsertOne) IDX

func (u *ImageUpsertOne) IDX(ctx context.Context) int

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

func (*ImageUpsertOne) Ignore

func (u *ImageUpsertOne) Ignore() *ImageUpsertOne

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

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

func (*ImageUpsertOne) SetMimeType

func (u *ImageUpsertOne) SetMimeType(v string) *ImageUpsertOne

SetMimeType sets the "mimeType" field.

func (*ImageUpsertOne) SetURL

func (u *ImageUpsertOne) SetURL(v string) *ImageUpsertOne

SetURL sets the "url" field.

func (*ImageUpsertOne) Update

func (u *ImageUpsertOne) Update(set func(*ImageUpsert)) *ImageUpsertOne

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

func (*ImageUpsertOne) UpdateMimeType

func (u *ImageUpsertOne) UpdateMimeType() *ImageUpsertOne

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

func (*ImageUpsertOne) UpdateNewValues

func (u *ImageUpsertOne) UpdateNewValues() *ImageUpsertOne

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

client.Image.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
	).
	Exec(ctx)

func (*ImageUpsertOne) UpdateURL

func (u *ImageUpsertOne) UpdateURL() *ImageUpsertOne

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

type Images

type Images []*Image

Images is a parsable slice of Image.

type InstanceMetadata

type InstanceMetadata struct {

	// ID of the ent.
	ID uuid.UUID `json:"id,omitempty"`
	// IsRemote holds the value of the "isRemote" field.
	IsRemote bool `json:"isRemote,omitempty"`
	// URI holds the value of the "uri" field.
	URI string `json:"uri,omitempty"`
	// Extensions holds the value of the "extensions" field.
	Extensions versia.Extensions `json:"extensions,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"`
	// Name holds the value of the "name" field.
	Name string `json:"name,omitempty"`
	// Description holds the value of the "description" field.
	Description *string `json:"description,omitempty"`
	// Host holds the value of the "host" field.
	Host string `json:"host,omitempty"`
	// PublicKey holds the value of the "publicKey" field.
	PublicKey []byte `json:"publicKey,omitempty"`
	// PublicKeyAlgorithm holds the value of the "publicKeyAlgorithm" field.
	PublicKeyAlgorithm string `json:"publicKeyAlgorithm,omitempty"`
	// PrivateKey holds the value of the "privateKey" field.
	PrivateKey []byte `json:"privateKey,omitempty"`
	// SoftwareName holds the value of the "softwareName" field.
	SoftwareName string `json:"softwareName,omitempty"`
	// SoftwareVersion holds the value of the "softwareVersion" field.
	SoftwareVersion string `json:"softwareVersion,omitempty"`
	// SharedInboxURI holds the value of the "sharedInboxURI" field.
	SharedInboxURI string `json:"sharedInboxURI,omitempty"`
	// ModeratorsURI holds the value of the "moderatorsURI" field.
	ModeratorsURI *string `json:"moderatorsURI,omitempty"`
	// AdminsURI holds the value of the "adminsURI" field.
	AdminsURI *string `json:"adminsURI,omitempty"`
	// LogoEndpoint holds the value of the "logoEndpoint" field.
	LogoEndpoint *string `json:"logoEndpoint,omitempty"`
	// LogoMimeType holds the value of the "logoMimeType" field.
	LogoMimeType *string `json:"logoMimeType,omitempty"`
	// BannerEndpoint holds the value of the "bannerEndpoint" field.
	BannerEndpoint *string `json:"bannerEndpoint,omitempty"`
	// BannerMimeType holds the value of the "bannerMimeType" field.
	BannerMimeType *string `json:"bannerMimeType,omitempty"`
	// SupportedVersions holds the value of the "supportedVersions" field.
	SupportedVersions []string `json:"supportedVersions,omitempty"`
	// SupportedExtensions holds the value of the "supportedExtensions" field.
	SupportedExtensions []string `json:"supportedExtensions,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the InstanceMetadataQuery when eager-loading is set.
	Edges InstanceMetadataEdges `json:"edges"`
	// contains filtered or unexported fields
}

InstanceMetadata is the model entity for the InstanceMetadata schema.

func (*InstanceMetadata) QueryAdmins

func (im *InstanceMetadata) QueryAdmins() *UserQuery

QueryAdmins queries the "admins" edge of the InstanceMetadata entity.

func (*InstanceMetadata) QueryModerators

func (im *InstanceMetadata) QueryModerators() *UserQuery

QueryModerators queries the "moderators" edge of the InstanceMetadata entity.

func (*InstanceMetadata) QueryUsers

func (im *InstanceMetadata) QueryUsers() *UserQuery

QueryUsers queries the "users" edge of the InstanceMetadata entity.

func (*InstanceMetadata) String

func (im *InstanceMetadata) String() string

String implements the fmt.Stringer.

func (*InstanceMetadata) Unwrap

func (im *InstanceMetadata) Unwrap() *InstanceMetadata

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

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

func (*InstanceMetadata) Value

func (im *InstanceMetadata) Value(name string) (ent.Value, error)

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

type InstanceMetadataClient

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

InstanceMetadataClient is a client for the InstanceMetadata schema.

func NewInstanceMetadataClient

func NewInstanceMetadataClient(c config) *InstanceMetadataClient

NewInstanceMetadataClient returns a client for the InstanceMetadata from the given config.

func (*InstanceMetadataClient) Create

Create returns a builder for creating a InstanceMetadata entity.

func (*InstanceMetadataClient) CreateBulk

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

func (*InstanceMetadataClient) Delete

Delete returns a delete builder for InstanceMetadata.

func (*InstanceMetadataClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*InstanceMetadataClient) DeleteOneID

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

func (*InstanceMetadataClient) Get

Get returns a InstanceMetadata entity by its id.

func (*InstanceMetadataClient) GetX

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

func (*InstanceMetadataClient) Hooks

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

Hooks returns the client hooks.

func (*InstanceMetadataClient) Intercept

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

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

func (*InstanceMetadataClient) Interceptors

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

Interceptors returns the client interceptors.

func (*InstanceMetadataClient) MapCreateBulk

func (c *InstanceMetadataClient) MapCreateBulk(slice any, setFunc func(*InstanceMetadataCreate, int)) *InstanceMetadataCreateBulk

MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.

func (*InstanceMetadataClient) Query

Query returns a query builder for InstanceMetadata.

func (*InstanceMetadataClient) QueryAdmins

func (c *InstanceMetadataClient) QueryAdmins(im *InstanceMetadata) *UserQuery

QueryAdmins queries the admins edge of a InstanceMetadata.

func (*InstanceMetadataClient) QueryModerators

func (c *InstanceMetadataClient) QueryModerators(im *InstanceMetadata) *UserQuery

QueryModerators queries the moderators edge of a InstanceMetadata.

func (*InstanceMetadataClient) QueryUsers

QueryUsers queries the users edge of a InstanceMetadata.

func (*InstanceMetadataClient) Update

Update returns an update builder for InstanceMetadata.

func (*InstanceMetadataClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*InstanceMetadataClient) UpdateOneID

UpdateOneID returns an update builder for the given id.

func (*InstanceMetadataClient) Use

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

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

type InstanceMetadataCreate

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

InstanceMetadataCreate is the builder for creating a InstanceMetadata entity.

func (*InstanceMetadataCreate) AddAdminIDs

func (imc *InstanceMetadataCreate) AddAdminIDs(ids ...uuid.UUID) *InstanceMetadataCreate

AddAdminIDs adds the "admins" edge to the User entity by IDs.

func (*InstanceMetadataCreate) AddAdmins

func (imc *InstanceMetadataCreate) AddAdmins(u ...*User) *InstanceMetadataCreate

AddAdmins adds the "admins" edges to the User entity.

func (*InstanceMetadataCreate) AddModeratorIDs

func (imc *InstanceMetadataCreate) AddModeratorIDs(ids ...uuid.UUID) *InstanceMetadataCreate

AddModeratorIDs adds the "moderators" edge to the User entity by IDs.

func (*InstanceMetadataCreate) AddModerators

func (imc *InstanceMetadataCreate) AddModerators(u ...*User) *InstanceMetadataCreate

AddModerators adds the "moderators" edges to the User entity.

func (*InstanceMetadataCreate) AddUserIDs

func (imc *InstanceMetadataCreate) AddUserIDs(ids ...uuid.UUID) *InstanceMetadataCreate

AddUserIDs adds the "users" edge to the User entity by IDs.

func (*InstanceMetadataCreate) AddUsers

func (imc *InstanceMetadataCreate) AddUsers(u ...*User) *InstanceMetadataCreate

AddUsers adds the "users" edges to the User entity.

func (*InstanceMetadataCreate) Exec

Exec executes the query.

func (*InstanceMetadataCreate) ExecX

func (imc *InstanceMetadataCreate) ExecX(ctx context.Context)

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

func (*InstanceMetadataCreate) Mutation

Mutation returns the InstanceMetadataMutation object of the builder.

func (*InstanceMetadataCreate) OnConflict

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

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

func (*InstanceMetadataCreate) OnConflictColumns

func (imc *InstanceMetadataCreate) OnConflictColumns(columns ...string) *InstanceMetadataUpsertOne

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

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

func (*InstanceMetadataCreate) Save

Save creates the InstanceMetadata in the database.

func (*InstanceMetadataCreate) SaveX

SaveX calls Save and panics if Save returns an error.

func (*InstanceMetadataCreate) SetAdminsURI

SetAdminsURI sets the "adminsURI" field.

func (*InstanceMetadataCreate) SetBannerEndpoint

func (imc *InstanceMetadataCreate) SetBannerEndpoint(s string) *InstanceMetadataCreate

SetBannerEndpoint sets the "bannerEndpoint" field.

func (*InstanceMetadataCreate) SetBannerMimeType

func (imc *InstanceMetadataCreate) SetBannerMimeType(s string) *InstanceMetadataCreate

SetBannerMimeType sets the "bannerMimeType" field.

func (*InstanceMetadataCreate) SetCreatedAt

SetCreatedAt sets the "created_at" field.

func (*InstanceMetadataCreate) SetDescription

func (imc *InstanceMetadataCreate) SetDescription(s string) *InstanceMetadataCreate

SetDescription sets the "description" field.

func (*InstanceMetadataCreate) SetExtensions

SetExtensions sets the "extensions" field.

func (*InstanceMetadataCreate) SetHost

SetHost sets the "host" field.

func (*InstanceMetadataCreate) SetID

SetID sets the "id" field.

func (*InstanceMetadataCreate) SetIsRemote

func (imc *InstanceMetadataCreate) SetIsRemote(b bool) *InstanceMetadataCreate

SetIsRemote sets the "isRemote" field.

func (*InstanceMetadataCreate) SetLogoEndpoint

func (imc *InstanceMetadataCreate) SetLogoEndpoint(s string) *InstanceMetadataCreate

SetLogoEndpoint sets the "logoEndpoint" field.

func (*InstanceMetadataCreate) SetLogoMimeType

func (imc *InstanceMetadataCreate) SetLogoMimeType(s string) *InstanceMetadataCreate

SetLogoMimeType sets the "logoMimeType" field.

func (*InstanceMetadataCreate) SetModeratorsURI

func (imc *InstanceMetadataCreate) SetModeratorsURI(s string) *InstanceMetadataCreate

SetModeratorsURI sets the "moderatorsURI" field.

func (*InstanceMetadataCreate) SetName

SetName sets the "name" field.

func (*InstanceMetadataCreate) SetNillableAdminsURI

func (imc *InstanceMetadataCreate) SetNillableAdminsURI(s *string) *InstanceMetadataCreate

SetNillableAdminsURI sets the "adminsURI" field if the given value is not nil.

func (*InstanceMetadataCreate) SetNillableBannerEndpoint

func (imc *InstanceMetadataCreate) SetNillableBannerEndpoint(s *string) *InstanceMetadataCreate

SetNillableBannerEndpoint sets the "bannerEndpoint" field if the given value is not nil.

func (*InstanceMetadataCreate) SetNillableBannerMimeType

func (imc *InstanceMetadataCreate) SetNillableBannerMimeType(s *string) *InstanceMetadataCreate

SetNillableBannerMimeType sets the "bannerMimeType" field if the given value is not nil.

func (*InstanceMetadataCreate) SetNillableCreatedAt

func (imc *InstanceMetadataCreate) SetNillableCreatedAt(t *time.Time) *InstanceMetadataCreate

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

func (*InstanceMetadataCreate) SetNillableDescription

func (imc *InstanceMetadataCreate) SetNillableDescription(s *string) *InstanceMetadataCreate

SetNillableDescription sets the "description" field if the given value is not nil.

func (*InstanceMetadataCreate) SetNillableID

func (imc *InstanceMetadataCreate) SetNillableID(u *uuid.UUID) *InstanceMetadataCreate

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

func (*InstanceMetadataCreate) SetNillableLogoEndpoint

func (imc *InstanceMetadataCreate) SetNillableLogoEndpoint(s *string) *InstanceMetadataCreate

SetNillableLogoEndpoint sets the "logoEndpoint" field if the given value is not nil.

func (*InstanceMetadataCreate) SetNillableLogoMimeType

func (imc *InstanceMetadataCreate) SetNillableLogoMimeType(s *string) *InstanceMetadataCreate

SetNillableLogoMimeType sets the "logoMimeType" field if the given value is not nil.

func (*InstanceMetadataCreate) SetNillableModeratorsURI

func (imc *InstanceMetadataCreate) SetNillableModeratorsURI(s *string) *InstanceMetadataCreate

SetNillableModeratorsURI sets the "moderatorsURI" field if the given value is not nil.

func (*InstanceMetadataCreate) SetNillableUpdatedAt

func (imc *InstanceMetadataCreate) SetNillableUpdatedAt(t *time.Time) *InstanceMetadataCreate

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

func (*InstanceMetadataCreate) SetPrivateKey

func (imc *InstanceMetadataCreate) SetPrivateKey(b []byte) *InstanceMetadataCreate

SetPrivateKey sets the "privateKey" field.

func (*InstanceMetadataCreate) SetPublicKey

func (imc *InstanceMetadataCreate) SetPublicKey(b []byte) *InstanceMetadataCreate

SetPublicKey sets the "publicKey" field.

func (*InstanceMetadataCreate) SetPublicKeyAlgorithm

func (imc *InstanceMetadataCreate) SetPublicKeyAlgorithm(s string) *InstanceMetadataCreate

SetPublicKeyAlgorithm sets the "publicKeyAlgorithm" field.

func (*InstanceMetadataCreate) SetSharedInboxURI

func (imc *InstanceMetadataCreate) SetSharedInboxURI(s string) *InstanceMetadataCreate

SetSharedInboxURI sets the "sharedInboxURI" field.

func (*InstanceMetadataCreate) SetSoftwareName

func (imc *InstanceMetadataCreate) SetSoftwareName(s string) *InstanceMetadataCreate

SetSoftwareName sets the "softwareName" field.

func (*InstanceMetadataCreate) SetSoftwareVersion

func (imc *InstanceMetadataCreate) SetSoftwareVersion(s string) *InstanceMetadataCreate

SetSoftwareVersion sets the "softwareVersion" field.

func (*InstanceMetadataCreate) SetSupportedExtensions

func (imc *InstanceMetadataCreate) SetSupportedExtensions(s []string) *InstanceMetadataCreate

SetSupportedExtensions sets the "supportedExtensions" field.

func (*InstanceMetadataCreate) SetSupportedVersions

func (imc *InstanceMetadataCreate) SetSupportedVersions(s []string) *InstanceMetadataCreate

SetSupportedVersions sets the "supportedVersions" field.

func (*InstanceMetadataCreate) SetURI

SetURI sets the "uri" field.

func (*InstanceMetadataCreate) SetUpdatedAt

SetUpdatedAt sets the "updated_at" field.

type InstanceMetadataCreateBulk

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

InstanceMetadataCreateBulk is the builder for creating many InstanceMetadata entities in bulk.

func (*InstanceMetadataCreateBulk) Exec

Exec executes the query.

func (*InstanceMetadataCreateBulk) ExecX

func (imcb *InstanceMetadataCreateBulk) ExecX(ctx context.Context)

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

func (*InstanceMetadataCreateBulk) OnConflict

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

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

func (*InstanceMetadataCreateBulk) OnConflictColumns

func (imcb *InstanceMetadataCreateBulk) OnConflictColumns(columns ...string) *InstanceMetadataUpsertBulk

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

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

func (*InstanceMetadataCreateBulk) Save

Save creates the InstanceMetadata entities in the database.

func (*InstanceMetadataCreateBulk) SaveX

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

type InstanceMetadataDelete

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

InstanceMetadataDelete is the builder for deleting a InstanceMetadata entity.

func (*InstanceMetadataDelete) Exec

func (imd *InstanceMetadataDelete) Exec(ctx context.Context) (int, error)

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

func (*InstanceMetadataDelete) ExecX

func (imd *InstanceMetadataDelete) ExecX(ctx context.Context) int

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

func (*InstanceMetadataDelete) Where

Where appends a list predicates to the InstanceMetadataDelete builder.

type InstanceMetadataDeleteOne

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

InstanceMetadataDeleteOne is the builder for deleting a single InstanceMetadata entity.

func (*InstanceMetadataDeleteOne) Exec

Exec executes the deletion query.

func (*InstanceMetadataDeleteOne) ExecX

func (imdo *InstanceMetadataDeleteOne) ExecX(ctx context.Context)

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

func (*InstanceMetadataDeleteOne) Where

Where appends a list predicates to the InstanceMetadataDelete builder.

type InstanceMetadataEdges

type InstanceMetadataEdges struct {
	// Users holds the value of the users edge.
	Users []*User `json:"users,omitempty"`
	// Moderators holds the value of the moderators edge.
	Moderators []*User `json:"moderators,omitempty"`
	// Admins holds the value of the admins edge.
	Admins []*User `json:"admins,omitempty"`
	// contains filtered or unexported fields
}

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

func (InstanceMetadataEdges) AdminsOrErr

func (e InstanceMetadataEdges) AdminsOrErr() ([]*User, error)

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

func (InstanceMetadataEdges) ModeratorsOrErr

func (e InstanceMetadataEdges) ModeratorsOrErr() ([]*User, error)

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

func (InstanceMetadataEdges) UsersOrErr

func (e InstanceMetadataEdges) UsersOrErr() ([]*User, error)

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

type InstanceMetadataGroupBy

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

InstanceMetadataGroupBy is the group-by builder for InstanceMetadata entities.

func (*InstanceMetadataGroupBy) Aggregate

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

func (*InstanceMetadataGroupBy) Bool

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

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

func (*InstanceMetadataGroupBy) BoolX

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

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

func (*InstanceMetadataGroupBy) Bools

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

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

func (*InstanceMetadataGroupBy) BoolsX

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

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

func (*InstanceMetadataGroupBy) Float64

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

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

func (*InstanceMetadataGroupBy) Float64X

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

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

func (*InstanceMetadataGroupBy) Float64s

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

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

func (*InstanceMetadataGroupBy) Float64sX

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

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

func (*InstanceMetadataGroupBy) Int

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

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

func (*InstanceMetadataGroupBy) IntX

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

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

func (*InstanceMetadataGroupBy) Ints

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

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

func (*InstanceMetadataGroupBy) IntsX

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

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

func (*InstanceMetadataGroupBy) Scan

func (imgb *InstanceMetadataGroupBy) Scan(ctx context.Context, v any) error

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

func (*InstanceMetadataGroupBy) ScanX

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

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

func (*InstanceMetadataGroupBy) String

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

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

func (*InstanceMetadataGroupBy) StringX

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

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

func (*InstanceMetadataGroupBy) Strings

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

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

func (*InstanceMetadataGroupBy) StringsX

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

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

type InstanceMetadataMutation

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

InstanceMetadataMutation represents an operation that mutates the InstanceMetadata nodes in the graph.

func (*InstanceMetadataMutation) AddAdminIDs

func (m *InstanceMetadataMutation) AddAdminIDs(ids ...uuid.UUID)

AddAdminIDs adds the "admins" edge to the User entity by ids.

func (*InstanceMetadataMutation) AddField

func (m *InstanceMetadataMutation) 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 (*InstanceMetadataMutation) AddModeratorIDs

func (m *InstanceMetadataMutation) AddModeratorIDs(ids ...uuid.UUID)

AddModeratorIDs adds the "moderators" edge to the User entity by ids.

func (*InstanceMetadataMutation) AddUserIDs

func (m *InstanceMetadataMutation) AddUserIDs(ids ...uuid.UUID)

AddUserIDs adds the "users" edge to the User entity by ids.

func (*InstanceMetadataMutation) AddedEdges

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

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

func (*InstanceMetadataMutation) AddedField

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

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

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

func (*InstanceMetadataMutation) AddedIDs

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

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

func (*InstanceMetadataMutation) AdminsCleared

func (m *InstanceMetadataMutation) AdminsCleared() bool

AdminsCleared reports if the "admins" edge to the User entity was cleared.

func (*InstanceMetadataMutation) AdminsIDs

func (m *InstanceMetadataMutation) AdminsIDs() (ids []uuid.UUID)

AdminsIDs returns the "admins" edge IDs in the mutation.

func (*InstanceMetadataMutation) AdminsURI

func (m *InstanceMetadataMutation) AdminsURI() (r string, exists bool)

AdminsURI returns the value of the "adminsURI" field in the mutation.

func (*InstanceMetadataMutation) AdminsURICleared

func (m *InstanceMetadataMutation) AdminsURICleared() bool

AdminsURICleared returns if the "adminsURI" field was cleared in this mutation.

func (*InstanceMetadataMutation) AppendSupportedExtensions

func (m *InstanceMetadataMutation) AppendSupportedExtensions(s []string)

AppendSupportedExtensions adds s to the "supportedExtensions" field.

func (*InstanceMetadataMutation) AppendSupportedVersions

func (m *InstanceMetadataMutation) AppendSupportedVersions(s []string)

AppendSupportedVersions adds s to the "supportedVersions" field.

func (*InstanceMetadataMutation) AppendedSupportedExtensions

func (m *InstanceMetadataMutation) AppendedSupportedExtensions() ([]string, bool)

AppendedSupportedExtensions returns the list of values that were appended to the "supportedExtensions" field in this mutation.

func (*InstanceMetadataMutation) AppendedSupportedVersions

func (m *InstanceMetadataMutation) AppendedSupportedVersions() ([]string, bool)

AppendedSupportedVersions returns the list of values that were appended to the "supportedVersions" field in this mutation.

func (*InstanceMetadataMutation) BannerEndpoint

func (m *InstanceMetadataMutation) BannerEndpoint() (r string, exists bool)

BannerEndpoint returns the value of the "bannerEndpoint" field in the mutation.

func (*InstanceMetadataMutation) BannerEndpointCleared

func (m *InstanceMetadataMutation) BannerEndpointCleared() bool

BannerEndpointCleared returns if the "bannerEndpoint" field was cleared in this mutation.

func (*InstanceMetadataMutation) BannerMimeType

func (m *InstanceMetadataMutation) BannerMimeType() (r string, exists bool)

BannerMimeType returns the value of the "bannerMimeType" field in the mutation.

func (*InstanceMetadataMutation) BannerMimeTypeCleared

func (m *InstanceMetadataMutation) BannerMimeTypeCleared() bool

BannerMimeTypeCleared returns if the "bannerMimeType" field was cleared in this mutation.

func (*InstanceMetadataMutation) ClearAdmins

func (m *InstanceMetadataMutation) ClearAdmins()

ClearAdmins clears the "admins" edge to the User entity.

func (*InstanceMetadataMutation) ClearAdminsURI

func (m *InstanceMetadataMutation) ClearAdminsURI()

ClearAdminsURI clears the value of the "adminsURI" field.

func (*InstanceMetadataMutation) ClearBannerEndpoint

func (m *InstanceMetadataMutation) ClearBannerEndpoint()

ClearBannerEndpoint clears the value of the "bannerEndpoint" field.

func (*InstanceMetadataMutation) ClearBannerMimeType

func (m *InstanceMetadataMutation) ClearBannerMimeType()

ClearBannerMimeType clears the value of the "bannerMimeType" field.

func (*InstanceMetadataMutation) ClearDescription

func (m *InstanceMetadataMutation) ClearDescription()

ClearDescription clears the value of the "description" field.

func (*InstanceMetadataMutation) ClearEdge

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

func (m *InstanceMetadataMutation) 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 (*InstanceMetadataMutation) ClearLogoEndpoint

func (m *InstanceMetadataMutation) ClearLogoEndpoint()

ClearLogoEndpoint clears the value of the "logoEndpoint" field.

func (*InstanceMetadataMutation) ClearLogoMimeType

func (m *InstanceMetadataMutation) ClearLogoMimeType()

ClearLogoMimeType clears the value of the "logoMimeType" field.

func (*InstanceMetadataMutation) ClearModerators

func (m *InstanceMetadataMutation) ClearModerators()

ClearModerators clears the "moderators" edge to the User entity.

func (*InstanceMetadataMutation) ClearModeratorsURI

func (m *InstanceMetadataMutation) ClearModeratorsURI()

ClearModeratorsURI clears the value of the "moderatorsURI" field.

func (*InstanceMetadataMutation) ClearPrivateKey

func (m *InstanceMetadataMutation) ClearPrivateKey()

ClearPrivateKey clears the value of the "privateKey" field.

func (*InstanceMetadataMutation) ClearUsers

func (m *InstanceMetadataMutation) ClearUsers()

ClearUsers clears the "users" edge to the User entity.

func (*InstanceMetadataMutation) ClearedEdges

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

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

func (*InstanceMetadataMutation) ClearedFields

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

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

func (InstanceMetadataMutation) Client

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

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

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

func (*InstanceMetadataMutation) Description

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

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

func (*InstanceMetadataMutation) DescriptionCleared

func (m *InstanceMetadataMutation) DescriptionCleared() bool

DescriptionCleared returns if the "description" field was cleared in this mutation.

func (*InstanceMetadataMutation) EdgeCleared

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

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

func (*InstanceMetadataMutation) Extensions

func (m *InstanceMetadataMutation) Extensions() (r versia.Extensions, exists bool)

Extensions returns the value of the "extensions" field in the mutation.

func (*InstanceMetadataMutation) Field

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

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

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

func (*InstanceMetadataMutation) Fields

func (m *InstanceMetadataMutation) 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 (*InstanceMetadataMutation) Host

func (m *InstanceMetadataMutation) Host() (r string, exists bool)

Host returns the value of the "host" field in the mutation.

func (*InstanceMetadataMutation) ID

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

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

func (*InstanceMetadataMutation) IDs

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

func (*InstanceMetadataMutation) IsRemote

func (m *InstanceMetadataMutation) IsRemote() (r bool, exists bool)

IsRemote returns the value of the "isRemote" field in the mutation.

func (*InstanceMetadataMutation) LogoEndpoint

func (m *InstanceMetadataMutation) LogoEndpoint() (r string, exists bool)

LogoEndpoint returns the value of the "logoEndpoint" field in the mutation.

func (*InstanceMetadataMutation) LogoEndpointCleared

func (m *InstanceMetadataMutation) LogoEndpointCleared() bool

LogoEndpointCleared returns if the "logoEndpoint" field was cleared in this mutation.

func (*InstanceMetadataMutation) LogoMimeType

func (m *InstanceMetadataMutation) LogoMimeType() (r string, exists bool)

LogoMimeType returns the value of the "logoMimeType" field in the mutation.

func (*InstanceMetadataMutation) LogoMimeTypeCleared

func (m *InstanceMetadataMutation) LogoMimeTypeCleared() bool

LogoMimeTypeCleared returns if the "logoMimeType" field was cleared in this mutation.

func (*InstanceMetadataMutation) ModeratorsCleared

func (m *InstanceMetadataMutation) ModeratorsCleared() bool

ModeratorsCleared reports if the "moderators" edge to the User entity was cleared.

func (*InstanceMetadataMutation) ModeratorsIDs

func (m *InstanceMetadataMutation) ModeratorsIDs() (ids []uuid.UUID)

ModeratorsIDs returns the "moderators" edge IDs in the mutation.

func (*InstanceMetadataMutation) ModeratorsURI

func (m *InstanceMetadataMutation) ModeratorsURI() (r string, exists bool)

ModeratorsURI returns the value of the "moderatorsURI" field in the mutation.

func (*InstanceMetadataMutation) ModeratorsURICleared

func (m *InstanceMetadataMutation) ModeratorsURICleared() bool

ModeratorsURICleared returns if the "moderatorsURI" field was cleared in this mutation.

func (*InstanceMetadataMutation) Name

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

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

func (*InstanceMetadataMutation) OldAdminsURI

func (m *InstanceMetadataMutation) OldAdminsURI(ctx context.Context) (v *string, err error)

OldAdminsURI returns the old "adminsURI" field's value of the InstanceMetadata entity. If the InstanceMetadata 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 (*InstanceMetadataMutation) OldBannerEndpoint

func (m *InstanceMetadataMutation) OldBannerEndpoint(ctx context.Context) (v *string, err error)

OldBannerEndpoint returns the old "bannerEndpoint" field's value of the InstanceMetadata entity. If the InstanceMetadata 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 (*InstanceMetadataMutation) OldBannerMimeType

func (m *InstanceMetadataMutation) OldBannerMimeType(ctx context.Context) (v *string, err error)

OldBannerMimeType returns the old "bannerMimeType" field's value of the InstanceMetadata entity. If the InstanceMetadata 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 (*InstanceMetadataMutation) OldCreatedAt

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

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

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

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

func (m *InstanceMetadataMutation) OldExtensions(ctx context.Context) (v versia.Extensions, err error)

OldExtensions returns the old "extensions" field's value of the InstanceMetadata entity. If the InstanceMetadata 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 (*InstanceMetadataMutation) OldField

func (m *InstanceMetadataMutation) 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 (*InstanceMetadataMutation) OldHost

func (m *InstanceMetadataMutation) OldHost(ctx context.Context) (v string, err error)

OldHost returns the old "host" field's value of the InstanceMetadata entity. If the InstanceMetadata 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 (*InstanceMetadataMutation) OldIsRemote

func (m *InstanceMetadataMutation) OldIsRemote(ctx context.Context) (v bool, err error)

OldIsRemote returns the old "isRemote" field's value of the InstanceMetadata entity. If the InstanceMetadata 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 (*InstanceMetadataMutation) OldLogoEndpoint

func (m *InstanceMetadataMutation) OldLogoEndpoint(ctx context.Context) (v *string, err error)

OldLogoEndpoint returns the old "logoEndpoint" field's value of the InstanceMetadata entity. If the InstanceMetadata 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 (*InstanceMetadataMutation) OldLogoMimeType

func (m *InstanceMetadataMutation) OldLogoMimeType(ctx context.Context) (v *string, err error)

OldLogoMimeType returns the old "logoMimeType" field's value of the InstanceMetadata entity. If the InstanceMetadata 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 (*InstanceMetadataMutation) OldModeratorsURI

func (m *InstanceMetadataMutation) OldModeratorsURI(ctx context.Context) (v *string, err error)

OldModeratorsURI returns the old "moderatorsURI" field's value of the InstanceMetadata entity. If the InstanceMetadata 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 (*InstanceMetadataMutation) OldName

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

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

func (m *InstanceMetadataMutation) OldPrivateKey(ctx context.Context) (v []byte, err error)

OldPrivateKey returns the old "privateKey" field's value of the InstanceMetadata entity. If the InstanceMetadata 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 (*InstanceMetadataMutation) OldPublicKey

func (m *InstanceMetadataMutation) OldPublicKey(ctx context.Context) (v []byte, err error)

OldPublicKey returns the old "publicKey" field's value of the InstanceMetadata entity. If the InstanceMetadata 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 (*InstanceMetadataMutation) OldPublicKeyAlgorithm

func (m *InstanceMetadataMutation) OldPublicKeyAlgorithm(ctx context.Context) (v string, err error)

OldPublicKeyAlgorithm returns the old "publicKeyAlgorithm" field's value of the InstanceMetadata entity. If the InstanceMetadata 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 (*InstanceMetadataMutation) OldSharedInboxURI

func (m *InstanceMetadataMutation) OldSharedInboxURI(ctx context.Context) (v string, err error)

OldSharedInboxURI returns the old "sharedInboxURI" field's value of the InstanceMetadata entity. If the InstanceMetadata 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 (*InstanceMetadataMutation) OldSoftwareName

func (m *InstanceMetadataMutation) OldSoftwareName(ctx context.Context) (v string, err error)

OldSoftwareName returns the old "softwareName" field's value of the InstanceMetadata entity. If the InstanceMetadata 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 (*InstanceMetadataMutation) OldSoftwareVersion

func (m *InstanceMetadataMutation) OldSoftwareVersion(ctx context.Context) (v string, err error)

OldSoftwareVersion returns the old "softwareVersion" field's value of the InstanceMetadata entity. If the InstanceMetadata 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 (*InstanceMetadataMutation) OldSupportedExtensions

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

OldSupportedExtensions returns the old "supportedExtensions" field's value of the InstanceMetadata entity. If the InstanceMetadata 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 (*InstanceMetadataMutation) OldSupportedVersions

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

OldSupportedVersions returns the old "supportedVersions" field's value of the InstanceMetadata entity. If the InstanceMetadata 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 (*InstanceMetadataMutation) OldURI

func (m *InstanceMetadataMutation) OldURI(ctx context.Context) (v string, err error)

OldURI returns the old "uri" field's value of the InstanceMetadata entity. If the InstanceMetadata 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 (*InstanceMetadataMutation) OldUpdatedAt

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

OldUpdatedAt returns the old "updated_at" field's value of the InstanceMetadata entity. If the InstanceMetadata 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 (*InstanceMetadataMutation) Op

func (m *InstanceMetadataMutation) Op() Op

Op returns the operation name.

func (*InstanceMetadataMutation) PrivateKey

func (m *InstanceMetadataMutation) PrivateKey() (r []byte, exists bool)

PrivateKey returns the value of the "privateKey" field in the mutation.

func (*InstanceMetadataMutation) PrivateKeyCleared

func (m *InstanceMetadataMutation) PrivateKeyCleared() bool

PrivateKeyCleared returns if the "privateKey" field was cleared in this mutation.

func (*InstanceMetadataMutation) PublicKey

func (m *InstanceMetadataMutation) PublicKey() (r []byte, exists bool)

PublicKey returns the value of the "publicKey" field in the mutation.

func (*InstanceMetadataMutation) PublicKeyAlgorithm

func (m *InstanceMetadataMutation) PublicKeyAlgorithm() (r string, exists bool)

PublicKeyAlgorithm returns the value of the "publicKeyAlgorithm" field in the mutation.

func (*InstanceMetadataMutation) RemoveAdminIDs

func (m *InstanceMetadataMutation) RemoveAdminIDs(ids ...uuid.UUID)

RemoveAdminIDs removes the "admins" edge to the User entity by IDs.

func (*InstanceMetadataMutation) RemoveModeratorIDs

func (m *InstanceMetadataMutation) RemoveModeratorIDs(ids ...uuid.UUID)

RemoveModeratorIDs removes the "moderators" edge to the User entity by IDs.

func (*InstanceMetadataMutation) RemoveUserIDs

func (m *InstanceMetadataMutation) RemoveUserIDs(ids ...uuid.UUID)

RemoveUserIDs removes the "users" edge to the User entity by IDs.

func (*InstanceMetadataMutation) RemovedAdminsIDs

func (m *InstanceMetadataMutation) RemovedAdminsIDs() (ids []uuid.UUID)

RemovedAdmins returns the removed IDs of the "admins" edge to the User entity.

func (*InstanceMetadataMutation) RemovedEdges

func (m *InstanceMetadataMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*InstanceMetadataMutation) RemovedIDs

func (m *InstanceMetadataMutation) 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 (*InstanceMetadataMutation) RemovedModeratorsIDs

func (m *InstanceMetadataMutation) RemovedModeratorsIDs() (ids []uuid.UUID)

RemovedModerators returns the removed IDs of the "moderators" edge to the User entity.

func (*InstanceMetadataMutation) RemovedUsersIDs

func (m *InstanceMetadataMutation) RemovedUsersIDs() (ids []uuid.UUID)

RemovedUsers returns the removed IDs of the "users" edge to the User entity.

func (*InstanceMetadataMutation) ResetAdmins

func (m *InstanceMetadataMutation) ResetAdmins()

ResetAdmins resets all changes to the "admins" edge.

func (*InstanceMetadataMutation) ResetAdminsURI

func (m *InstanceMetadataMutation) ResetAdminsURI()

ResetAdminsURI resets all changes to the "adminsURI" field.

func (*InstanceMetadataMutation) ResetBannerEndpoint

func (m *InstanceMetadataMutation) ResetBannerEndpoint()

ResetBannerEndpoint resets all changes to the "bannerEndpoint" field.

func (*InstanceMetadataMutation) ResetBannerMimeType

func (m *InstanceMetadataMutation) ResetBannerMimeType()

ResetBannerMimeType resets all changes to the "bannerMimeType" field.

func (*InstanceMetadataMutation) ResetCreatedAt

func (m *InstanceMetadataMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*InstanceMetadataMutation) ResetDescription

func (m *InstanceMetadataMutation) ResetDescription()

ResetDescription resets all changes to the "description" field.

func (*InstanceMetadataMutation) ResetEdge

func (m *InstanceMetadataMutation) 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 (*InstanceMetadataMutation) ResetExtensions

func (m *InstanceMetadataMutation) ResetExtensions()

ResetExtensions resets all changes to the "extensions" field.

func (*InstanceMetadataMutation) ResetField

func (m *InstanceMetadataMutation) 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 (*InstanceMetadataMutation) ResetHost

func (m *InstanceMetadataMutation) ResetHost()

ResetHost resets all changes to the "host" field.

func (*InstanceMetadataMutation) ResetIsRemote

func (m *InstanceMetadataMutation) ResetIsRemote()

ResetIsRemote resets all changes to the "isRemote" field.

func (*InstanceMetadataMutation) ResetLogoEndpoint

func (m *InstanceMetadataMutation) ResetLogoEndpoint()

ResetLogoEndpoint resets all changes to the "logoEndpoint" field.

func (*InstanceMetadataMutation) ResetLogoMimeType

func (m *InstanceMetadataMutation) ResetLogoMimeType()

ResetLogoMimeType resets all changes to the "logoMimeType" field.

func (*InstanceMetadataMutation) ResetModerators

func (m *InstanceMetadataMutation) ResetModerators()

ResetModerators resets all changes to the "moderators" edge.

func (*InstanceMetadataMutation) ResetModeratorsURI

func (m *InstanceMetadataMutation) ResetModeratorsURI()

ResetModeratorsURI resets all changes to the "moderatorsURI" field.

func (*InstanceMetadataMutation) ResetName

func (m *InstanceMetadataMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*InstanceMetadataMutation) ResetPrivateKey

func (m *InstanceMetadataMutation) ResetPrivateKey()

ResetPrivateKey resets all changes to the "privateKey" field.

func (*InstanceMetadataMutation) ResetPublicKey

func (m *InstanceMetadataMutation) ResetPublicKey()

ResetPublicKey resets all changes to the "publicKey" field.

func (*InstanceMetadataMutation) ResetPublicKeyAlgorithm

func (m *InstanceMetadataMutation) ResetPublicKeyAlgorithm()

ResetPublicKeyAlgorithm resets all changes to the "publicKeyAlgorithm" field.

func (*InstanceMetadataMutation) ResetSharedInboxURI

func (m *InstanceMetadataMutation) ResetSharedInboxURI()

ResetSharedInboxURI resets all changes to the "sharedInboxURI" field.

func (*InstanceMetadataMutation) ResetSoftwareName

func (m *InstanceMetadataMutation) ResetSoftwareName()

ResetSoftwareName resets all changes to the "softwareName" field.

func (*InstanceMetadataMutation) ResetSoftwareVersion

func (m *InstanceMetadataMutation) ResetSoftwareVersion()

ResetSoftwareVersion resets all changes to the "softwareVersion" field.

func (*InstanceMetadataMutation) ResetSupportedExtensions

func (m *InstanceMetadataMutation) ResetSupportedExtensions()

ResetSupportedExtensions resets all changes to the "supportedExtensions" field.

func (*InstanceMetadataMutation) ResetSupportedVersions

func (m *InstanceMetadataMutation) ResetSupportedVersions()

ResetSupportedVersions resets all changes to the "supportedVersions" field.

func (*InstanceMetadataMutation) ResetURI

func (m *InstanceMetadataMutation) ResetURI()

ResetURI resets all changes to the "uri" field.

func (*InstanceMetadataMutation) ResetUpdatedAt

func (m *InstanceMetadataMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*InstanceMetadataMutation) ResetUsers

func (m *InstanceMetadataMutation) ResetUsers()

ResetUsers resets all changes to the "users" edge.

func (*InstanceMetadataMutation) SetAdminsURI

func (m *InstanceMetadataMutation) SetAdminsURI(s string)

SetAdminsURI sets the "adminsURI" field.

func (*InstanceMetadataMutation) SetBannerEndpoint

func (m *InstanceMetadataMutation) SetBannerEndpoint(s string)

SetBannerEndpoint sets the "bannerEndpoint" field.

func (*InstanceMetadataMutation) SetBannerMimeType

func (m *InstanceMetadataMutation) SetBannerMimeType(s string)

SetBannerMimeType sets the "bannerMimeType" field.

func (*InstanceMetadataMutation) SetCreatedAt

func (m *InstanceMetadataMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" field.

func (*InstanceMetadataMutation) SetDescription

func (m *InstanceMetadataMutation) SetDescription(s string)

SetDescription sets the "description" field.

func (*InstanceMetadataMutation) SetExtensions

func (m *InstanceMetadataMutation) SetExtensions(v versia.Extensions)

SetExtensions sets the "extensions" field.

func (*InstanceMetadataMutation) SetField

func (m *InstanceMetadataMutation) 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 (*InstanceMetadataMutation) SetHost

func (m *InstanceMetadataMutation) SetHost(s string)

SetHost sets the "host" field.

func (*InstanceMetadataMutation) SetID

func (m *InstanceMetadataMutation) SetID(id uuid.UUID)

SetID sets the value of the id field. Note that this operation is only accepted on creation of InstanceMetadata entities.

func (*InstanceMetadataMutation) SetIsRemote

func (m *InstanceMetadataMutation) SetIsRemote(b bool)

SetIsRemote sets the "isRemote" field.

func (*InstanceMetadataMutation) SetLogoEndpoint

func (m *InstanceMetadataMutation) SetLogoEndpoint(s string)

SetLogoEndpoint sets the "logoEndpoint" field.

func (*InstanceMetadataMutation) SetLogoMimeType

func (m *InstanceMetadataMutation) SetLogoMimeType(s string)

SetLogoMimeType sets the "logoMimeType" field.

func (*InstanceMetadataMutation) SetModeratorsURI

func (m *InstanceMetadataMutation) SetModeratorsURI(s string)

SetModeratorsURI sets the "moderatorsURI" field.

func (*InstanceMetadataMutation) SetName

func (m *InstanceMetadataMutation) SetName(s string)

SetName sets the "name" field.

func (*InstanceMetadataMutation) SetOp

func (m *InstanceMetadataMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*InstanceMetadataMutation) SetPrivateKey

func (m *InstanceMetadataMutation) SetPrivateKey(b []byte)

SetPrivateKey sets the "privateKey" field.

func (*InstanceMetadataMutation) SetPublicKey

func (m *InstanceMetadataMutation) SetPublicKey(b []byte)

SetPublicKey sets the "publicKey" field.

func (*InstanceMetadataMutation) SetPublicKeyAlgorithm

func (m *InstanceMetadataMutation) SetPublicKeyAlgorithm(s string)

SetPublicKeyAlgorithm sets the "publicKeyAlgorithm" field.

func (*InstanceMetadataMutation) SetSharedInboxURI

func (m *InstanceMetadataMutation) SetSharedInboxURI(s string)

SetSharedInboxURI sets the "sharedInboxURI" field.

func (*InstanceMetadataMutation) SetSoftwareName

func (m *InstanceMetadataMutation) SetSoftwareName(s string)

SetSoftwareName sets the "softwareName" field.

func (*InstanceMetadataMutation) SetSoftwareVersion

func (m *InstanceMetadataMutation) SetSoftwareVersion(s string)

SetSoftwareVersion sets the "softwareVersion" field.

func (*InstanceMetadataMutation) SetSupportedExtensions

func (m *InstanceMetadataMutation) SetSupportedExtensions(s []string)

SetSupportedExtensions sets the "supportedExtensions" field.

func (*InstanceMetadataMutation) SetSupportedVersions

func (m *InstanceMetadataMutation) SetSupportedVersions(s []string)

SetSupportedVersions sets the "supportedVersions" field.

func (*InstanceMetadataMutation) SetURI

func (m *InstanceMetadataMutation) SetURI(s string)

SetURI sets the "uri" field.

func (*InstanceMetadataMutation) SetUpdatedAt

func (m *InstanceMetadataMutation) SetUpdatedAt(t time.Time)

SetUpdatedAt sets the "updated_at" field.

func (*InstanceMetadataMutation) SharedInboxURI

func (m *InstanceMetadataMutation) SharedInboxURI() (r string, exists bool)

SharedInboxURI returns the value of the "sharedInboxURI" field in the mutation.

func (*InstanceMetadataMutation) SoftwareName

func (m *InstanceMetadataMutation) SoftwareName() (r string, exists bool)

SoftwareName returns the value of the "softwareName" field in the mutation.

func (*InstanceMetadataMutation) SoftwareVersion

func (m *InstanceMetadataMutation) SoftwareVersion() (r string, exists bool)

SoftwareVersion returns the value of the "softwareVersion" field in the mutation.

func (*InstanceMetadataMutation) SupportedExtensions

func (m *InstanceMetadataMutation) SupportedExtensions() (r []string, exists bool)

SupportedExtensions returns the value of the "supportedExtensions" field in the mutation.

func (*InstanceMetadataMutation) SupportedVersions

func (m *InstanceMetadataMutation) SupportedVersions() (r []string, exists bool)

SupportedVersions returns the value of the "supportedVersions" field in the mutation.

func (InstanceMetadataMutation) Tx

func (m InstanceMetadataMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*InstanceMetadataMutation) Type

func (m *InstanceMetadataMutation) Type() string

Type returns the node type of this mutation (InstanceMetadata).

func (*InstanceMetadataMutation) URI

func (m *InstanceMetadataMutation) URI() (r string, exists bool)

URI returns the value of the "uri" field in the mutation.

func (*InstanceMetadataMutation) UpdatedAt

func (m *InstanceMetadataMutation) UpdatedAt() (r time.Time, exists bool)

UpdatedAt returns the value of the "updated_at" field in the mutation.

func (*InstanceMetadataMutation) UsersCleared

func (m *InstanceMetadataMutation) UsersCleared() bool

UsersCleared reports if the "users" edge to the User entity was cleared.

func (*InstanceMetadataMutation) UsersIDs

func (m *InstanceMetadataMutation) UsersIDs() (ids []uuid.UUID)

UsersIDs returns the "users" edge IDs in the mutation.

func (*InstanceMetadataMutation) Where

Where appends a list predicates to the InstanceMetadataMutation builder.

func (*InstanceMetadataMutation) WhereP

func (m *InstanceMetadataMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the InstanceMetadataMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type InstanceMetadataQuery

type InstanceMetadataQuery struct {
	// contains filtered or unexported fields
}

InstanceMetadataQuery is the builder for querying InstanceMetadata entities.

func (*InstanceMetadataQuery) Aggregate

Aggregate returns a InstanceMetadataSelect configured with the given aggregations.

func (*InstanceMetadataQuery) All

All executes the query and returns a list of InstanceMetadataSlice.

func (*InstanceMetadataQuery) AllX

AllX is like All, but panics if an error occurs.

func (*InstanceMetadataQuery) Clone

Clone returns a duplicate of the InstanceMetadataQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*InstanceMetadataQuery) Count

func (imq *InstanceMetadataQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*InstanceMetadataQuery) CountX

func (imq *InstanceMetadataQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*InstanceMetadataQuery) Exist

func (imq *InstanceMetadataQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*InstanceMetadataQuery) ExistX

func (imq *InstanceMetadataQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*InstanceMetadataQuery) First

First returns the first InstanceMetadata entity from the query. Returns a *NotFoundError when no InstanceMetadata was found.

func (*InstanceMetadataQuery) FirstID

func (imq *InstanceMetadataQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

FirstID returns the first InstanceMetadata ID from the query. Returns a *NotFoundError when no InstanceMetadata ID was found.

func (*InstanceMetadataQuery) FirstIDX

func (imq *InstanceMetadataQuery) FirstIDX(ctx context.Context) uuid.UUID

FirstIDX is like FirstID, but panics if an error occurs.

func (*InstanceMetadataQuery) FirstX

FirstX is like First, but panics if an error occurs.

func (*InstanceMetadataQuery) GroupBy

func (imq *InstanceMetadataQuery) GroupBy(field string, fields ...string) *InstanceMetadataGroupBy

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 {
	IsRemote bool `json:"isRemote,omitempty"`
	Count int `json:"count,omitempty"`
}

client.InstanceMetadata.Query().
	GroupBy(instancemetadata.FieldIsRemote).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*InstanceMetadataQuery) IDs

func (imq *InstanceMetadataQuery) IDs(ctx context.Context) (ids []uuid.UUID, err error)

IDs executes the query and returns a list of InstanceMetadata IDs.

func (*InstanceMetadataQuery) IDsX

func (imq *InstanceMetadataQuery) IDsX(ctx context.Context) []uuid.UUID

IDsX is like IDs, but panics if an error occurs.

func (*InstanceMetadataQuery) Limit

func (imq *InstanceMetadataQuery) Limit(limit int) *InstanceMetadataQuery

Limit the number of records to be returned by this query.

func (*InstanceMetadataQuery) Offset

func (imq *InstanceMetadataQuery) Offset(offset int) *InstanceMetadataQuery

Offset to start from.

func (*InstanceMetadataQuery) Only

Only returns a single InstanceMetadata entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one InstanceMetadata entity is found. Returns a *NotFoundError when no InstanceMetadata entities are found.

func (*InstanceMetadataQuery) OnlyID

func (imq *InstanceMetadataQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

OnlyID is like Only, but returns the only InstanceMetadata ID in the query. Returns a *NotSingularError when more than one InstanceMetadata ID is found. Returns a *NotFoundError when no entities are found.

func (*InstanceMetadataQuery) OnlyIDX

func (imq *InstanceMetadataQuery) OnlyIDX(ctx context.Context) uuid.UUID

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*InstanceMetadataQuery) OnlyX

OnlyX is like Only, but panics if an error occurs.

func (*InstanceMetadataQuery) Order

Order specifies how the records should be ordered.

func (*InstanceMetadataQuery) QueryAdmins

func (imq *InstanceMetadataQuery) QueryAdmins() *UserQuery

QueryAdmins chains the current query on the "admins" edge.

func (*InstanceMetadataQuery) QueryModerators

func (imq *InstanceMetadataQuery) QueryModerators() *UserQuery

QueryModerators chains the current query on the "moderators" edge.

func (*InstanceMetadataQuery) QueryUsers

func (imq *InstanceMetadataQuery) QueryUsers() *UserQuery

QueryUsers chains the current query on the "users" edge.

func (*InstanceMetadataQuery) Select

func (imq *InstanceMetadataQuery) Select(fields ...string) *InstanceMetadataSelect

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 {
	IsRemote bool `json:"isRemote,omitempty"`
}

client.InstanceMetadata.Query().
	Select(instancemetadata.FieldIsRemote).
	Scan(ctx, &v)

func (*InstanceMetadataQuery) Unique

func (imq *InstanceMetadataQuery) Unique(unique bool) *InstanceMetadataQuery

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 (*InstanceMetadataQuery) Where

Where adds a new predicate for the InstanceMetadataQuery builder.

func (*InstanceMetadataQuery) WithAdmins

func (imq *InstanceMetadataQuery) WithAdmins(opts ...func(*UserQuery)) *InstanceMetadataQuery

WithAdmins tells the query-builder to eager-load the nodes that are connected to the "admins" edge. The optional arguments are used to configure the query builder of the edge.

func (*InstanceMetadataQuery) WithModerators

func (imq *InstanceMetadataQuery) WithModerators(opts ...func(*UserQuery)) *InstanceMetadataQuery

WithModerators tells the query-builder to eager-load the nodes that are connected to the "moderators" edge. The optional arguments are used to configure the query builder of the edge.

func (*InstanceMetadataQuery) WithUsers

func (imq *InstanceMetadataQuery) WithUsers(opts ...func(*UserQuery)) *InstanceMetadataQuery

WithUsers tells the query-builder to eager-load the nodes that are connected to the "users" edge. The optional arguments are used to configure the query builder of the edge.

type InstanceMetadataSelect

type InstanceMetadataSelect struct {
	*InstanceMetadataQuery
	// contains filtered or unexported fields
}

InstanceMetadataSelect is the builder for selecting fields of InstanceMetadata entities.

func (*InstanceMetadataSelect) Aggregate

Aggregate adds the given aggregation functions to the selector query.

func (*InstanceMetadataSelect) Bool

func (s *InstanceMetadataSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*InstanceMetadataSelect) BoolX

func (s *InstanceMetadataSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*InstanceMetadataSelect) Bools

func (s *InstanceMetadataSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*InstanceMetadataSelect) BoolsX

func (s *InstanceMetadataSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*InstanceMetadataSelect) Float64

func (s *InstanceMetadataSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*InstanceMetadataSelect) Float64X

func (s *InstanceMetadataSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*InstanceMetadataSelect) Float64s

func (s *InstanceMetadataSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*InstanceMetadataSelect) Float64sX

func (s *InstanceMetadataSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*InstanceMetadataSelect) Int

func (s *InstanceMetadataSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*InstanceMetadataSelect) IntX

func (s *InstanceMetadataSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*InstanceMetadataSelect) Ints

func (s *InstanceMetadataSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*InstanceMetadataSelect) IntsX

func (s *InstanceMetadataSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*InstanceMetadataSelect) Scan

func (ims *InstanceMetadataSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*InstanceMetadataSelect) ScanX

func (s *InstanceMetadataSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*InstanceMetadataSelect) String

func (s *InstanceMetadataSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*InstanceMetadataSelect) StringX

func (s *InstanceMetadataSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*InstanceMetadataSelect) Strings

func (s *InstanceMetadataSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*InstanceMetadataSelect) StringsX

func (s *InstanceMetadataSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type InstanceMetadataSlice

type InstanceMetadataSlice []*InstanceMetadata

InstanceMetadataSlice is a parsable slice of InstanceMetadata.

type InstanceMetadataUpdate

type InstanceMetadataUpdate struct {
	// contains filtered or unexported fields
}

InstanceMetadataUpdate is the builder for updating InstanceMetadata entities.

func (*InstanceMetadataUpdate) AddAdminIDs

func (imu *InstanceMetadataUpdate) AddAdminIDs(ids ...uuid.UUID) *InstanceMetadataUpdate

AddAdminIDs adds the "admins" edge to the User entity by IDs.

func (*InstanceMetadataUpdate) AddAdmins

func (imu *InstanceMetadataUpdate) AddAdmins(u ...*User) *InstanceMetadataUpdate

AddAdmins adds the "admins" edges to the User entity.

func (*InstanceMetadataUpdate) AddModeratorIDs

func (imu *InstanceMetadataUpdate) AddModeratorIDs(ids ...uuid.UUID) *InstanceMetadataUpdate

AddModeratorIDs adds the "moderators" edge to the User entity by IDs.

func (*InstanceMetadataUpdate) AddModerators

func (imu *InstanceMetadataUpdate) AddModerators(u ...*User) *InstanceMetadataUpdate

AddModerators adds the "moderators" edges to the User entity.

func (*InstanceMetadataUpdate) AddUserIDs

func (imu *InstanceMetadataUpdate) AddUserIDs(ids ...uuid.UUID) *InstanceMetadataUpdate

AddUserIDs adds the "users" edge to the User entity by IDs.

func (*InstanceMetadataUpdate) AddUsers

func (imu *InstanceMetadataUpdate) AddUsers(u ...*User) *InstanceMetadataUpdate

AddUsers adds the "users" edges to the User entity.

func (*InstanceMetadataUpdate) AppendSupportedExtensions

func (imu *InstanceMetadataUpdate) AppendSupportedExtensions(s []string) *InstanceMetadataUpdate

AppendSupportedExtensions appends s to the "supportedExtensions" field.

func (*InstanceMetadataUpdate) AppendSupportedVersions

func (imu *InstanceMetadataUpdate) AppendSupportedVersions(s []string) *InstanceMetadataUpdate

AppendSupportedVersions appends s to the "supportedVersions" field.

func (*InstanceMetadataUpdate) ClearAdmins

func (imu *InstanceMetadataUpdate) ClearAdmins() *InstanceMetadataUpdate

ClearAdmins clears all "admins" edges to the User entity.

func (*InstanceMetadataUpdate) ClearAdminsURI

func (imu *InstanceMetadataUpdate) ClearAdminsURI() *InstanceMetadataUpdate

ClearAdminsURI clears the value of the "adminsURI" field.

func (*InstanceMetadataUpdate) ClearBannerEndpoint

func (imu *InstanceMetadataUpdate) ClearBannerEndpoint() *InstanceMetadataUpdate

ClearBannerEndpoint clears the value of the "bannerEndpoint" field.

func (*InstanceMetadataUpdate) ClearBannerMimeType

func (imu *InstanceMetadataUpdate) ClearBannerMimeType() *InstanceMetadataUpdate

ClearBannerMimeType clears the value of the "bannerMimeType" field.

func (*InstanceMetadataUpdate) ClearDescription

func (imu *InstanceMetadataUpdate) ClearDescription() *InstanceMetadataUpdate

ClearDescription clears the value of the "description" field.

func (*InstanceMetadataUpdate) ClearLogoEndpoint

func (imu *InstanceMetadataUpdate) ClearLogoEndpoint() *InstanceMetadataUpdate

ClearLogoEndpoint clears the value of the "logoEndpoint" field.

func (*InstanceMetadataUpdate) ClearLogoMimeType

func (imu *InstanceMetadataUpdate) ClearLogoMimeType() *InstanceMetadataUpdate

ClearLogoMimeType clears the value of the "logoMimeType" field.

func (*InstanceMetadataUpdate) ClearModerators

func (imu *InstanceMetadataUpdate) ClearModerators() *InstanceMetadataUpdate

ClearModerators clears all "moderators" edges to the User entity.

func (*InstanceMetadataUpdate) ClearModeratorsURI

func (imu *InstanceMetadataUpdate) ClearModeratorsURI() *InstanceMetadataUpdate

ClearModeratorsURI clears the value of the "moderatorsURI" field.

func (*InstanceMetadataUpdate) ClearPrivateKey

func (imu *InstanceMetadataUpdate) ClearPrivateKey() *InstanceMetadataUpdate

ClearPrivateKey clears the value of the "privateKey" field.

func (*InstanceMetadataUpdate) ClearUsers

ClearUsers clears all "users" edges to the User entity.

func (*InstanceMetadataUpdate) Exec

Exec executes the query.

func (*InstanceMetadataUpdate) ExecX

func (imu *InstanceMetadataUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*InstanceMetadataUpdate) Mutation

Mutation returns the InstanceMetadataMutation object of the builder.

func (*InstanceMetadataUpdate) RemoveAdminIDs

func (imu *InstanceMetadataUpdate) RemoveAdminIDs(ids ...uuid.UUID) *InstanceMetadataUpdate

RemoveAdminIDs removes the "admins" edge to User entities by IDs.

func (*InstanceMetadataUpdate) RemoveAdmins

func (imu *InstanceMetadataUpdate) RemoveAdmins(u ...*User) *InstanceMetadataUpdate

RemoveAdmins removes "admins" edges to User entities.

func (*InstanceMetadataUpdate) RemoveModeratorIDs

func (imu *InstanceMetadataUpdate) RemoveModeratorIDs(ids ...uuid.UUID) *InstanceMetadataUpdate

RemoveModeratorIDs removes the "moderators" edge to User entities by IDs.

func (*InstanceMetadataUpdate) RemoveModerators

func (imu *InstanceMetadataUpdate) RemoveModerators(u ...*User) *InstanceMetadataUpdate

RemoveModerators removes "moderators" edges to User entities.

func (*InstanceMetadataUpdate) RemoveUserIDs

func (imu *InstanceMetadataUpdate) RemoveUserIDs(ids ...uuid.UUID) *InstanceMetadataUpdate

RemoveUserIDs removes the "users" edge to User entities by IDs.

func (*InstanceMetadataUpdate) RemoveUsers

func (imu *InstanceMetadataUpdate) RemoveUsers(u ...*User) *InstanceMetadataUpdate

RemoveUsers removes "users" edges to User entities.

func (*InstanceMetadataUpdate) Save

func (imu *InstanceMetadataUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*InstanceMetadataUpdate) SaveX

func (imu *InstanceMetadataUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*InstanceMetadataUpdate) SetAdminsURI

SetAdminsURI sets the "adminsURI" field.

func (*InstanceMetadataUpdate) SetBannerEndpoint

func (imu *InstanceMetadataUpdate) SetBannerEndpoint(s string) *InstanceMetadataUpdate

SetBannerEndpoint sets the "bannerEndpoint" field.

func (*InstanceMetadataUpdate) SetBannerMimeType

func (imu *InstanceMetadataUpdate) SetBannerMimeType(s string) *InstanceMetadataUpdate

SetBannerMimeType sets the "bannerMimeType" field.

func (*InstanceMetadataUpdate) SetDescription

func (imu *InstanceMetadataUpdate) SetDescription(s string) *InstanceMetadataUpdate

SetDescription sets the "description" field.

func (*InstanceMetadataUpdate) SetExtensions

SetExtensions sets the "extensions" field.

func (*InstanceMetadataUpdate) SetHost

SetHost sets the "host" field.

func (*InstanceMetadataUpdate) SetIsRemote

func (imu *InstanceMetadataUpdate) SetIsRemote(b bool) *InstanceMetadataUpdate

SetIsRemote sets the "isRemote" field.

func (*InstanceMetadataUpdate) SetLogoEndpoint

func (imu *InstanceMetadataUpdate) SetLogoEndpoint(s string) *InstanceMetadataUpdate

SetLogoEndpoint sets the "logoEndpoint" field.

func (*InstanceMetadataUpdate) SetLogoMimeType

func (imu *InstanceMetadataUpdate) SetLogoMimeType(s string) *InstanceMetadataUpdate

SetLogoMimeType sets the "logoMimeType" field.

func (*InstanceMetadataUpdate) SetModeratorsURI

func (imu *InstanceMetadataUpdate) SetModeratorsURI(s string) *InstanceMetadataUpdate

SetModeratorsURI sets the "moderatorsURI" field.

func (*InstanceMetadataUpdate) SetName

SetName sets the "name" field.

func (*InstanceMetadataUpdate) SetNillableAdminsURI

func (imu *InstanceMetadataUpdate) SetNillableAdminsURI(s *string) *InstanceMetadataUpdate

SetNillableAdminsURI sets the "adminsURI" field if the given value is not nil.

func (*InstanceMetadataUpdate) SetNillableBannerEndpoint

func (imu *InstanceMetadataUpdate) SetNillableBannerEndpoint(s *string) *InstanceMetadataUpdate

SetNillableBannerEndpoint sets the "bannerEndpoint" field if the given value is not nil.

func (*InstanceMetadataUpdate) SetNillableBannerMimeType

func (imu *InstanceMetadataUpdate) SetNillableBannerMimeType(s *string) *InstanceMetadataUpdate

SetNillableBannerMimeType sets the "bannerMimeType" field if the given value is not nil.

func (*InstanceMetadataUpdate) SetNillableDescription

func (imu *InstanceMetadataUpdate) SetNillableDescription(s *string) *InstanceMetadataUpdate

SetNillableDescription sets the "description" field if the given value is not nil.

func (*InstanceMetadataUpdate) SetNillableHost

func (imu *InstanceMetadataUpdate) SetNillableHost(s *string) *InstanceMetadataUpdate

SetNillableHost sets the "host" field if the given value is not nil.

func (*InstanceMetadataUpdate) SetNillableIsRemote

func (imu *InstanceMetadataUpdate) SetNillableIsRemote(b *bool) *InstanceMetadataUpdate

SetNillableIsRemote sets the "isRemote" field if the given value is not nil.

func (*InstanceMetadataUpdate) SetNillableLogoEndpoint

func (imu *InstanceMetadataUpdate) SetNillableLogoEndpoint(s *string) *InstanceMetadataUpdate

SetNillableLogoEndpoint sets the "logoEndpoint" field if the given value is not nil.

func (*InstanceMetadataUpdate) SetNillableLogoMimeType

func (imu *InstanceMetadataUpdate) SetNillableLogoMimeType(s *string) *InstanceMetadataUpdate

SetNillableLogoMimeType sets the "logoMimeType" field if the given value is not nil.

func (*InstanceMetadataUpdate) SetNillableModeratorsURI

func (imu *InstanceMetadataUpdate) SetNillableModeratorsURI(s *string) *InstanceMetadataUpdate

SetNillableModeratorsURI sets the "moderatorsURI" field if the given value is not nil.

func (*InstanceMetadataUpdate) SetNillableName

func (imu *InstanceMetadataUpdate) SetNillableName(s *string) *InstanceMetadataUpdate

SetNillableName sets the "name" field if the given value is not nil.

func (*InstanceMetadataUpdate) SetNillablePublicKeyAlgorithm

func (imu *InstanceMetadataUpdate) SetNillablePublicKeyAlgorithm(s *string) *InstanceMetadataUpdate

SetNillablePublicKeyAlgorithm sets the "publicKeyAlgorithm" field if the given value is not nil.

func (*InstanceMetadataUpdate) SetNillableSharedInboxURI

func (imu *InstanceMetadataUpdate) SetNillableSharedInboxURI(s *string) *InstanceMetadataUpdate

SetNillableSharedInboxURI sets the "sharedInboxURI" field if the given value is not nil.

func (*InstanceMetadataUpdate) SetNillableSoftwareName

func (imu *InstanceMetadataUpdate) SetNillableSoftwareName(s *string) *InstanceMetadataUpdate

SetNillableSoftwareName sets the "softwareName" field if the given value is not nil.

func (*InstanceMetadataUpdate) SetNillableSoftwareVersion

func (imu *InstanceMetadataUpdate) SetNillableSoftwareVersion(s *string) *InstanceMetadataUpdate

SetNillableSoftwareVersion sets the "softwareVersion" field if the given value is not nil.

func (*InstanceMetadataUpdate) SetNillableURI

func (imu *InstanceMetadataUpdate) SetNillableURI(s *string) *InstanceMetadataUpdate

SetNillableURI sets the "uri" field if the given value is not nil.

func (*InstanceMetadataUpdate) SetPrivateKey

func (imu *InstanceMetadataUpdate) SetPrivateKey(b []byte) *InstanceMetadataUpdate

SetPrivateKey sets the "privateKey" field.

func (*InstanceMetadataUpdate) SetPublicKey

func (imu *InstanceMetadataUpdate) SetPublicKey(b []byte) *InstanceMetadataUpdate

SetPublicKey sets the "publicKey" field.

func (*InstanceMetadataUpdate) SetPublicKeyAlgorithm

func (imu *InstanceMetadataUpdate) SetPublicKeyAlgorithm(s string) *InstanceMetadataUpdate

SetPublicKeyAlgorithm sets the "publicKeyAlgorithm" field.

func (*InstanceMetadataUpdate) SetSharedInboxURI

func (imu *InstanceMetadataUpdate) SetSharedInboxURI(s string) *InstanceMetadataUpdate

SetSharedInboxURI sets the "sharedInboxURI" field.

func (*InstanceMetadataUpdate) SetSoftwareName

func (imu *InstanceMetadataUpdate) SetSoftwareName(s string) *InstanceMetadataUpdate

SetSoftwareName sets the "softwareName" field.

func (*InstanceMetadataUpdate) SetSoftwareVersion

func (imu *InstanceMetadataUpdate) SetSoftwareVersion(s string) *InstanceMetadataUpdate

SetSoftwareVersion sets the "softwareVersion" field.

func (*InstanceMetadataUpdate) SetSupportedExtensions

func (imu *InstanceMetadataUpdate) SetSupportedExtensions(s []string) *InstanceMetadataUpdate

SetSupportedExtensions sets the "supportedExtensions" field.

func (*InstanceMetadataUpdate) SetSupportedVersions

func (imu *InstanceMetadataUpdate) SetSupportedVersions(s []string) *InstanceMetadataUpdate

SetSupportedVersions sets the "supportedVersions" field.

func (*InstanceMetadataUpdate) SetURI

SetURI sets the "uri" field.

func (*InstanceMetadataUpdate) SetUpdatedAt

SetUpdatedAt sets the "updated_at" field.

func (*InstanceMetadataUpdate) Where

Where appends a list predicates to the InstanceMetadataUpdate builder.

type InstanceMetadataUpdateOne

type InstanceMetadataUpdateOne struct {
	// contains filtered or unexported fields
}

InstanceMetadataUpdateOne is the builder for updating a single InstanceMetadata entity.

func (*InstanceMetadataUpdateOne) AddAdminIDs

func (imuo *InstanceMetadataUpdateOne) AddAdminIDs(ids ...uuid.UUID) *InstanceMetadataUpdateOne

AddAdminIDs adds the "admins" edge to the User entity by IDs.

func (*InstanceMetadataUpdateOne) AddAdmins

AddAdmins adds the "admins" edges to the User entity.

func (*InstanceMetadataUpdateOne) AddModeratorIDs

func (imuo *InstanceMetadataUpdateOne) AddModeratorIDs(ids ...uuid.UUID) *InstanceMetadataUpdateOne

AddModeratorIDs adds the "moderators" edge to the User entity by IDs.

func (*InstanceMetadataUpdateOne) AddModerators

func (imuo *InstanceMetadataUpdateOne) AddModerators(u ...*User) *InstanceMetadataUpdateOne

AddModerators adds the "moderators" edges to the User entity.

func (*InstanceMetadataUpdateOne) AddUserIDs

AddUserIDs adds the "users" edge to the User entity by IDs.

func (*InstanceMetadataUpdateOne) AddUsers

AddUsers adds the "users" edges to the User entity.

func (*InstanceMetadataUpdateOne) AppendSupportedExtensions

func (imuo *InstanceMetadataUpdateOne) AppendSupportedExtensions(s []string) *InstanceMetadataUpdateOne

AppendSupportedExtensions appends s to the "supportedExtensions" field.

func (*InstanceMetadataUpdateOne) AppendSupportedVersions

func (imuo *InstanceMetadataUpdateOne) AppendSupportedVersions(s []string) *InstanceMetadataUpdateOne

AppendSupportedVersions appends s to the "supportedVersions" field.

func (*InstanceMetadataUpdateOne) ClearAdmins

ClearAdmins clears all "admins" edges to the User entity.

func (*InstanceMetadataUpdateOne) ClearAdminsURI

func (imuo *InstanceMetadataUpdateOne) ClearAdminsURI() *InstanceMetadataUpdateOne

ClearAdminsURI clears the value of the "adminsURI" field.

func (*InstanceMetadataUpdateOne) ClearBannerEndpoint

func (imuo *InstanceMetadataUpdateOne) ClearBannerEndpoint() *InstanceMetadataUpdateOne

ClearBannerEndpoint clears the value of the "bannerEndpoint" field.

func (*InstanceMetadataUpdateOne) ClearBannerMimeType

func (imuo *InstanceMetadataUpdateOne) ClearBannerMimeType() *InstanceMetadataUpdateOne

ClearBannerMimeType clears the value of the "bannerMimeType" field.

func (*InstanceMetadataUpdateOne) ClearDescription

func (imuo *InstanceMetadataUpdateOne) ClearDescription() *InstanceMetadataUpdateOne

ClearDescription clears the value of the "description" field.

func (*InstanceMetadataUpdateOne) ClearLogoEndpoint

func (imuo *InstanceMetadataUpdateOne) ClearLogoEndpoint() *InstanceMetadataUpdateOne

ClearLogoEndpoint clears the value of the "logoEndpoint" field.

func (*InstanceMetadataUpdateOne) ClearLogoMimeType

func (imuo *InstanceMetadataUpdateOne) ClearLogoMimeType() *InstanceMetadataUpdateOne

ClearLogoMimeType clears the value of the "logoMimeType" field.

func (*InstanceMetadataUpdateOne) ClearModerators

func (imuo *InstanceMetadataUpdateOne) ClearModerators() *InstanceMetadataUpdateOne

ClearModerators clears all "moderators" edges to the User entity.

func (*InstanceMetadataUpdateOne) ClearModeratorsURI

func (imuo *InstanceMetadataUpdateOne) ClearModeratorsURI() *InstanceMetadataUpdateOne

ClearModeratorsURI clears the value of the "moderatorsURI" field.

func (*InstanceMetadataUpdateOne) ClearPrivateKey

func (imuo *InstanceMetadataUpdateOne) ClearPrivateKey() *InstanceMetadataUpdateOne

ClearPrivateKey clears the value of the "privateKey" field.

func (*InstanceMetadataUpdateOne) ClearUsers

ClearUsers clears all "users" edges to the User entity.

func (*InstanceMetadataUpdateOne) Exec

Exec executes the query on the entity.

func (*InstanceMetadataUpdateOne) ExecX

func (imuo *InstanceMetadataUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*InstanceMetadataUpdateOne) Mutation

Mutation returns the InstanceMetadataMutation object of the builder.

func (*InstanceMetadataUpdateOne) RemoveAdminIDs

func (imuo *InstanceMetadataUpdateOne) RemoveAdminIDs(ids ...uuid.UUID) *InstanceMetadataUpdateOne

RemoveAdminIDs removes the "admins" edge to User entities by IDs.

func (*InstanceMetadataUpdateOne) RemoveAdmins

func (imuo *InstanceMetadataUpdateOne) RemoveAdmins(u ...*User) *InstanceMetadataUpdateOne

RemoveAdmins removes "admins" edges to User entities.

func (*InstanceMetadataUpdateOne) RemoveModeratorIDs

func (imuo *InstanceMetadataUpdateOne) RemoveModeratorIDs(ids ...uuid.UUID) *InstanceMetadataUpdateOne

RemoveModeratorIDs removes the "moderators" edge to User entities by IDs.

func (*InstanceMetadataUpdateOne) RemoveModerators

func (imuo *InstanceMetadataUpdateOne) RemoveModerators(u ...*User) *InstanceMetadataUpdateOne

RemoveModerators removes "moderators" edges to User entities.

func (*InstanceMetadataUpdateOne) RemoveUserIDs

func (imuo *InstanceMetadataUpdateOne) RemoveUserIDs(ids ...uuid.UUID) *InstanceMetadataUpdateOne

RemoveUserIDs removes the "users" edge to User entities by IDs.

func (*InstanceMetadataUpdateOne) RemoveUsers

func (imuo *InstanceMetadataUpdateOne) RemoveUsers(u ...*User) *InstanceMetadataUpdateOne

RemoveUsers removes "users" edges to User entities.

func (*InstanceMetadataUpdateOne) Save

Save executes the query and returns the updated InstanceMetadata entity.

func (*InstanceMetadataUpdateOne) SaveX

SaveX is like Save, but panics if an error occurs.

func (*InstanceMetadataUpdateOne) Select

func (imuo *InstanceMetadataUpdateOne) Select(field string, fields ...string) *InstanceMetadataUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*InstanceMetadataUpdateOne) SetAdminsURI

SetAdminsURI sets the "adminsURI" field.

func (*InstanceMetadataUpdateOne) SetBannerEndpoint

func (imuo *InstanceMetadataUpdateOne) SetBannerEndpoint(s string) *InstanceMetadataUpdateOne

SetBannerEndpoint sets the "bannerEndpoint" field.

func (*InstanceMetadataUpdateOne) SetBannerMimeType

func (imuo *InstanceMetadataUpdateOne) SetBannerMimeType(s string) *InstanceMetadataUpdateOne

SetBannerMimeType sets the "bannerMimeType" field.

func (*InstanceMetadataUpdateOne) SetDescription

SetDescription sets the "description" field.

func (*InstanceMetadataUpdateOne) SetExtensions

SetExtensions sets the "extensions" field.

func (*InstanceMetadataUpdateOne) SetHost

SetHost sets the "host" field.

func (*InstanceMetadataUpdateOne) SetIsRemote

SetIsRemote sets the "isRemote" field.

func (*InstanceMetadataUpdateOne) SetLogoEndpoint

SetLogoEndpoint sets the "logoEndpoint" field.

func (*InstanceMetadataUpdateOne) SetLogoMimeType

SetLogoMimeType sets the "logoMimeType" field.

func (*InstanceMetadataUpdateOne) SetModeratorsURI

func (imuo *InstanceMetadataUpdateOne) SetModeratorsURI(s string) *InstanceMetadataUpdateOne

SetModeratorsURI sets the "moderatorsURI" field.

func (*InstanceMetadataUpdateOne) SetName

SetName sets the "name" field.

func (*InstanceMetadataUpdateOne) SetNillableAdminsURI

func (imuo *InstanceMetadataUpdateOne) SetNillableAdminsURI(s *string) *InstanceMetadataUpdateOne

SetNillableAdminsURI sets the "adminsURI" field if the given value is not nil.

func (*InstanceMetadataUpdateOne) SetNillableBannerEndpoint

func (imuo *InstanceMetadataUpdateOne) SetNillableBannerEndpoint(s *string) *InstanceMetadataUpdateOne

SetNillableBannerEndpoint sets the "bannerEndpoint" field if the given value is not nil.

func (*InstanceMetadataUpdateOne) SetNillableBannerMimeType

func (imuo *InstanceMetadataUpdateOne) SetNillableBannerMimeType(s *string) *InstanceMetadataUpdateOne

SetNillableBannerMimeType sets the "bannerMimeType" field if the given value is not nil.

func (*InstanceMetadataUpdateOne) SetNillableDescription

func (imuo *InstanceMetadataUpdateOne) SetNillableDescription(s *string) *InstanceMetadataUpdateOne

SetNillableDescription sets the "description" field if the given value is not nil.

func (*InstanceMetadataUpdateOne) SetNillableHost

func (imuo *InstanceMetadataUpdateOne) SetNillableHost(s *string) *InstanceMetadataUpdateOne

SetNillableHost sets the "host" field if the given value is not nil.

func (*InstanceMetadataUpdateOne) SetNillableIsRemote

func (imuo *InstanceMetadataUpdateOne) SetNillableIsRemote(b *bool) *InstanceMetadataUpdateOne

SetNillableIsRemote sets the "isRemote" field if the given value is not nil.

func (*InstanceMetadataUpdateOne) SetNillableLogoEndpoint

func (imuo *InstanceMetadataUpdateOne) SetNillableLogoEndpoint(s *string) *InstanceMetadataUpdateOne

SetNillableLogoEndpoint sets the "logoEndpoint" field if the given value is not nil.

func (*InstanceMetadataUpdateOne) SetNillableLogoMimeType

func (imuo *InstanceMetadataUpdateOne) SetNillableLogoMimeType(s *string) *InstanceMetadataUpdateOne

SetNillableLogoMimeType sets the "logoMimeType" field if the given value is not nil.

func (*InstanceMetadataUpdateOne) SetNillableModeratorsURI

func (imuo *InstanceMetadataUpdateOne) SetNillableModeratorsURI(s *string) *InstanceMetadataUpdateOne

SetNillableModeratorsURI sets the "moderatorsURI" field if the given value is not nil.

func (*InstanceMetadataUpdateOne) SetNillableName

func (imuo *InstanceMetadataUpdateOne) SetNillableName(s *string) *InstanceMetadataUpdateOne

SetNillableName sets the "name" field if the given value is not nil.

func (*InstanceMetadataUpdateOne) SetNillablePublicKeyAlgorithm

func (imuo *InstanceMetadataUpdateOne) SetNillablePublicKeyAlgorithm(s *string) *InstanceMetadataUpdateOne

SetNillablePublicKeyAlgorithm sets the "publicKeyAlgorithm" field if the given value is not nil.

func (*InstanceMetadataUpdateOne) SetNillableSharedInboxURI

func (imuo *InstanceMetadataUpdateOne) SetNillableSharedInboxURI(s *string) *InstanceMetadataUpdateOne

SetNillableSharedInboxURI sets the "sharedInboxURI" field if the given value is not nil.

func (*InstanceMetadataUpdateOne) SetNillableSoftwareName

func (imuo *InstanceMetadataUpdateOne) SetNillableSoftwareName(s *string) *InstanceMetadataUpdateOne

SetNillableSoftwareName sets the "softwareName" field if the given value is not nil.

func (*InstanceMetadataUpdateOne) SetNillableSoftwareVersion

func (imuo *InstanceMetadataUpdateOne) SetNillableSoftwareVersion(s *string) *InstanceMetadataUpdateOne

SetNillableSoftwareVersion sets the "softwareVersion" field if the given value is not nil.

func (*InstanceMetadataUpdateOne) SetNillableURI

SetNillableURI sets the "uri" field if the given value is not nil.

func (*InstanceMetadataUpdateOne) SetPrivateKey

func (imuo *InstanceMetadataUpdateOne) SetPrivateKey(b []byte) *InstanceMetadataUpdateOne

SetPrivateKey sets the "privateKey" field.

func (*InstanceMetadataUpdateOne) SetPublicKey

func (imuo *InstanceMetadataUpdateOne) SetPublicKey(b []byte) *InstanceMetadataUpdateOne

SetPublicKey sets the "publicKey" field.

func (*InstanceMetadataUpdateOne) SetPublicKeyAlgorithm

func (imuo *InstanceMetadataUpdateOne) SetPublicKeyAlgorithm(s string) *InstanceMetadataUpdateOne

SetPublicKeyAlgorithm sets the "publicKeyAlgorithm" field.

func (*InstanceMetadataUpdateOne) SetSharedInboxURI

func (imuo *InstanceMetadataUpdateOne) SetSharedInboxURI(s string) *InstanceMetadataUpdateOne

SetSharedInboxURI sets the "sharedInboxURI" field.

func (*InstanceMetadataUpdateOne) SetSoftwareName

SetSoftwareName sets the "softwareName" field.

func (*InstanceMetadataUpdateOne) SetSoftwareVersion

func (imuo *InstanceMetadataUpdateOne) SetSoftwareVersion(s string) *InstanceMetadataUpdateOne

SetSoftwareVersion sets the "softwareVersion" field.

func (*InstanceMetadataUpdateOne) SetSupportedExtensions

func (imuo *InstanceMetadataUpdateOne) SetSupportedExtensions(s []string) *InstanceMetadataUpdateOne

SetSupportedExtensions sets the "supportedExtensions" field.

func (*InstanceMetadataUpdateOne) SetSupportedVersions

func (imuo *InstanceMetadataUpdateOne) SetSupportedVersions(s []string) *InstanceMetadataUpdateOne

SetSupportedVersions sets the "supportedVersions" field.

func (*InstanceMetadataUpdateOne) SetURI

SetURI sets the "uri" field.

func (*InstanceMetadataUpdateOne) SetUpdatedAt

SetUpdatedAt sets the "updated_at" field.

func (*InstanceMetadataUpdateOne) Where

Where appends a list predicates to the InstanceMetadataUpdate builder.

type InstanceMetadataUpsert

type InstanceMetadataUpsert struct {
	*sql.UpdateSet
}

InstanceMetadataUpsert is the "OnConflict" setter.

func (*InstanceMetadataUpsert) ClearAdminsURI

func (u *InstanceMetadataUpsert) ClearAdminsURI() *InstanceMetadataUpsert

ClearAdminsURI clears the value of the "adminsURI" field.

func (*InstanceMetadataUpsert) ClearBannerEndpoint

func (u *InstanceMetadataUpsert) ClearBannerEndpoint() *InstanceMetadataUpsert

ClearBannerEndpoint clears the value of the "bannerEndpoint" field.

func (*InstanceMetadataUpsert) ClearBannerMimeType

func (u *InstanceMetadataUpsert) ClearBannerMimeType() *InstanceMetadataUpsert

ClearBannerMimeType clears the value of the "bannerMimeType" field.

func (*InstanceMetadataUpsert) ClearDescription

func (u *InstanceMetadataUpsert) ClearDescription() *InstanceMetadataUpsert

ClearDescription clears the value of the "description" field.

func (*InstanceMetadataUpsert) ClearLogoEndpoint

func (u *InstanceMetadataUpsert) ClearLogoEndpoint() *InstanceMetadataUpsert

ClearLogoEndpoint clears the value of the "logoEndpoint" field.

func (*InstanceMetadataUpsert) ClearLogoMimeType

func (u *InstanceMetadataUpsert) ClearLogoMimeType() *InstanceMetadataUpsert

ClearLogoMimeType clears the value of the "logoMimeType" field.

func (*InstanceMetadataUpsert) ClearModeratorsURI

func (u *InstanceMetadataUpsert) ClearModeratorsURI() *InstanceMetadataUpsert

ClearModeratorsURI clears the value of the "moderatorsURI" field.

func (*InstanceMetadataUpsert) ClearPrivateKey

func (u *InstanceMetadataUpsert) ClearPrivateKey() *InstanceMetadataUpsert

ClearPrivateKey clears the value of the "privateKey" field.

func (*InstanceMetadataUpsert) SetAdminsURI

SetAdminsURI sets the "adminsURI" field.

func (*InstanceMetadataUpsert) SetBannerEndpoint

func (u *InstanceMetadataUpsert) SetBannerEndpoint(v string) *InstanceMetadataUpsert

SetBannerEndpoint sets the "bannerEndpoint" field.

func (*InstanceMetadataUpsert) SetBannerMimeType

func (u *InstanceMetadataUpsert) SetBannerMimeType(v string) *InstanceMetadataUpsert

SetBannerMimeType sets the "bannerMimeType" field.

func (*InstanceMetadataUpsert) SetDescription

SetDescription sets the "description" field.

func (*InstanceMetadataUpsert) SetExtensions

SetExtensions sets the "extensions" field.

func (*InstanceMetadataUpsert) SetHost

SetHost sets the "host" field.

func (*InstanceMetadataUpsert) SetIsRemote

SetIsRemote sets the "isRemote" field.

func (*InstanceMetadataUpsert) SetLogoEndpoint

func (u *InstanceMetadataUpsert) SetLogoEndpoint(v string) *InstanceMetadataUpsert

SetLogoEndpoint sets the "logoEndpoint" field.

func (*InstanceMetadataUpsert) SetLogoMimeType

func (u *InstanceMetadataUpsert) SetLogoMimeType(v string) *InstanceMetadataUpsert

SetLogoMimeType sets the "logoMimeType" field.

func (*InstanceMetadataUpsert) SetModeratorsURI

func (u *InstanceMetadataUpsert) SetModeratorsURI(v string) *InstanceMetadataUpsert

SetModeratorsURI sets the "moderatorsURI" field.

func (*InstanceMetadataUpsert) SetName

SetName sets the "name" field.

func (*InstanceMetadataUpsert) SetPrivateKey

func (u *InstanceMetadataUpsert) SetPrivateKey(v []byte) *InstanceMetadataUpsert

SetPrivateKey sets the "privateKey" field.

func (*InstanceMetadataUpsert) SetPublicKey

func (u *InstanceMetadataUpsert) SetPublicKey(v []byte) *InstanceMetadataUpsert

SetPublicKey sets the "publicKey" field.

func (*InstanceMetadataUpsert) SetPublicKeyAlgorithm

func (u *InstanceMetadataUpsert) SetPublicKeyAlgorithm(v string) *InstanceMetadataUpsert

SetPublicKeyAlgorithm sets the "publicKeyAlgorithm" field.

func (*InstanceMetadataUpsert) SetSharedInboxURI

func (u *InstanceMetadataUpsert) SetSharedInboxURI(v string) *InstanceMetadataUpsert

SetSharedInboxURI sets the "sharedInboxURI" field.

func (*InstanceMetadataUpsert) SetSoftwareName

func (u *InstanceMetadataUpsert) SetSoftwareName(v string) *InstanceMetadataUpsert

SetSoftwareName sets the "softwareName" field.

func (*InstanceMetadataUpsert) SetSoftwareVersion

func (u *InstanceMetadataUpsert) SetSoftwareVersion(v string) *InstanceMetadataUpsert

SetSoftwareVersion sets the "softwareVersion" field.

func (*InstanceMetadataUpsert) SetSupportedExtensions

func (u *InstanceMetadataUpsert) SetSupportedExtensions(v []string) *InstanceMetadataUpsert

SetSupportedExtensions sets the "supportedExtensions" field.

func (*InstanceMetadataUpsert) SetSupportedVersions

func (u *InstanceMetadataUpsert) SetSupportedVersions(v []string) *InstanceMetadataUpsert

SetSupportedVersions sets the "supportedVersions" field.

func (*InstanceMetadataUpsert) SetURI

SetURI sets the "uri" field.

func (*InstanceMetadataUpsert) SetUpdatedAt

SetUpdatedAt sets the "updated_at" field.

func (*InstanceMetadataUpsert) UpdateAdminsURI

func (u *InstanceMetadataUpsert) UpdateAdminsURI() *InstanceMetadataUpsert

UpdateAdminsURI sets the "adminsURI" field to the value that was provided on create.

func (*InstanceMetadataUpsert) UpdateBannerEndpoint

func (u *InstanceMetadataUpsert) UpdateBannerEndpoint() *InstanceMetadataUpsert

UpdateBannerEndpoint sets the "bannerEndpoint" field to the value that was provided on create.

func (*InstanceMetadataUpsert) UpdateBannerMimeType

func (u *InstanceMetadataUpsert) UpdateBannerMimeType() *InstanceMetadataUpsert

UpdateBannerMimeType sets the "bannerMimeType" field to the value that was provided on create.

func (*InstanceMetadataUpsert) UpdateDescription

func (u *InstanceMetadataUpsert) UpdateDescription() *InstanceMetadataUpsert

UpdateDescription sets the "description" field to the value that was provided on create.

func (*InstanceMetadataUpsert) UpdateExtensions

func (u *InstanceMetadataUpsert) UpdateExtensions() *InstanceMetadataUpsert

UpdateExtensions sets the "extensions" field to the value that was provided on create.

func (*InstanceMetadataUpsert) UpdateHost

UpdateHost sets the "host" field to the value that was provided on create.

func (*InstanceMetadataUpsert) UpdateIsRemote

func (u *InstanceMetadataUpsert) UpdateIsRemote() *InstanceMetadataUpsert

UpdateIsRemote sets the "isRemote" field to the value that was provided on create.

func (*InstanceMetadataUpsert) UpdateLogoEndpoint

func (u *InstanceMetadataUpsert) UpdateLogoEndpoint() *InstanceMetadataUpsert

UpdateLogoEndpoint sets the "logoEndpoint" field to the value that was provided on create.

func (*InstanceMetadataUpsert) UpdateLogoMimeType

func (u *InstanceMetadataUpsert) UpdateLogoMimeType() *InstanceMetadataUpsert

UpdateLogoMimeType sets the "logoMimeType" field to the value that was provided on create.

func (*InstanceMetadataUpsert) UpdateModeratorsURI

func (u *InstanceMetadataUpsert) UpdateModeratorsURI() *InstanceMetadataUpsert

UpdateModeratorsURI sets the "moderatorsURI" field to the value that was provided on create.

func (*InstanceMetadataUpsert) UpdateName

UpdateName sets the "name" field to the value that was provided on create.

func (*InstanceMetadataUpsert) UpdatePrivateKey

func (u *InstanceMetadataUpsert) UpdatePrivateKey() *InstanceMetadataUpsert

UpdatePrivateKey sets the "privateKey" field to the value that was provided on create.

func (*InstanceMetadataUpsert) UpdatePublicKey

func (u *InstanceMetadataUpsert) UpdatePublicKey() *InstanceMetadataUpsert

UpdatePublicKey sets the "publicKey" field to the value that was provided on create.

func (*InstanceMetadataUpsert) UpdatePublicKeyAlgorithm

func (u *InstanceMetadataUpsert) UpdatePublicKeyAlgorithm() *InstanceMetadataUpsert

UpdatePublicKeyAlgorithm sets the "publicKeyAlgorithm" field to the value that was provided on create.

func (*InstanceMetadataUpsert) UpdateSharedInboxURI

func (u *InstanceMetadataUpsert) UpdateSharedInboxURI() *InstanceMetadataUpsert

UpdateSharedInboxURI sets the "sharedInboxURI" field to the value that was provided on create.

func (*InstanceMetadataUpsert) UpdateSoftwareName

func (u *InstanceMetadataUpsert) UpdateSoftwareName() *InstanceMetadataUpsert

UpdateSoftwareName sets the "softwareName" field to the value that was provided on create.

func (*InstanceMetadataUpsert) UpdateSoftwareVersion

func (u *InstanceMetadataUpsert) UpdateSoftwareVersion() *InstanceMetadataUpsert

UpdateSoftwareVersion sets the "softwareVersion" field to the value that was provided on create.

func (*InstanceMetadataUpsert) UpdateSupportedExtensions

func (u *InstanceMetadataUpsert) UpdateSupportedExtensions() *InstanceMetadataUpsert

UpdateSupportedExtensions sets the "supportedExtensions" field to the value that was provided on create.

func (*InstanceMetadataUpsert) UpdateSupportedVersions

func (u *InstanceMetadataUpsert) UpdateSupportedVersions() *InstanceMetadataUpsert

UpdateSupportedVersions sets the "supportedVersions" field to the value that was provided on create.

func (*InstanceMetadataUpsert) UpdateURI

UpdateURI sets the "uri" field to the value that was provided on create.

func (*InstanceMetadataUpsert) UpdateUpdatedAt

func (u *InstanceMetadataUpsert) UpdateUpdatedAt() *InstanceMetadataUpsert

UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.

type InstanceMetadataUpsertBulk

type InstanceMetadataUpsertBulk struct {
	// contains filtered or unexported fields
}

InstanceMetadataUpsertBulk is the builder for "upsert"-ing a bulk of InstanceMetadata nodes.

func (*InstanceMetadataUpsertBulk) ClearAdminsURI

ClearAdminsURI clears the value of the "adminsURI" field.

func (*InstanceMetadataUpsertBulk) ClearBannerEndpoint

func (u *InstanceMetadataUpsertBulk) ClearBannerEndpoint() *InstanceMetadataUpsertBulk

ClearBannerEndpoint clears the value of the "bannerEndpoint" field.

func (*InstanceMetadataUpsertBulk) ClearBannerMimeType

func (u *InstanceMetadataUpsertBulk) ClearBannerMimeType() *InstanceMetadataUpsertBulk

ClearBannerMimeType clears the value of the "bannerMimeType" field.

func (*InstanceMetadataUpsertBulk) ClearDescription

ClearDescription clears the value of the "description" field.

func (*InstanceMetadataUpsertBulk) ClearLogoEndpoint

ClearLogoEndpoint clears the value of the "logoEndpoint" field.

func (*InstanceMetadataUpsertBulk) ClearLogoMimeType

ClearLogoMimeType clears the value of the "logoMimeType" field.

func (*InstanceMetadataUpsertBulk) ClearModeratorsURI

func (u *InstanceMetadataUpsertBulk) ClearModeratorsURI() *InstanceMetadataUpsertBulk

ClearModeratorsURI clears the value of the "moderatorsURI" field.

func (*InstanceMetadataUpsertBulk) ClearPrivateKey

ClearPrivateKey clears the value of the "privateKey" field.

func (*InstanceMetadataUpsertBulk) DoNothing

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*InstanceMetadataUpsertBulk) Exec

Exec executes the query.

func (*InstanceMetadataUpsertBulk) ExecX

ExecX is like Exec, but panics if an error occurs.

func (*InstanceMetadataUpsertBulk) Ignore

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.InstanceMetadata.Create().
	OnConflict(sql.ResolveWithIgnore()).
	Exec(ctx)

func (*InstanceMetadataUpsertBulk) SetAdminsURI

SetAdminsURI sets the "adminsURI" field.

func (*InstanceMetadataUpsertBulk) SetBannerEndpoint

SetBannerEndpoint sets the "bannerEndpoint" field.

func (*InstanceMetadataUpsertBulk) SetBannerMimeType

SetBannerMimeType sets the "bannerMimeType" field.

func (*InstanceMetadataUpsertBulk) SetDescription

SetDescription sets the "description" field.

func (*InstanceMetadataUpsertBulk) SetExtensions

SetExtensions sets the "extensions" field.

func (*InstanceMetadataUpsertBulk) SetHost

SetHost sets the "host" field.

func (*InstanceMetadataUpsertBulk) SetIsRemote

SetIsRemote sets the "isRemote" field.

func (*InstanceMetadataUpsertBulk) SetLogoEndpoint

SetLogoEndpoint sets the "logoEndpoint" field.

func (*InstanceMetadataUpsertBulk) SetLogoMimeType

SetLogoMimeType sets the "logoMimeType" field.

func (*InstanceMetadataUpsertBulk) SetModeratorsURI

SetModeratorsURI sets the "moderatorsURI" field.

func (*InstanceMetadataUpsertBulk) SetName

SetName sets the "name" field.

func (*InstanceMetadataUpsertBulk) SetPrivateKey

SetPrivateKey sets the "privateKey" field.

func (*InstanceMetadataUpsertBulk) SetPublicKey

SetPublicKey sets the "publicKey" field.

func (*InstanceMetadataUpsertBulk) SetPublicKeyAlgorithm

func (u *InstanceMetadataUpsertBulk) SetPublicKeyAlgorithm(v string) *InstanceMetadataUpsertBulk

SetPublicKeyAlgorithm sets the "publicKeyAlgorithm" field.

func (*InstanceMetadataUpsertBulk) SetSharedInboxURI

SetSharedInboxURI sets the "sharedInboxURI" field.

func (*InstanceMetadataUpsertBulk) SetSoftwareName

SetSoftwareName sets the "softwareName" field.

func (*InstanceMetadataUpsertBulk) SetSoftwareVersion

SetSoftwareVersion sets the "softwareVersion" field.

func (*InstanceMetadataUpsertBulk) SetSupportedExtensions

func (u *InstanceMetadataUpsertBulk) SetSupportedExtensions(v []string) *InstanceMetadataUpsertBulk

SetSupportedExtensions sets the "supportedExtensions" field.

func (*InstanceMetadataUpsertBulk) SetSupportedVersions

func (u *InstanceMetadataUpsertBulk) SetSupportedVersions(v []string) *InstanceMetadataUpsertBulk

SetSupportedVersions sets the "supportedVersions" field.

func (*InstanceMetadataUpsertBulk) SetURI

SetURI sets the "uri" field.

func (*InstanceMetadataUpsertBulk) SetUpdatedAt

SetUpdatedAt sets the "updated_at" field.

func (*InstanceMetadataUpsertBulk) Update

Update allows overriding fields `UPDATE` values. See the InstanceMetadataCreateBulk.OnConflict documentation for more info.

func (*InstanceMetadataUpsertBulk) UpdateAdminsURI

UpdateAdminsURI sets the "adminsURI" field to the value that was provided on create.

func (*InstanceMetadataUpsertBulk) UpdateBannerEndpoint

func (u *InstanceMetadataUpsertBulk) UpdateBannerEndpoint() *InstanceMetadataUpsertBulk

UpdateBannerEndpoint sets the "bannerEndpoint" field to the value that was provided on create.

func (*InstanceMetadataUpsertBulk) UpdateBannerMimeType

func (u *InstanceMetadataUpsertBulk) UpdateBannerMimeType() *InstanceMetadataUpsertBulk

UpdateBannerMimeType sets the "bannerMimeType" field to the value that was provided on create.

func (*InstanceMetadataUpsertBulk) UpdateDescription

UpdateDescription sets the "description" field to the value that was provided on create.

func (*InstanceMetadataUpsertBulk) UpdateExtensions

UpdateExtensions sets the "extensions" field to the value that was provided on create.

func (*InstanceMetadataUpsertBulk) UpdateHost

UpdateHost sets the "host" field to the value that was provided on create.

func (*InstanceMetadataUpsertBulk) UpdateIsRemote

UpdateIsRemote sets the "isRemote" field to the value that was provided on create.

func (*InstanceMetadataUpsertBulk) UpdateLogoEndpoint

func (u *InstanceMetadataUpsertBulk) UpdateLogoEndpoint() *InstanceMetadataUpsertBulk

UpdateLogoEndpoint sets the "logoEndpoint" field to the value that was provided on create.

func (*InstanceMetadataUpsertBulk) UpdateLogoMimeType

func (u *InstanceMetadataUpsertBulk) UpdateLogoMimeType() *InstanceMetadataUpsertBulk

UpdateLogoMimeType sets the "logoMimeType" field to the value that was provided on create.

func (*InstanceMetadataUpsertBulk) UpdateModeratorsURI

func (u *InstanceMetadataUpsertBulk) UpdateModeratorsURI() *InstanceMetadataUpsertBulk

UpdateModeratorsURI sets the "moderatorsURI" field to the value that was provided on create.

func (*InstanceMetadataUpsertBulk) UpdateName

UpdateName sets the "name" field to the value that was provided on create.

func (*InstanceMetadataUpsertBulk) UpdateNewValues

UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:

client.InstanceMetadata.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
		sql.ResolveWith(func(u *sql.UpdateSet) {
			u.SetIgnore(instancemetadata.FieldID)
		}),
	).
	Exec(ctx)

func (*InstanceMetadataUpsertBulk) UpdatePrivateKey

UpdatePrivateKey sets the "privateKey" field to the value that was provided on create.

func (*InstanceMetadataUpsertBulk) UpdatePublicKey

UpdatePublicKey sets the "publicKey" field to the value that was provided on create.

func (*InstanceMetadataUpsertBulk) UpdatePublicKeyAlgorithm

func (u *InstanceMetadataUpsertBulk) UpdatePublicKeyAlgorithm() *InstanceMetadataUpsertBulk

UpdatePublicKeyAlgorithm sets the "publicKeyAlgorithm" field to the value that was provided on create.

func (*InstanceMetadataUpsertBulk) UpdateSharedInboxURI

func (u *InstanceMetadataUpsertBulk) UpdateSharedInboxURI() *InstanceMetadataUpsertBulk

UpdateSharedInboxURI sets the "sharedInboxURI" field to the value that was provided on create.

func (*InstanceMetadataUpsertBulk) UpdateSoftwareName

func (u *InstanceMetadataUpsertBulk) UpdateSoftwareName() *InstanceMetadataUpsertBulk

UpdateSoftwareName sets the "softwareName" field to the value that was provided on create.

func (*InstanceMetadataUpsertBulk) UpdateSoftwareVersion

func (u *InstanceMetadataUpsertBulk) UpdateSoftwareVersion() *InstanceMetadataUpsertBulk

UpdateSoftwareVersion sets the "softwareVersion" field to the value that was provided on create.

func (*InstanceMetadataUpsertBulk) UpdateSupportedExtensions

func (u *InstanceMetadataUpsertBulk) UpdateSupportedExtensions() *InstanceMetadataUpsertBulk

UpdateSupportedExtensions sets the "supportedExtensions" field to the value that was provided on create.

func (*InstanceMetadataUpsertBulk) UpdateSupportedVersions

func (u *InstanceMetadataUpsertBulk) UpdateSupportedVersions() *InstanceMetadataUpsertBulk

UpdateSupportedVersions sets the "supportedVersions" field to the value that was provided on create.

func (*InstanceMetadataUpsertBulk) UpdateURI

UpdateURI sets the "uri" field to the value that was provided on create.

func (*InstanceMetadataUpsertBulk) UpdateUpdatedAt

UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.

type InstanceMetadataUpsertOne

type InstanceMetadataUpsertOne struct {
	// contains filtered or unexported fields
}

InstanceMetadataUpsertOne is the builder for "upsert"-ing

one InstanceMetadata node.

func (*InstanceMetadataUpsertOne) ClearAdminsURI

ClearAdminsURI clears the value of the "adminsURI" field.

func (*InstanceMetadataUpsertOne) ClearBannerEndpoint

func (u *InstanceMetadataUpsertOne) ClearBannerEndpoint() *InstanceMetadataUpsertOne

ClearBannerEndpoint clears the value of the "bannerEndpoint" field.

func (*InstanceMetadataUpsertOne) ClearBannerMimeType

func (u *InstanceMetadataUpsertOne) ClearBannerMimeType() *InstanceMetadataUpsertOne

ClearBannerMimeType clears the value of the "bannerMimeType" field.

func (*InstanceMetadataUpsertOne) ClearDescription

ClearDescription clears the value of the "description" field.

func (*InstanceMetadataUpsertOne) ClearLogoEndpoint

func (u *InstanceMetadataUpsertOne) ClearLogoEndpoint() *InstanceMetadataUpsertOne

ClearLogoEndpoint clears the value of the "logoEndpoint" field.

func (*InstanceMetadataUpsertOne) ClearLogoMimeType

func (u *InstanceMetadataUpsertOne) ClearLogoMimeType() *InstanceMetadataUpsertOne

ClearLogoMimeType clears the value of the "logoMimeType" field.

func (*InstanceMetadataUpsertOne) ClearModeratorsURI

func (u *InstanceMetadataUpsertOne) ClearModeratorsURI() *InstanceMetadataUpsertOne

ClearModeratorsURI clears the value of the "moderatorsURI" field.

func (*InstanceMetadataUpsertOne) ClearPrivateKey

ClearPrivateKey clears the value of the "privateKey" field.

func (*InstanceMetadataUpsertOne) DoNothing

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*InstanceMetadataUpsertOne) Exec

Exec executes the query.

func (*InstanceMetadataUpsertOne) ExecX

ExecX is like Exec, but panics if an error occurs.

func (*InstanceMetadataUpsertOne) ID

func (u *InstanceMetadataUpsertOne) ID(ctx context.Context) (id uuid.UUID, err error)

Exec executes the UPSERT query and returns the inserted/updated ID.

func (*InstanceMetadataUpsertOne) IDX

IDX is like ID, but panics if an error occurs.

func (*InstanceMetadataUpsertOne) Ignore

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.InstanceMetadata.Create().
    OnConflict(sql.ResolveWithIgnore()).
    Exec(ctx)

func (*InstanceMetadataUpsertOne) SetAdminsURI

SetAdminsURI sets the "adminsURI" field.

func (*InstanceMetadataUpsertOne) SetBannerEndpoint

SetBannerEndpoint sets the "bannerEndpoint" field.

func (*InstanceMetadataUpsertOne) SetBannerMimeType

SetBannerMimeType sets the "bannerMimeType" field.

func (*InstanceMetadataUpsertOne) SetDescription

SetDescription sets the "description" field.

func (*InstanceMetadataUpsertOne) SetExtensions

SetExtensions sets the "extensions" field.

func (*InstanceMetadataUpsertOne) SetHost

SetHost sets the "host" field.

func (*InstanceMetadataUpsertOne) SetIsRemote

SetIsRemote sets the "isRemote" field.

func (*InstanceMetadataUpsertOne) SetLogoEndpoint

SetLogoEndpoint sets the "logoEndpoint" field.

func (*InstanceMetadataUpsertOne) SetLogoMimeType

SetLogoMimeType sets the "logoMimeType" field.

func (*InstanceMetadataUpsertOne) SetModeratorsURI

SetModeratorsURI sets the "moderatorsURI" field.

func (*InstanceMetadataUpsertOne) SetName

SetName sets the "name" field.

func (*InstanceMetadataUpsertOne) SetPrivateKey

SetPrivateKey sets the "privateKey" field.

func (*InstanceMetadataUpsertOne) SetPublicKey

SetPublicKey sets the "publicKey" field.

func (*InstanceMetadataUpsertOne) SetPublicKeyAlgorithm

func (u *InstanceMetadataUpsertOne) SetPublicKeyAlgorithm(v string) *InstanceMetadataUpsertOne

SetPublicKeyAlgorithm sets the "publicKeyAlgorithm" field.

func (*InstanceMetadataUpsertOne) SetSharedInboxURI

SetSharedInboxURI sets the "sharedInboxURI" field.

func (*InstanceMetadataUpsertOne) SetSoftwareName

SetSoftwareName sets the "softwareName" field.

func (*InstanceMetadataUpsertOne) SetSoftwareVersion

SetSoftwareVersion sets the "softwareVersion" field.

func (*InstanceMetadataUpsertOne) SetSupportedExtensions

func (u *InstanceMetadataUpsertOne) SetSupportedExtensions(v []string) *InstanceMetadataUpsertOne

SetSupportedExtensions sets the "supportedExtensions" field.

func (*InstanceMetadataUpsertOne) SetSupportedVersions

func (u *InstanceMetadataUpsertOne) SetSupportedVersions(v []string) *InstanceMetadataUpsertOne

SetSupportedVersions sets the "supportedVersions" field.

func (*InstanceMetadataUpsertOne) SetURI

SetURI sets the "uri" field.

func (*InstanceMetadataUpsertOne) SetUpdatedAt

SetUpdatedAt sets the "updated_at" field.

func (*InstanceMetadataUpsertOne) Update

Update allows overriding fields `UPDATE` values. See the InstanceMetadataCreate.OnConflict documentation for more info.

func (*InstanceMetadataUpsertOne) UpdateAdminsURI

UpdateAdminsURI sets the "adminsURI" field to the value that was provided on create.

func (*InstanceMetadataUpsertOne) UpdateBannerEndpoint

func (u *InstanceMetadataUpsertOne) UpdateBannerEndpoint() *InstanceMetadataUpsertOne

UpdateBannerEndpoint sets the "bannerEndpoint" field to the value that was provided on create.

func (*InstanceMetadataUpsertOne) UpdateBannerMimeType

func (u *InstanceMetadataUpsertOne) UpdateBannerMimeType() *InstanceMetadataUpsertOne

UpdateBannerMimeType sets the "bannerMimeType" field to the value that was provided on create.

func (*InstanceMetadataUpsertOne) UpdateDescription

func (u *InstanceMetadataUpsertOne) UpdateDescription() *InstanceMetadataUpsertOne

UpdateDescription sets the "description" field to the value that was provided on create.

func (*InstanceMetadataUpsertOne) UpdateExtensions

UpdateExtensions sets the "extensions" field to the value that was provided on create.

func (*InstanceMetadataUpsertOne) UpdateHost

UpdateHost sets the "host" field to the value that was provided on create.

func (*InstanceMetadataUpsertOne) UpdateIsRemote

UpdateIsRemote sets the "isRemote" field to the value that was provided on create.

func (*InstanceMetadataUpsertOne) UpdateLogoEndpoint

func (u *InstanceMetadataUpsertOne) UpdateLogoEndpoint() *InstanceMetadataUpsertOne

UpdateLogoEndpoint sets the "logoEndpoint" field to the value that was provided on create.

func (*InstanceMetadataUpsertOne) UpdateLogoMimeType

func (u *InstanceMetadataUpsertOne) UpdateLogoMimeType() *InstanceMetadataUpsertOne

UpdateLogoMimeType sets the "logoMimeType" field to the value that was provided on create.

func (*InstanceMetadataUpsertOne) UpdateModeratorsURI

func (u *InstanceMetadataUpsertOne) UpdateModeratorsURI() *InstanceMetadataUpsertOne

UpdateModeratorsURI sets the "moderatorsURI" field to the value that was provided on create.

func (*InstanceMetadataUpsertOne) UpdateName

UpdateName sets the "name" field to the value that was provided on create.

func (*InstanceMetadataUpsertOne) UpdateNewValues

UpdateNewValues updates the mutable fields using the new values that were set on create except the ID field. Using this option is equivalent to using:

client.InstanceMetadata.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
		sql.ResolveWith(func(u *sql.UpdateSet) {
			u.SetIgnore(instancemetadata.FieldID)
		}),
	).
	Exec(ctx)

func (*InstanceMetadataUpsertOne) UpdatePrivateKey

UpdatePrivateKey sets the "privateKey" field to the value that was provided on create.

func (*InstanceMetadataUpsertOne) UpdatePublicKey

UpdatePublicKey sets the "publicKey" field to the value that was provided on create.

func (*InstanceMetadataUpsertOne) UpdatePublicKeyAlgorithm

func (u *InstanceMetadataUpsertOne) UpdatePublicKeyAlgorithm() *InstanceMetadataUpsertOne

UpdatePublicKeyAlgorithm sets the "publicKeyAlgorithm" field to the value that was provided on create.

func (*InstanceMetadataUpsertOne) UpdateSharedInboxURI

func (u *InstanceMetadataUpsertOne) UpdateSharedInboxURI() *InstanceMetadataUpsertOne

UpdateSharedInboxURI sets the "sharedInboxURI" field to the value that was provided on create.

func (*InstanceMetadataUpsertOne) UpdateSoftwareName

func (u *InstanceMetadataUpsertOne) UpdateSoftwareName() *InstanceMetadataUpsertOne

UpdateSoftwareName sets the "softwareName" field to the value that was provided on create.

func (*InstanceMetadataUpsertOne) UpdateSoftwareVersion

func (u *InstanceMetadataUpsertOne) UpdateSoftwareVersion() *InstanceMetadataUpsertOne

UpdateSoftwareVersion sets the "softwareVersion" field to the value that was provided on create.

func (*InstanceMetadataUpsertOne) UpdateSupportedExtensions

func (u *InstanceMetadataUpsertOne) UpdateSupportedExtensions() *InstanceMetadataUpsertOne

UpdateSupportedExtensions sets the "supportedExtensions" field to the value that was provided on create.

func (*InstanceMetadataUpsertOne) UpdateSupportedVersions

func (u *InstanceMetadataUpsertOne) UpdateSupportedVersions() *InstanceMetadataUpsertOne

UpdateSupportedVersions sets the "supportedVersions" field to the value that was provided on create.

func (*InstanceMetadataUpsertOne) UpdateURI

UpdateURI sets the "uri" field to the value that was provided on create.

func (*InstanceMetadataUpsertOne) UpdateUpdatedAt

UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.

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 Note

type Note struct {

	// ID of the ent.
	ID uuid.UUID `json:"id,omitempty"`
	// IsRemote holds the value of the "isRemote" field.
	IsRemote bool `json:"isRemote,omitempty"`
	// URI holds the value of the "uri" field.
	URI string `json:"uri,omitempty"`
	// Extensions holds the value of the "extensions" field.
	Extensions versia.Extensions `json:"extensions,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"`
	// Subject holds the value of the "subject" field.
	Subject *string `json:"subject,omitempty"`
	// Content holds the value of the "content" field.
	Content string `json:"content,omitempty"`
	// IsSensitive holds the value of the "isSensitive" field.
	IsSensitive bool `json:"isSensitive,omitempty"`
	// Visibility holds the value of the "visibility" field.
	Visibility note.Visibility `json:"visibility,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the NoteQuery when eager-loading is set.
	Edges NoteEdges `json:"edges"`
	// contains filtered or unexported fields
}

Note is the model entity for the Note schema.

func (*Note) QueryAttachments

func (n *Note) QueryAttachments() *AttachmentQuery

QueryAttachments queries the "attachments" edge of the Note entity.

func (*Note) QueryAuthor

func (n *Note) QueryAuthor() *UserQuery

QueryAuthor queries the "author" edge of the Note entity.

func (*Note) QueryMentions

func (n *Note) QueryMentions() *UserQuery

QueryMentions queries the "mentions" edge of the Note entity.

func (*Note) String

func (n *Note) String() string

String implements the fmt.Stringer.

func (*Note) Unwrap

func (n *Note) Unwrap() *Note

Unwrap unwraps the Note 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 (*Note) Update

func (n *Note) Update() *NoteUpdateOne

Update returns a builder for updating this Note. Note that you need to call Note.Unwrap() before calling this method if this Note was returned from a transaction, and the transaction was committed or rolled back.

func (*Note) Value

func (n *Note) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the Note. This includes values selected through modifiers, order, etc.

type NoteClient

type NoteClient struct {
	// contains filtered or unexported fields
}

NoteClient is a client for the Note schema.

func NewNoteClient

func NewNoteClient(c config) *NoteClient

NewNoteClient returns a client for the Note from the given config.

func (*NoteClient) Create

func (c *NoteClient) Create() *NoteCreate

Create returns a builder for creating a Note entity.

func (*NoteClient) CreateBulk

func (c *NoteClient) CreateBulk(builders ...*NoteCreate) *NoteCreateBulk

CreateBulk returns a builder for creating a bulk of Note entities.

func (*NoteClient) Delete

func (c *NoteClient) Delete() *NoteDelete

Delete returns a delete builder for Note.

func (*NoteClient) DeleteOne

func (c *NoteClient) DeleteOne(n *Note) *NoteDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*NoteClient) DeleteOneID

func (c *NoteClient) DeleteOneID(id uuid.UUID) *NoteDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*NoteClient) Get

func (c *NoteClient) Get(ctx context.Context, id uuid.UUID) (*Note, error)

Get returns a Note entity by its id.

func (*NoteClient) GetX

func (c *NoteClient) GetX(ctx context.Context, id uuid.UUID) *Note

GetX is like Get, but panics if an error occurs.

func (*NoteClient) Hooks

func (c *NoteClient) Hooks() []Hook

Hooks returns the client hooks.

func (*NoteClient) Intercept

func (c *NoteClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `note.Intercept(f(g(h())))`.

func (*NoteClient) Interceptors

func (c *NoteClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*NoteClient) MapCreateBulk

func (c *NoteClient) MapCreateBulk(slice any, setFunc func(*NoteCreate, int)) *NoteCreateBulk

MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.

func (*NoteClient) Query

func (c *NoteClient) Query() *NoteQuery

Query returns a query builder for Note.

func (*NoteClient) QueryAttachments

func (c *NoteClient) QueryAttachments(n *Note) *AttachmentQuery

QueryAttachments queries the attachments edge of a Note.

func (*NoteClient) QueryAuthor

func (c *NoteClient) QueryAuthor(n *Note) *UserQuery

QueryAuthor queries the author edge of a Note.

func (*NoteClient) QueryMentions

func (c *NoteClient) QueryMentions(n *Note) *UserQuery

QueryMentions queries the mentions edge of a Note.

func (*NoteClient) Update

func (c *NoteClient) Update() *NoteUpdate

Update returns an update builder for Note.

func (*NoteClient) UpdateOne

func (c *NoteClient) UpdateOne(n *Note) *NoteUpdateOne

UpdateOne returns an update builder for the given entity.

func (*NoteClient) UpdateOneID

func (c *NoteClient) UpdateOneID(id uuid.UUID) *NoteUpdateOne

UpdateOneID returns an update builder for the given id.

func (*NoteClient) Use

func (c *NoteClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `note.Hooks(f(g(h())))`.

type NoteCreate

type NoteCreate struct {
	// contains filtered or unexported fields
}

NoteCreate is the builder for creating a Note entity.

func (*NoteCreate) AddAttachmentIDs

func (nc *NoteCreate) AddAttachmentIDs(ids ...uuid.UUID) *NoteCreate

AddAttachmentIDs adds the "attachments" edge to the Attachment entity by IDs.

func (*NoteCreate) AddAttachments

func (nc *NoteCreate) AddAttachments(a ...*Attachment) *NoteCreate

AddAttachments adds the "attachments" edges to the Attachment entity.

func (*NoteCreate) AddMentionIDs

func (nc *NoteCreate) AddMentionIDs(ids ...uuid.UUID) *NoteCreate

AddMentionIDs adds the "mentions" edge to the User entity by IDs.

func (*NoteCreate) AddMentions

func (nc *NoteCreate) AddMentions(u ...*User) *NoteCreate

AddMentions adds the "mentions" edges to the User entity.

func (*NoteCreate) Exec

func (nc *NoteCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*NoteCreate) ExecX

func (nc *NoteCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*NoteCreate) Mutation

func (nc *NoteCreate) Mutation() *NoteMutation

Mutation returns the NoteMutation object of the builder.

func (*NoteCreate) OnConflict

func (nc *NoteCreate) OnConflict(opts ...sql.ConflictOption) *NoteUpsertOne

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.Note.Create().
	SetIsRemote(v).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.NoteUpsert) {
		SetIsRemote(v+v).
	}).
	Exec(ctx)

func (*NoteCreate) OnConflictColumns

func (nc *NoteCreate) OnConflictColumns(columns ...string) *NoteUpsertOne

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.Note.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*NoteCreate) Save

func (nc *NoteCreate) Save(ctx context.Context) (*Note, error)

Save creates the Note in the database.

func (*NoteCreate) SaveX

func (nc *NoteCreate) SaveX(ctx context.Context) *Note

SaveX calls Save and panics if Save returns an error.

func (*NoteCreate) SetAuthor

func (nc *NoteCreate) SetAuthor(u *User) *NoteCreate

SetAuthor sets the "author" edge to the User entity.

func (*NoteCreate) SetAuthorID

func (nc *NoteCreate) SetAuthorID(id uuid.UUID) *NoteCreate

SetAuthorID sets the "author" edge to the User entity by ID.

func (*NoteCreate) SetContent

func (nc *NoteCreate) SetContent(s string) *NoteCreate

SetContent sets the "content" field.

func (*NoteCreate) SetCreatedAt

func (nc *NoteCreate) SetCreatedAt(t time.Time) *NoteCreate

SetCreatedAt sets the "created_at" field.

func (*NoteCreate) SetExtensions

func (nc *NoteCreate) SetExtensions(v versia.Extensions) *NoteCreate

SetExtensions sets the "extensions" field.

func (*NoteCreate) SetID

func (nc *NoteCreate) SetID(u uuid.UUID) *NoteCreate

SetID sets the "id" field.

func (*NoteCreate) SetIsRemote

func (nc *NoteCreate) SetIsRemote(b bool) *NoteCreate

SetIsRemote sets the "isRemote" field.

func (*NoteCreate) SetIsSensitive

func (nc *NoteCreate) SetIsSensitive(b bool) *NoteCreate

SetIsSensitive sets the "isSensitive" field.

func (*NoteCreate) SetNillableCreatedAt

func (nc *NoteCreate) SetNillableCreatedAt(t *time.Time) *NoteCreate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*NoteCreate) SetNillableID

func (nc *NoteCreate) SetNillableID(u *uuid.UUID) *NoteCreate

SetNillableID sets the "id" field if the given value is not nil.

func (*NoteCreate) SetNillableIsSensitive

func (nc *NoteCreate) SetNillableIsSensitive(b *bool) *NoteCreate

SetNillableIsSensitive sets the "isSensitive" field if the given value is not nil.

func (*NoteCreate) SetNillableSubject

func (nc *NoteCreate) SetNillableSubject(s *string) *NoteCreate

SetNillableSubject sets the "subject" field if the given value is not nil.

func (*NoteCreate) SetNillableUpdatedAt

func (nc *NoteCreate) SetNillableUpdatedAt(t *time.Time) *NoteCreate

SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.

func (*NoteCreate) SetNillableVisibility

func (nc *NoteCreate) SetNillableVisibility(n *note.Visibility) *NoteCreate

SetNillableVisibility sets the "visibility" field if the given value is not nil.

func (*NoteCreate) SetSubject

func (nc *NoteCreate) SetSubject(s string) *NoteCreate

SetSubject sets the "subject" field.

func (*NoteCreate) SetURI

func (nc *NoteCreate) SetURI(s string) *NoteCreate

SetURI sets the "uri" field.

func (*NoteCreate) SetUpdatedAt

func (nc *NoteCreate) SetUpdatedAt(t time.Time) *NoteCreate

SetUpdatedAt sets the "updated_at" field.

func (*NoteCreate) SetVisibility

func (nc *NoteCreate) SetVisibility(n note.Visibility) *NoteCreate

SetVisibility sets the "visibility" field.

type NoteCreateBulk

type NoteCreateBulk struct {
	// contains filtered or unexported fields
}

NoteCreateBulk is the builder for creating many Note entities in bulk.

func (*NoteCreateBulk) Exec

func (ncb *NoteCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*NoteCreateBulk) ExecX

func (ncb *NoteCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*NoteCreateBulk) OnConflict

func (ncb *NoteCreateBulk) OnConflict(opts ...sql.ConflictOption) *NoteUpsertBulk

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.Note.CreateBulk(builders...).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.NoteUpsert) {
		SetIsRemote(v+v).
	}).
	Exec(ctx)

func (*NoteCreateBulk) OnConflictColumns

func (ncb *NoteCreateBulk) OnConflictColumns(columns ...string) *NoteUpsertBulk

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.Note.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*NoteCreateBulk) Save

func (ncb *NoteCreateBulk) Save(ctx context.Context) ([]*Note, error)

Save creates the Note entities in the database.

func (*NoteCreateBulk) SaveX

func (ncb *NoteCreateBulk) SaveX(ctx context.Context) []*Note

SaveX is like Save, but panics if an error occurs.

type NoteDelete

type NoteDelete struct {
	// contains filtered or unexported fields
}

NoteDelete is the builder for deleting a Note entity.

func (*NoteDelete) Exec

func (nd *NoteDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*NoteDelete) ExecX

func (nd *NoteDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*NoteDelete) Where

func (nd *NoteDelete) Where(ps ...predicate.Note) *NoteDelete

Where appends a list predicates to the NoteDelete builder.

type NoteDeleteOne

type NoteDeleteOne struct {
	// contains filtered or unexported fields
}

NoteDeleteOne is the builder for deleting a single Note entity.

func (*NoteDeleteOne) Exec

func (ndo *NoteDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*NoteDeleteOne) ExecX

func (ndo *NoteDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*NoteDeleteOne) Where

func (ndo *NoteDeleteOne) Where(ps ...predicate.Note) *NoteDeleteOne

Where appends a list predicates to the NoteDelete builder.

type NoteEdges

type NoteEdges struct {
	// Author holds the value of the author edge.
	Author *User `json:"author,omitempty"`
	// Mentions holds the value of the mentions edge.
	Mentions []*User `json:"mentions,omitempty"`
	// Attachments holds the value of the attachments edge.
	Attachments []*Attachment `json:"attachments,omitempty"`
	// contains filtered or unexported fields
}

NoteEdges holds the relations/edges for other nodes in the graph.

func (NoteEdges) AttachmentsOrErr

func (e NoteEdges) AttachmentsOrErr() ([]*Attachment, error)

AttachmentsOrErr returns the Attachments value or an error if the edge was not loaded in eager-loading.

func (NoteEdges) AuthorOrErr

func (e NoteEdges) AuthorOrErr() (*User, error)

AuthorOrErr returns the Author value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

func (NoteEdges) MentionsOrErr

func (e NoteEdges) MentionsOrErr() ([]*User, error)

MentionsOrErr returns the Mentions value or an error if the edge was not loaded in eager-loading.

type NoteGroupBy

type NoteGroupBy struct {
	// contains filtered or unexported fields
}

NoteGroupBy is the group-by builder for Note entities.

func (*NoteGroupBy) Aggregate

func (ngb *NoteGroupBy) Aggregate(fns ...AggregateFunc) *NoteGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*NoteGroupBy) Bool

func (s *NoteGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*NoteGroupBy) BoolX

func (s *NoteGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*NoteGroupBy) Bools

func (s *NoteGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*NoteGroupBy) BoolsX

func (s *NoteGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*NoteGroupBy) Float64

func (s *NoteGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*NoteGroupBy) Float64X

func (s *NoteGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*NoteGroupBy) Float64s

func (s *NoteGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*NoteGroupBy) Float64sX

func (s *NoteGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*NoteGroupBy) Int

func (s *NoteGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*NoteGroupBy) IntX

func (s *NoteGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*NoteGroupBy) Ints

func (s *NoteGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*NoteGroupBy) IntsX

func (s *NoteGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*NoteGroupBy) Scan

func (ngb *NoteGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*NoteGroupBy) ScanX

func (s *NoteGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*NoteGroupBy) String

func (s *NoteGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*NoteGroupBy) StringX

func (s *NoteGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*NoteGroupBy) Strings

func (s *NoteGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*NoteGroupBy) StringsX

func (s *NoteGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type NoteMutation

type NoteMutation struct {
	// contains filtered or unexported fields
}

NoteMutation represents an operation that mutates the Note nodes in the graph.

func (*NoteMutation) AddAttachmentIDs

func (m *NoteMutation) AddAttachmentIDs(ids ...uuid.UUID)

AddAttachmentIDs adds the "attachments" edge to the Attachment entity by ids.

func (*NoteMutation) AddField

func (m *NoteMutation) 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 (*NoteMutation) AddMentionIDs

func (m *NoteMutation) AddMentionIDs(ids ...uuid.UUID)

AddMentionIDs adds the "mentions" edge to the User entity by ids.

func (*NoteMutation) AddedEdges

func (m *NoteMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*NoteMutation) AddedField

func (m *NoteMutation) 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 (*NoteMutation) AddedFields

func (m *NoteMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*NoteMutation) AddedIDs

func (m *NoteMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*NoteMutation) AttachmentsCleared

func (m *NoteMutation) AttachmentsCleared() bool

AttachmentsCleared reports if the "attachments" edge to the Attachment entity was cleared.

func (*NoteMutation) AttachmentsIDs

func (m *NoteMutation) AttachmentsIDs() (ids []uuid.UUID)

AttachmentsIDs returns the "attachments" edge IDs in the mutation.

func (*NoteMutation) AuthorCleared

func (m *NoteMutation) AuthorCleared() bool

AuthorCleared reports if the "author" edge to the User entity was cleared.

func (*NoteMutation) AuthorID

func (m *NoteMutation) AuthorID() (id uuid.UUID, exists bool)

AuthorID returns the "author" edge ID in the mutation.

func (*NoteMutation) AuthorIDs

func (m *NoteMutation) AuthorIDs() (ids []uuid.UUID)

AuthorIDs returns the "author" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use AuthorID instead. It exists only for internal usage by the builders.

func (*NoteMutation) ClearAttachments

func (m *NoteMutation) ClearAttachments()

ClearAttachments clears the "attachments" edge to the Attachment entity.

func (*NoteMutation) ClearAuthor

func (m *NoteMutation) ClearAuthor()

ClearAuthor clears the "author" edge to the User entity.

func (*NoteMutation) ClearEdge

func (m *NoteMutation) 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 (*NoteMutation) ClearField

func (m *NoteMutation) 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 (*NoteMutation) ClearMentions

func (m *NoteMutation) ClearMentions()

ClearMentions clears the "mentions" edge to the User entity.

func (*NoteMutation) ClearSubject

func (m *NoteMutation) ClearSubject()

ClearSubject clears the value of the "subject" field.

func (*NoteMutation) ClearedEdges

func (m *NoteMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*NoteMutation) ClearedFields

func (m *NoteMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (NoteMutation) Client

func (m NoteMutation) 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 (*NoteMutation) Content

func (m *NoteMutation) Content() (r string, exists bool)

Content returns the value of the "content" field in the mutation.

func (*NoteMutation) CreatedAt

func (m *NoteMutation) CreatedAt() (r time.Time, exists bool)

CreatedAt returns the value of the "created_at" field in the mutation.

func (*NoteMutation) EdgeCleared

func (m *NoteMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*NoteMutation) Extensions

func (m *NoteMutation) Extensions() (r versia.Extensions, exists bool)

Extensions returns the value of the "extensions" field in the mutation.

func (*NoteMutation) Field

func (m *NoteMutation) 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 (*NoteMutation) FieldCleared

func (m *NoteMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*NoteMutation) Fields

func (m *NoteMutation) 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 (*NoteMutation) ID

func (m *NoteMutation) ID() (id uuid.UUID, exists bool)

ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.

func (*NoteMutation) IDs

func (m *NoteMutation) IDs(ctx context.Context) ([]uuid.UUID, error)

IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.

func (*NoteMutation) IsRemote

func (m *NoteMutation) IsRemote() (r bool, exists bool)

IsRemote returns the value of the "isRemote" field in the mutation.

func (*NoteMutation) IsSensitive

func (m *NoteMutation) IsSensitive() (r bool, exists bool)

IsSensitive returns the value of the "isSensitive" field in the mutation.

func (*NoteMutation) MentionsCleared

func (m *NoteMutation) MentionsCleared() bool

MentionsCleared reports if the "mentions" edge to the User entity was cleared.

func (*NoteMutation) MentionsIDs

func (m *NoteMutation) MentionsIDs() (ids []uuid.UUID)

MentionsIDs returns the "mentions" edge IDs in the mutation.

func (*NoteMutation) OldContent

func (m *NoteMutation) OldContent(ctx context.Context) (v string, err error)

OldContent returns the old "content" field's value of the Note entity. If the Note 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 (*NoteMutation) OldCreatedAt

func (m *NoteMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)

OldCreatedAt returns the old "created_at" field's value of the Note entity. If the Note 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 (*NoteMutation) OldExtensions

func (m *NoteMutation) OldExtensions(ctx context.Context) (v versia.Extensions, err error)

OldExtensions returns the old "extensions" field's value of the Note entity. If the Note 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 (*NoteMutation) OldField

func (m *NoteMutation) 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 (*NoteMutation) OldIsRemote

func (m *NoteMutation) OldIsRemote(ctx context.Context) (v bool, err error)

OldIsRemote returns the old "isRemote" field's value of the Note entity. If the Note 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 (*NoteMutation) OldIsSensitive

func (m *NoteMutation) OldIsSensitive(ctx context.Context) (v bool, err error)

OldIsSensitive returns the old "isSensitive" field's value of the Note entity. If the Note 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 (*NoteMutation) OldSubject

func (m *NoteMutation) OldSubject(ctx context.Context) (v *string, err error)

OldSubject returns the old "subject" field's value of the Note entity. If the Note 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 (*NoteMutation) OldURI

func (m *NoteMutation) OldURI(ctx context.Context) (v string, err error)

OldURI returns the old "uri" field's value of the Note entity. If the Note 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 (*NoteMutation) OldUpdatedAt

func (m *NoteMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)

OldUpdatedAt returns the old "updated_at" field's value of the Note entity. If the Note 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 (*NoteMutation) OldVisibility

func (m *NoteMutation) OldVisibility(ctx context.Context) (v note.Visibility, err error)

OldVisibility returns the old "visibility" field's value of the Note entity. If the Note 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 (*NoteMutation) Op

func (m *NoteMutation) Op() Op

Op returns the operation name.

func (*NoteMutation) RemoveAttachmentIDs

func (m *NoteMutation) RemoveAttachmentIDs(ids ...uuid.UUID)

RemoveAttachmentIDs removes the "attachments" edge to the Attachment entity by IDs.

func (*NoteMutation) RemoveMentionIDs

func (m *NoteMutation) RemoveMentionIDs(ids ...uuid.UUID)

RemoveMentionIDs removes the "mentions" edge to the User entity by IDs.

func (*NoteMutation) RemovedAttachmentsIDs

func (m *NoteMutation) RemovedAttachmentsIDs() (ids []uuid.UUID)

RemovedAttachments returns the removed IDs of the "attachments" edge to the Attachment entity.

func (*NoteMutation) RemovedEdges

func (m *NoteMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*NoteMutation) RemovedIDs

func (m *NoteMutation) 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 (*NoteMutation) RemovedMentionsIDs

func (m *NoteMutation) RemovedMentionsIDs() (ids []uuid.UUID)

RemovedMentions returns the removed IDs of the "mentions" edge to the User entity.

func (*NoteMutation) ResetAttachments

func (m *NoteMutation) ResetAttachments()

ResetAttachments resets all changes to the "attachments" edge.

func (*NoteMutation) ResetAuthor

func (m *NoteMutation) ResetAuthor()

ResetAuthor resets all changes to the "author" edge.

func (*NoteMutation) ResetContent

func (m *NoteMutation) ResetContent()

ResetContent resets all changes to the "content" field.

func (*NoteMutation) ResetCreatedAt

func (m *NoteMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*NoteMutation) ResetEdge

func (m *NoteMutation) 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 (*NoteMutation) ResetExtensions

func (m *NoteMutation) ResetExtensions()

ResetExtensions resets all changes to the "extensions" field.

func (*NoteMutation) ResetField

func (m *NoteMutation) 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 (*NoteMutation) ResetIsRemote

func (m *NoteMutation) ResetIsRemote()

ResetIsRemote resets all changes to the "isRemote" field.

func (*NoteMutation) ResetIsSensitive

func (m *NoteMutation) ResetIsSensitive()

ResetIsSensitive resets all changes to the "isSensitive" field.

func (*NoteMutation) ResetMentions

func (m *NoteMutation) ResetMentions()

ResetMentions resets all changes to the "mentions" edge.

func (*NoteMutation) ResetSubject

func (m *NoteMutation) ResetSubject()

ResetSubject resets all changes to the "subject" field.

func (*NoteMutation) ResetURI

func (m *NoteMutation) ResetURI()

ResetURI resets all changes to the "uri" field.

func (*NoteMutation) ResetUpdatedAt

func (m *NoteMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*NoteMutation) ResetVisibility

func (m *NoteMutation) ResetVisibility()

ResetVisibility resets all changes to the "visibility" field.

func (*NoteMutation) SetAuthorID

func (m *NoteMutation) SetAuthorID(id uuid.UUID)

SetAuthorID sets the "author" edge to the User entity by id.

func (*NoteMutation) SetContent

func (m *NoteMutation) SetContent(s string)

SetContent sets the "content" field.

func (*NoteMutation) SetCreatedAt

func (m *NoteMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" field.

func (*NoteMutation) SetExtensions

func (m *NoteMutation) SetExtensions(v versia.Extensions)

SetExtensions sets the "extensions" field.

func (*NoteMutation) SetField

func (m *NoteMutation) 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 (*NoteMutation) SetID

func (m *NoteMutation) SetID(id uuid.UUID)

SetID sets the value of the id field. Note that this operation is only accepted on creation of Note entities.

func (*NoteMutation) SetIsRemote

func (m *NoteMutation) SetIsRemote(b bool)

SetIsRemote sets the "isRemote" field.

func (*NoteMutation) SetIsSensitive

func (m *NoteMutation) SetIsSensitive(b bool)

SetIsSensitive sets the "isSensitive" field.

func (*NoteMutation) SetOp

func (m *NoteMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*NoteMutation) SetSubject

func (m *NoteMutation) SetSubject(s string)

SetSubject sets the "subject" field.

func (*NoteMutation) SetURI

func (m *NoteMutation) SetURI(s string)

SetURI sets the "uri" field.

func (*NoteMutation) SetUpdatedAt

func (m *NoteMutation) SetUpdatedAt(t time.Time)

SetUpdatedAt sets the "updated_at" field.

func (*NoteMutation) SetVisibility

func (m *NoteMutation) SetVisibility(n note.Visibility)

SetVisibility sets the "visibility" field.

func (*NoteMutation) Subject

func (m *NoteMutation) Subject() (r string, exists bool)

Subject returns the value of the "subject" field in the mutation.

func (*NoteMutation) SubjectCleared

func (m *NoteMutation) SubjectCleared() bool

SubjectCleared returns if the "subject" field was cleared in this mutation.

func (NoteMutation) Tx

func (m NoteMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*NoteMutation) Type

func (m *NoteMutation) Type() string

Type returns the node type of this mutation (Note).

func (*NoteMutation) URI

func (m *NoteMutation) URI() (r string, exists bool)

URI returns the value of the "uri" field in the mutation.

func (*NoteMutation) UpdatedAt

func (m *NoteMutation) UpdatedAt() (r time.Time, exists bool)

UpdatedAt returns the value of the "updated_at" field in the mutation.

func (*NoteMutation) Visibility

func (m *NoteMutation) Visibility() (r note.Visibility, exists bool)

Visibility returns the value of the "visibility" field in the mutation.

func (*NoteMutation) Where

func (m *NoteMutation) Where(ps ...predicate.Note)

Where appends a list predicates to the NoteMutation builder.

func (*NoteMutation) WhereP

func (m *NoteMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the NoteMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type NoteQuery

type NoteQuery struct {
	// contains filtered or unexported fields
}

NoteQuery is the builder for querying Note entities.

func (*NoteQuery) Aggregate

func (nq *NoteQuery) Aggregate(fns ...AggregateFunc) *NoteSelect

Aggregate returns a NoteSelect configured with the given aggregations.

func (*NoteQuery) All

func (nq *NoteQuery) All(ctx context.Context) ([]*Note, error)

All executes the query and returns a list of Notes.

func (*NoteQuery) AllX

func (nq *NoteQuery) AllX(ctx context.Context) []*Note

AllX is like All, but panics if an error occurs.

func (*NoteQuery) Clone

func (nq *NoteQuery) Clone() *NoteQuery

Clone returns a duplicate of the NoteQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*NoteQuery) Count

func (nq *NoteQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*NoteQuery) CountX

func (nq *NoteQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*NoteQuery) Exist

func (nq *NoteQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*NoteQuery) ExistX

func (nq *NoteQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*NoteQuery) First

func (nq *NoteQuery) First(ctx context.Context) (*Note, error)

First returns the first Note entity from the query. Returns a *NotFoundError when no Note was found.

func (*NoteQuery) FirstID

func (nq *NoteQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

FirstID returns the first Note ID from the query. Returns a *NotFoundError when no Note ID was found.

func (*NoteQuery) FirstIDX

func (nq *NoteQuery) FirstIDX(ctx context.Context) uuid.UUID

FirstIDX is like FirstID, but panics if an error occurs.

func (*NoteQuery) FirstX

func (nq *NoteQuery) FirstX(ctx context.Context) *Note

FirstX is like First, but panics if an error occurs.

func (*NoteQuery) GroupBy

func (nq *NoteQuery) GroupBy(field string, fields ...string) *NoteGroupBy

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 {
	IsRemote bool `json:"isRemote,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Note.Query().
	GroupBy(note.FieldIsRemote).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*NoteQuery) IDs

func (nq *NoteQuery) IDs(ctx context.Context) (ids []uuid.UUID, err error)

IDs executes the query and returns a list of Note IDs.

func (*NoteQuery) IDsX

func (nq *NoteQuery) IDsX(ctx context.Context) []uuid.UUID

IDsX is like IDs, but panics if an error occurs.

func (*NoteQuery) Limit

func (nq *NoteQuery) Limit(limit int) *NoteQuery

Limit the number of records to be returned by this query.

func (*NoteQuery) Offset

func (nq *NoteQuery) Offset(offset int) *NoteQuery

Offset to start from.

func (*NoteQuery) Only

func (nq *NoteQuery) Only(ctx context.Context) (*Note, error)

Only returns a single Note entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Note entity is found. Returns a *NotFoundError when no Note entities are found.

func (*NoteQuery) OnlyID

func (nq *NoteQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

OnlyID is like Only, but returns the only Note ID in the query. Returns a *NotSingularError when more than one Note ID is found. Returns a *NotFoundError when no entities are found.

func (*NoteQuery) OnlyIDX

func (nq *NoteQuery) OnlyIDX(ctx context.Context) uuid.UUID

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*NoteQuery) OnlyX

func (nq *NoteQuery) OnlyX(ctx context.Context) *Note

OnlyX is like Only, but panics if an error occurs.

func (*NoteQuery) Order

func (nq *NoteQuery) Order(o ...note.OrderOption) *NoteQuery

Order specifies how the records should be ordered.

func (*NoteQuery) QueryAttachments

func (nq *NoteQuery) QueryAttachments() *AttachmentQuery

QueryAttachments chains the current query on the "attachments" edge.

func (*NoteQuery) QueryAuthor

func (nq *NoteQuery) QueryAuthor() *UserQuery

QueryAuthor chains the current query on the "author" edge.

func (*NoteQuery) QueryMentions

func (nq *NoteQuery) QueryMentions() *UserQuery

QueryMentions chains the current query on the "mentions" edge.

func (*NoteQuery) Select

func (nq *NoteQuery) Select(fields ...string) *NoteSelect

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 {
	IsRemote bool `json:"isRemote,omitempty"`
}

client.Note.Query().
	Select(note.FieldIsRemote).
	Scan(ctx, &v)

func (*NoteQuery) Unique

func (nq *NoteQuery) Unique(unique bool) *NoteQuery

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 (*NoteQuery) Where

func (nq *NoteQuery) Where(ps ...predicate.Note) *NoteQuery

Where adds a new predicate for the NoteQuery builder.

func (*NoteQuery) WithAttachments

func (nq *NoteQuery) WithAttachments(opts ...func(*AttachmentQuery)) *NoteQuery

WithAttachments tells the query-builder to eager-load the nodes that are connected to the "attachments" edge. The optional arguments are used to configure the query builder of the edge.

func (*NoteQuery) WithAuthor

func (nq *NoteQuery) WithAuthor(opts ...func(*UserQuery)) *NoteQuery

WithAuthor tells the query-builder to eager-load the nodes that are connected to the "author" edge. The optional arguments are used to configure the query builder of the edge.

func (*NoteQuery) WithMentions

func (nq *NoteQuery) WithMentions(opts ...func(*UserQuery)) *NoteQuery

WithMentions tells the query-builder to eager-load the nodes that are connected to the "mentions" edge. The optional arguments are used to configure the query builder of the edge.

type NoteSelect

type NoteSelect struct {
	*NoteQuery
	// contains filtered or unexported fields
}

NoteSelect is the builder for selecting fields of Note entities.

func (*NoteSelect) Aggregate

func (ns *NoteSelect) Aggregate(fns ...AggregateFunc) *NoteSelect

Aggregate adds the given aggregation functions to the selector query.

func (*NoteSelect) Bool

func (s *NoteSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*NoteSelect) BoolX

func (s *NoteSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*NoteSelect) Bools

func (s *NoteSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*NoteSelect) BoolsX

func (s *NoteSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*NoteSelect) Float64

func (s *NoteSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*NoteSelect) Float64X

func (s *NoteSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*NoteSelect) Float64s

func (s *NoteSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*NoteSelect) Float64sX

func (s *NoteSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*NoteSelect) Int

func (s *NoteSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*NoteSelect) IntX

func (s *NoteSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*NoteSelect) Ints

func (s *NoteSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*NoteSelect) IntsX

func (s *NoteSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*NoteSelect) Scan

func (ns *NoteSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*NoteSelect) ScanX

func (s *NoteSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*NoteSelect) String

func (s *NoteSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*NoteSelect) StringX

func (s *NoteSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*NoteSelect) Strings

func (s *NoteSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*NoteSelect) StringsX

func (s *NoteSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type NoteUpdate

type NoteUpdate struct {
	// contains filtered or unexported fields
}

NoteUpdate is the builder for updating Note entities.

func (*NoteUpdate) AddAttachmentIDs

func (nu *NoteUpdate) AddAttachmentIDs(ids ...uuid.UUID) *NoteUpdate

AddAttachmentIDs adds the "attachments" edge to the Attachment entity by IDs.

func (*NoteUpdate) AddAttachments

func (nu *NoteUpdate) AddAttachments(a ...*Attachment) *NoteUpdate

AddAttachments adds the "attachments" edges to the Attachment entity.

func (*NoteUpdate) AddMentionIDs

func (nu *NoteUpdate) AddMentionIDs(ids ...uuid.UUID) *NoteUpdate

AddMentionIDs adds the "mentions" edge to the User entity by IDs.

func (*NoteUpdate) AddMentions

func (nu *NoteUpdate) AddMentions(u ...*User) *NoteUpdate

AddMentions adds the "mentions" edges to the User entity.

func (*NoteUpdate) ClearAttachments

func (nu *NoteUpdate) ClearAttachments() *NoteUpdate

ClearAttachments clears all "attachments" edges to the Attachment entity.

func (*NoteUpdate) ClearAuthor

func (nu *NoteUpdate) ClearAuthor() *NoteUpdate

ClearAuthor clears the "author" edge to the User entity.

func (*NoteUpdate) ClearMentions

func (nu *NoteUpdate) ClearMentions() *NoteUpdate

ClearMentions clears all "mentions" edges to the User entity.

func (*NoteUpdate) ClearSubject

func (nu *NoteUpdate) ClearSubject() *NoteUpdate

ClearSubject clears the value of the "subject" field.

func (*NoteUpdate) Exec

func (nu *NoteUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*NoteUpdate) ExecX

func (nu *NoteUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*NoteUpdate) Mutation

func (nu *NoteUpdate) Mutation() *NoteMutation

Mutation returns the NoteMutation object of the builder.

func (*NoteUpdate) RemoveAttachmentIDs

func (nu *NoteUpdate) RemoveAttachmentIDs(ids ...uuid.UUID) *NoteUpdate

RemoveAttachmentIDs removes the "attachments" edge to Attachment entities by IDs.

func (*NoteUpdate) RemoveAttachments

func (nu *NoteUpdate) RemoveAttachments(a ...*Attachment) *NoteUpdate

RemoveAttachments removes "attachments" edges to Attachment entities.

func (*NoteUpdate) RemoveMentionIDs

func (nu *NoteUpdate) RemoveMentionIDs(ids ...uuid.UUID) *NoteUpdate

RemoveMentionIDs removes the "mentions" edge to User entities by IDs.

func (*NoteUpdate) RemoveMentions

func (nu *NoteUpdate) RemoveMentions(u ...*User) *NoteUpdate

RemoveMentions removes "mentions" edges to User entities.

func (*NoteUpdate) Save

func (nu *NoteUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*NoteUpdate) SaveX

func (nu *NoteUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*NoteUpdate) SetAuthor

func (nu *NoteUpdate) SetAuthor(u *User) *NoteUpdate

SetAuthor sets the "author" edge to the User entity.

func (*NoteUpdate) SetAuthorID

func (nu *NoteUpdate) SetAuthorID(id uuid.UUID) *NoteUpdate

SetAuthorID sets the "author" edge to the User entity by ID.

func (*NoteUpdate) SetContent

func (nu *NoteUpdate) SetContent(s string) *NoteUpdate

SetContent sets the "content" field.

func (*NoteUpdate) SetExtensions

func (nu *NoteUpdate) SetExtensions(v versia.Extensions) *NoteUpdate

SetExtensions sets the "extensions" field.

func (*NoteUpdate) SetIsRemote

func (nu *NoteUpdate) SetIsRemote(b bool) *NoteUpdate

SetIsRemote sets the "isRemote" field.

func (*NoteUpdate) SetIsSensitive

func (nu *NoteUpdate) SetIsSensitive(b bool) *NoteUpdate

SetIsSensitive sets the "isSensitive" field.

func (*NoteUpdate) SetNillableContent

func (nu *NoteUpdate) SetNillableContent(s *string) *NoteUpdate

SetNillableContent sets the "content" field if the given value is not nil.

func (*NoteUpdate) SetNillableIsRemote

func (nu *NoteUpdate) SetNillableIsRemote(b *bool) *NoteUpdate

SetNillableIsRemote sets the "isRemote" field if the given value is not nil.

func (*NoteUpdate) SetNillableIsSensitive

func (nu *NoteUpdate) SetNillableIsSensitive(b *bool) *NoteUpdate

SetNillableIsSensitive sets the "isSensitive" field if the given value is not nil.

func (*NoteUpdate) SetNillableSubject

func (nu *NoteUpdate) SetNillableSubject(s *string) *NoteUpdate

SetNillableSubject sets the "subject" field if the given value is not nil.

func (*NoteUpdate) SetNillableURI

func (nu *NoteUpdate) SetNillableURI(s *string) *NoteUpdate

SetNillableURI sets the "uri" field if the given value is not nil.

func (*NoteUpdate) SetNillableVisibility

func (nu *NoteUpdate) SetNillableVisibility(n *note.Visibility) *NoteUpdate

SetNillableVisibility sets the "visibility" field if the given value is not nil.

func (*NoteUpdate) SetSubject

func (nu *NoteUpdate) SetSubject(s string) *NoteUpdate

SetSubject sets the "subject" field.

func (*NoteUpdate) SetURI

func (nu *NoteUpdate) SetURI(s string) *NoteUpdate

SetURI sets the "uri" field.

func (*NoteUpdate) SetUpdatedAt

func (nu *NoteUpdate) SetUpdatedAt(t time.Time) *NoteUpdate

SetUpdatedAt sets the "updated_at" field.

func (*NoteUpdate) SetVisibility

func (nu *NoteUpdate) SetVisibility(n note.Visibility) *NoteUpdate

SetVisibility sets the "visibility" field.

func (*NoteUpdate) Where

func (nu *NoteUpdate) Where(ps ...predicate.Note) *NoteUpdate

Where appends a list predicates to the NoteUpdate builder.

type NoteUpdateOne

type NoteUpdateOne struct {
	// contains filtered or unexported fields
}

NoteUpdateOne is the builder for updating a single Note entity.

func (*NoteUpdateOne) AddAttachmentIDs

func (nuo *NoteUpdateOne) AddAttachmentIDs(ids ...uuid.UUID) *NoteUpdateOne

AddAttachmentIDs adds the "attachments" edge to the Attachment entity by IDs.

func (*NoteUpdateOne) AddAttachments

func (nuo *NoteUpdateOne) AddAttachments(a ...*Attachment) *NoteUpdateOne

AddAttachments adds the "attachments" edges to the Attachment entity.

func (*NoteUpdateOne) AddMentionIDs

func (nuo *NoteUpdateOne) AddMentionIDs(ids ...uuid.UUID) *NoteUpdateOne

AddMentionIDs adds the "mentions" edge to the User entity by IDs.

func (*NoteUpdateOne) AddMentions

func (nuo *NoteUpdateOne) AddMentions(u ...*User) *NoteUpdateOne

AddMentions adds the "mentions" edges to the User entity.

func (*NoteUpdateOne) ClearAttachments

func (nuo *NoteUpdateOne) ClearAttachments() *NoteUpdateOne

ClearAttachments clears all "attachments" edges to the Attachment entity.

func (*NoteUpdateOne) ClearAuthor

func (nuo *NoteUpdateOne) ClearAuthor() *NoteUpdateOne

ClearAuthor clears the "author" edge to the User entity.

func (*NoteUpdateOne) ClearMentions

func (nuo *NoteUpdateOne) ClearMentions() *NoteUpdateOne

ClearMentions clears all "mentions" edges to the User entity.

func (*NoteUpdateOne) ClearSubject

func (nuo *NoteUpdateOne) ClearSubject() *NoteUpdateOne

ClearSubject clears the value of the "subject" field.

func (*NoteUpdateOne) Exec

func (nuo *NoteUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*NoteUpdateOne) ExecX

func (nuo *NoteUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*NoteUpdateOne) Mutation

func (nuo *NoteUpdateOne) Mutation() *NoteMutation

Mutation returns the NoteMutation object of the builder.

func (*NoteUpdateOne) RemoveAttachmentIDs

func (nuo *NoteUpdateOne) RemoveAttachmentIDs(ids ...uuid.UUID) *NoteUpdateOne

RemoveAttachmentIDs removes the "attachments" edge to Attachment entities by IDs.

func (*NoteUpdateOne) RemoveAttachments

func (nuo *NoteUpdateOne) RemoveAttachments(a ...*Attachment) *NoteUpdateOne

RemoveAttachments removes "attachments" edges to Attachment entities.

func (*NoteUpdateOne) RemoveMentionIDs

func (nuo *NoteUpdateOne) RemoveMentionIDs(ids ...uuid.UUID) *NoteUpdateOne

RemoveMentionIDs removes the "mentions" edge to User entities by IDs.

func (*NoteUpdateOne) RemoveMentions

func (nuo *NoteUpdateOne) RemoveMentions(u ...*User) *NoteUpdateOne

RemoveMentions removes "mentions" edges to User entities.

func (*NoteUpdateOne) Save

func (nuo *NoteUpdateOne) Save(ctx context.Context) (*Note, error)

Save executes the query and returns the updated Note entity.

func (*NoteUpdateOne) SaveX

func (nuo *NoteUpdateOne) SaveX(ctx context.Context) *Note

SaveX is like Save, but panics if an error occurs.

func (*NoteUpdateOne) Select

func (nuo *NoteUpdateOne) Select(field string, fields ...string) *NoteUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*NoteUpdateOne) SetAuthor

func (nuo *NoteUpdateOne) SetAuthor(u *User) *NoteUpdateOne

SetAuthor sets the "author" edge to the User entity.

func (*NoteUpdateOne) SetAuthorID

func (nuo *NoteUpdateOne) SetAuthorID(id uuid.UUID) *NoteUpdateOne

SetAuthorID sets the "author" edge to the User entity by ID.

func (*NoteUpdateOne) SetContent

func (nuo *NoteUpdateOne) SetContent(s string) *NoteUpdateOne

SetContent sets the "content" field.

func (*NoteUpdateOne) SetExtensions

func (nuo *NoteUpdateOne) SetExtensions(v versia.Extensions) *NoteUpdateOne

SetExtensions sets the "extensions" field.

func (*NoteUpdateOne) SetIsRemote

func (nuo *NoteUpdateOne) SetIsRemote(b bool) *NoteUpdateOne

SetIsRemote sets the "isRemote" field.

func (*NoteUpdateOne) SetIsSensitive

func (nuo *NoteUpdateOne) SetIsSensitive(b bool) *NoteUpdateOne

SetIsSensitive sets the "isSensitive" field.

func (*NoteUpdateOne) SetNillableContent

func (nuo *NoteUpdateOne) SetNillableContent(s *string) *NoteUpdateOne

SetNillableContent sets the "content" field if the given value is not nil.

func (*NoteUpdateOne) SetNillableIsRemote

func (nuo *NoteUpdateOne) SetNillableIsRemote(b *bool) *NoteUpdateOne

SetNillableIsRemote sets the "isRemote" field if the given value is not nil.

func (*NoteUpdateOne) SetNillableIsSensitive

func (nuo *NoteUpdateOne) SetNillableIsSensitive(b *bool) *NoteUpdateOne

SetNillableIsSensitive sets the "isSensitive" field if the given value is not nil.

func (*NoteUpdateOne) SetNillableSubject

func (nuo *NoteUpdateOne) SetNillableSubject(s *string) *NoteUpdateOne

SetNillableSubject sets the "subject" field if the given value is not nil.

func (*NoteUpdateOne) SetNillableURI

func (nuo *NoteUpdateOne) SetNillableURI(s *string) *NoteUpdateOne

SetNillableURI sets the "uri" field if the given value is not nil.

func (*NoteUpdateOne) SetNillableVisibility

func (nuo *NoteUpdateOne) SetNillableVisibility(n *note.Visibility) *NoteUpdateOne

SetNillableVisibility sets the "visibility" field if the given value is not nil.

func (*NoteUpdateOne) SetSubject

func (nuo *NoteUpdateOne) SetSubject(s string) *NoteUpdateOne

SetSubject sets the "subject" field.

func (*NoteUpdateOne) SetURI

func (nuo *NoteUpdateOne) SetURI(s string) *NoteUpdateOne

SetURI sets the "uri" field.

func (*NoteUpdateOne) SetUpdatedAt

func (nuo *NoteUpdateOne) SetUpdatedAt(t time.Time) *NoteUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*NoteUpdateOne) SetVisibility

func (nuo *NoteUpdateOne) SetVisibility(n note.Visibility) *NoteUpdateOne

SetVisibility sets the "visibility" field.

func (*NoteUpdateOne) Where

func (nuo *NoteUpdateOne) Where(ps ...predicate.Note) *NoteUpdateOne

Where appends a list predicates to the NoteUpdate builder.

type NoteUpsert

type NoteUpsert struct {
	*sql.UpdateSet
}

NoteUpsert is the "OnConflict" setter.

func (*NoteUpsert) ClearSubject

func (u *NoteUpsert) ClearSubject() *NoteUpsert

ClearSubject clears the value of the "subject" field.

func (*NoteUpsert) SetContent

func (u *NoteUpsert) SetContent(v string) *NoteUpsert

SetContent sets the "content" field.

func (*NoteUpsert) SetExtensions

func (u *NoteUpsert) SetExtensions(v versia.Extensions) *NoteUpsert

SetExtensions sets the "extensions" field.

func (*NoteUpsert) SetIsRemote

func (u *NoteUpsert) SetIsRemote(v bool) *NoteUpsert

SetIsRemote sets the "isRemote" field.

func (*NoteUpsert) SetIsSensitive

func (u *NoteUpsert) SetIsSensitive(v bool) *NoteUpsert

SetIsSensitive sets the "isSensitive" field.

func (*NoteUpsert) SetSubject

func (u *NoteUpsert) SetSubject(v string) *NoteUpsert

SetSubject sets the "subject" field.

func (*NoteUpsert) SetURI

func (u *NoteUpsert) SetURI(v string) *NoteUpsert

SetURI sets the "uri" field.

func (*NoteUpsert) SetUpdatedAt

func (u *NoteUpsert) SetUpdatedAt(v time.Time) *NoteUpsert

SetUpdatedAt sets the "updated_at" field.

func (*NoteUpsert) SetVisibility

func (u *NoteUpsert) SetVisibility(v note.Visibility) *NoteUpsert

SetVisibility sets the "visibility" field.

func (*NoteUpsert) UpdateContent

func (u *NoteUpsert) UpdateContent() *NoteUpsert

UpdateContent sets the "content" field to the value that was provided on create.

func (*NoteUpsert) UpdateExtensions

func (u *NoteUpsert) UpdateExtensions() *NoteUpsert

UpdateExtensions sets the "extensions" field to the value that was provided on create.

func (*NoteUpsert) UpdateIsRemote

func (u *NoteUpsert) UpdateIsRemote() *NoteUpsert

UpdateIsRemote sets the "isRemote" field to the value that was provided on create.

func (*NoteUpsert) UpdateIsSensitive

func (u *NoteUpsert) UpdateIsSensitive() *NoteUpsert

UpdateIsSensitive sets the "isSensitive" field to the value that was provided on create.

func (*NoteUpsert) UpdateSubject

func (u *NoteUpsert) UpdateSubject() *NoteUpsert

UpdateSubject sets the "subject" field to the value that was provided on create.

func (*NoteUpsert) UpdateURI

func (u *NoteUpsert) UpdateURI() *NoteUpsert

UpdateURI sets the "uri" field to the value that was provided on create.

func (*NoteUpsert) UpdateUpdatedAt

func (u *NoteUpsert) UpdateUpdatedAt() *NoteUpsert

UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.

func (*NoteUpsert) UpdateVisibility

func (u *NoteUpsert) UpdateVisibility() *NoteUpsert

UpdateVisibility sets the "visibility" field to the value that was provided on create.

type NoteUpsertBulk

type NoteUpsertBulk struct {
	// contains filtered or unexported fields
}

NoteUpsertBulk is the builder for "upsert"-ing a bulk of Note nodes.

func (*NoteUpsertBulk) ClearSubject

func (u *NoteUpsertBulk) ClearSubject() *NoteUpsertBulk

ClearSubject clears the value of the "subject" field.

func (*NoteUpsertBulk) DoNothing

func (u *NoteUpsertBulk) DoNothing() *NoteUpsertBulk

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*NoteUpsertBulk) Exec

func (u *NoteUpsertBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*NoteUpsertBulk) ExecX

func (u *NoteUpsertBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*NoteUpsertBulk) Ignore

func (u *NoteUpsertBulk) Ignore() *NoteUpsertBulk

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.Note.Create().
	OnConflict(sql.ResolveWithIgnore()).
	Exec(ctx)

func (*NoteUpsertBulk) SetContent

func (u *NoteUpsertBulk) SetContent(v string) *NoteUpsertBulk

SetContent sets the "content" field.

func (*NoteUpsertBulk) SetExtensions

func (u *NoteUpsertBulk) SetExtensions(v versia.Extensions) *NoteUpsertBulk

SetExtensions sets the "extensions" field.

func (*NoteUpsertBulk) SetIsRemote

func (u *NoteUpsertBulk) SetIsRemote(v bool) *NoteUpsertBulk

SetIsRemote sets the "isRemote" field.

func (*NoteUpsertBulk) SetIsSensitive

func (u *NoteUpsertBulk) SetIsSensitive(v bool) *NoteUpsertBulk

SetIsSensitive sets the "isSensitive" field.

func (*NoteUpsertBulk) SetSubject

func (u *NoteUpsertBulk) SetSubject(v string) *NoteUpsertBulk

SetSubject sets the "subject" field.

func (*NoteUpsertBulk) SetURI

func (u *NoteUpsertBulk) SetURI(v string) *NoteUpsertBulk

SetURI sets the "uri" field.

func (*NoteUpsertBulk) SetUpdatedAt

func (u *NoteUpsertBulk) SetUpdatedAt(v time.Time) *NoteUpsertBulk

SetUpdatedAt sets the "updated_at" field.

func (*NoteUpsertBulk) SetVisibility

func (u *NoteUpsertBulk) SetVisibility(v note.Visibility) *NoteUpsertBulk

SetVisibility sets the "visibility" field.

func (*NoteUpsertBulk) Update

func (u *NoteUpsertBulk) Update(set func(*NoteUpsert)) *NoteUpsertBulk

Update allows overriding fields `UPDATE` values. See the NoteCreateBulk.OnConflict documentation for more info.

func (*NoteUpsertBulk) UpdateContent

func (u *NoteUpsertBulk) UpdateContent() *NoteUpsertBulk

UpdateContent sets the "content" field to the value that was provided on create.

func (*NoteUpsertBulk) UpdateExtensions

func (u *NoteUpsertBulk) UpdateExtensions() *NoteUpsertBulk

UpdateExtensions sets the "extensions" field to the value that was provided on create.

func (*NoteUpsertBulk) UpdateIsRemote

func (u *NoteUpsertBulk) UpdateIsRemote() *NoteUpsertBulk

UpdateIsRemote sets the "isRemote" field to the value that was provided on create.

func (*NoteUpsertBulk) UpdateIsSensitive

func (u *NoteUpsertBulk) UpdateIsSensitive() *NoteUpsertBulk

UpdateIsSensitive sets the "isSensitive" field to the value that was provided on create.

func (*NoteUpsertBulk) UpdateNewValues

func (u *NoteUpsertBulk) UpdateNewValues() *NoteUpsertBulk

UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:

client.Note.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
		sql.ResolveWith(func(u *sql.UpdateSet) {
			u.SetIgnore(note.FieldID)
		}),
	).
	Exec(ctx)

func (*NoteUpsertBulk) UpdateSubject

func (u *NoteUpsertBulk) UpdateSubject() *NoteUpsertBulk

UpdateSubject sets the "subject" field to the value that was provided on create.

func (*NoteUpsertBulk) UpdateURI

func (u *NoteUpsertBulk) UpdateURI() *NoteUpsertBulk

UpdateURI sets the "uri" field to the value that was provided on create.

func (*NoteUpsertBulk) UpdateUpdatedAt

func (u *NoteUpsertBulk) UpdateUpdatedAt() *NoteUpsertBulk

UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.

func (*NoteUpsertBulk) UpdateVisibility

func (u *NoteUpsertBulk) UpdateVisibility() *NoteUpsertBulk

UpdateVisibility sets the "visibility" field to the value that was provided on create.

type NoteUpsertOne

type NoteUpsertOne struct {
	// contains filtered or unexported fields
}

NoteUpsertOne is the builder for "upsert"-ing

one Note node.

func (*NoteUpsertOne) ClearSubject

func (u *NoteUpsertOne) ClearSubject() *NoteUpsertOne

ClearSubject clears the value of the "subject" field.

func (*NoteUpsertOne) DoNothing

func (u *NoteUpsertOne) DoNothing() *NoteUpsertOne

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*NoteUpsertOne) Exec

func (u *NoteUpsertOne) Exec(ctx context.Context) error

Exec executes the query.

func (*NoteUpsertOne) ExecX

func (u *NoteUpsertOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*NoteUpsertOne) ID

func (u *NoteUpsertOne) ID(ctx context.Context) (id uuid.UUID, err error)

Exec executes the UPSERT query and returns the inserted/updated ID.

func (*NoteUpsertOne) IDX

func (u *NoteUpsertOne) IDX(ctx context.Context) uuid.UUID

IDX is like ID, but panics if an error occurs.

func (*NoteUpsertOne) Ignore

func (u *NoteUpsertOne) Ignore() *NoteUpsertOne

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.Note.Create().
    OnConflict(sql.ResolveWithIgnore()).
    Exec(ctx)

func (*NoteUpsertOne) SetContent

func (u *NoteUpsertOne) SetContent(v string) *NoteUpsertOne

SetContent sets the "content" field.

func (*NoteUpsertOne) SetExtensions

func (u *NoteUpsertOne) SetExtensions(v versia.Extensions) *NoteUpsertOne

SetExtensions sets the "extensions" field.

func (*NoteUpsertOne) SetIsRemote

func (u *NoteUpsertOne) SetIsRemote(v bool) *NoteUpsertOne

SetIsRemote sets the "isRemote" field.

func (*NoteUpsertOne) SetIsSensitive

func (u *NoteUpsertOne) SetIsSensitive(v bool) *NoteUpsertOne

SetIsSensitive sets the "isSensitive" field.

func (*NoteUpsertOne) SetSubject

func (u *NoteUpsertOne) SetSubject(v string) *NoteUpsertOne

SetSubject sets the "subject" field.

func (*NoteUpsertOne) SetURI

func (u *NoteUpsertOne) SetURI(v string) *NoteUpsertOne

SetURI sets the "uri" field.

func (*NoteUpsertOne) SetUpdatedAt

func (u *NoteUpsertOne) SetUpdatedAt(v time.Time) *NoteUpsertOne

SetUpdatedAt sets the "updated_at" field.

func (*NoteUpsertOne) SetVisibility

func (u *NoteUpsertOne) SetVisibility(v note.Visibility) *NoteUpsertOne

SetVisibility sets the "visibility" field.

func (*NoteUpsertOne) Update

func (u *NoteUpsertOne) Update(set func(*NoteUpsert)) *NoteUpsertOne

Update allows overriding fields `UPDATE` values. See the NoteCreate.OnConflict documentation for more info.

func (*NoteUpsertOne) UpdateContent

func (u *NoteUpsertOne) UpdateContent() *NoteUpsertOne

UpdateContent sets the "content" field to the value that was provided on create.

func (*NoteUpsertOne) UpdateExtensions

func (u *NoteUpsertOne) UpdateExtensions() *NoteUpsertOne

UpdateExtensions sets the "extensions" field to the value that was provided on create.

func (*NoteUpsertOne) UpdateIsRemote

func (u *NoteUpsertOne) UpdateIsRemote() *NoteUpsertOne

UpdateIsRemote sets the "isRemote" field to the value that was provided on create.

func (*NoteUpsertOne) UpdateIsSensitive

func (u *NoteUpsertOne) UpdateIsSensitive() *NoteUpsertOne

UpdateIsSensitive sets the "isSensitive" field to the value that was provided on create.

func (*NoteUpsertOne) UpdateNewValues

func (u *NoteUpsertOne) UpdateNewValues() *NoteUpsertOne

UpdateNewValues updates the mutable fields using the new values that were set on create except the ID field. Using this option is equivalent to using:

client.Note.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
		sql.ResolveWith(func(u *sql.UpdateSet) {
			u.SetIgnore(note.FieldID)
		}),
	).
	Exec(ctx)

func (*NoteUpsertOne) UpdateSubject

func (u *NoteUpsertOne) UpdateSubject() *NoteUpsertOne

UpdateSubject sets the "subject" field to the value that was provided on create.

func (*NoteUpsertOne) UpdateURI

func (u *NoteUpsertOne) UpdateURI() *NoteUpsertOne

UpdateURI sets the "uri" field to the value that was provided on create.

func (*NoteUpsertOne) UpdateUpdatedAt

func (u *NoteUpsertOne) UpdateUpdatedAt() *NoteUpsertOne

UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.

func (*NoteUpsertOne) UpdateVisibility

func (u *NoteUpsertOne) UpdateVisibility() *NoteUpsertOne

UpdateVisibility sets the "visibility" field to the value that was provided on create.

type Notes

type Notes []*Note

Notes is a parsable slice of Note.

type Op

type Op = ent.Op

ent aliases to avoid import conflicts in user's code.

type Option

type Option func(*config)

Option function to configure the client.

func Debug

func Debug() Option

Debug enables debug logging on the ent.Driver.

func Driver

func Driver(driver dialect.Driver) Option

Driver configures the client driver.

func Log

func Log(fn func(...any)) Option

Log sets the logging function for debug mode.

type OrderFunc

type OrderFunc func(*sql.Selector)

OrderFunc applies an ordering on the sql selector. Deprecated: Use Asc/Desc functions or the package builders instead.

type Policy

type Policy = ent.Policy

ent aliases to avoid import conflicts in user's code.

type Querier

type Querier = ent.Querier

ent aliases to avoid import conflicts in user's code.

type QuerierFunc

type QuerierFunc = ent.QuerierFunc

ent aliases to avoid import conflicts in user's code.

type Query

type Query = ent.Query

ent aliases to avoid import conflicts in user's code.

type QueryContext

type QueryContext = ent.QueryContext

ent aliases to avoid import conflicts in user's code.

type RollbackFunc

type RollbackFunc func(context.Context, *Tx) error

The RollbackFunc type is an adapter to allow the use of ordinary function as a Rollbacker. If f is a function with the appropriate signature, RollbackFunc(f) is a Rollbacker that calls f.

func (RollbackFunc) Rollback

func (f RollbackFunc) Rollback(ctx context.Context, tx *Tx) error

Rollback calls f(ctx, m).

type RollbackHook

type RollbackHook func(Rollbacker) Rollbacker

RollbackHook defines the "rollback middleware". A function that gets a Rollbacker and returns a Rollbacker. For example:

hook := func(next ent.Rollbacker) ent.Rollbacker {
	return ent.RollbackFunc(func(ctx context.Context, tx *ent.Tx) error {
		// Do some stuff before.
		if err := next.Rollback(ctx, tx); err != nil {
			return err
		}
		// Do some stuff after.
		return nil
	})
}

type Rollbacker

type Rollbacker interface {
	Rollback(context.Context, *Tx) error
}

Rollbacker is the interface that wraps the Rollback method.

type TraverseFunc

type TraverseFunc = ent.TraverseFunc

ent aliases to avoid import conflicts in user's code.

type Traverser

type Traverser = ent.Traverser

ent aliases to avoid import conflicts in user's code.

type Tx

type Tx struct {

	// Attachment is the client for interacting with the Attachment builders.
	Attachment *AttachmentClient
	// Follow is the client for interacting with the Follow builders.
	Follow *FollowClient
	// Image is the client for interacting with the Image builders.
	Image *ImageClient
	// InstanceMetadata is the client for interacting with the InstanceMetadata builders.
	InstanceMetadata *InstanceMetadataClient
	// Note is the client for interacting with the Note builders.
	Note *NoteClient
	// User is the client for interacting with the User builders.
	User *UserClient
	// contains filtered or unexported fields
}

Tx is a transactional client that is created by calling Client.Tx().

func TxFromContext

func TxFromContext(ctx context.Context) *Tx

TxFromContext returns a Tx stored inside a context, or nil if there isn't one.

func (*Tx) Client

func (tx *Tx) Client() *Client

Client returns a Client that binds to current transaction.

func (*Tx) Commit

func (tx *Tx) Commit() error

Commit commits the transaction.

func (*Tx) OnCommit

func (tx *Tx) OnCommit(f CommitHook)

OnCommit adds a hook to call on commit.

func (*Tx) OnRollback

func (tx *Tx) OnRollback(f RollbackHook)

OnRollback adds a hook to call on rollback.

func (*Tx) Rollback

func (tx *Tx) Rollback() error

Rollback rollbacks the transaction.

type User

type User struct {

	// ID of the ent.
	ID uuid.UUID `json:"id,omitempty"`
	// IsRemote holds the value of the "isRemote" field.
	IsRemote bool `json:"isRemote,omitempty"`
	// URI holds the value of the "uri" field.
	URI string `json:"uri,omitempty"`
	// Extensions holds the value of the "extensions" field.
	Extensions versia.Extensions `json:"extensions,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"`
	// Username holds the value of the "username" field.
	Username string `json:"username,omitempty"`
	// PasswordHash holds the value of the "passwordHash" field.
	PasswordHash *[]byte `json:"passwordHash,omitempty"`
	// DisplayName holds the value of the "displayName" field.
	DisplayName *string `json:"displayName,omitempty"`
	// Biography holds the value of the "biography" field.
	Biography *string `json:"biography,omitempty"`
	// PublicKey holds the value of the "publicKey" field.
	PublicKey []byte `json:"publicKey,omitempty"`
	// PublicKeyActor holds the value of the "publicKeyActor" field.
	PublicKeyActor string `json:"publicKeyActor,omitempty"`
	// PublicKeyAlgorithm holds the value of the "publicKeyAlgorithm" field.
	PublicKeyAlgorithm string `json:"publicKeyAlgorithm,omitempty"`
	// PrivateKey holds the value of the "privateKey" field.
	PrivateKey []byte `json:"privateKey,omitempty"`
	// Indexable holds the value of the "indexable" field.
	Indexable bool `json:"indexable,omitempty"`
	// PrivacyLevel holds the value of the "privacyLevel" field.
	PrivacyLevel user.PrivacyLevel `json:"privacyLevel,omitempty"`
	// Fields holds the value of the "fields" field.
	Fields []versia.UserField `json:"fields,omitempty"`
	// Inbox holds the value of the "inbox" field.
	Inbox string `json:"inbox,omitempty"`
	// Featured holds the value of the "featured" field.
	Featured string `json:"featured,omitempty"`
	// Followers holds the value of the "followers" field.
	Followers string `json:"followers,omitempty"`
	// Following holds the value of the "following" field.
	Following string `json:"following,omitempty"`
	// Outbox holds the value of the "outbox" field.
	Outbox string `json:"outbox,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) QueryAdministeredServers

func (u *User) QueryAdministeredServers() *InstanceMetadataQuery

QueryAdministeredServers queries the "administeredServers" edge of the User entity.

func (*User) QueryAuthoredNotes

func (u *User) QueryAuthoredNotes() *NoteQuery

QueryAuthoredNotes queries the "authoredNotes" edge of the User entity.

func (*User) QueryAvatarImage

func (u *User) QueryAvatarImage() *ImageQuery

QueryAvatarImage queries the "avatarImage" edge of the User entity.

func (*User) QueryHeaderImage

func (u *User) QueryHeaderImage() *ImageQuery

QueryHeaderImage queries the "headerImage" edge of the User entity.

func (*User) QueryMentionedNotes

func (u *User) QueryMentionedNotes() *NoteQuery

QueryMentionedNotes queries the "mentionedNotes" edge of the User entity.

func (*User) QueryModeratedServers

func (u *User) QueryModeratedServers() *InstanceMetadataQuery

QueryModeratedServers queries the "moderatedServers" edge of the User entity.

func (*User) QueryServers

func (u *User) QueryServers() *InstanceMetadataQuery

QueryServers queries the "servers" 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.

func (*User) Value

func (u *User) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the User. This includes values selected through modifiers, order, etc.

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 uuid.UUID) *UserDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*UserClient) Get

func (c *UserClient) Get(ctx context.Context, id uuid.UUID) (*User, error)

Get returns a User entity by its id.

func (*UserClient) GetX

func (c *UserClient) GetX(ctx context.Context, id uuid.UUID) *User

GetX is like Get, but panics if an error occurs.

func (*UserClient) Hooks

func (c *UserClient) Hooks() []Hook

Hooks returns the client hooks.

func (*UserClient) 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) MapCreateBulk

func (c *UserClient) MapCreateBulk(slice any, setFunc func(*UserCreate, int)) *UserCreateBulk

MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.

func (*UserClient) Query

func (c *UserClient) Query() *UserQuery

Query returns a query builder for User.

func (*UserClient) QueryAdministeredServers

func (c *UserClient) QueryAdministeredServers(u *User) *InstanceMetadataQuery

QueryAdministeredServers queries the administeredServers edge of a User.

func (*UserClient) QueryAuthoredNotes

func (c *UserClient) QueryAuthoredNotes(u *User) *NoteQuery

QueryAuthoredNotes queries the authoredNotes edge of a User.

func (*UserClient) QueryAvatarImage

func (c *UserClient) QueryAvatarImage(u *User) *ImageQuery

QueryAvatarImage queries the avatarImage edge of a User.

func (*UserClient) QueryHeaderImage

func (c *UserClient) QueryHeaderImage(u *User) *ImageQuery

QueryHeaderImage queries the headerImage edge of a User.

func (*UserClient) QueryMentionedNotes

func (c *UserClient) QueryMentionedNotes(u *User) *NoteQuery

QueryMentionedNotes queries the mentionedNotes edge of a User.

func (*UserClient) QueryModeratedServers

func (c *UserClient) QueryModeratedServers(u *User) *InstanceMetadataQuery

QueryModeratedServers queries the moderatedServers edge of a User.

func (*UserClient) QueryServers

func (c *UserClient) QueryServers(u *User) *InstanceMetadataQuery

QueryServers queries the servers edge of a User.

func (*UserClient) Update

func (c *UserClient) Update() *UserUpdate

Update returns an update builder for User.

func (*UserClient) UpdateOne

func (c *UserClient) UpdateOne(u *User) *UserUpdateOne

UpdateOne returns an update builder for the given entity.

func (*UserClient) UpdateOneID

func (c *UserClient) UpdateOneID(id uuid.UUID) *UserUpdateOne

UpdateOneID returns an update builder for the given id.

func (*UserClient) Use

func (c *UserClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `user.Hooks(f(g(h())))`.

type UserCreate

type UserCreate struct {
	// contains filtered or unexported fields
}

UserCreate is the builder for creating a User entity.

func (*UserCreate) AddAdministeredServerIDs

func (uc *UserCreate) AddAdministeredServerIDs(ids ...uuid.UUID) *UserCreate

AddAdministeredServerIDs adds the "administeredServers" edge to the InstanceMetadata entity by IDs.

func (*UserCreate) AddAdministeredServers

func (uc *UserCreate) AddAdministeredServers(i ...*InstanceMetadata) *UserCreate

AddAdministeredServers adds the "administeredServers" edges to the InstanceMetadata entity.

func (*UserCreate) AddAuthoredNoteIDs

func (uc *UserCreate) AddAuthoredNoteIDs(ids ...uuid.UUID) *UserCreate

AddAuthoredNoteIDs adds the "authoredNotes" edge to the Note entity by IDs.

func (*UserCreate) AddAuthoredNotes

func (uc *UserCreate) AddAuthoredNotes(n ...*Note) *UserCreate

AddAuthoredNotes adds the "authoredNotes" edges to the Note entity.

func (*UserCreate) AddMentionedNoteIDs

func (uc *UserCreate) AddMentionedNoteIDs(ids ...uuid.UUID) *UserCreate

AddMentionedNoteIDs adds the "mentionedNotes" edge to the Note entity by IDs.

func (*UserCreate) AddMentionedNotes

func (uc *UserCreate) AddMentionedNotes(n ...*Note) *UserCreate

AddMentionedNotes adds the "mentionedNotes" edges to the Note entity.

func (*UserCreate) AddModeratedServerIDs

func (uc *UserCreate) AddModeratedServerIDs(ids ...uuid.UUID) *UserCreate

AddModeratedServerIDs adds the "moderatedServers" edge to the InstanceMetadata entity by IDs.

func (*UserCreate) AddModeratedServers

func (uc *UserCreate) AddModeratedServers(i ...*InstanceMetadata) *UserCreate

AddModeratedServers adds the "moderatedServers" edges to the InstanceMetadata entity.

func (*UserCreate) AddServerIDs

func (uc *UserCreate) AddServerIDs(ids ...uuid.UUID) *UserCreate

AddServerIDs adds the "servers" edge to the InstanceMetadata entity by IDs.

func (*UserCreate) AddServers

func (uc *UserCreate) AddServers(i ...*InstanceMetadata) *UserCreate

AddServers adds the "servers" edges to the InstanceMetadata entity.

func (*UserCreate) Exec

func (uc *UserCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*UserCreate) ExecX

func (uc *UserCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserCreate) Mutation

func (uc *UserCreate) Mutation() *UserMutation

Mutation returns the UserMutation object of the builder.

func (*UserCreate) OnConflict

func (uc *UserCreate) OnConflict(opts ...sql.ConflictOption) *UserUpsertOne

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.User.Create().
	SetIsRemote(v).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.UserUpsert) {
		SetIsRemote(v+v).
	}).
	Exec(ctx)

func (*UserCreate) OnConflictColumns

func (uc *UserCreate) OnConflictColumns(columns ...string) *UserUpsertOne

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.User.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*UserCreate) Save

func (uc *UserCreate) Save(ctx context.Context) (*User, error)

Save creates the User in the database.

func (*UserCreate) SaveX

func (uc *UserCreate) SaveX(ctx context.Context) *User

SaveX calls Save and panics if Save returns an error.

func (*UserCreate) SetAvatarImage

func (uc *UserCreate) SetAvatarImage(i *Image) *UserCreate

SetAvatarImage sets the "avatarImage" edge to the Image entity.

func (*UserCreate) SetAvatarImageID

func (uc *UserCreate) SetAvatarImageID(id int) *UserCreate

SetAvatarImageID sets the "avatarImage" edge to the Image entity by ID.

func (*UserCreate) SetBiography

func (uc *UserCreate) SetBiography(s string) *UserCreate

SetBiography sets the "biography" field.

func (*UserCreate) SetCreatedAt

func (uc *UserCreate) SetCreatedAt(t time.Time) *UserCreate

SetCreatedAt sets the "created_at" field.

func (*UserCreate) SetDisplayName

func (uc *UserCreate) SetDisplayName(s string) *UserCreate

SetDisplayName sets the "displayName" field.

func (*UserCreate) SetExtensions

func (uc *UserCreate) SetExtensions(v versia.Extensions) *UserCreate

SetExtensions sets the "extensions" field.

func (*UserCreate) SetFeatured

func (uc *UserCreate) SetFeatured(s string) *UserCreate

SetFeatured sets the "featured" field.

func (*UserCreate) SetFields

func (uc *UserCreate) SetFields(vf []versia.UserField) *UserCreate

SetFields sets the "fields" field.

func (*UserCreate) SetFollowers

func (uc *UserCreate) SetFollowers(s string) *UserCreate

SetFollowers sets the "followers" field.

func (*UserCreate) SetFollowing

func (uc *UserCreate) SetFollowing(s string) *UserCreate

SetFollowing sets the "following" field.

func (*UserCreate) SetHeaderImage

func (uc *UserCreate) SetHeaderImage(i *Image) *UserCreate

SetHeaderImage sets the "headerImage" edge to the Image entity.

func (*UserCreate) SetHeaderImageID

func (uc *UserCreate) SetHeaderImageID(id int) *UserCreate

SetHeaderImageID sets the "headerImage" edge to the Image entity by ID.

func (*UserCreate) SetID

func (uc *UserCreate) SetID(u uuid.UUID) *UserCreate

SetID sets the "id" field.

func (*UserCreate) SetInbox

func (uc *UserCreate) SetInbox(s string) *UserCreate

SetInbox sets the "inbox" field.

func (*UserCreate) SetIndexable

func (uc *UserCreate) SetIndexable(b bool) *UserCreate

SetIndexable sets the "indexable" field.

func (*UserCreate) SetIsRemote

func (uc *UserCreate) SetIsRemote(b bool) *UserCreate

SetIsRemote sets the "isRemote" field.

func (*UserCreate) SetNillableAvatarImageID

func (uc *UserCreate) SetNillableAvatarImageID(id *int) *UserCreate

SetNillableAvatarImageID sets the "avatarImage" edge to the Image entity by ID if the given value is not nil.

func (*UserCreate) SetNillableBiography

func (uc *UserCreate) SetNillableBiography(s *string) *UserCreate

SetNillableBiography sets the "biography" field if the given value is not nil.

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) SetNillableDisplayName

func (uc *UserCreate) SetNillableDisplayName(s *string) *UserCreate

SetNillableDisplayName sets the "displayName" field if the given value is not nil.

func (*UserCreate) SetNillableHeaderImageID

func (uc *UserCreate) SetNillableHeaderImageID(id *int) *UserCreate

SetNillableHeaderImageID sets the "headerImage" edge to the Image entity by ID if the given value is not nil.

func (*UserCreate) SetNillableID

func (uc *UserCreate) SetNillableID(u *uuid.UUID) *UserCreate

SetNillableID sets the "id" field if the given value is not nil.

func (*UserCreate) SetNillableIndexable

func (uc *UserCreate) SetNillableIndexable(b *bool) *UserCreate

SetNillableIndexable sets the "indexable" field if the given value is not nil.

func (*UserCreate) SetNillablePrivacyLevel

func (uc *UserCreate) SetNillablePrivacyLevel(ul *user.PrivacyLevel) *UserCreate

SetNillablePrivacyLevel sets the "privacyLevel" 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) SetOutbox

func (uc *UserCreate) SetOutbox(s string) *UserCreate

SetOutbox sets the "outbox" field.

func (*UserCreate) SetPasswordHash

func (uc *UserCreate) SetPasswordHash(b []byte) *UserCreate

SetPasswordHash sets the "passwordHash" field.

func (*UserCreate) SetPrivacyLevel

func (uc *UserCreate) SetPrivacyLevel(ul user.PrivacyLevel) *UserCreate

SetPrivacyLevel sets the "privacyLevel" field.

func (*UserCreate) SetPrivateKey

func (uc *UserCreate) SetPrivateKey(b []byte) *UserCreate

SetPrivateKey sets the "privateKey" field.

func (*UserCreate) SetPublicKey

func (uc *UserCreate) SetPublicKey(b []byte) *UserCreate

SetPublicKey sets the "publicKey" field.

func (*UserCreate) SetPublicKeyActor

func (uc *UserCreate) SetPublicKeyActor(s string) *UserCreate

SetPublicKeyActor sets the "publicKeyActor" field.

func (*UserCreate) SetPublicKeyAlgorithm

func (uc *UserCreate) SetPublicKeyAlgorithm(s string) *UserCreate

SetPublicKeyAlgorithm sets the "publicKeyAlgorithm" field.

func (*UserCreate) SetURI

func (uc *UserCreate) SetURI(s string) *UserCreate

SetURI sets the "uri" 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) OnConflict

func (ucb *UserCreateBulk) OnConflict(opts ...sql.ConflictOption) *UserUpsertBulk

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.User.CreateBulk(builders...).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.UserUpsert) {
		SetIsRemote(v+v).
	}).
	Exec(ctx)

func (*UserCreateBulk) OnConflictColumns

func (ucb *UserCreateBulk) OnConflictColumns(columns ...string) *UserUpsertBulk

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.User.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*UserCreateBulk) Save

func (ucb *UserCreateBulk) Save(ctx context.Context) ([]*User, error)

Save creates the User entities in the database.

func (*UserCreateBulk) SaveX

func (ucb *UserCreateBulk) SaveX(ctx context.Context) []*User

SaveX is like Save, but panics if an error occurs.

type UserDelete

type UserDelete struct {
	// contains filtered or unexported fields
}

UserDelete is the builder for deleting a User entity.

func (*UserDelete) Exec

func (ud *UserDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*UserDelete) ExecX

func (ud *UserDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*UserDelete) Where

func (ud *UserDelete) Where(ps ...predicate.User) *UserDelete

Where appends a list predicates to the UserDelete builder.

type UserDeleteOne

type UserDeleteOne struct {
	// contains filtered or unexported fields
}

UserDeleteOne is the builder for deleting a single User entity.

func (*UserDeleteOne) Exec

func (udo *UserDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*UserDeleteOne) ExecX

func (udo *UserDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

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 {
	// AvatarImage holds the value of the avatarImage edge.
	AvatarImage *Image `json:"avatarImage,omitempty"`
	// HeaderImage holds the value of the headerImage edge.
	HeaderImage *Image `json:"headerImage,omitempty"`
	// AuthoredNotes holds the value of the authoredNotes edge.
	AuthoredNotes []*Note `json:"authoredNotes,omitempty"`
	// MentionedNotes holds the value of the mentionedNotes edge.
	MentionedNotes []*Note `json:"mentionedNotes,omitempty"`
	// Servers holds the value of the servers edge.
	Servers []*InstanceMetadata `json:"servers,omitempty"`
	// ModeratedServers holds the value of the moderatedServers edge.
	ModeratedServers []*InstanceMetadata `json:"moderatedServers,omitempty"`
	// AdministeredServers holds the value of the administeredServers edge.
	AdministeredServers []*InstanceMetadata `json:"administeredServers,omitempty"`
	// contains filtered or unexported fields
}

UserEdges holds the relations/edges for other nodes in the graph.

func (UserEdges) AdministeredServersOrErr

func (e UserEdges) AdministeredServersOrErr() ([]*InstanceMetadata, error)

AdministeredServersOrErr returns the AdministeredServers value or an error if the edge was not loaded in eager-loading.

func (UserEdges) AuthoredNotesOrErr

func (e UserEdges) AuthoredNotesOrErr() ([]*Note, error)

AuthoredNotesOrErr returns the AuthoredNotes value or an error if the edge was not loaded in eager-loading.

func (UserEdges) AvatarImageOrErr

func (e UserEdges) AvatarImageOrErr() (*Image, error)

AvatarImageOrErr returns the AvatarImage value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

func (UserEdges) HeaderImageOrErr

func (e UserEdges) HeaderImageOrErr() (*Image, error)

HeaderImageOrErr returns the HeaderImage value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

func (UserEdges) MentionedNotesOrErr

func (e UserEdges) MentionedNotesOrErr() ([]*Note, error)

MentionedNotesOrErr returns the MentionedNotes value or an error if the edge was not loaded in eager-loading.

func (UserEdges) ModeratedServersOrErr

func (e UserEdges) ModeratedServersOrErr() ([]*InstanceMetadata, error)

ModeratedServersOrErr returns the ModeratedServers value or an error if the edge was not loaded in eager-loading.

func (UserEdges) ServersOrErr

func (e UserEdges) ServersOrErr() ([]*InstanceMetadata, error)

ServersOrErr returns the Servers 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 UserMutation

type UserMutation struct {
	// contains filtered or unexported fields
}

UserMutation represents an operation that mutates the User nodes in the graph.

func (*UserMutation) AddAdministeredServerIDs

func (m *UserMutation) AddAdministeredServerIDs(ids ...uuid.UUID)

AddAdministeredServerIDs adds the "administeredServers" edge to the InstanceMetadata entity by ids.

func (*UserMutation) AddAuthoredNoteIDs

func (m *UserMutation) AddAuthoredNoteIDs(ids ...uuid.UUID)

AddAuthoredNoteIDs adds the "authoredNotes" edge to the Note 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) AddMentionedNoteIDs

func (m *UserMutation) AddMentionedNoteIDs(ids ...uuid.UUID)

AddMentionedNoteIDs adds the "mentionedNotes" edge to the Note entity by ids.

func (*UserMutation) AddModeratedServerIDs

func (m *UserMutation) AddModeratedServerIDs(ids ...uuid.UUID)

AddModeratedServerIDs adds the "moderatedServers" edge to the InstanceMetadata entity by ids.

func (*UserMutation) AddServerIDs

func (m *UserMutation) AddServerIDs(ids ...uuid.UUID)

AddServerIDs adds the "servers" edge to the InstanceMetadata entity by ids.

func (*UserMutation) AddedEdges

func (m *UserMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*UserMutation) AddedField

func (m *UserMutation) AddedField(name string) (ent.Value, bool)

AddedField returns the numeric value that was incremented/decremented on a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*UserMutation) AddedFields

func (m *UserMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*UserMutation) 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) AdministeredServersCleared

func (m *UserMutation) AdministeredServersCleared() bool

AdministeredServersCleared reports if the "administeredServers" edge to the InstanceMetadata entity was cleared.

func (*UserMutation) AdministeredServersIDs

func (m *UserMutation) AdministeredServersIDs() (ids []uuid.UUID)

AdministeredServersIDs returns the "administeredServers" edge IDs in the mutation.

func (*UserMutation) AppendFields

func (m *UserMutation) AppendFields(vf []versia.UserField)

AppendFields adds vf to the "fields" field.

func (*UserMutation) AppendedFields

func (m *UserMutation) AppendedFields() ([]versia.UserField, bool)

AppendedFields returns the list of values that were appended to the "fields" field in this mutation.

func (*UserMutation) AuthoredNotesCleared

func (m *UserMutation) AuthoredNotesCleared() bool

AuthoredNotesCleared reports if the "authoredNotes" edge to the Note entity was cleared.

func (*UserMutation) AuthoredNotesIDs

func (m *UserMutation) AuthoredNotesIDs() (ids []uuid.UUID)

AuthoredNotesIDs returns the "authoredNotes" edge IDs in the mutation.

func (*UserMutation) AvatarImageCleared

func (m *UserMutation) AvatarImageCleared() bool

AvatarImageCleared reports if the "avatarImage" edge to the Image entity was cleared.

func (*UserMutation) AvatarImageID

func (m *UserMutation) AvatarImageID() (id int, exists bool)

AvatarImageID returns the "avatarImage" edge ID in the mutation.

func (*UserMutation) AvatarImageIDs

func (m *UserMutation) AvatarImageIDs() (ids []int)

AvatarImageIDs returns the "avatarImage" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use AvatarImageID instead. It exists only for internal usage by the builders.

func (*UserMutation) Biography

func (m *UserMutation) Biography() (r string, exists bool)

Biography returns the value of the "biography" field in the mutation.

func (*UserMutation) BiographyCleared

func (m *UserMutation) BiographyCleared() bool

BiographyCleared returns if the "biography" field was cleared in this mutation.

func (*UserMutation) ClearAdministeredServers

func (m *UserMutation) ClearAdministeredServers()

ClearAdministeredServers clears the "administeredServers" edge to the InstanceMetadata entity.

func (*UserMutation) ClearAuthoredNotes

func (m *UserMutation) ClearAuthoredNotes()

ClearAuthoredNotes clears the "authoredNotes" edge to the Note entity.

func (*UserMutation) ClearAvatarImage

func (m *UserMutation) ClearAvatarImage()

ClearAvatarImage clears the "avatarImage" edge to the Image entity.

func (*UserMutation) ClearBiography

func (m *UserMutation) ClearBiography()

ClearBiography clears the value of the "biography" field.

func (*UserMutation) ClearDisplayName

func (m *UserMutation) ClearDisplayName()

ClearDisplayName clears the value of the "displayName" field.

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) ClearHeaderImage

func (m *UserMutation) ClearHeaderImage()

ClearHeaderImage clears the "headerImage" edge to the Image entity.

func (*UserMutation) ClearMentionedNotes

func (m *UserMutation) ClearMentionedNotes()

ClearMentionedNotes clears the "mentionedNotes" edge to the Note entity.

func (*UserMutation) ClearModeratedServers

func (m *UserMutation) ClearModeratedServers()

ClearModeratedServers clears the "moderatedServers" edge to the InstanceMetadata entity.

func (*UserMutation) ClearPasswordHash

func (m *UserMutation) ClearPasswordHash()

ClearPasswordHash clears the value of the "passwordHash" field.

func (*UserMutation) ClearPrivateKey

func (m *UserMutation) ClearPrivateKey()

ClearPrivateKey clears the value of the "privateKey" field.

func (*UserMutation) ClearServers

func (m *UserMutation) ClearServers()

ClearServers clears the "servers" edge to the InstanceMetadata entity.

func (*UserMutation) ClearedEdges

func (m *UserMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*UserMutation) ClearedFields

func (m *UserMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (UserMutation) Client

func (m UserMutation) Client() *Client

Client returns a new `ent.Client` from the mutation. If the mutation was executed in a transaction (ent.Tx), a transactional client is returned.

func (*UserMutation) CreatedAt

func (m *UserMutation) CreatedAt() (r time.Time, exists bool)

CreatedAt returns the value of the "created_at" field in the mutation.

func (*UserMutation) DisplayName

func (m *UserMutation) DisplayName() (r string, exists bool)

DisplayName returns the value of the "displayName" field in the mutation.

func (*UserMutation) DisplayNameCleared

func (m *UserMutation) DisplayNameCleared() bool

DisplayNameCleared returns if the "displayName" field was cleared in this 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) Extensions

func (m *UserMutation) Extensions() (r versia.Extensions, exists bool)

Extensions returns the value of the "extensions" field in the mutation.

func (*UserMutation) Featured

func (m *UserMutation) Featured() (r string, exists bool)

Featured returns the value of the "featured" 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) Followers

func (m *UserMutation) Followers() (r string, exists bool)

Followers returns the value of the "followers" field in the mutation.

func (*UserMutation) Following

func (m *UserMutation) Following() (r string, exists bool)

Following returns the value of the "following" field in the mutation.

func (*UserMutation) GetFields

func (m *UserMutation) GetFields() (r []versia.UserField, exists bool)

GetFields returns the value of the "fields" field in the mutation.

func (*UserMutation) HeaderImageCleared

func (m *UserMutation) HeaderImageCleared() bool

HeaderImageCleared reports if the "headerImage" edge to the Image entity was cleared.

func (*UserMutation) HeaderImageID

func (m *UserMutation) HeaderImageID() (id int, exists bool)

HeaderImageID returns the "headerImage" edge ID in the mutation.

func (*UserMutation) HeaderImageIDs

func (m *UserMutation) HeaderImageIDs() (ids []int)

HeaderImageIDs returns the "headerImage" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use HeaderImageID instead. It exists only for internal usage by the builders.

func (*UserMutation) ID

func (m *UserMutation) ID() (id uuid.UUID, exists bool)

ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.

func (*UserMutation) IDs

func (m *UserMutation) IDs(ctx context.Context) ([]uuid.UUID, error)

IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.

func (*UserMutation) Inbox

func (m *UserMutation) Inbox() (r string, exists bool)

Inbox returns the value of the "inbox" field in the mutation.

func (*UserMutation) Indexable

func (m *UserMutation) Indexable() (r bool, exists bool)

Indexable returns the value of the "indexable" field in the mutation.

func (*UserMutation) IsRemote

func (m *UserMutation) IsRemote() (r bool, exists bool)

IsRemote returns the value of the "isRemote" field in the mutation.

func (*UserMutation) MentionedNotesCleared

func (m *UserMutation) MentionedNotesCleared() bool

MentionedNotesCleared reports if the "mentionedNotes" edge to the Note entity was cleared.

func (*UserMutation) MentionedNotesIDs

func (m *UserMutation) MentionedNotesIDs() (ids []uuid.UUID)

MentionedNotesIDs returns the "mentionedNotes" edge IDs in the mutation.

func (*UserMutation) ModeratedServersCleared

func (m *UserMutation) ModeratedServersCleared() bool

ModeratedServersCleared reports if the "moderatedServers" edge to the InstanceMetadata entity was cleared.

func (*UserMutation) ModeratedServersIDs

func (m *UserMutation) ModeratedServersIDs() (ids []uuid.UUID)

ModeratedServersIDs returns the "moderatedServers" edge IDs in the mutation.

func (*UserMutation) OldBiography

func (m *UserMutation) OldBiography(ctx context.Context) (v *string, err error)

OldBiography returns the old "biography" 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) 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) OldDisplayName

func (m *UserMutation) OldDisplayName(ctx context.Context) (v *string, err error)

OldDisplayName returns the old "displayName" 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) OldExtensions

func (m *UserMutation) OldExtensions(ctx context.Context) (v versia.Extensions, err error)

OldExtensions returns the old "extensions" 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) OldFeatured

func (m *UserMutation) OldFeatured(ctx context.Context) (v string, err error)

OldFeatured returns the old "featured" 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) OldFields

func (m *UserMutation) OldFields(ctx context.Context) (v []versia.UserField, err error)

OldFields returns the old "fields" 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) OldFollowers

func (m *UserMutation) OldFollowers(ctx context.Context) (v string, err error)

OldFollowers returns the old "followers" 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) OldFollowing

func (m *UserMutation) OldFollowing(ctx context.Context) (v string, err error)

OldFollowing returns the old "following" 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) OldInbox

func (m *UserMutation) OldInbox(ctx context.Context) (v string, err error)

OldInbox returns the old "inbox" 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) OldIndexable

func (m *UserMutation) OldIndexable(ctx context.Context) (v bool, err error)

OldIndexable returns the old "indexable" 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) OldIsRemote

func (m *UserMutation) OldIsRemote(ctx context.Context) (v bool, err error)

OldIsRemote returns the old "isRemote" 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) OldOutbox

func (m *UserMutation) OldOutbox(ctx context.Context) (v string, err error)

OldOutbox returns the old "outbox" 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) OldPasswordHash

func (m *UserMutation) OldPasswordHash(ctx context.Context) (v *[]byte, err error)

OldPasswordHash returns the old "passwordHash" 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) OldPrivacyLevel

func (m *UserMutation) OldPrivacyLevel(ctx context.Context) (v user.PrivacyLevel, err error)

OldPrivacyLevel returns the old "privacyLevel" 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) OldPrivateKey

func (m *UserMutation) OldPrivateKey(ctx context.Context) (v []byte, err error)

OldPrivateKey returns the old "privateKey" 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) OldPublicKey

func (m *UserMutation) OldPublicKey(ctx context.Context) (v []byte, err error)

OldPublicKey returns the old "publicKey" 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) OldPublicKeyActor

func (m *UserMutation) OldPublicKeyActor(ctx context.Context) (v string, err error)

OldPublicKeyActor returns the old "publicKeyActor" 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) OldPublicKeyAlgorithm

func (m *UserMutation) OldPublicKeyAlgorithm(ctx context.Context) (v string, err error)

OldPublicKeyAlgorithm returns the old "publicKeyAlgorithm" 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) OldURI

func (m *UserMutation) OldURI(ctx context.Context) (v string, err error)

OldURI returns the old "uri" 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) Outbox

func (m *UserMutation) Outbox() (r string, exists bool)

Outbox returns the value of the "outbox" field in the mutation.

func (*UserMutation) PasswordHash

func (m *UserMutation) PasswordHash() (r []byte, exists bool)

PasswordHash returns the value of the "passwordHash" field in the mutation.

func (*UserMutation) PasswordHashCleared

func (m *UserMutation) PasswordHashCleared() bool

PasswordHashCleared returns if the "passwordHash" field was cleared in this mutation.

func (*UserMutation) PrivacyLevel

func (m *UserMutation) PrivacyLevel() (r user.PrivacyLevel, exists bool)

PrivacyLevel returns the value of the "privacyLevel" field in the mutation.

func (*UserMutation) PrivateKey

func (m *UserMutation) PrivateKey() (r []byte, exists bool)

PrivateKey returns the value of the "privateKey" field in the mutation.

func (*UserMutation) PrivateKeyCleared

func (m *UserMutation) PrivateKeyCleared() bool

PrivateKeyCleared returns if the "privateKey" field was cleared in this mutation.

func (*UserMutation) PublicKey

func (m *UserMutation) PublicKey() (r []byte, exists bool)

PublicKey returns the value of the "publicKey" field in the mutation.

func (*UserMutation) PublicKeyActor

func (m *UserMutation) PublicKeyActor() (r string, exists bool)

PublicKeyActor returns the value of the "publicKeyActor" field in the mutation.

func (*UserMutation) PublicKeyAlgorithm

func (m *UserMutation) PublicKeyAlgorithm() (r string, exists bool)

PublicKeyAlgorithm returns the value of the "publicKeyAlgorithm" field in the mutation.

func (*UserMutation) RemoveAdministeredServerIDs

func (m *UserMutation) RemoveAdministeredServerIDs(ids ...uuid.UUID)

RemoveAdministeredServerIDs removes the "administeredServers" edge to the InstanceMetadata entity by IDs.

func (*UserMutation) RemoveAuthoredNoteIDs

func (m *UserMutation) RemoveAuthoredNoteIDs(ids ...uuid.UUID)

RemoveAuthoredNoteIDs removes the "authoredNotes" edge to the Note entity by IDs.

func (*UserMutation) RemoveMentionedNoteIDs

func (m *UserMutation) RemoveMentionedNoteIDs(ids ...uuid.UUID)

RemoveMentionedNoteIDs removes the "mentionedNotes" edge to the Note entity by IDs.

func (*UserMutation) RemoveModeratedServerIDs

func (m *UserMutation) RemoveModeratedServerIDs(ids ...uuid.UUID)

RemoveModeratedServerIDs removes the "moderatedServers" edge to the InstanceMetadata entity by IDs.

func (*UserMutation) RemoveServerIDs

func (m *UserMutation) RemoveServerIDs(ids ...uuid.UUID)

RemoveServerIDs removes the "servers" edge to the InstanceMetadata entity by IDs.

func (*UserMutation) RemovedAdministeredServersIDs

func (m *UserMutation) RemovedAdministeredServersIDs() (ids []uuid.UUID)

RemovedAdministeredServers returns the removed IDs of the "administeredServers" edge to the InstanceMetadata entity.

func (*UserMutation) RemovedAuthoredNotesIDs

func (m *UserMutation) RemovedAuthoredNotesIDs() (ids []uuid.UUID)

RemovedAuthoredNotes returns the removed IDs of the "authoredNotes" edge to the Note 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) RemovedMentionedNotesIDs

func (m *UserMutation) RemovedMentionedNotesIDs() (ids []uuid.UUID)

RemovedMentionedNotes returns the removed IDs of the "mentionedNotes" edge to the Note entity.

func (*UserMutation) RemovedModeratedServersIDs

func (m *UserMutation) RemovedModeratedServersIDs() (ids []uuid.UUID)

RemovedModeratedServers returns the removed IDs of the "moderatedServers" edge to the InstanceMetadata entity.

func (*UserMutation) RemovedServersIDs

func (m *UserMutation) RemovedServersIDs() (ids []uuid.UUID)

RemovedServers returns the removed IDs of the "servers" edge to the InstanceMetadata entity.

func (*UserMutation) ResetAdministeredServers

func (m *UserMutation) ResetAdministeredServers()

ResetAdministeredServers resets all changes to the "administeredServers" edge.

func (*UserMutation) ResetAuthoredNotes

func (m *UserMutation) ResetAuthoredNotes()

ResetAuthoredNotes resets all changes to the "authoredNotes" edge.

func (*UserMutation) ResetAvatarImage

func (m *UserMutation) ResetAvatarImage()

ResetAvatarImage resets all changes to the "avatarImage" edge.

func (*UserMutation) ResetBiography

func (m *UserMutation) ResetBiography()

ResetBiography resets all changes to the "biography" field.

func (*UserMutation) ResetCreatedAt

func (m *UserMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*UserMutation) ResetDisplayName

func (m *UserMutation) ResetDisplayName()

ResetDisplayName resets all changes to the "displayName" field.

func (*UserMutation) ResetEdge

func (m *UserMutation) ResetEdge(name string) error

ResetEdge resets all changes to the edge with the given name in this mutation. It returns an error if the edge is not defined in the schema.

func (*UserMutation) ResetExtensions

func (m *UserMutation) ResetExtensions()

ResetExtensions resets all changes to the "extensions" field.

func (*UserMutation) ResetFeatured

func (m *UserMutation) ResetFeatured()

ResetFeatured resets all changes to the "featured" 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) ResetFields

func (m *UserMutation) ResetFields()

ResetFields resets all changes to the "fields" field.

func (*UserMutation) ResetFollowers

func (m *UserMutation) ResetFollowers()

ResetFollowers resets all changes to the "followers" field.

func (*UserMutation) ResetFollowing

func (m *UserMutation) ResetFollowing()

ResetFollowing resets all changes to the "following" field.

func (*UserMutation) ResetHeaderImage

func (m *UserMutation) ResetHeaderImage()

ResetHeaderImage resets all changes to the "headerImage" edge.

func (*UserMutation) ResetInbox

func (m *UserMutation) ResetInbox()

ResetInbox resets all changes to the "inbox" field.

func (*UserMutation) ResetIndexable

func (m *UserMutation) ResetIndexable()

ResetIndexable resets all changes to the "indexable" field.

func (*UserMutation) ResetIsRemote

func (m *UserMutation) ResetIsRemote()

ResetIsRemote resets all changes to the "isRemote" field.

func (*UserMutation) ResetMentionedNotes

func (m *UserMutation) ResetMentionedNotes()

ResetMentionedNotes resets all changes to the "mentionedNotes" edge.

func (*UserMutation) ResetModeratedServers

func (m *UserMutation) ResetModeratedServers()

ResetModeratedServers resets all changes to the "moderatedServers" edge.

func (*UserMutation) ResetOutbox

func (m *UserMutation) ResetOutbox()

ResetOutbox resets all changes to the "outbox" field.

func (*UserMutation) ResetPasswordHash

func (m *UserMutation) ResetPasswordHash()

ResetPasswordHash resets all changes to the "passwordHash" field.

func (*UserMutation) ResetPrivacyLevel

func (m *UserMutation) ResetPrivacyLevel()

ResetPrivacyLevel resets all changes to the "privacyLevel" field.

func (*UserMutation) ResetPrivateKey

func (m *UserMutation) ResetPrivateKey()

ResetPrivateKey resets all changes to the "privateKey" field.

func (*UserMutation) ResetPublicKey

func (m *UserMutation) ResetPublicKey()

ResetPublicKey resets all changes to the "publicKey" field.

func (*UserMutation) ResetPublicKeyActor

func (m *UserMutation) ResetPublicKeyActor()

ResetPublicKeyActor resets all changes to the "publicKeyActor" field.

func (*UserMutation) ResetPublicKeyAlgorithm

func (m *UserMutation) ResetPublicKeyAlgorithm()

ResetPublicKeyAlgorithm resets all changes to the "publicKeyAlgorithm" field.

func (*UserMutation) ResetServers

func (m *UserMutation) ResetServers()

ResetServers resets all changes to the "servers" edge.

func (*UserMutation) ResetURI

func (m *UserMutation) ResetURI()

ResetURI resets all changes to the "uri" 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) ServersCleared

func (m *UserMutation) ServersCleared() bool

ServersCleared reports if the "servers" edge to the InstanceMetadata entity was cleared.

func (*UserMutation) ServersIDs

func (m *UserMutation) ServersIDs() (ids []uuid.UUID)

ServersIDs returns the "servers" edge IDs in the mutation.

func (*UserMutation) SetAvatarImageID

func (m *UserMutation) SetAvatarImageID(id int)

SetAvatarImageID sets the "avatarImage" edge to the Image entity by id.

func (*UserMutation) SetBiography

func (m *UserMutation) SetBiography(s string)

SetBiography sets the "biography" field.

func (*UserMutation) SetCreatedAt

func (m *UserMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" field.

func (*UserMutation) SetDisplayName

func (m *UserMutation) SetDisplayName(s string)

SetDisplayName sets the "displayName" field.

func (*UserMutation) SetExtensions

func (m *UserMutation) SetExtensions(v versia.Extensions)

SetExtensions sets the "extensions" field.

func (*UserMutation) SetFeatured

func (m *UserMutation) SetFeatured(s string)

SetFeatured sets the "featured" 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) SetFields

func (m *UserMutation) SetFields(vf []versia.UserField)

SetFields sets the "fields" field.

func (*UserMutation) SetFollowers

func (m *UserMutation) SetFollowers(s string)

SetFollowers sets the "followers" field.

func (*UserMutation) SetFollowing

func (m *UserMutation) SetFollowing(s string)

SetFollowing sets the "following" field.

func (*UserMutation) SetHeaderImageID

func (m *UserMutation) SetHeaderImageID(id int)

SetHeaderImageID sets the "headerImage" edge to the Image entity by id.

func (*UserMutation) SetID

func (m *UserMutation) SetID(id uuid.UUID)

SetID sets the value of the id field. Note that this operation is only accepted on creation of User entities.

func (*UserMutation) SetInbox

func (m *UserMutation) SetInbox(s string)

SetInbox sets the "inbox" field.

func (*UserMutation) SetIndexable

func (m *UserMutation) SetIndexable(b bool)

SetIndexable sets the "indexable" field.

func (*UserMutation) SetIsRemote

func (m *UserMutation) SetIsRemote(b bool)

SetIsRemote sets the "isRemote" field.

func (*UserMutation) SetOp

func (m *UserMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*UserMutation) SetOutbox

func (m *UserMutation) SetOutbox(s string)

SetOutbox sets the "outbox" field.

func (*UserMutation) SetPasswordHash

func (m *UserMutation) SetPasswordHash(b []byte)

SetPasswordHash sets the "passwordHash" field.

func (*UserMutation) SetPrivacyLevel

func (m *UserMutation) SetPrivacyLevel(ul user.PrivacyLevel)

SetPrivacyLevel sets the "privacyLevel" field.

func (*UserMutation) SetPrivateKey

func (m *UserMutation) SetPrivateKey(b []byte)

SetPrivateKey sets the "privateKey" field.

func (*UserMutation) SetPublicKey

func (m *UserMutation) SetPublicKey(b []byte)

SetPublicKey sets the "publicKey" field.

func (*UserMutation) SetPublicKeyActor

func (m *UserMutation) SetPublicKeyActor(s string)

SetPublicKeyActor sets the "publicKeyActor" field.

func (*UserMutation) SetPublicKeyAlgorithm

func (m *UserMutation) SetPublicKeyAlgorithm(s string)

SetPublicKeyAlgorithm sets the "publicKeyAlgorithm" field.

func (*UserMutation) SetURI

func (m *UserMutation) SetURI(s string)

SetURI sets the "uri" 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) URI

func (m *UserMutation) URI() (r string, exists bool)

URI returns the value of the "uri" 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 uuid.UUID, err error)

FirstID returns the first User ID from the query. Returns a *NotFoundError when no User ID was found.

func (*UserQuery) FirstIDX

func (uq *UserQuery) FirstIDX(ctx context.Context) uuid.UUID

FirstIDX is like FirstID, but panics if an error occurs.

func (*UserQuery) FirstX

func (uq *UserQuery) FirstX(ctx context.Context) *User

FirstX is like First, but panics if an error occurs.

func (*UserQuery) GroupBy

func (uq *UserQuery) GroupBy(field string, fields ...string) *UserGroupBy

GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.

Example:

var v []struct {
	IsRemote bool `json:"isRemote,omitempty"`
	Count int `json:"count,omitempty"`
}

client.User.Query().
	GroupBy(user.FieldIsRemote).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*UserQuery) IDs

func (uq *UserQuery) IDs(ctx context.Context) (ids []uuid.UUID, err error)

IDs executes the query and returns a list of User IDs.

func (*UserQuery) IDsX

func (uq *UserQuery) IDsX(ctx context.Context) []uuid.UUID

IDsX is like IDs, but panics if an error occurs.

func (*UserQuery) Limit

func (uq *UserQuery) Limit(limit int) *UserQuery

Limit the number of records to be returned by this query.

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 uuid.UUID, err error)

OnlyID is like Only, but returns the only User ID in the query. Returns a *NotSingularError when more than one User ID is found. Returns a *NotFoundError when no entities are found.

func (*UserQuery) OnlyIDX

func (uq *UserQuery) OnlyIDX(ctx context.Context) uuid.UUID

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*UserQuery) OnlyX

func (uq *UserQuery) OnlyX(ctx context.Context) *User

OnlyX is like Only, but panics if an error occurs.

func (*UserQuery) Order

func (uq *UserQuery) Order(o ...user.OrderOption) *UserQuery

Order specifies how the records should be ordered.

func (*UserQuery) QueryAdministeredServers

func (uq *UserQuery) QueryAdministeredServers() *InstanceMetadataQuery

QueryAdministeredServers chains the current query on the "administeredServers" edge.

func (*UserQuery) QueryAuthoredNotes

func (uq *UserQuery) QueryAuthoredNotes() *NoteQuery

QueryAuthoredNotes chains the current query on the "authoredNotes" edge.

func (*UserQuery) QueryAvatarImage

func (uq *UserQuery) QueryAvatarImage() *ImageQuery

QueryAvatarImage chains the current query on the "avatarImage" edge.

func (*UserQuery) QueryHeaderImage

func (uq *UserQuery) QueryHeaderImage() *ImageQuery

QueryHeaderImage chains the current query on the "headerImage" edge.

func (*UserQuery) QueryMentionedNotes

func (uq *UserQuery) QueryMentionedNotes() *NoteQuery

QueryMentionedNotes chains the current query on the "mentionedNotes" edge.

func (*UserQuery) QueryModeratedServers

func (uq *UserQuery) QueryModeratedServers() *InstanceMetadataQuery

QueryModeratedServers chains the current query on the "moderatedServers" edge.

func (*UserQuery) QueryServers

func (uq *UserQuery) QueryServers() *InstanceMetadataQuery

QueryServers chains the current query on the "servers" 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 {
	IsRemote bool `json:"isRemote,omitempty"`
}

client.User.Query().
	Select(user.FieldIsRemote).
	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) WithAdministeredServers

func (uq *UserQuery) WithAdministeredServers(opts ...func(*InstanceMetadataQuery)) *UserQuery

WithAdministeredServers tells the query-builder to eager-load the nodes that are connected to the "administeredServers" edge. The optional arguments are used to configure the query builder of the edge.

func (*UserQuery) WithAuthoredNotes

func (uq *UserQuery) WithAuthoredNotes(opts ...func(*NoteQuery)) *UserQuery

WithAuthoredNotes tells the query-builder to eager-load the nodes that are connected to the "authoredNotes" edge. The optional arguments are used to configure the query builder of the edge.

func (*UserQuery) WithAvatarImage

func (uq *UserQuery) WithAvatarImage(opts ...func(*ImageQuery)) *UserQuery

WithAvatarImage tells the query-builder to eager-load the nodes that are connected to the "avatarImage" edge. The optional arguments are used to configure the query builder of the edge.

func (*UserQuery) WithHeaderImage

func (uq *UserQuery) WithHeaderImage(opts ...func(*ImageQuery)) *UserQuery

WithHeaderImage tells the query-builder to eager-load the nodes that are connected to the "headerImage" edge. The optional arguments are used to configure the query builder of the edge.

func (*UserQuery) WithMentionedNotes

func (uq *UserQuery) WithMentionedNotes(opts ...func(*NoteQuery)) *UserQuery

WithMentionedNotes tells the query-builder to eager-load the nodes that are connected to the "mentionedNotes" edge. The optional arguments are used to configure the query builder of the edge.

func (*UserQuery) WithModeratedServers

func (uq *UserQuery) WithModeratedServers(opts ...func(*InstanceMetadataQuery)) *UserQuery

WithModeratedServers tells the query-builder to eager-load the nodes that are connected to the "moderatedServers" edge. The optional arguments are used to configure the query builder of the edge.

func (*UserQuery) WithServers

func (uq *UserQuery) WithServers(opts ...func(*InstanceMetadataQuery)) *UserQuery

WithServers tells the query-builder to eager-load the nodes that are connected to the "servers" 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) 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) AddAdministeredServerIDs

func (uu *UserUpdate) AddAdministeredServerIDs(ids ...uuid.UUID) *UserUpdate

AddAdministeredServerIDs adds the "administeredServers" edge to the InstanceMetadata entity by IDs.

func (*UserUpdate) AddAdministeredServers

func (uu *UserUpdate) AddAdministeredServers(i ...*InstanceMetadata) *UserUpdate

AddAdministeredServers adds the "administeredServers" edges to the InstanceMetadata entity.

func (*UserUpdate) AddAuthoredNoteIDs

func (uu *UserUpdate) AddAuthoredNoteIDs(ids ...uuid.UUID) *UserUpdate

AddAuthoredNoteIDs adds the "authoredNotes" edge to the Note entity by IDs.

func (*UserUpdate) AddAuthoredNotes

func (uu *UserUpdate) AddAuthoredNotes(n ...*Note) *UserUpdate

AddAuthoredNotes adds the "authoredNotes" edges to the Note entity.

func (*UserUpdate) AddMentionedNoteIDs

func (uu *UserUpdate) AddMentionedNoteIDs(ids ...uuid.UUID) *UserUpdate

AddMentionedNoteIDs adds the "mentionedNotes" edge to the Note entity by IDs.

func (*UserUpdate) AddMentionedNotes

func (uu *UserUpdate) AddMentionedNotes(n ...*Note) *UserUpdate

AddMentionedNotes adds the "mentionedNotes" edges to the Note entity.

func (*UserUpdate) AddModeratedServerIDs

func (uu *UserUpdate) AddModeratedServerIDs(ids ...uuid.UUID) *UserUpdate

AddModeratedServerIDs adds the "moderatedServers" edge to the InstanceMetadata entity by IDs.

func (*UserUpdate) AddModeratedServers

func (uu *UserUpdate) AddModeratedServers(i ...*InstanceMetadata) *UserUpdate

AddModeratedServers adds the "moderatedServers" edges to the InstanceMetadata entity.

func (*UserUpdate) AddServerIDs

func (uu *UserUpdate) AddServerIDs(ids ...uuid.UUID) *UserUpdate

AddServerIDs adds the "servers" edge to the InstanceMetadata entity by IDs.

func (*UserUpdate) AddServers

func (uu *UserUpdate) AddServers(i ...*InstanceMetadata) *UserUpdate

AddServers adds the "servers" edges to the InstanceMetadata entity.

func (*UserUpdate) AppendFields

func (uu *UserUpdate) AppendFields(vf []versia.UserField) *UserUpdate

AppendFields appends vf to the "fields" field.

func (*UserUpdate) ClearAdministeredServers

func (uu *UserUpdate) ClearAdministeredServers() *UserUpdate

ClearAdministeredServers clears all "administeredServers" edges to the InstanceMetadata entity.

func (*UserUpdate) ClearAuthoredNotes

func (uu *UserUpdate) ClearAuthoredNotes() *UserUpdate

ClearAuthoredNotes clears all "authoredNotes" edges to the Note entity.

func (*UserUpdate) ClearAvatarImage

func (uu *UserUpdate) ClearAvatarImage() *UserUpdate

ClearAvatarImage clears the "avatarImage" edge to the Image entity.

func (*UserUpdate) ClearBiography

func (uu *UserUpdate) ClearBiography() *UserUpdate

ClearBiography clears the value of the "biography" field.

func (*UserUpdate) ClearDisplayName

func (uu *UserUpdate) ClearDisplayName() *UserUpdate

ClearDisplayName clears the value of the "displayName" field.

func (*UserUpdate) ClearHeaderImage

func (uu *UserUpdate) ClearHeaderImage() *UserUpdate

ClearHeaderImage clears the "headerImage" edge to the Image entity.

func (*UserUpdate) ClearMentionedNotes

func (uu *UserUpdate) ClearMentionedNotes() *UserUpdate

ClearMentionedNotes clears all "mentionedNotes" edges to the Note entity.

func (*UserUpdate) ClearModeratedServers

func (uu *UserUpdate) ClearModeratedServers() *UserUpdate

ClearModeratedServers clears all "moderatedServers" edges to the InstanceMetadata entity.

func (*UserUpdate) ClearPasswordHash

func (uu *UserUpdate) ClearPasswordHash() *UserUpdate

ClearPasswordHash clears the value of the "passwordHash" field.

func (*UserUpdate) ClearPrivateKey

func (uu *UserUpdate) ClearPrivateKey() *UserUpdate

ClearPrivateKey clears the value of the "privateKey" field.

func (*UserUpdate) ClearServers

func (uu *UserUpdate) ClearServers() *UserUpdate

ClearServers clears all "servers" edges to the InstanceMetadata entity.

func (*UserUpdate) Exec

func (uu *UserUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*UserUpdate) ExecX

func (uu *UserUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserUpdate) Mutation

func (uu *UserUpdate) Mutation() *UserMutation

Mutation returns the UserMutation object of the builder.

func (*UserUpdate) RemoveAdministeredServerIDs

func (uu *UserUpdate) RemoveAdministeredServerIDs(ids ...uuid.UUID) *UserUpdate

RemoveAdministeredServerIDs removes the "administeredServers" edge to InstanceMetadata entities by IDs.

func (*UserUpdate) RemoveAdministeredServers

func (uu *UserUpdate) RemoveAdministeredServers(i ...*InstanceMetadata) *UserUpdate

RemoveAdministeredServers removes "administeredServers" edges to InstanceMetadata entities.

func (*UserUpdate) RemoveAuthoredNoteIDs

func (uu *UserUpdate) RemoveAuthoredNoteIDs(ids ...uuid.UUID) *UserUpdate

RemoveAuthoredNoteIDs removes the "authoredNotes" edge to Note entities by IDs.

func (*UserUpdate) RemoveAuthoredNotes

func (uu *UserUpdate) RemoveAuthoredNotes(n ...*Note) *UserUpdate

RemoveAuthoredNotes removes "authoredNotes" edges to Note entities.

func (*UserUpdate) RemoveMentionedNoteIDs

func (uu *UserUpdate) RemoveMentionedNoteIDs(ids ...uuid.UUID) *UserUpdate

RemoveMentionedNoteIDs removes the "mentionedNotes" edge to Note entities by IDs.

func (*UserUpdate) RemoveMentionedNotes

func (uu *UserUpdate) RemoveMentionedNotes(n ...*Note) *UserUpdate

RemoveMentionedNotes removes "mentionedNotes" edges to Note entities.

func (*UserUpdate) RemoveModeratedServerIDs

func (uu *UserUpdate) RemoveModeratedServerIDs(ids ...uuid.UUID) *UserUpdate

RemoveModeratedServerIDs removes the "moderatedServers" edge to InstanceMetadata entities by IDs.

func (*UserUpdate) RemoveModeratedServers

func (uu *UserUpdate) RemoveModeratedServers(i ...*InstanceMetadata) *UserUpdate

RemoveModeratedServers removes "moderatedServers" edges to InstanceMetadata entities.

func (*UserUpdate) RemoveServerIDs

func (uu *UserUpdate) RemoveServerIDs(ids ...uuid.UUID) *UserUpdate

RemoveServerIDs removes the "servers" edge to InstanceMetadata entities by IDs.

func (*UserUpdate) RemoveServers

func (uu *UserUpdate) RemoveServers(i ...*InstanceMetadata) *UserUpdate

RemoveServers removes "servers" edges to InstanceMetadata 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) SetAvatarImage

func (uu *UserUpdate) SetAvatarImage(i *Image) *UserUpdate

SetAvatarImage sets the "avatarImage" edge to the Image entity.

func (*UserUpdate) SetAvatarImageID

func (uu *UserUpdate) SetAvatarImageID(id int) *UserUpdate

SetAvatarImageID sets the "avatarImage" edge to the Image entity by ID.

func (*UserUpdate) SetBiography

func (uu *UserUpdate) SetBiography(s string) *UserUpdate

SetBiography sets the "biography" field.

func (*UserUpdate) SetDisplayName

func (uu *UserUpdate) SetDisplayName(s string) *UserUpdate

SetDisplayName sets the "displayName" field.

func (*UserUpdate) SetExtensions

func (uu *UserUpdate) SetExtensions(v versia.Extensions) *UserUpdate

SetExtensions sets the "extensions" field.

func (*UserUpdate) SetFeatured

func (uu *UserUpdate) SetFeatured(s string) *UserUpdate

SetFeatured sets the "featured" field.

func (*UserUpdate) SetFields

func (uu *UserUpdate) SetFields(vf []versia.UserField) *UserUpdate

SetFields sets the "fields" field.

func (*UserUpdate) SetFollowers

func (uu *UserUpdate) SetFollowers(s string) *UserUpdate

SetFollowers sets the "followers" field.

func (*UserUpdate) SetFollowing

func (uu *UserUpdate) SetFollowing(s string) *UserUpdate

SetFollowing sets the "following" field.

func (*UserUpdate) SetHeaderImage

func (uu *UserUpdate) SetHeaderImage(i *Image) *UserUpdate

SetHeaderImage sets the "headerImage" edge to the Image entity.

func (*UserUpdate) SetHeaderImageID

func (uu *UserUpdate) SetHeaderImageID(id int) *UserUpdate

SetHeaderImageID sets the "headerImage" edge to the Image entity by ID.

func (*UserUpdate) SetInbox

func (uu *UserUpdate) SetInbox(s string) *UserUpdate

SetInbox sets the "inbox" field.

func (*UserUpdate) SetIndexable

func (uu *UserUpdate) SetIndexable(b bool) *UserUpdate

SetIndexable sets the "indexable" field.

func (*UserUpdate) SetIsRemote

func (uu *UserUpdate) SetIsRemote(b bool) *UserUpdate

SetIsRemote sets the "isRemote" field.

func (*UserUpdate) SetNillableAvatarImageID

func (uu *UserUpdate) SetNillableAvatarImageID(id *int) *UserUpdate

SetNillableAvatarImageID sets the "avatarImage" edge to the Image entity by ID if the given value is not nil.

func (*UserUpdate) SetNillableBiography

func (uu *UserUpdate) SetNillableBiography(s *string) *UserUpdate

SetNillableBiography sets the "biography" field if the given value is not nil.

func (*UserUpdate) SetNillableDisplayName

func (uu *UserUpdate) SetNillableDisplayName(s *string) *UserUpdate

SetNillableDisplayName sets the "displayName" field if the given value is not nil.

func (*UserUpdate) SetNillableFeatured

func (uu *UserUpdate) SetNillableFeatured(s *string) *UserUpdate

SetNillableFeatured sets the "featured" field if the given value is not nil.

func (*UserUpdate) SetNillableFollowers

func (uu *UserUpdate) SetNillableFollowers(s *string) *UserUpdate

SetNillableFollowers sets the "followers" field if the given value is not nil.

func (*UserUpdate) SetNillableFollowing

func (uu *UserUpdate) SetNillableFollowing(s *string) *UserUpdate

SetNillableFollowing sets the "following" field if the given value is not nil.

func (*UserUpdate) SetNillableHeaderImageID

func (uu *UserUpdate) SetNillableHeaderImageID(id *int) *UserUpdate

SetNillableHeaderImageID sets the "headerImage" edge to the Image entity by ID if the given value is not nil.

func (*UserUpdate) SetNillableInbox

func (uu *UserUpdate) SetNillableInbox(s *string) *UserUpdate

SetNillableInbox sets the "inbox" field if the given value is not nil.

func (*UserUpdate) SetNillableIndexable

func (uu *UserUpdate) SetNillableIndexable(b *bool) *UserUpdate

SetNillableIndexable sets the "indexable" field if the given value is not nil.

func (*UserUpdate) SetNillableIsRemote

func (uu *UserUpdate) SetNillableIsRemote(b *bool) *UserUpdate

SetNillableIsRemote sets the "isRemote" field if the given value is not nil.

func (*UserUpdate) SetNillableOutbox

func (uu *UserUpdate) SetNillableOutbox(s *string) *UserUpdate

SetNillableOutbox sets the "outbox" field if the given value is not nil.

func (*UserUpdate) SetNillablePrivacyLevel

func (uu *UserUpdate) SetNillablePrivacyLevel(ul *user.PrivacyLevel) *UserUpdate

SetNillablePrivacyLevel sets the "privacyLevel" field if the given value is not nil.

func (*UserUpdate) SetNillablePublicKeyActor

func (uu *UserUpdate) SetNillablePublicKeyActor(s *string) *UserUpdate

SetNillablePublicKeyActor sets the "publicKeyActor" field if the given value is not nil.

func (*UserUpdate) SetNillablePublicKeyAlgorithm

func (uu *UserUpdate) SetNillablePublicKeyAlgorithm(s *string) *UserUpdate

SetNillablePublicKeyAlgorithm sets the "publicKeyAlgorithm" field if the given value is not nil.

func (*UserUpdate) SetNillableURI

func (uu *UserUpdate) SetNillableURI(s *string) *UserUpdate

SetNillableURI sets the "uri" field if the given value is not nil.

func (*UserUpdate) SetNillableUsername

func (uu *UserUpdate) SetNillableUsername(s *string) *UserUpdate

SetNillableUsername sets the "username" field if the given value is not nil.

func (*UserUpdate) SetOutbox

func (uu *UserUpdate) SetOutbox(s string) *UserUpdate

SetOutbox sets the "outbox" field.

func (*UserUpdate) SetPasswordHash

func (uu *UserUpdate) SetPasswordHash(b []byte) *UserUpdate

SetPasswordHash sets the "passwordHash" field.

func (*UserUpdate) SetPrivacyLevel

func (uu *UserUpdate) SetPrivacyLevel(ul user.PrivacyLevel) *UserUpdate

SetPrivacyLevel sets the "privacyLevel" field.

func (*UserUpdate) SetPrivateKey

func (uu *UserUpdate) SetPrivateKey(b []byte) *UserUpdate

SetPrivateKey sets the "privateKey" field.

func (*UserUpdate) SetPublicKey

func (uu *UserUpdate) SetPublicKey(b []byte) *UserUpdate

SetPublicKey sets the "publicKey" field.

func (*UserUpdate) SetPublicKeyActor

func (uu *UserUpdate) SetPublicKeyActor(s string) *UserUpdate

SetPublicKeyActor sets the "publicKeyActor" field.

func (*UserUpdate) SetPublicKeyAlgorithm

func (uu *UserUpdate) SetPublicKeyAlgorithm(s string) *UserUpdate

SetPublicKeyAlgorithm sets the "publicKeyAlgorithm" field.

func (*UserUpdate) SetURI

func (uu *UserUpdate) SetURI(s string) *UserUpdate

SetURI sets the "uri" 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) AddAdministeredServerIDs

func (uuo *UserUpdateOne) AddAdministeredServerIDs(ids ...uuid.UUID) *UserUpdateOne

AddAdministeredServerIDs adds the "administeredServers" edge to the InstanceMetadata entity by IDs.

func (*UserUpdateOne) AddAdministeredServers

func (uuo *UserUpdateOne) AddAdministeredServers(i ...*InstanceMetadata) *UserUpdateOne

AddAdministeredServers adds the "administeredServers" edges to the InstanceMetadata entity.

func (*UserUpdateOne) AddAuthoredNoteIDs

func (uuo *UserUpdateOne) AddAuthoredNoteIDs(ids ...uuid.UUID) *UserUpdateOne

AddAuthoredNoteIDs adds the "authoredNotes" edge to the Note entity by IDs.

func (*UserUpdateOne) AddAuthoredNotes

func (uuo *UserUpdateOne) AddAuthoredNotes(n ...*Note) *UserUpdateOne

AddAuthoredNotes adds the "authoredNotes" edges to the Note entity.

func (*UserUpdateOne) AddMentionedNoteIDs

func (uuo *UserUpdateOne) AddMentionedNoteIDs(ids ...uuid.UUID) *UserUpdateOne

AddMentionedNoteIDs adds the "mentionedNotes" edge to the Note entity by IDs.

func (*UserUpdateOne) AddMentionedNotes

func (uuo *UserUpdateOne) AddMentionedNotes(n ...*Note) *UserUpdateOne

AddMentionedNotes adds the "mentionedNotes" edges to the Note entity.

func (*UserUpdateOne) AddModeratedServerIDs

func (uuo *UserUpdateOne) AddModeratedServerIDs(ids ...uuid.UUID) *UserUpdateOne

AddModeratedServerIDs adds the "moderatedServers" edge to the InstanceMetadata entity by IDs.

func (*UserUpdateOne) AddModeratedServers

func (uuo *UserUpdateOne) AddModeratedServers(i ...*InstanceMetadata) *UserUpdateOne

AddModeratedServers adds the "moderatedServers" edges to the InstanceMetadata entity.

func (*UserUpdateOne) AddServerIDs

func (uuo *UserUpdateOne) AddServerIDs(ids ...uuid.UUID) *UserUpdateOne

AddServerIDs adds the "servers" edge to the InstanceMetadata entity by IDs.

func (*UserUpdateOne) AddServers

func (uuo *UserUpdateOne) AddServers(i ...*InstanceMetadata) *UserUpdateOne

AddServers adds the "servers" edges to the InstanceMetadata entity.

func (*UserUpdateOne) AppendFields

func (uuo *UserUpdateOne) AppendFields(vf []versia.UserField) *UserUpdateOne

AppendFields appends vf to the "fields" field.

func (*UserUpdateOne) ClearAdministeredServers

func (uuo *UserUpdateOne) ClearAdministeredServers() *UserUpdateOne

ClearAdministeredServers clears all "administeredServers" edges to the InstanceMetadata entity.

func (*UserUpdateOne) ClearAuthoredNotes

func (uuo *UserUpdateOne) ClearAuthoredNotes() *UserUpdateOne

ClearAuthoredNotes clears all "authoredNotes" edges to the Note entity.

func (*UserUpdateOne) ClearAvatarImage

func (uuo *UserUpdateOne) ClearAvatarImage() *UserUpdateOne

ClearAvatarImage clears the "avatarImage" edge to the Image entity.

func (*UserUpdateOne) ClearBiography

func (uuo *UserUpdateOne) ClearBiography() *UserUpdateOne

ClearBiography clears the value of the "biography" field.

func (*UserUpdateOne) ClearDisplayName

func (uuo *UserUpdateOne) ClearDisplayName() *UserUpdateOne

ClearDisplayName clears the value of the "displayName" field.

func (*UserUpdateOne) ClearHeaderImage

func (uuo *UserUpdateOne) ClearHeaderImage() *UserUpdateOne

ClearHeaderImage clears the "headerImage" edge to the Image entity.

func (*UserUpdateOne) ClearMentionedNotes

func (uuo *UserUpdateOne) ClearMentionedNotes() *UserUpdateOne

ClearMentionedNotes clears all "mentionedNotes" edges to the Note entity.

func (*UserUpdateOne) ClearModeratedServers

func (uuo *UserUpdateOne) ClearModeratedServers() *UserUpdateOne

ClearModeratedServers clears all "moderatedServers" edges to the InstanceMetadata entity.

func (*UserUpdateOne) ClearPasswordHash

func (uuo *UserUpdateOne) ClearPasswordHash() *UserUpdateOne

ClearPasswordHash clears the value of the "passwordHash" field.

func (*UserUpdateOne) ClearPrivateKey

func (uuo *UserUpdateOne) ClearPrivateKey() *UserUpdateOne

ClearPrivateKey clears the value of the "privateKey" field.

func (*UserUpdateOne) ClearServers

func (uuo *UserUpdateOne) ClearServers() *UserUpdateOne

ClearServers clears all "servers" edges to the InstanceMetadata entity.

func (*UserUpdateOne) Exec

func (uuo *UserUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*UserUpdateOne) ExecX

func (uuo *UserUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserUpdateOne) Mutation

func (uuo *UserUpdateOne) Mutation() *UserMutation

Mutation returns the UserMutation object of the builder.

func (*UserUpdateOne) RemoveAdministeredServerIDs

func (uuo *UserUpdateOne) RemoveAdministeredServerIDs(ids ...uuid.UUID) *UserUpdateOne

RemoveAdministeredServerIDs removes the "administeredServers" edge to InstanceMetadata entities by IDs.

func (*UserUpdateOne) RemoveAdministeredServers

func (uuo *UserUpdateOne) RemoveAdministeredServers(i ...*InstanceMetadata) *UserUpdateOne

RemoveAdministeredServers removes "administeredServers" edges to InstanceMetadata entities.

func (*UserUpdateOne) RemoveAuthoredNoteIDs

func (uuo *UserUpdateOne) RemoveAuthoredNoteIDs(ids ...uuid.UUID) *UserUpdateOne

RemoveAuthoredNoteIDs removes the "authoredNotes" edge to Note entities by IDs.

func (*UserUpdateOne) RemoveAuthoredNotes

func (uuo *UserUpdateOne) RemoveAuthoredNotes(n ...*Note) *UserUpdateOne

RemoveAuthoredNotes removes "authoredNotes" edges to Note entities.

func (*UserUpdateOne) RemoveMentionedNoteIDs

func (uuo *UserUpdateOne) RemoveMentionedNoteIDs(ids ...uuid.UUID) *UserUpdateOne

RemoveMentionedNoteIDs removes the "mentionedNotes" edge to Note entities by IDs.

func (*UserUpdateOne) RemoveMentionedNotes

func (uuo *UserUpdateOne) RemoveMentionedNotes(n ...*Note) *UserUpdateOne

RemoveMentionedNotes removes "mentionedNotes" edges to Note entities.

func (*UserUpdateOne) RemoveModeratedServerIDs

func (uuo *UserUpdateOne) RemoveModeratedServerIDs(ids ...uuid.UUID) *UserUpdateOne

RemoveModeratedServerIDs removes the "moderatedServers" edge to InstanceMetadata entities by IDs.

func (*UserUpdateOne) RemoveModeratedServers

func (uuo *UserUpdateOne) RemoveModeratedServers(i ...*InstanceMetadata) *UserUpdateOne

RemoveModeratedServers removes "moderatedServers" edges to InstanceMetadata entities.

func (*UserUpdateOne) RemoveServerIDs

func (uuo *UserUpdateOne) RemoveServerIDs(ids ...uuid.UUID) *UserUpdateOne

RemoveServerIDs removes the "servers" edge to InstanceMetadata entities by IDs.

func (*UserUpdateOne) RemoveServers

func (uuo *UserUpdateOne) RemoveServers(i ...*InstanceMetadata) *UserUpdateOne

RemoveServers removes "servers" edges to InstanceMetadata 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) SetAvatarImage

func (uuo *UserUpdateOne) SetAvatarImage(i *Image) *UserUpdateOne

SetAvatarImage sets the "avatarImage" edge to the Image entity.

func (*UserUpdateOne) SetAvatarImageID

func (uuo *UserUpdateOne) SetAvatarImageID(id int) *UserUpdateOne

SetAvatarImageID sets the "avatarImage" edge to the Image entity by ID.

func (*UserUpdateOne) SetBiography

func (uuo *UserUpdateOne) SetBiography(s string) *UserUpdateOne

SetBiography sets the "biography" field.

func (*UserUpdateOne) SetDisplayName

func (uuo *UserUpdateOne) SetDisplayName(s string) *UserUpdateOne

SetDisplayName sets the "displayName" field.

func (*UserUpdateOne) SetExtensions

func (uuo *UserUpdateOne) SetExtensions(v versia.Extensions) *UserUpdateOne

SetExtensions sets the "extensions" field.

func (*UserUpdateOne) SetFeatured

func (uuo *UserUpdateOne) SetFeatured(s string) *UserUpdateOne

SetFeatured sets the "featured" field.

func (*UserUpdateOne) SetFields

func (uuo *UserUpdateOne) SetFields(vf []versia.UserField) *UserUpdateOne

SetFields sets the "fields" field.

func (*UserUpdateOne) SetFollowers

func (uuo *UserUpdateOne) SetFollowers(s string) *UserUpdateOne

SetFollowers sets the "followers" field.

func (*UserUpdateOne) SetFollowing

func (uuo *UserUpdateOne) SetFollowing(s string) *UserUpdateOne

SetFollowing sets the "following" field.

func (*UserUpdateOne) SetHeaderImage

func (uuo *UserUpdateOne) SetHeaderImage(i *Image) *UserUpdateOne

SetHeaderImage sets the "headerImage" edge to the Image entity.

func (*UserUpdateOne) SetHeaderImageID

func (uuo *UserUpdateOne) SetHeaderImageID(id int) *UserUpdateOne

SetHeaderImageID sets the "headerImage" edge to the Image entity by ID.

func (*UserUpdateOne) SetInbox

func (uuo *UserUpdateOne) SetInbox(s string) *UserUpdateOne

SetInbox sets the "inbox" field.

func (*UserUpdateOne) SetIndexable

func (uuo *UserUpdateOne) SetIndexable(b bool) *UserUpdateOne

SetIndexable sets the "indexable" field.

func (*UserUpdateOne) SetIsRemote

func (uuo *UserUpdateOne) SetIsRemote(b bool) *UserUpdateOne

SetIsRemote sets the "isRemote" field.

func (*UserUpdateOne) SetNillableAvatarImageID

func (uuo *UserUpdateOne) SetNillableAvatarImageID(id *int) *UserUpdateOne

SetNillableAvatarImageID sets the "avatarImage" edge to the Image entity by ID if the given value is not nil.

func (*UserUpdateOne) SetNillableBiography

func (uuo *UserUpdateOne) SetNillableBiography(s *string) *UserUpdateOne

SetNillableBiography sets the "biography" field if the given value is not nil.

func (*UserUpdateOne) SetNillableDisplayName

func (uuo *UserUpdateOne) SetNillableDisplayName(s *string) *UserUpdateOne

SetNillableDisplayName sets the "displayName" field if the given value is not nil.

func (*UserUpdateOne) SetNillableFeatured

func (uuo *UserUpdateOne) SetNillableFeatured(s *string) *UserUpdateOne

SetNillableFeatured sets the "featured" field if the given value is not nil.

func (*UserUpdateOne) SetNillableFollowers

func (uuo *UserUpdateOne) SetNillableFollowers(s *string) *UserUpdateOne

SetNillableFollowers sets the "followers" field if the given value is not nil.

func (*UserUpdateOne) SetNillableFollowing

func (uuo *UserUpdateOne) SetNillableFollowing(s *string) *UserUpdateOne

SetNillableFollowing sets the "following" field if the given value is not nil.

func (*UserUpdateOne) SetNillableHeaderImageID

func (uuo *UserUpdateOne) SetNillableHeaderImageID(id *int) *UserUpdateOne

SetNillableHeaderImageID sets the "headerImage" edge to the Image entity by ID if the given value is not nil.

func (*UserUpdateOne) SetNillableInbox

func (uuo *UserUpdateOne) SetNillableInbox(s *string) *UserUpdateOne

SetNillableInbox sets the "inbox" field if the given value is not nil.

func (*UserUpdateOne) SetNillableIndexable

func (uuo *UserUpdateOne) SetNillableIndexable(b *bool) *UserUpdateOne

SetNillableIndexable sets the "indexable" field if the given value is not nil.

func (*UserUpdateOne) SetNillableIsRemote

func (uuo *UserUpdateOne) SetNillableIsRemote(b *bool) *UserUpdateOne

SetNillableIsRemote sets the "isRemote" field if the given value is not nil.

func (*UserUpdateOne) SetNillableOutbox

func (uuo *UserUpdateOne) SetNillableOutbox(s *string) *UserUpdateOne

SetNillableOutbox sets the "outbox" field if the given value is not nil.

func (*UserUpdateOne) SetNillablePrivacyLevel

func (uuo *UserUpdateOne) SetNillablePrivacyLevel(ul *user.PrivacyLevel) *UserUpdateOne

SetNillablePrivacyLevel sets the "privacyLevel" field if the given value is not nil.

func (*UserUpdateOne) SetNillablePublicKeyActor

func (uuo *UserUpdateOne) SetNillablePublicKeyActor(s *string) *UserUpdateOne

SetNillablePublicKeyActor sets the "publicKeyActor" field if the given value is not nil.

func (*UserUpdateOne) SetNillablePublicKeyAlgorithm

func (uuo *UserUpdateOne) SetNillablePublicKeyAlgorithm(s *string) *UserUpdateOne

SetNillablePublicKeyAlgorithm sets the "publicKeyAlgorithm" field if the given value is not nil.

func (*UserUpdateOne) SetNillableURI

func (uuo *UserUpdateOne) SetNillableURI(s *string) *UserUpdateOne

SetNillableURI sets the "uri" field if the given value is not nil.

func (*UserUpdateOne) SetNillableUsername

func (uuo *UserUpdateOne) SetNillableUsername(s *string) *UserUpdateOne

SetNillableUsername sets the "username" field if the given value is not nil.

func (*UserUpdateOne) SetOutbox

func (uuo *UserUpdateOne) SetOutbox(s string) *UserUpdateOne

SetOutbox sets the "outbox" field.

func (*UserUpdateOne) SetPasswordHash

func (uuo *UserUpdateOne) SetPasswordHash(b []byte) *UserUpdateOne

SetPasswordHash sets the "passwordHash" field.

func (*UserUpdateOne) SetPrivacyLevel

func (uuo *UserUpdateOne) SetPrivacyLevel(ul user.PrivacyLevel) *UserUpdateOne

SetPrivacyLevel sets the "privacyLevel" field.

func (*UserUpdateOne) SetPrivateKey

func (uuo *UserUpdateOne) SetPrivateKey(b []byte) *UserUpdateOne

SetPrivateKey sets the "privateKey" field.

func (*UserUpdateOne) SetPublicKey

func (uuo *UserUpdateOne) SetPublicKey(b []byte) *UserUpdateOne

SetPublicKey sets the "publicKey" field.

func (*UserUpdateOne) SetPublicKeyActor

func (uuo *UserUpdateOne) SetPublicKeyActor(s string) *UserUpdateOne

SetPublicKeyActor sets the "publicKeyActor" field.

func (*UserUpdateOne) SetPublicKeyAlgorithm

func (uuo *UserUpdateOne) SetPublicKeyAlgorithm(s string) *UserUpdateOne

SetPublicKeyAlgorithm sets the "publicKeyAlgorithm" field.

func (*UserUpdateOne) SetURI

func (uuo *UserUpdateOne) SetURI(s string) *UserUpdateOne

SetURI sets the "uri" 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 UserUpsert

type UserUpsert struct {
	*sql.UpdateSet
}

UserUpsert is the "OnConflict" setter.

func (*UserUpsert) ClearBiography

func (u *UserUpsert) ClearBiography() *UserUpsert

ClearBiography clears the value of the "biography" field.

func (*UserUpsert) ClearDisplayName

func (u *UserUpsert) ClearDisplayName() *UserUpsert

ClearDisplayName clears the value of the "displayName" field.

func (*UserUpsert) ClearPasswordHash

func (u *UserUpsert) ClearPasswordHash() *UserUpsert

ClearPasswordHash clears the value of the "passwordHash" field.

func (*UserUpsert) ClearPrivateKey

func (u *UserUpsert) ClearPrivateKey() *UserUpsert

ClearPrivateKey clears the value of the "privateKey" field.

func (*UserUpsert) SetBiography

func (u *UserUpsert) SetBiography(v string) *UserUpsert

SetBiography sets the "biography" field.

func (*UserUpsert) SetDisplayName

func (u *UserUpsert) SetDisplayName(v string) *UserUpsert

SetDisplayName sets the "displayName" field.

func (*UserUpsert) SetExtensions

func (u *UserUpsert) SetExtensions(v versia.Extensions) *UserUpsert

SetExtensions sets the "extensions" field.

func (*UserUpsert) SetFeatured

func (u *UserUpsert) SetFeatured(v string) *UserUpsert

SetFeatured sets the "featured" field.

func (*UserUpsert) SetFields

func (u *UserUpsert) SetFields(v []versia.UserField) *UserUpsert

SetFields sets the "fields" field.

func (*UserUpsert) SetFollowers

func (u *UserUpsert) SetFollowers(v string) *UserUpsert

SetFollowers sets the "followers" field.

func (*UserUpsert) SetFollowing

func (u *UserUpsert) SetFollowing(v string) *UserUpsert

SetFollowing sets the "following" field.

func (*UserUpsert) SetInbox

func (u *UserUpsert) SetInbox(v string) *UserUpsert

SetInbox sets the "inbox" field.

func (*UserUpsert) SetIndexable

func (u *UserUpsert) SetIndexable(v bool) *UserUpsert

SetIndexable sets the "indexable" field.

func (*UserUpsert) SetIsRemote

func (u *UserUpsert) SetIsRemote(v bool) *UserUpsert

SetIsRemote sets the "isRemote" field.

func (*UserUpsert) SetOutbox

func (u *UserUpsert) SetOutbox(v string) *UserUpsert

SetOutbox sets the "outbox" field.

func (*UserUpsert) SetPasswordHash

func (u *UserUpsert) SetPasswordHash(v []byte) *UserUpsert

SetPasswordHash sets the "passwordHash" field.

func (*UserUpsert) SetPrivacyLevel

func (u *UserUpsert) SetPrivacyLevel(v user.PrivacyLevel) *UserUpsert

SetPrivacyLevel sets the "privacyLevel" field.

func (*UserUpsert) SetPrivateKey

func (u *UserUpsert) SetPrivateKey(v []byte) *UserUpsert

SetPrivateKey sets the "privateKey" field.

func (*UserUpsert) SetPublicKey

func (u *UserUpsert) SetPublicKey(v []byte) *UserUpsert

SetPublicKey sets the "publicKey" field.

func (*UserUpsert) SetPublicKeyActor

func (u *UserUpsert) SetPublicKeyActor(v string) *UserUpsert

SetPublicKeyActor sets the "publicKeyActor" field.

func (*UserUpsert) SetPublicKeyAlgorithm

func (u *UserUpsert) SetPublicKeyAlgorithm(v string) *UserUpsert

SetPublicKeyAlgorithm sets the "publicKeyAlgorithm" field.

func (*UserUpsert) SetURI

func (u *UserUpsert) SetURI(v string) *UserUpsert

SetURI sets the "uri" field.

func (*UserUpsert) SetUpdatedAt

func (u *UserUpsert) SetUpdatedAt(v time.Time) *UserUpsert

SetUpdatedAt sets the "updated_at" field.

func (*UserUpsert) SetUsername

func (u *UserUpsert) SetUsername(v string) *UserUpsert

SetUsername sets the "username" field.

func (*UserUpsert) UpdateBiography

func (u *UserUpsert) UpdateBiography() *UserUpsert

UpdateBiography sets the "biography" field to the value that was provided on create.

func (*UserUpsert) UpdateDisplayName

func (u *UserUpsert) UpdateDisplayName() *UserUpsert

UpdateDisplayName sets the "displayName" field to the value that was provided on create.

func (*UserUpsert) UpdateExtensions

func (u *UserUpsert) UpdateExtensions() *UserUpsert

UpdateExtensions sets the "extensions" field to the value that was provided on create.

func (*UserUpsert) UpdateFeatured

func (u *UserUpsert) UpdateFeatured() *UserUpsert

UpdateFeatured sets the "featured" field to the value that was provided on create.

func (*UserUpsert) UpdateFields

func (u *UserUpsert) UpdateFields() *UserUpsert

UpdateFields sets the "fields" field to the value that was provided on create.

func (*UserUpsert) UpdateFollowers

func (u *UserUpsert) UpdateFollowers() *UserUpsert

UpdateFollowers sets the "followers" field to the value that was provided on create.

func (*UserUpsert) UpdateFollowing

func (u *UserUpsert) UpdateFollowing() *UserUpsert

UpdateFollowing sets the "following" field to the value that was provided on create.

func (*UserUpsert) UpdateInbox

func (u *UserUpsert) UpdateInbox() *UserUpsert

UpdateInbox sets the "inbox" field to the value that was provided on create.

func (*UserUpsert) UpdateIndexable

func (u *UserUpsert) UpdateIndexable() *UserUpsert

UpdateIndexable sets the "indexable" field to the value that was provided on create.

func (*UserUpsert) UpdateIsRemote

func (u *UserUpsert) UpdateIsRemote() *UserUpsert

UpdateIsRemote sets the "isRemote" field to the value that was provided on create.

func (*UserUpsert) UpdateOutbox

func (u *UserUpsert) UpdateOutbox() *UserUpsert

UpdateOutbox sets the "outbox" field to the value that was provided on create.

func (*UserUpsert) UpdatePasswordHash

func (u *UserUpsert) UpdatePasswordHash() *UserUpsert

UpdatePasswordHash sets the "passwordHash" field to the value that was provided on create.

func (*UserUpsert) UpdatePrivacyLevel

func (u *UserUpsert) UpdatePrivacyLevel() *UserUpsert

UpdatePrivacyLevel sets the "privacyLevel" field to the value that was provided on create.

func (*UserUpsert) UpdatePrivateKey

func (u *UserUpsert) UpdatePrivateKey() *UserUpsert

UpdatePrivateKey sets the "privateKey" field to the value that was provided on create.

func (*UserUpsert) UpdatePublicKey

func (u *UserUpsert) UpdatePublicKey() *UserUpsert

UpdatePublicKey sets the "publicKey" field to the value that was provided on create.

func (*UserUpsert) UpdatePublicKeyActor

func (u *UserUpsert) UpdatePublicKeyActor() *UserUpsert

UpdatePublicKeyActor sets the "publicKeyActor" field to the value that was provided on create.

func (*UserUpsert) UpdatePublicKeyAlgorithm

func (u *UserUpsert) UpdatePublicKeyAlgorithm() *UserUpsert

UpdatePublicKeyAlgorithm sets the "publicKeyAlgorithm" field to the value that was provided on create.

func (*UserUpsert) UpdateURI

func (u *UserUpsert) UpdateURI() *UserUpsert

UpdateURI sets the "uri" field to the value that was provided on create.

func (*UserUpsert) UpdateUpdatedAt

func (u *UserUpsert) UpdateUpdatedAt() *UserUpsert

UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.

func (*UserUpsert) UpdateUsername

func (u *UserUpsert) UpdateUsername() *UserUpsert

UpdateUsername sets the "username" field to the value that was provided on create.

type UserUpsertBulk

type UserUpsertBulk struct {
	// contains filtered or unexported fields
}

UserUpsertBulk is the builder for "upsert"-ing a bulk of User nodes.

func (*UserUpsertBulk) ClearBiography

func (u *UserUpsertBulk) ClearBiography() *UserUpsertBulk

ClearBiography clears the value of the "biography" field.

func (*UserUpsertBulk) ClearDisplayName

func (u *UserUpsertBulk) ClearDisplayName() *UserUpsertBulk

ClearDisplayName clears the value of the "displayName" field.

func (*UserUpsertBulk) ClearPasswordHash

func (u *UserUpsertBulk) ClearPasswordHash() *UserUpsertBulk

ClearPasswordHash clears the value of the "passwordHash" field.

func (*UserUpsertBulk) ClearPrivateKey

func (u *UserUpsertBulk) ClearPrivateKey() *UserUpsertBulk

ClearPrivateKey clears the value of the "privateKey" field.

func (*UserUpsertBulk) DoNothing

func (u *UserUpsertBulk) DoNothing() *UserUpsertBulk

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*UserUpsertBulk) Exec

func (u *UserUpsertBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*UserUpsertBulk) ExecX

func (u *UserUpsertBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserUpsertBulk) Ignore

func (u *UserUpsertBulk) Ignore() *UserUpsertBulk

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.User.Create().
	OnConflict(sql.ResolveWithIgnore()).
	Exec(ctx)

func (*UserUpsertBulk) SetBiography

func (u *UserUpsertBulk) SetBiography(v string) *UserUpsertBulk

SetBiography sets the "biography" field.

func (*UserUpsertBulk) SetDisplayName

func (u *UserUpsertBulk) SetDisplayName(v string) *UserUpsertBulk

SetDisplayName sets the "displayName" field.

func (*UserUpsertBulk) SetExtensions

func (u *UserUpsertBulk) SetExtensions(v versia.Extensions) *UserUpsertBulk

SetExtensions sets the "extensions" field.

func (*UserUpsertBulk) SetFeatured

func (u *UserUpsertBulk) SetFeatured(v string) *UserUpsertBulk

SetFeatured sets the "featured" field.

func (*UserUpsertBulk) SetFields

func (u *UserUpsertBulk) SetFields(v []versia.UserField) *UserUpsertBulk

SetFields sets the "fields" field.

func (*UserUpsertBulk) SetFollowers

func (u *UserUpsertBulk) SetFollowers(v string) *UserUpsertBulk

SetFollowers sets the "followers" field.

func (*UserUpsertBulk) SetFollowing

func (u *UserUpsertBulk) SetFollowing(v string) *UserUpsertBulk

SetFollowing sets the "following" field.

func (*UserUpsertBulk) SetInbox

func (u *UserUpsertBulk) SetInbox(v string) *UserUpsertBulk

SetInbox sets the "inbox" field.

func (*UserUpsertBulk) SetIndexable

func (u *UserUpsertBulk) SetIndexable(v bool) *UserUpsertBulk

SetIndexable sets the "indexable" field.

func (*UserUpsertBulk) SetIsRemote

func (u *UserUpsertBulk) SetIsRemote(v bool) *UserUpsertBulk

SetIsRemote sets the "isRemote" field.

func (*UserUpsertBulk) SetOutbox

func (u *UserUpsertBulk) SetOutbox(v string) *UserUpsertBulk

SetOutbox sets the "outbox" field.

func (*UserUpsertBulk) SetPasswordHash

func (u *UserUpsertBulk) SetPasswordHash(v []byte) *UserUpsertBulk

SetPasswordHash sets the "passwordHash" field.

func (*UserUpsertBulk) SetPrivacyLevel

func (u *UserUpsertBulk) SetPrivacyLevel(v user.PrivacyLevel) *UserUpsertBulk

SetPrivacyLevel sets the "privacyLevel" field.

func (*UserUpsertBulk) SetPrivateKey

func (u *UserUpsertBulk) SetPrivateKey(v []byte) *UserUpsertBulk

SetPrivateKey sets the "privateKey" field.

func (*UserUpsertBulk) SetPublicKey

func (u *UserUpsertBulk) SetPublicKey(v []byte) *UserUpsertBulk

SetPublicKey sets the "publicKey" field.

func (*UserUpsertBulk) SetPublicKeyActor

func (u *UserUpsertBulk) SetPublicKeyActor(v string) *UserUpsertBulk

SetPublicKeyActor sets the "publicKeyActor" field.

func (*UserUpsertBulk) SetPublicKeyAlgorithm

func (u *UserUpsertBulk) SetPublicKeyAlgorithm(v string) *UserUpsertBulk

SetPublicKeyAlgorithm sets the "publicKeyAlgorithm" field.

func (*UserUpsertBulk) SetURI

func (u *UserUpsertBulk) SetURI(v string) *UserUpsertBulk

SetURI sets the "uri" field.

func (*UserUpsertBulk) SetUpdatedAt

func (u *UserUpsertBulk) SetUpdatedAt(v time.Time) *UserUpsertBulk

SetUpdatedAt sets the "updated_at" field.

func (*UserUpsertBulk) SetUsername

func (u *UserUpsertBulk) SetUsername(v string) *UserUpsertBulk

SetUsername sets the "username" field.

func (*UserUpsertBulk) Update

func (u *UserUpsertBulk) Update(set func(*UserUpsert)) *UserUpsertBulk

Update allows overriding fields `UPDATE` values. See the UserCreateBulk.OnConflict documentation for more info.

func (*UserUpsertBulk) UpdateBiography

func (u *UserUpsertBulk) UpdateBiography() *UserUpsertBulk

UpdateBiography sets the "biography" field to the value that was provided on create.

func (*UserUpsertBulk) UpdateDisplayName

func (u *UserUpsertBulk) UpdateDisplayName() *UserUpsertBulk

UpdateDisplayName sets the "displayName" field to the value that was provided on create.

func (*UserUpsertBulk) UpdateExtensions

func (u *UserUpsertBulk) UpdateExtensions() *UserUpsertBulk

UpdateExtensions sets the "extensions" field to the value that was provided on create.

func (*UserUpsertBulk) UpdateFeatured

func (u *UserUpsertBulk) UpdateFeatured() *UserUpsertBulk

UpdateFeatured sets the "featured" field to the value that was provided on create.

func (*UserUpsertBulk) UpdateFields

func (u *UserUpsertBulk) UpdateFields() *UserUpsertBulk

UpdateFields sets the "fields" field to the value that was provided on create.

func (*UserUpsertBulk) UpdateFollowers

func (u *UserUpsertBulk) UpdateFollowers() *UserUpsertBulk

UpdateFollowers sets the "followers" field to the value that was provided on create.

func (*UserUpsertBulk) UpdateFollowing

func (u *UserUpsertBulk) UpdateFollowing() *UserUpsertBulk

UpdateFollowing sets the "following" field to the value that was provided on create.

func (*UserUpsertBulk) UpdateInbox

func (u *UserUpsertBulk) UpdateInbox() *UserUpsertBulk

UpdateInbox sets the "inbox" field to the value that was provided on create.

func (*UserUpsertBulk) UpdateIndexable

func (u *UserUpsertBulk) UpdateIndexable() *UserUpsertBulk

UpdateIndexable sets the "indexable" field to the value that was provided on create.

func (*UserUpsertBulk) UpdateIsRemote

func (u *UserUpsertBulk) UpdateIsRemote() *UserUpsertBulk

UpdateIsRemote sets the "isRemote" field to the value that was provided on create.

func (*UserUpsertBulk) UpdateNewValues

func (u *UserUpsertBulk) UpdateNewValues() *UserUpsertBulk

UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:

client.User.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
		sql.ResolveWith(func(u *sql.UpdateSet) {
			u.SetIgnore(user.FieldID)
		}),
	).
	Exec(ctx)

func (*UserUpsertBulk) UpdateOutbox

func (u *UserUpsertBulk) UpdateOutbox() *UserUpsertBulk

UpdateOutbox sets the "outbox" field to the value that was provided on create.

func (*UserUpsertBulk) UpdatePasswordHash

func (u *UserUpsertBulk) UpdatePasswordHash() *UserUpsertBulk

UpdatePasswordHash sets the "passwordHash" field to the value that was provided on create.

func (*UserUpsertBulk) UpdatePrivacyLevel

func (u *UserUpsertBulk) UpdatePrivacyLevel() *UserUpsertBulk

UpdatePrivacyLevel sets the "privacyLevel" field to the value that was provided on create.

func (*UserUpsertBulk) UpdatePrivateKey

func (u *UserUpsertBulk) UpdatePrivateKey() *UserUpsertBulk

UpdatePrivateKey sets the "privateKey" field to the value that was provided on create.

func (*UserUpsertBulk) UpdatePublicKey

func (u *UserUpsertBulk) UpdatePublicKey() *UserUpsertBulk

UpdatePublicKey sets the "publicKey" field to the value that was provided on create.

func (*UserUpsertBulk) UpdatePublicKeyActor

func (u *UserUpsertBulk) UpdatePublicKeyActor() *UserUpsertBulk

UpdatePublicKeyActor sets the "publicKeyActor" field to the value that was provided on create.

func (*UserUpsertBulk) UpdatePublicKeyAlgorithm

func (u *UserUpsertBulk) UpdatePublicKeyAlgorithm() *UserUpsertBulk

UpdatePublicKeyAlgorithm sets the "publicKeyAlgorithm" field to the value that was provided on create.

func (*UserUpsertBulk) UpdateURI

func (u *UserUpsertBulk) UpdateURI() *UserUpsertBulk

UpdateURI sets the "uri" field to the value that was provided on create.

func (*UserUpsertBulk) UpdateUpdatedAt

func (u *UserUpsertBulk) UpdateUpdatedAt() *UserUpsertBulk

UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.

func (*UserUpsertBulk) UpdateUsername

func (u *UserUpsertBulk) UpdateUsername() *UserUpsertBulk

UpdateUsername sets the "username" field to the value that was provided on create.

type UserUpsertOne

type UserUpsertOne struct {
	// contains filtered or unexported fields
}

UserUpsertOne is the builder for "upsert"-ing

one User node.

func (*UserUpsertOne) ClearBiography

func (u *UserUpsertOne) ClearBiography() *UserUpsertOne

ClearBiography clears the value of the "biography" field.

func (*UserUpsertOne) ClearDisplayName

func (u *UserUpsertOne) ClearDisplayName() *UserUpsertOne

ClearDisplayName clears the value of the "displayName" field.

func (*UserUpsertOne) ClearPasswordHash

func (u *UserUpsertOne) ClearPasswordHash() *UserUpsertOne

ClearPasswordHash clears the value of the "passwordHash" field.

func (*UserUpsertOne) ClearPrivateKey

func (u *UserUpsertOne) ClearPrivateKey() *UserUpsertOne

ClearPrivateKey clears the value of the "privateKey" field.

func (*UserUpsertOne) DoNothing

func (u *UserUpsertOne) DoNothing() *UserUpsertOne

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*UserUpsertOne) Exec

func (u *UserUpsertOne) Exec(ctx context.Context) error

Exec executes the query.

func (*UserUpsertOne) ExecX

func (u *UserUpsertOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserUpsertOne) ID

func (u *UserUpsertOne) ID(ctx context.Context) (id uuid.UUID, err error)

Exec executes the UPSERT query and returns the inserted/updated ID.

func (*UserUpsertOne) IDX

func (u *UserUpsertOne) IDX(ctx context.Context) uuid.UUID

IDX is like ID, but panics if an error occurs.

func (*UserUpsertOne) Ignore

func (u *UserUpsertOne) Ignore() *UserUpsertOne

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.User.Create().
    OnConflict(sql.ResolveWithIgnore()).
    Exec(ctx)

func (*UserUpsertOne) SetBiography

func (u *UserUpsertOne) SetBiography(v string) *UserUpsertOne

SetBiography sets the "biography" field.

func (*UserUpsertOne) SetDisplayName

func (u *UserUpsertOne) SetDisplayName(v string) *UserUpsertOne

SetDisplayName sets the "displayName" field.

func (*UserUpsertOne) SetExtensions

func (u *UserUpsertOne) SetExtensions(v versia.Extensions) *UserUpsertOne

SetExtensions sets the "extensions" field.

func (*UserUpsertOne) SetFeatured

func (u *UserUpsertOne) SetFeatured(v string) *UserUpsertOne

SetFeatured sets the "featured" field.

func (*UserUpsertOne) SetFields

func (u *UserUpsertOne) SetFields(v []versia.UserField) *UserUpsertOne

SetFields sets the "fields" field.

func (*UserUpsertOne) SetFollowers

func (u *UserUpsertOne) SetFollowers(v string) *UserUpsertOne

SetFollowers sets the "followers" field.

func (*UserUpsertOne) SetFollowing

func (u *UserUpsertOne) SetFollowing(v string) *UserUpsertOne

SetFollowing sets the "following" field.

func (*UserUpsertOne) SetInbox

func (u *UserUpsertOne) SetInbox(v string) *UserUpsertOne

SetInbox sets the "inbox" field.

func (*UserUpsertOne) SetIndexable

func (u *UserUpsertOne) SetIndexable(v bool) *UserUpsertOne

SetIndexable sets the "indexable" field.

func (*UserUpsertOne) SetIsRemote

func (u *UserUpsertOne) SetIsRemote(v bool) *UserUpsertOne

SetIsRemote sets the "isRemote" field.

func (*UserUpsertOne) SetOutbox

func (u *UserUpsertOne) SetOutbox(v string) *UserUpsertOne

SetOutbox sets the "outbox" field.

func (*UserUpsertOne) SetPasswordHash

func (u *UserUpsertOne) SetPasswordHash(v []byte) *UserUpsertOne

SetPasswordHash sets the "passwordHash" field.

func (*UserUpsertOne) SetPrivacyLevel

func (u *UserUpsertOne) SetPrivacyLevel(v user.PrivacyLevel) *UserUpsertOne

SetPrivacyLevel sets the "privacyLevel" field.

func (*UserUpsertOne) SetPrivateKey

func (u *UserUpsertOne) SetPrivateKey(v []byte) *UserUpsertOne

SetPrivateKey sets the "privateKey" field.

func (*UserUpsertOne) SetPublicKey

func (u *UserUpsertOne) SetPublicKey(v []byte) *UserUpsertOne

SetPublicKey sets the "publicKey" field.

func (*UserUpsertOne) SetPublicKeyActor

func (u *UserUpsertOne) SetPublicKeyActor(v string) *UserUpsertOne

SetPublicKeyActor sets the "publicKeyActor" field.

func (*UserUpsertOne) SetPublicKeyAlgorithm

func (u *UserUpsertOne) SetPublicKeyAlgorithm(v string) *UserUpsertOne

SetPublicKeyAlgorithm sets the "publicKeyAlgorithm" field.

func (*UserUpsertOne) SetURI

func (u *UserUpsertOne) SetURI(v string) *UserUpsertOne

SetURI sets the "uri" field.

func (*UserUpsertOne) SetUpdatedAt

func (u *UserUpsertOne) SetUpdatedAt(v time.Time) *UserUpsertOne

SetUpdatedAt sets the "updated_at" field.

func (*UserUpsertOne) SetUsername

func (u *UserUpsertOne) SetUsername(v string) *UserUpsertOne

SetUsername sets the "username" field.

func (*UserUpsertOne) Update

func (u *UserUpsertOne) Update(set func(*UserUpsert)) *UserUpsertOne

Update allows overriding fields `UPDATE` values. See the UserCreate.OnConflict documentation for more info.

func (*UserUpsertOne) UpdateBiography

func (u *UserUpsertOne) UpdateBiography() *UserUpsertOne

UpdateBiography sets the "biography" field to the value that was provided on create.

func (*UserUpsertOne) UpdateDisplayName

func (u *UserUpsertOne) UpdateDisplayName() *UserUpsertOne

UpdateDisplayName sets the "displayName" field to the value that was provided on create.

func (*UserUpsertOne) UpdateExtensions

func (u *UserUpsertOne) UpdateExtensions() *UserUpsertOne

UpdateExtensions sets the "extensions" field to the value that was provided on create.

func (*UserUpsertOne) UpdateFeatured

func (u *UserUpsertOne) UpdateFeatured() *UserUpsertOne

UpdateFeatured sets the "featured" field to the value that was provided on create.

func (*UserUpsertOne) UpdateFields

func (u *UserUpsertOne) UpdateFields() *UserUpsertOne

UpdateFields sets the "fields" field to the value that was provided on create.

func (*UserUpsertOne) UpdateFollowers

func (u *UserUpsertOne) UpdateFollowers() *UserUpsertOne

UpdateFollowers sets the "followers" field to the value that was provided on create.

func (*UserUpsertOne) UpdateFollowing

func (u *UserUpsertOne) UpdateFollowing() *UserUpsertOne

UpdateFollowing sets the "following" field to the value that was provided on create.

func (*UserUpsertOne) UpdateInbox

func (u *UserUpsertOne) UpdateInbox() *UserUpsertOne

UpdateInbox sets the "inbox" field to the value that was provided on create.

func (*UserUpsertOne) UpdateIndexable

func (u *UserUpsertOne) UpdateIndexable() *UserUpsertOne

UpdateIndexable sets the "indexable" field to the value that was provided on create.

func (*UserUpsertOne) UpdateIsRemote

func (u *UserUpsertOne) UpdateIsRemote() *UserUpsertOne

UpdateIsRemote sets the "isRemote" field to the value that was provided on create.

func (*UserUpsertOne) UpdateNewValues

func (u *UserUpsertOne) UpdateNewValues() *UserUpsertOne

UpdateNewValues updates the mutable fields using the new values that were set on create except the ID field. Using this option is equivalent to using:

client.User.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
		sql.ResolveWith(func(u *sql.UpdateSet) {
			u.SetIgnore(user.FieldID)
		}),
	).
	Exec(ctx)

func (*UserUpsertOne) UpdateOutbox

func (u *UserUpsertOne) UpdateOutbox() *UserUpsertOne

UpdateOutbox sets the "outbox" field to the value that was provided on create.

func (*UserUpsertOne) UpdatePasswordHash

func (u *UserUpsertOne) UpdatePasswordHash() *UserUpsertOne

UpdatePasswordHash sets the "passwordHash" field to the value that was provided on create.

func (*UserUpsertOne) UpdatePrivacyLevel

func (u *UserUpsertOne) UpdatePrivacyLevel() *UserUpsertOne

UpdatePrivacyLevel sets the "privacyLevel" field to the value that was provided on create.

func (*UserUpsertOne) UpdatePrivateKey

func (u *UserUpsertOne) UpdatePrivateKey() *UserUpsertOne

UpdatePrivateKey sets the "privateKey" field to the value that was provided on create.

func (*UserUpsertOne) UpdatePublicKey

func (u *UserUpsertOne) UpdatePublicKey() *UserUpsertOne

UpdatePublicKey sets the "publicKey" field to the value that was provided on create.

func (*UserUpsertOne) UpdatePublicKeyActor

func (u *UserUpsertOne) UpdatePublicKeyActor() *UserUpsertOne

UpdatePublicKeyActor sets the "publicKeyActor" field to the value that was provided on create.

func (*UserUpsertOne) UpdatePublicKeyAlgorithm

func (u *UserUpsertOne) UpdatePublicKeyAlgorithm() *UserUpsertOne

UpdatePublicKeyAlgorithm sets the "publicKeyAlgorithm" field to the value that was provided on create.

func (*UserUpsertOne) UpdateURI

func (u *UserUpsertOne) UpdateURI() *UserUpsertOne

UpdateURI sets the "uri" field to the value that was provided on create.

func (*UserUpsertOne) UpdateUpdatedAt

func (u *UserUpsertOne) UpdateUpdatedAt() *UserUpsertOne

UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.

func (*UserUpsertOne) UpdateUsername

func (u *UserUpsertOne) UpdateUsername() *UserUpsertOne

UpdateUsername sets the "username" field to the value that was provided on create.

type Users

type Users []*User

Users is a parsable slice of User.

type ValidationError

type ValidationError struct {
	Name string // Field or edge name.
	// contains filtered or unexported fields
}

ValidationError returns when validating a field or edge fails.

func (*ValidationError) Error

func (e *ValidationError) Error() string

Error implements the error interface.

func (*ValidationError) Unwrap

func (e *ValidationError) Unwrap() error

Unwrap implements the errors.Wrapper interface.

type Value

type Value = ent.Value

ent aliases to avoid import conflicts in user's code.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL