ent

package
v0.0.0-...-06a3cf6 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2025 License: AGPL-3.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

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

	// Node types.
	TypeActivity = "Activity"
	TypeFeed     = "Feed"
	TypeSource   = "Source"
)

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 Activities

type Activities []*Activity

Activities is a parsable slice of Activity.

type Activity

type Activity struct {

	// ID of the ent.
	ID string `json:"id,omitempty"`
	// UID holds the value of the "uid" field.
	UID string `json:"uid,omitempty"`
	// SourceUids holds the value of the "source_uids" field.
	SourceUids []string `json:"source_uids,omitempty"`
	// SourceType holds the value of the "source_type" field.
	SourceType string `json:"source_type,omitempty"`
	// Title holds the value of the "title" field.
	Title string `json:"title,omitempty"`
	// Body holds the value of the "body" field.
	Body string `json:"body,omitempty"`
	// URL holds the value of the "url" field.
	URL string `json:"url,omitempty"`
	// ImageURL holds the value of the "image_url" field.
	ImageURL string `json:"image_url,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// ShortSummary holds the value of the "short_summary" field.
	ShortSummary string `json:"short_summary,omitempty"`
	// FullSummary holds the value of the "full_summary" field.
	FullSummary string `json:"full_summary,omitempty"`
	// RawJSON holds the value of the "raw_json" field.
	RawJSON string `json:"raw_json,omitempty"`
	// Embedding1536 holds the value of the "embedding_1536" field.
	Embedding1536 *pgvector.Vector `json:"embedding_1536,omitempty"`
	// Embedding3072 holds the value of the "embedding_3072" field.
	Embedding3072 *pgvector.Vector `json:"embedding_3072,omitempty"`
	// SocialScore holds the value of the "social_score" field.
	SocialScore float64 `json:"social_score,omitempty"`
	// UpdateCount holds the value of the "update_count" field.
	UpdateCount int `json:"update_count,omitempty"`
	// contains filtered or unexported fields
}

Activity is the model entity for the Activity schema.

func (*Activity) String

func (a *Activity) String() string

String implements the fmt.Stringer.

func (*Activity) Unwrap

func (a *Activity) Unwrap() *Activity

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

func (a *Activity) Update() *ActivityUpdateOne

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

func (*Activity) Value

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

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

type ActivityClient

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

ActivityClient is a client for the Activity schema.

func NewActivityClient

func NewActivityClient(c config) *ActivityClient

NewActivityClient returns a client for the Activity from the given config.

func (*ActivityClient) Create

func (c *ActivityClient) Create() *ActivityCreate

Create returns a builder for creating a Activity entity.

func (*ActivityClient) CreateBulk

func (c *ActivityClient) CreateBulk(builders ...*ActivityCreate) *ActivityCreateBulk

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

func (*ActivityClient) Delete

func (c *ActivityClient) Delete() *ActivityDelete

Delete returns a delete builder for Activity.

func (*ActivityClient) DeleteOne

func (c *ActivityClient) DeleteOne(a *Activity) *ActivityDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*ActivityClient) DeleteOneID

func (c *ActivityClient) DeleteOneID(id string) *ActivityDeleteOne

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

func (*ActivityClient) Get

func (c *ActivityClient) Get(ctx context.Context, id string) (*Activity, error)

Get returns a Activity entity by its id.

func (*ActivityClient) GetX

func (c *ActivityClient) GetX(ctx context.Context, id string) *Activity

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

func (*ActivityClient) Hooks

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

Hooks returns the client hooks.

func (*ActivityClient) Intercept

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

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

func (*ActivityClient) Interceptors

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

Interceptors returns the client interceptors.

func (*ActivityClient) MapCreateBulk

func (c *ActivityClient) MapCreateBulk(slice any, setFunc func(*ActivityCreate, int)) *ActivityCreateBulk

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 (*ActivityClient) Query

func (c *ActivityClient) Query() *ActivityQuery

Query returns a query builder for Activity.

func (*ActivityClient) Update

func (c *ActivityClient) Update() *ActivityUpdate

Update returns an update builder for Activity.

func (*ActivityClient) UpdateOne

func (c *ActivityClient) UpdateOne(a *Activity) *ActivityUpdateOne

UpdateOne returns an update builder for the given entity.

func (*ActivityClient) UpdateOneID

func (c *ActivityClient) UpdateOneID(id string) *ActivityUpdateOne

UpdateOneID returns an update builder for the given id.

func (*ActivityClient) Use

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

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

type ActivityCreate

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

ActivityCreate is the builder for creating a Activity entity.

func (*ActivityCreate) Exec

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

Exec executes the query.

func (*ActivityCreate) ExecX

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

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

func (*ActivityCreate) Mutation

func (ac *ActivityCreate) Mutation() *ActivityMutation

Mutation returns the ActivityMutation object of the builder.

func (*ActivityCreate) OnConflict

func (ac *ActivityCreate) OnConflict(opts ...sql.ConflictOption) *ActivityUpsertOne

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

client.Activity.Create().
	SetUID(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.ActivityUpsert) {
		SetUID(v+v).
	}).
	Exec(ctx)

func (*ActivityCreate) OnConflictColumns

func (ac *ActivityCreate) OnConflictColumns(columns ...string) *ActivityUpsertOne

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

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

func (*ActivityCreate) Save

func (ac *ActivityCreate) Save(ctx context.Context) (*Activity, error)

Save creates the Activity in the database.

func (*ActivityCreate) SaveX

func (ac *ActivityCreate) SaveX(ctx context.Context) *Activity

SaveX calls Save and panics if Save returns an error.

func (*ActivityCreate) SetBody

func (ac *ActivityCreate) SetBody(s string) *ActivityCreate

SetBody sets the "body" field.

func (*ActivityCreate) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*ActivityCreate) SetEmbedding1536

func (ac *ActivityCreate) SetEmbedding1536(pg pgvector.Vector) *ActivityCreate

SetEmbedding1536 sets the "embedding_1536" field.

func (*ActivityCreate) SetEmbedding3072

func (ac *ActivityCreate) SetEmbedding3072(pg pgvector.Vector) *ActivityCreate

SetEmbedding3072 sets the "embedding_3072" field.

func (*ActivityCreate) SetFullSummary

func (ac *ActivityCreate) SetFullSummary(s string) *ActivityCreate

SetFullSummary sets the "full_summary" field.

func (*ActivityCreate) SetID

func (ac *ActivityCreate) SetID(s string) *ActivityCreate

SetID sets the "id" field.

func (*ActivityCreate) SetImageURL

func (ac *ActivityCreate) SetImageURL(s string) *ActivityCreate

SetImageURL sets the "image_url" field.

func (*ActivityCreate) SetNillableEmbedding1536

func (ac *ActivityCreate) SetNillableEmbedding1536(pg *pgvector.Vector) *ActivityCreate

SetNillableEmbedding1536 sets the "embedding_1536" field if the given value is not nil.

func (*ActivityCreate) SetNillableEmbedding3072

func (ac *ActivityCreate) SetNillableEmbedding3072(pg *pgvector.Vector) *ActivityCreate

SetNillableEmbedding3072 sets the "embedding_3072" field if the given value is not nil.

func (*ActivityCreate) SetNillableSocialScore

func (ac *ActivityCreate) SetNillableSocialScore(f *float64) *ActivityCreate

SetNillableSocialScore sets the "social_score" field if the given value is not nil.

func (*ActivityCreate) SetNillableUpdateCount

func (ac *ActivityCreate) SetNillableUpdateCount(i *int) *ActivityCreate

SetNillableUpdateCount sets the "update_count" field if the given value is not nil.

func (*ActivityCreate) SetRawJSON

func (ac *ActivityCreate) SetRawJSON(s string) *ActivityCreate

SetRawJSON sets the "raw_json" field.

func (*ActivityCreate) SetShortSummary

func (ac *ActivityCreate) SetShortSummary(s string) *ActivityCreate

SetShortSummary sets the "short_summary" field.

func (*ActivityCreate) SetSocialScore

func (ac *ActivityCreate) SetSocialScore(f float64) *ActivityCreate

SetSocialScore sets the "social_score" field.

func (*ActivityCreate) SetSourceType

func (ac *ActivityCreate) SetSourceType(s string) *ActivityCreate

SetSourceType sets the "source_type" field.

func (*ActivityCreate) SetSourceUids

func (ac *ActivityCreate) SetSourceUids(s []string) *ActivityCreate

SetSourceUids sets the "source_uids" field.

func (*ActivityCreate) SetTitle

func (ac *ActivityCreate) SetTitle(s string) *ActivityCreate

SetTitle sets the "title" field.

func (*ActivityCreate) SetUID

func (ac *ActivityCreate) SetUID(s string) *ActivityCreate

SetUID sets the "uid" field.

func (*ActivityCreate) SetURL

func (ac *ActivityCreate) SetURL(s string) *ActivityCreate

SetURL sets the "url" field.

func (*ActivityCreate) SetUpdateCount

func (ac *ActivityCreate) SetUpdateCount(i int) *ActivityCreate

SetUpdateCount sets the "update_count" field.

type ActivityCreateBulk

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

ActivityCreateBulk is the builder for creating many Activity entities in bulk.

func (*ActivityCreateBulk) Exec

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

Exec executes the query.

func (*ActivityCreateBulk) ExecX

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

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

func (*ActivityCreateBulk) OnConflict

func (acb *ActivityCreateBulk) OnConflict(opts ...sql.ConflictOption) *ActivityUpsertBulk

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

client.Activity.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.ActivityUpsert) {
		SetUID(v+v).
	}).
	Exec(ctx)

func (*ActivityCreateBulk) OnConflictColumns

func (acb *ActivityCreateBulk) OnConflictColumns(columns ...string) *ActivityUpsertBulk

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

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

func (*ActivityCreateBulk) Save

func (acb *ActivityCreateBulk) Save(ctx context.Context) ([]*Activity, error)

Save creates the Activity entities in the database.

func (*ActivityCreateBulk) SaveX

func (acb *ActivityCreateBulk) SaveX(ctx context.Context) []*Activity

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

type ActivityDelete

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

ActivityDelete is the builder for deleting a Activity entity.

func (*ActivityDelete) Exec

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

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

func (*ActivityDelete) ExecX

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

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

func (*ActivityDelete) Where

func (ad *ActivityDelete) Where(ps ...predicate.Activity) *ActivityDelete

Where appends a list predicates to the ActivityDelete builder.

type ActivityDeleteOne

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

ActivityDeleteOne is the builder for deleting a single Activity entity.

func (*ActivityDeleteOne) Exec

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

Exec executes the deletion query.

func (*ActivityDeleteOne) ExecX

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

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

func (*ActivityDeleteOne) Where

Where appends a list predicates to the ActivityDelete builder.

type ActivityGroupBy

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

ActivityGroupBy is the group-by builder for Activity entities.

func (*ActivityGroupBy) Aggregate

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

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

func (*ActivityGroupBy) Bool

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

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

func (*ActivityGroupBy) BoolX

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

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

func (*ActivityGroupBy) Bools

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

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

func (*ActivityGroupBy) BoolsX

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

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

func (*ActivityGroupBy) Float64

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

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

func (*ActivityGroupBy) Float64X

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

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

func (*ActivityGroupBy) Float64s

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

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

func (*ActivityGroupBy) Float64sX

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

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

func (*ActivityGroupBy) Int

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

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

func (*ActivityGroupBy) IntX

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

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

func (*ActivityGroupBy) Ints

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

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

func (*ActivityGroupBy) IntsX

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

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

func (*ActivityGroupBy) Scan

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

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

func (*ActivityGroupBy) ScanX

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

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

func (*ActivityGroupBy) String

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

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

func (*ActivityGroupBy) StringX

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

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

func (*ActivityGroupBy) Strings

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

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

func (*ActivityGroupBy) StringsX

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

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

type ActivityMutation

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

ActivityMutation represents an operation that mutates the Activity nodes in the graph.

func (*ActivityMutation) AddField

func (m *ActivityMutation) 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 (*ActivityMutation) AddSocialScore

func (m *ActivityMutation) AddSocialScore(f float64)

AddSocialScore adds f to the "social_score" field.

func (*ActivityMutation) AddUpdateCount

func (m *ActivityMutation) AddUpdateCount(i int)

AddUpdateCount adds i to the "update_count" field.

func (*ActivityMutation) AddedEdges

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

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

func (*ActivityMutation) AddedField

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

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

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

func (*ActivityMutation) AddedIDs

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

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

func (*ActivityMutation) AddedSocialScore

func (m *ActivityMutation) AddedSocialScore() (r float64, exists bool)

AddedSocialScore returns the value that was added to the "social_score" field in this mutation.

func (*ActivityMutation) AddedUpdateCount

func (m *ActivityMutation) AddedUpdateCount() (r int, exists bool)

AddedUpdateCount returns the value that was added to the "update_count" field in this mutation.

func (*ActivityMutation) AppendSourceUids

func (m *ActivityMutation) AppendSourceUids(s []string)

AppendSourceUids adds s to the "source_uids" field.

func (*ActivityMutation) AppendedSourceUids

func (m *ActivityMutation) AppendedSourceUids() ([]string, bool)

AppendedSourceUids returns the list of values that were appended to the "source_uids" field in this mutation.

func (*ActivityMutation) Body

func (m *ActivityMutation) Body() (r string, exists bool)

Body returns the value of the "body" field in the mutation.

func (*ActivityMutation) ClearEdge

func (m *ActivityMutation) 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 (*ActivityMutation) ClearEmbedding1536

func (m *ActivityMutation) ClearEmbedding1536()

ClearEmbedding1536 clears the value of the "embedding_1536" field.

func (*ActivityMutation) ClearEmbedding3072

func (m *ActivityMutation) ClearEmbedding3072()

ClearEmbedding3072 clears the value of the "embedding_3072" field.

func (*ActivityMutation) ClearField

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

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

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

func (*ActivityMutation) ClearedFields

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

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

func (ActivityMutation) Client

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

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

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

func (*ActivityMutation) EdgeCleared

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

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

func (*ActivityMutation) Embedding1536

func (m *ActivityMutation) Embedding1536() (r pgvector.Vector, exists bool)

Embedding1536 returns the value of the "embedding_1536" field in the mutation.

func (*ActivityMutation) Embedding1536Cleared

func (m *ActivityMutation) Embedding1536Cleared() bool

Embedding1536Cleared returns if the "embedding_1536" field was cleared in this mutation.

func (*ActivityMutation) Embedding3072

func (m *ActivityMutation) Embedding3072() (r pgvector.Vector, exists bool)

Embedding3072 returns the value of the "embedding_3072" field in the mutation.

func (*ActivityMutation) Embedding3072Cleared

func (m *ActivityMutation) Embedding3072Cleared() bool

Embedding3072Cleared returns if the "embedding_3072" field was cleared in this mutation.

func (*ActivityMutation) Field

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

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

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

func (*ActivityMutation) Fields

func (m *ActivityMutation) 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 (*ActivityMutation) FullSummary

func (m *ActivityMutation) FullSummary() (r string, exists bool)

FullSummary returns the value of the "full_summary" field in the mutation.

func (*ActivityMutation) ID

func (m *ActivityMutation) ID() (id string, 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 (*ActivityMutation) IDs

func (m *ActivityMutation) IDs(ctx context.Context) ([]string, 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 (*ActivityMutation) ImageURL

func (m *ActivityMutation) ImageURL() (r string, exists bool)

ImageURL returns the value of the "image_url" field in the mutation.

func (*ActivityMutation) OldBody

func (m *ActivityMutation) OldBody(ctx context.Context) (v string, err error)

OldBody returns the old "body" field's value of the Activity entity. If the Activity 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 (*ActivityMutation) OldCreatedAt

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

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

func (m *ActivityMutation) OldEmbedding1536(ctx context.Context) (v *pgvector.Vector, err error)

OldEmbedding1536 returns the old "embedding_1536" field's value of the Activity entity. If the Activity 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 (*ActivityMutation) OldEmbedding3072

func (m *ActivityMutation) OldEmbedding3072(ctx context.Context) (v *pgvector.Vector, err error)

OldEmbedding3072 returns the old "embedding_3072" field's value of the Activity entity. If the Activity 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 (*ActivityMutation) OldField

func (m *ActivityMutation) 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 (*ActivityMutation) OldFullSummary

func (m *ActivityMutation) OldFullSummary(ctx context.Context) (v string, err error)

OldFullSummary returns the old "full_summary" field's value of the Activity entity. If the Activity 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 (*ActivityMutation) OldImageURL

func (m *ActivityMutation) OldImageURL(ctx context.Context) (v string, err error)

OldImageURL returns the old "image_url" field's value of the Activity entity. If the Activity 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 (*ActivityMutation) OldRawJSON

func (m *ActivityMutation) OldRawJSON(ctx context.Context) (v string, err error)

OldRawJSON returns the old "raw_json" field's value of the Activity entity. If the Activity 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 (*ActivityMutation) OldShortSummary

func (m *ActivityMutation) OldShortSummary(ctx context.Context) (v string, err error)

OldShortSummary returns the old "short_summary" field's value of the Activity entity. If the Activity 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 (*ActivityMutation) OldSocialScore

func (m *ActivityMutation) OldSocialScore(ctx context.Context) (v float64, err error)

OldSocialScore returns the old "social_score" field's value of the Activity entity. If the Activity 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 (*ActivityMutation) OldSourceType

func (m *ActivityMutation) OldSourceType(ctx context.Context) (v string, err error)

OldSourceType returns the old "source_type" field's value of the Activity entity. If the Activity 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 (*ActivityMutation) OldSourceUids

func (m *ActivityMutation) OldSourceUids(ctx context.Context) (v []string, err error)

OldSourceUids returns the old "source_uids" field's value of the Activity entity. If the Activity 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 (*ActivityMutation) OldTitle

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

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

func (m *ActivityMutation) OldUID(ctx context.Context) (v string, err error)

OldUID returns the old "uid" field's value of the Activity entity. If the Activity 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 (*ActivityMutation) OldURL

func (m *ActivityMutation) OldURL(ctx context.Context) (v string, err error)

OldURL returns the old "url" field's value of the Activity entity. If the Activity 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 (*ActivityMutation) OldUpdateCount

func (m *ActivityMutation) OldUpdateCount(ctx context.Context) (v int, err error)

OldUpdateCount returns the old "update_count" field's value of the Activity entity. If the Activity 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 (*ActivityMutation) Op

func (m *ActivityMutation) Op() Op

Op returns the operation name.

func (*ActivityMutation) RawJSON

func (m *ActivityMutation) RawJSON() (r string, exists bool)

RawJSON returns the value of the "raw_json" field in the mutation.

func (*ActivityMutation) RemovedEdges

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

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

func (*ActivityMutation) RemovedIDs

func (m *ActivityMutation) 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 (*ActivityMutation) ResetBody

func (m *ActivityMutation) ResetBody()

ResetBody resets all changes to the "body" field.

func (*ActivityMutation) ResetCreatedAt

func (m *ActivityMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*ActivityMutation) ResetEdge

func (m *ActivityMutation) 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 (*ActivityMutation) ResetEmbedding1536

func (m *ActivityMutation) ResetEmbedding1536()

ResetEmbedding1536 resets all changes to the "embedding_1536" field.

func (*ActivityMutation) ResetEmbedding3072

func (m *ActivityMutation) ResetEmbedding3072()

ResetEmbedding3072 resets all changes to the "embedding_3072" field.

func (*ActivityMutation) ResetField

func (m *ActivityMutation) 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 (*ActivityMutation) ResetFullSummary

func (m *ActivityMutation) ResetFullSummary()

ResetFullSummary resets all changes to the "full_summary" field.

func (*ActivityMutation) ResetImageURL

func (m *ActivityMutation) ResetImageURL()

ResetImageURL resets all changes to the "image_url" field.

func (*ActivityMutation) ResetRawJSON

func (m *ActivityMutation) ResetRawJSON()

ResetRawJSON resets all changes to the "raw_json" field.

func (*ActivityMutation) ResetShortSummary

func (m *ActivityMutation) ResetShortSummary()

ResetShortSummary resets all changes to the "short_summary" field.

func (*ActivityMutation) ResetSocialScore

func (m *ActivityMutation) ResetSocialScore()

ResetSocialScore resets all changes to the "social_score" field.

func (*ActivityMutation) ResetSourceType

func (m *ActivityMutation) ResetSourceType()

ResetSourceType resets all changes to the "source_type" field.

func (*ActivityMutation) ResetSourceUids

func (m *ActivityMutation) ResetSourceUids()

ResetSourceUids resets all changes to the "source_uids" field.

func (*ActivityMutation) ResetTitle

func (m *ActivityMutation) ResetTitle()

ResetTitle resets all changes to the "title" field.

func (*ActivityMutation) ResetUID

func (m *ActivityMutation) ResetUID()

ResetUID resets all changes to the "uid" field.

func (*ActivityMutation) ResetURL

func (m *ActivityMutation) ResetURL()

ResetURL resets all changes to the "url" field.

func (*ActivityMutation) ResetUpdateCount

func (m *ActivityMutation) ResetUpdateCount()

ResetUpdateCount resets all changes to the "update_count" field.

func (*ActivityMutation) SetBody

func (m *ActivityMutation) SetBody(s string)

SetBody sets the "body" field.

func (*ActivityMutation) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*ActivityMutation) SetEmbedding1536

func (m *ActivityMutation) SetEmbedding1536(pg pgvector.Vector)

SetEmbedding1536 sets the "embedding_1536" field.

func (*ActivityMutation) SetEmbedding3072

func (m *ActivityMutation) SetEmbedding3072(pg pgvector.Vector)

SetEmbedding3072 sets the "embedding_3072" field.

func (*ActivityMutation) SetField

func (m *ActivityMutation) 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 (*ActivityMutation) SetFullSummary

func (m *ActivityMutation) SetFullSummary(s string)

SetFullSummary sets the "full_summary" field.

func (*ActivityMutation) SetID

func (m *ActivityMutation) SetID(id string)

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

func (*ActivityMutation) SetImageURL

func (m *ActivityMutation) SetImageURL(s string)

SetImageURL sets the "image_url" field.

func (*ActivityMutation) SetOp

func (m *ActivityMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*ActivityMutation) SetRawJSON

func (m *ActivityMutation) SetRawJSON(s string)

SetRawJSON sets the "raw_json" field.

func (*ActivityMutation) SetShortSummary

func (m *ActivityMutation) SetShortSummary(s string)

SetShortSummary sets the "short_summary" field.

func (*ActivityMutation) SetSocialScore

func (m *ActivityMutation) SetSocialScore(f float64)

SetSocialScore sets the "social_score" field.

func (*ActivityMutation) SetSourceType

func (m *ActivityMutation) SetSourceType(s string)

SetSourceType sets the "source_type" field.

func (*ActivityMutation) SetSourceUids

func (m *ActivityMutation) SetSourceUids(s []string)

SetSourceUids sets the "source_uids" field.

func (*ActivityMutation) SetTitle

func (m *ActivityMutation) SetTitle(s string)

SetTitle sets the "title" field.

func (*ActivityMutation) SetUID

func (m *ActivityMutation) SetUID(s string)

SetUID sets the "uid" field.

func (*ActivityMutation) SetURL

func (m *ActivityMutation) SetURL(s string)

SetURL sets the "url" field.

func (*ActivityMutation) SetUpdateCount

func (m *ActivityMutation) SetUpdateCount(i int)

SetUpdateCount sets the "update_count" field.

func (*ActivityMutation) ShortSummary

func (m *ActivityMutation) ShortSummary() (r string, exists bool)

ShortSummary returns the value of the "short_summary" field in the mutation.

func (*ActivityMutation) SocialScore

func (m *ActivityMutation) SocialScore() (r float64, exists bool)

SocialScore returns the value of the "social_score" field in the mutation.

func (*ActivityMutation) SourceType

func (m *ActivityMutation) SourceType() (r string, exists bool)

SourceType returns the value of the "source_type" field in the mutation.

func (*ActivityMutation) SourceUids

func (m *ActivityMutation) SourceUids() (r []string, exists bool)

SourceUids returns the value of the "source_uids" field in the mutation.

func (*ActivityMutation) Title

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

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

func (ActivityMutation) Tx

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

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

func (*ActivityMutation) Type

func (m *ActivityMutation) Type() string

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

func (*ActivityMutation) UID

func (m *ActivityMutation) UID() (r string, exists bool)

UID returns the value of the "uid" field in the mutation.

func (*ActivityMutation) URL

func (m *ActivityMutation) URL() (r string, exists bool)

URL returns the value of the "url" field in the mutation.

func (*ActivityMutation) UpdateCount

func (m *ActivityMutation) UpdateCount() (r int, exists bool)

UpdateCount returns the value of the "update_count" field in the mutation.

func (*ActivityMutation) Where

func (m *ActivityMutation) Where(ps ...predicate.Activity)

Where appends a list predicates to the ActivityMutation builder.

func (*ActivityMutation) WhereP

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

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

type ActivityQuery

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

ActivityQuery is the builder for querying Activity entities.

func (*ActivityQuery) Aggregate

func (aq *ActivityQuery) Aggregate(fns ...AggregateFunc) *ActivitySelect

Aggregate returns a ActivitySelect configured with the given aggregations.

func (*ActivityQuery) All

func (aq *ActivityQuery) All(ctx context.Context) ([]*Activity, error)

All executes the query and returns a list of Activities.

func (*ActivityQuery) AllX

func (aq *ActivityQuery) AllX(ctx context.Context) []*Activity

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

func (*ActivityQuery) Clone

func (aq *ActivityQuery) Clone() *ActivityQuery

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

func (*ActivityQuery) Count

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

Count returns the count of the given query.

func (*ActivityQuery) CountX

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

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

func (*ActivityQuery) Exist

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

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

func (*ActivityQuery) ExistX

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

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

func (*ActivityQuery) First

func (aq *ActivityQuery) First(ctx context.Context) (*Activity, error)

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

func (*ActivityQuery) FirstID

func (aq *ActivityQuery) FirstID(ctx context.Context) (id string, err error)

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

func (*ActivityQuery) FirstIDX

func (aq *ActivityQuery) FirstIDX(ctx context.Context) string

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

func (*ActivityQuery) FirstX

func (aq *ActivityQuery) FirstX(ctx context.Context) *Activity

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

func (*ActivityQuery) GroupBy

func (aq *ActivityQuery) GroupBy(field string, fields ...string) *ActivityGroupBy

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

client.Activity.Query().
	GroupBy(activity.FieldUID).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*ActivityQuery) IDs

func (aq *ActivityQuery) IDs(ctx context.Context) (ids []string, err error)

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

func (*ActivityQuery) IDsX

func (aq *ActivityQuery) IDsX(ctx context.Context) []string

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

func (*ActivityQuery) Limit

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

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

func (*ActivityQuery) Offset

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

Offset to start from.

func (*ActivityQuery) Only

func (aq *ActivityQuery) Only(ctx context.Context) (*Activity, error)

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

func (*ActivityQuery) OnlyID

func (aq *ActivityQuery) OnlyID(ctx context.Context) (id string, err error)

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

func (*ActivityQuery) OnlyIDX

func (aq *ActivityQuery) OnlyIDX(ctx context.Context) string

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

func (*ActivityQuery) OnlyX

func (aq *ActivityQuery) OnlyX(ctx context.Context) *Activity

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

func (*ActivityQuery) Order

Order specifies how the records should be ordered.

func (*ActivityQuery) Select

func (aq *ActivityQuery) Select(fields ...string) *ActivitySelect

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

client.Activity.Query().
	Select(activity.FieldUID).
	Scan(ctx, &v)

func (*ActivityQuery) Unique

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

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

func (aq *ActivityQuery) Where(ps ...predicate.Activity) *ActivityQuery

Where adds a new predicate for the ActivityQuery builder.

type ActivitySelect

type ActivitySelect struct {
	*ActivityQuery
	// contains filtered or unexported fields
}

ActivitySelect is the builder for selecting fields of Activity entities.

func (*ActivitySelect) Aggregate

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

Aggregate adds the given aggregation functions to the selector query.

func (*ActivitySelect) Bool

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

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

func (*ActivitySelect) BoolX

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

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

func (*ActivitySelect) Bools

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

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

func (*ActivitySelect) BoolsX

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

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

func (*ActivitySelect) Float64

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

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

func (*ActivitySelect) Float64X

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

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

func (*ActivitySelect) Float64s

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

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

func (*ActivitySelect) Float64sX

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

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

func (*ActivitySelect) Int

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

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

func (*ActivitySelect) IntX

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

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

func (*ActivitySelect) Ints

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

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

func (*ActivitySelect) IntsX

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

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

func (*ActivitySelect) Scan

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

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

func (*ActivitySelect) ScanX

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

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

func (*ActivitySelect) String

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

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

func (*ActivitySelect) StringX

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

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

func (*ActivitySelect) Strings

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

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

func (*ActivitySelect) StringsX

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

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

type ActivityUpdate

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

ActivityUpdate is the builder for updating Activity entities.

func (*ActivityUpdate) AddSocialScore

func (au *ActivityUpdate) AddSocialScore(f float64) *ActivityUpdate

AddSocialScore adds f to the "social_score" field.

func (*ActivityUpdate) AddUpdateCount

func (au *ActivityUpdate) AddUpdateCount(i int) *ActivityUpdate

AddUpdateCount adds i to the "update_count" field.

func (*ActivityUpdate) AppendSourceUids

func (au *ActivityUpdate) AppendSourceUids(s []string) *ActivityUpdate

AppendSourceUids appends s to the "source_uids" field.

func (*ActivityUpdate) ClearEmbedding1536

func (au *ActivityUpdate) ClearEmbedding1536() *ActivityUpdate

ClearEmbedding1536 clears the value of the "embedding_1536" field.

func (*ActivityUpdate) ClearEmbedding3072

func (au *ActivityUpdate) ClearEmbedding3072() *ActivityUpdate

ClearEmbedding3072 clears the value of the "embedding_3072" field.

func (*ActivityUpdate) Exec

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

Exec executes the query.

func (*ActivityUpdate) ExecX

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

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

func (*ActivityUpdate) Mutation

func (au *ActivityUpdate) Mutation() *ActivityMutation

Mutation returns the ActivityMutation object of the builder.

func (*ActivityUpdate) Save

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

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

func (*ActivityUpdate) SaveX

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

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

func (*ActivityUpdate) SetBody

func (au *ActivityUpdate) SetBody(s string) *ActivityUpdate

SetBody sets the "body" field.

func (*ActivityUpdate) SetCreatedAt

func (au *ActivityUpdate) SetCreatedAt(t time.Time) *ActivityUpdate

SetCreatedAt sets the "created_at" field.

func (*ActivityUpdate) SetEmbedding1536

func (au *ActivityUpdate) SetEmbedding1536(pg pgvector.Vector) *ActivityUpdate

SetEmbedding1536 sets the "embedding_1536" field.

func (*ActivityUpdate) SetEmbedding3072

func (au *ActivityUpdate) SetEmbedding3072(pg pgvector.Vector) *ActivityUpdate

SetEmbedding3072 sets the "embedding_3072" field.

func (*ActivityUpdate) SetFullSummary

func (au *ActivityUpdate) SetFullSummary(s string) *ActivityUpdate

SetFullSummary sets the "full_summary" field.

func (*ActivityUpdate) SetImageURL

func (au *ActivityUpdate) SetImageURL(s string) *ActivityUpdate

SetImageURL sets the "image_url" field.

func (*ActivityUpdate) SetNillableBody

func (au *ActivityUpdate) SetNillableBody(s *string) *ActivityUpdate

SetNillableBody sets the "body" field if the given value is not nil.

func (*ActivityUpdate) SetNillableCreatedAt

func (au *ActivityUpdate) SetNillableCreatedAt(t *time.Time) *ActivityUpdate

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

func (*ActivityUpdate) SetNillableEmbedding1536

func (au *ActivityUpdate) SetNillableEmbedding1536(pg *pgvector.Vector) *ActivityUpdate

SetNillableEmbedding1536 sets the "embedding_1536" field if the given value is not nil.

func (*ActivityUpdate) SetNillableEmbedding3072

func (au *ActivityUpdate) SetNillableEmbedding3072(pg *pgvector.Vector) *ActivityUpdate

SetNillableEmbedding3072 sets the "embedding_3072" field if the given value is not nil.

func (*ActivityUpdate) SetNillableFullSummary

func (au *ActivityUpdate) SetNillableFullSummary(s *string) *ActivityUpdate

SetNillableFullSummary sets the "full_summary" field if the given value is not nil.

func (*ActivityUpdate) SetNillableImageURL

func (au *ActivityUpdate) SetNillableImageURL(s *string) *ActivityUpdate

SetNillableImageURL sets the "image_url" field if the given value is not nil.

func (*ActivityUpdate) SetNillableRawJSON

func (au *ActivityUpdate) SetNillableRawJSON(s *string) *ActivityUpdate

SetNillableRawJSON sets the "raw_json" field if the given value is not nil.

func (*ActivityUpdate) SetNillableShortSummary

func (au *ActivityUpdate) SetNillableShortSummary(s *string) *ActivityUpdate

SetNillableShortSummary sets the "short_summary" field if the given value is not nil.

func (*ActivityUpdate) SetNillableSocialScore

func (au *ActivityUpdate) SetNillableSocialScore(f *float64) *ActivityUpdate

SetNillableSocialScore sets the "social_score" field if the given value is not nil.

func (*ActivityUpdate) SetNillableSourceType

func (au *ActivityUpdate) SetNillableSourceType(s *string) *ActivityUpdate

SetNillableSourceType sets the "source_type" field if the given value is not nil.

func (*ActivityUpdate) SetNillableTitle

func (au *ActivityUpdate) SetNillableTitle(s *string) *ActivityUpdate

SetNillableTitle sets the "title" field if the given value is not nil.

func (*ActivityUpdate) SetNillableUID

func (au *ActivityUpdate) SetNillableUID(s *string) *ActivityUpdate

SetNillableUID sets the "uid" field if the given value is not nil.

func (*ActivityUpdate) SetNillableURL

func (au *ActivityUpdate) SetNillableURL(s *string) *ActivityUpdate

SetNillableURL sets the "url" field if the given value is not nil.

func (*ActivityUpdate) SetNillableUpdateCount

func (au *ActivityUpdate) SetNillableUpdateCount(i *int) *ActivityUpdate

SetNillableUpdateCount sets the "update_count" field if the given value is not nil.

func (*ActivityUpdate) SetRawJSON

func (au *ActivityUpdate) SetRawJSON(s string) *ActivityUpdate

SetRawJSON sets the "raw_json" field.

func (*ActivityUpdate) SetShortSummary

func (au *ActivityUpdate) SetShortSummary(s string) *ActivityUpdate

SetShortSummary sets the "short_summary" field.

func (*ActivityUpdate) SetSocialScore

func (au *ActivityUpdate) SetSocialScore(f float64) *ActivityUpdate

SetSocialScore sets the "social_score" field.

func (*ActivityUpdate) SetSourceType

func (au *ActivityUpdate) SetSourceType(s string) *ActivityUpdate

SetSourceType sets the "source_type" field.

func (*ActivityUpdate) SetSourceUids

func (au *ActivityUpdate) SetSourceUids(s []string) *ActivityUpdate

SetSourceUids sets the "source_uids" field.

func (*ActivityUpdate) SetTitle

func (au *ActivityUpdate) SetTitle(s string) *ActivityUpdate

SetTitle sets the "title" field.

func (*ActivityUpdate) SetUID

func (au *ActivityUpdate) SetUID(s string) *ActivityUpdate

SetUID sets the "uid" field.

func (*ActivityUpdate) SetURL

func (au *ActivityUpdate) SetURL(s string) *ActivityUpdate

SetURL sets the "url" field.

func (*ActivityUpdate) SetUpdateCount

func (au *ActivityUpdate) SetUpdateCount(i int) *ActivityUpdate

SetUpdateCount sets the "update_count" field.

func (*ActivityUpdate) Where

func (au *ActivityUpdate) Where(ps ...predicate.Activity) *ActivityUpdate

Where appends a list predicates to the ActivityUpdate builder.

type ActivityUpdateOne

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

ActivityUpdateOne is the builder for updating a single Activity entity.

func (*ActivityUpdateOne) AddSocialScore

func (auo *ActivityUpdateOne) AddSocialScore(f float64) *ActivityUpdateOne

AddSocialScore adds f to the "social_score" field.

func (*ActivityUpdateOne) AddUpdateCount

func (auo *ActivityUpdateOne) AddUpdateCount(i int) *ActivityUpdateOne

AddUpdateCount adds i to the "update_count" field.

func (*ActivityUpdateOne) AppendSourceUids

func (auo *ActivityUpdateOne) AppendSourceUids(s []string) *ActivityUpdateOne

AppendSourceUids appends s to the "source_uids" field.

func (*ActivityUpdateOne) ClearEmbedding1536

func (auo *ActivityUpdateOne) ClearEmbedding1536() *ActivityUpdateOne

ClearEmbedding1536 clears the value of the "embedding_1536" field.

func (*ActivityUpdateOne) ClearEmbedding3072

func (auo *ActivityUpdateOne) ClearEmbedding3072() *ActivityUpdateOne

ClearEmbedding3072 clears the value of the "embedding_3072" field.

func (*ActivityUpdateOne) Exec

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

Exec executes the query on the entity.

func (*ActivityUpdateOne) ExecX

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

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

func (*ActivityUpdateOne) Mutation

func (auo *ActivityUpdateOne) Mutation() *ActivityMutation

Mutation returns the ActivityMutation object of the builder.

func (*ActivityUpdateOne) Save

func (auo *ActivityUpdateOne) Save(ctx context.Context) (*Activity, error)

Save executes the query and returns the updated Activity entity.

func (*ActivityUpdateOne) SaveX

func (auo *ActivityUpdateOne) SaveX(ctx context.Context) *Activity

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

func (*ActivityUpdateOne) Select

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

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

func (*ActivityUpdateOne) SetBody

func (auo *ActivityUpdateOne) SetBody(s string) *ActivityUpdateOne

SetBody sets the "body" field.

func (*ActivityUpdateOne) SetCreatedAt

func (auo *ActivityUpdateOne) SetCreatedAt(t time.Time) *ActivityUpdateOne

SetCreatedAt sets the "created_at" field.

func (*ActivityUpdateOne) SetEmbedding1536

func (auo *ActivityUpdateOne) SetEmbedding1536(pg pgvector.Vector) *ActivityUpdateOne

SetEmbedding1536 sets the "embedding_1536" field.

func (*ActivityUpdateOne) SetEmbedding3072

func (auo *ActivityUpdateOne) SetEmbedding3072(pg pgvector.Vector) *ActivityUpdateOne

SetEmbedding3072 sets the "embedding_3072" field.

func (*ActivityUpdateOne) SetFullSummary

func (auo *ActivityUpdateOne) SetFullSummary(s string) *ActivityUpdateOne

SetFullSummary sets the "full_summary" field.

func (*ActivityUpdateOne) SetImageURL

func (auo *ActivityUpdateOne) SetImageURL(s string) *ActivityUpdateOne

SetImageURL sets the "image_url" field.

func (*ActivityUpdateOne) SetNillableBody

func (auo *ActivityUpdateOne) SetNillableBody(s *string) *ActivityUpdateOne

SetNillableBody sets the "body" field if the given value is not nil.

func (*ActivityUpdateOne) SetNillableCreatedAt

func (auo *ActivityUpdateOne) SetNillableCreatedAt(t *time.Time) *ActivityUpdateOne

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

func (*ActivityUpdateOne) SetNillableEmbedding1536

func (auo *ActivityUpdateOne) SetNillableEmbedding1536(pg *pgvector.Vector) *ActivityUpdateOne

SetNillableEmbedding1536 sets the "embedding_1536" field if the given value is not nil.

func (*ActivityUpdateOne) SetNillableEmbedding3072

func (auo *ActivityUpdateOne) SetNillableEmbedding3072(pg *pgvector.Vector) *ActivityUpdateOne

SetNillableEmbedding3072 sets the "embedding_3072" field if the given value is not nil.

func (*ActivityUpdateOne) SetNillableFullSummary

func (auo *ActivityUpdateOne) SetNillableFullSummary(s *string) *ActivityUpdateOne

SetNillableFullSummary sets the "full_summary" field if the given value is not nil.

func (*ActivityUpdateOne) SetNillableImageURL

func (auo *ActivityUpdateOne) SetNillableImageURL(s *string) *ActivityUpdateOne

SetNillableImageURL sets the "image_url" field if the given value is not nil.

func (*ActivityUpdateOne) SetNillableRawJSON

func (auo *ActivityUpdateOne) SetNillableRawJSON(s *string) *ActivityUpdateOne

SetNillableRawJSON sets the "raw_json" field if the given value is not nil.

func (*ActivityUpdateOne) SetNillableShortSummary

func (auo *ActivityUpdateOne) SetNillableShortSummary(s *string) *ActivityUpdateOne

SetNillableShortSummary sets the "short_summary" field if the given value is not nil.

func (*ActivityUpdateOne) SetNillableSocialScore

func (auo *ActivityUpdateOne) SetNillableSocialScore(f *float64) *ActivityUpdateOne

SetNillableSocialScore sets the "social_score" field if the given value is not nil.

func (*ActivityUpdateOne) SetNillableSourceType

func (auo *ActivityUpdateOne) SetNillableSourceType(s *string) *ActivityUpdateOne

SetNillableSourceType sets the "source_type" field if the given value is not nil.

func (*ActivityUpdateOne) SetNillableTitle

func (auo *ActivityUpdateOne) SetNillableTitle(s *string) *ActivityUpdateOne

SetNillableTitle sets the "title" field if the given value is not nil.

func (*ActivityUpdateOne) SetNillableUID

func (auo *ActivityUpdateOne) SetNillableUID(s *string) *ActivityUpdateOne

SetNillableUID sets the "uid" field if the given value is not nil.

func (*ActivityUpdateOne) SetNillableURL

func (auo *ActivityUpdateOne) SetNillableURL(s *string) *ActivityUpdateOne

SetNillableURL sets the "url" field if the given value is not nil.

func (*ActivityUpdateOne) SetNillableUpdateCount

func (auo *ActivityUpdateOne) SetNillableUpdateCount(i *int) *ActivityUpdateOne

SetNillableUpdateCount sets the "update_count" field if the given value is not nil.

func (*ActivityUpdateOne) SetRawJSON

func (auo *ActivityUpdateOne) SetRawJSON(s string) *ActivityUpdateOne

SetRawJSON sets the "raw_json" field.

func (*ActivityUpdateOne) SetShortSummary

func (auo *ActivityUpdateOne) SetShortSummary(s string) *ActivityUpdateOne

SetShortSummary sets the "short_summary" field.

func (*ActivityUpdateOne) SetSocialScore

func (auo *ActivityUpdateOne) SetSocialScore(f float64) *ActivityUpdateOne

SetSocialScore sets the "social_score" field.

func (*ActivityUpdateOne) SetSourceType

func (auo *ActivityUpdateOne) SetSourceType(s string) *ActivityUpdateOne

SetSourceType sets the "source_type" field.

func (*ActivityUpdateOne) SetSourceUids

func (auo *ActivityUpdateOne) SetSourceUids(s []string) *ActivityUpdateOne

SetSourceUids sets the "source_uids" field.

func (*ActivityUpdateOne) SetTitle

func (auo *ActivityUpdateOne) SetTitle(s string) *ActivityUpdateOne

SetTitle sets the "title" field.

func (*ActivityUpdateOne) SetUID

func (auo *ActivityUpdateOne) SetUID(s string) *ActivityUpdateOne

SetUID sets the "uid" field.

func (*ActivityUpdateOne) SetURL

func (auo *ActivityUpdateOne) SetURL(s string) *ActivityUpdateOne

SetURL sets the "url" field.

func (*ActivityUpdateOne) SetUpdateCount

func (auo *ActivityUpdateOne) SetUpdateCount(i int) *ActivityUpdateOne

SetUpdateCount sets the "update_count" field.

func (*ActivityUpdateOne) Where

Where appends a list predicates to the ActivityUpdate builder.

type ActivityUpsert

type ActivityUpsert struct {
	*sql.UpdateSet
}

ActivityUpsert is the "OnConflict" setter.

func (*ActivityUpsert) AddSocialScore

func (u *ActivityUpsert) AddSocialScore(v float64) *ActivityUpsert

AddSocialScore adds v to the "social_score" field.

func (*ActivityUpsert) AddUpdateCount

func (u *ActivityUpsert) AddUpdateCount(v int) *ActivityUpsert

AddUpdateCount adds v to the "update_count" field.

func (*ActivityUpsert) ClearEmbedding1536

func (u *ActivityUpsert) ClearEmbedding1536() *ActivityUpsert

ClearEmbedding1536 clears the value of the "embedding_1536" field.

func (*ActivityUpsert) ClearEmbedding3072

func (u *ActivityUpsert) ClearEmbedding3072() *ActivityUpsert

ClearEmbedding3072 clears the value of the "embedding_3072" field.

func (*ActivityUpsert) SetBody

func (u *ActivityUpsert) SetBody(v string) *ActivityUpsert

SetBody sets the "body" field.

func (*ActivityUpsert) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*ActivityUpsert) SetEmbedding1536

func (u *ActivityUpsert) SetEmbedding1536(v pgvector.Vector) *ActivityUpsert

SetEmbedding1536 sets the "embedding_1536" field.

func (*ActivityUpsert) SetEmbedding3072

func (u *ActivityUpsert) SetEmbedding3072(v pgvector.Vector) *ActivityUpsert

SetEmbedding3072 sets the "embedding_3072" field.

func (*ActivityUpsert) SetFullSummary

func (u *ActivityUpsert) SetFullSummary(v string) *ActivityUpsert

SetFullSummary sets the "full_summary" field.

func (*ActivityUpsert) SetImageURL

func (u *ActivityUpsert) SetImageURL(v string) *ActivityUpsert

SetImageURL sets the "image_url" field.

func (*ActivityUpsert) SetRawJSON

func (u *ActivityUpsert) SetRawJSON(v string) *ActivityUpsert

SetRawJSON sets the "raw_json" field.

func (*ActivityUpsert) SetShortSummary

func (u *ActivityUpsert) SetShortSummary(v string) *ActivityUpsert

SetShortSummary sets the "short_summary" field.

func (*ActivityUpsert) SetSocialScore

func (u *ActivityUpsert) SetSocialScore(v float64) *ActivityUpsert

SetSocialScore sets the "social_score" field.

func (*ActivityUpsert) SetSourceType

func (u *ActivityUpsert) SetSourceType(v string) *ActivityUpsert

SetSourceType sets the "source_type" field.

func (*ActivityUpsert) SetSourceUids

func (u *ActivityUpsert) SetSourceUids(v []string) *ActivityUpsert

SetSourceUids sets the "source_uids" field.

func (*ActivityUpsert) SetTitle

func (u *ActivityUpsert) SetTitle(v string) *ActivityUpsert

SetTitle sets the "title" field.

func (*ActivityUpsert) SetUID

func (u *ActivityUpsert) SetUID(v string) *ActivityUpsert

SetUID sets the "uid" field.

func (*ActivityUpsert) SetURL

func (u *ActivityUpsert) SetURL(v string) *ActivityUpsert

SetURL sets the "url" field.

func (*ActivityUpsert) SetUpdateCount

func (u *ActivityUpsert) SetUpdateCount(v int) *ActivityUpsert

SetUpdateCount sets the "update_count" field.

func (*ActivityUpsert) UpdateBody

func (u *ActivityUpsert) UpdateBody() *ActivityUpsert

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

func (*ActivityUpsert) UpdateCreatedAt

func (u *ActivityUpsert) UpdateCreatedAt() *ActivityUpsert

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

func (*ActivityUpsert) UpdateEmbedding1536

func (u *ActivityUpsert) UpdateEmbedding1536() *ActivityUpsert

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

func (*ActivityUpsert) UpdateEmbedding3072

func (u *ActivityUpsert) UpdateEmbedding3072() *ActivityUpsert

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

func (*ActivityUpsert) UpdateFullSummary

func (u *ActivityUpsert) UpdateFullSummary() *ActivityUpsert

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

func (*ActivityUpsert) UpdateImageURL

func (u *ActivityUpsert) UpdateImageURL() *ActivityUpsert

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

func (*ActivityUpsert) UpdateRawJSON

func (u *ActivityUpsert) UpdateRawJSON() *ActivityUpsert

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

func (*ActivityUpsert) UpdateShortSummary

func (u *ActivityUpsert) UpdateShortSummary() *ActivityUpsert

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

func (*ActivityUpsert) UpdateSocialScore

func (u *ActivityUpsert) UpdateSocialScore() *ActivityUpsert

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

func (*ActivityUpsert) UpdateSourceType

func (u *ActivityUpsert) UpdateSourceType() *ActivityUpsert

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

func (*ActivityUpsert) UpdateSourceUids

func (u *ActivityUpsert) UpdateSourceUids() *ActivityUpsert

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

func (*ActivityUpsert) UpdateTitle

func (u *ActivityUpsert) UpdateTitle() *ActivityUpsert

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

func (*ActivityUpsert) UpdateUID

func (u *ActivityUpsert) UpdateUID() *ActivityUpsert

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

func (*ActivityUpsert) UpdateURL

func (u *ActivityUpsert) UpdateURL() *ActivityUpsert

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

func (*ActivityUpsert) UpdateUpdateCount

func (u *ActivityUpsert) UpdateUpdateCount() *ActivityUpsert

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

type ActivityUpsertBulk

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

ActivityUpsertBulk is the builder for "upsert"-ing a bulk of Activity nodes.

func (*ActivityUpsertBulk) AddSocialScore

func (u *ActivityUpsertBulk) AddSocialScore(v float64) *ActivityUpsertBulk

AddSocialScore adds v to the "social_score" field.

func (*ActivityUpsertBulk) AddUpdateCount

func (u *ActivityUpsertBulk) AddUpdateCount(v int) *ActivityUpsertBulk

AddUpdateCount adds v to the "update_count" field.

func (*ActivityUpsertBulk) ClearEmbedding1536

func (u *ActivityUpsertBulk) ClearEmbedding1536() *ActivityUpsertBulk

ClearEmbedding1536 clears the value of the "embedding_1536" field.

func (*ActivityUpsertBulk) ClearEmbedding3072

func (u *ActivityUpsertBulk) ClearEmbedding3072() *ActivityUpsertBulk

ClearEmbedding3072 clears the value of the "embedding_3072" field.

func (*ActivityUpsertBulk) DoNothing

func (u *ActivityUpsertBulk) DoNothing() *ActivityUpsertBulk

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

func (*ActivityUpsertBulk) Exec

func (u *ActivityUpsertBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*ActivityUpsertBulk) ExecX

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

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

func (*ActivityUpsertBulk) Ignore

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

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

func (*ActivityUpsertBulk) SetBody

SetBody sets the "body" field.

func (*ActivityUpsertBulk) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*ActivityUpsertBulk) SetEmbedding1536

func (u *ActivityUpsertBulk) SetEmbedding1536(v pgvector.Vector) *ActivityUpsertBulk

SetEmbedding1536 sets the "embedding_1536" field.

func (*ActivityUpsertBulk) SetEmbedding3072

func (u *ActivityUpsertBulk) SetEmbedding3072(v pgvector.Vector) *ActivityUpsertBulk

SetEmbedding3072 sets the "embedding_3072" field.

func (*ActivityUpsertBulk) SetFullSummary

func (u *ActivityUpsertBulk) SetFullSummary(v string) *ActivityUpsertBulk

SetFullSummary sets the "full_summary" field.

func (*ActivityUpsertBulk) SetImageURL

func (u *ActivityUpsertBulk) SetImageURL(v string) *ActivityUpsertBulk

SetImageURL sets the "image_url" field.

func (*ActivityUpsertBulk) SetRawJSON

func (u *ActivityUpsertBulk) SetRawJSON(v string) *ActivityUpsertBulk

SetRawJSON sets the "raw_json" field.

func (*ActivityUpsertBulk) SetShortSummary

func (u *ActivityUpsertBulk) SetShortSummary(v string) *ActivityUpsertBulk

SetShortSummary sets the "short_summary" field.

func (*ActivityUpsertBulk) SetSocialScore

func (u *ActivityUpsertBulk) SetSocialScore(v float64) *ActivityUpsertBulk

SetSocialScore sets the "social_score" field.

func (*ActivityUpsertBulk) SetSourceType

func (u *ActivityUpsertBulk) SetSourceType(v string) *ActivityUpsertBulk

SetSourceType sets the "source_type" field.

func (*ActivityUpsertBulk) SetSourceUids

func (u *ActivityUpsertBulk) SetSourceUids(v []string) *ActivityUpsertBulk

SetSourceUids sets the "source_uids" field.

func (*ActivityUpsertBulk) SetTitle

SetTitle sets the "title" field.

func (*ActivityUpsertBulk) SetUID

SetUID sets the "uid" field.

func (*ActivityUpsertBulk) SetURL

SetURL sets the "url" field.

func (*ActivityUpsertBulk) SetUpdateCount

func (u *ActivityUpsertBulk) SetUpdateCount(v int) *ActivityUpsertBulk

SetUpdateCount sets the "update_count" field.

func (*ActivityUpsertBulk) Update

func (u *ActivityUpsertBulk) Update(set func(*ActivityUpsert)) *ActivityUpsertBulk

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

func (*ActivityUpsertBulk) UpdateBody

func (u *ActivityUpsertBulk) UpdateBody() *ActivityUpsertBulk

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

func (*ActivityUpsertBulk) UpdateCreatedAt

func (u *ActivityUpsertBulk) UpdateCreatedAt() *ActivityUpsertBulk

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

func (*ActivityUpsertBulk) UpdateEmbedding1536

func (u *ActivityUpsertBulk) UpdateEmbedding1536() *ActivityUpsertBulk

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

func (*ActivityUpsertBulk) UpdateEmbedding3072

func (u *ActivityUpsertBulk) UpdateEmbedding3072() *ActivityUpsertBulk

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

func (*ActivityUpsertBulk) UpdateFullSummary

func (u *ActivityUpsertBulk) UpdateFullSummary() *ActivityUpsertBulk

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

func (*ActivityUpsertBulk) UpdateImageURL

func (u *ActivityUpsertBulk) UpdateImageURL() *ActivityUpsertBulk

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

func (*ActivityUpsertBulk) UpdateNewValues

func (u *ActivityUpsertBulk) UpdateNewValues() *ActivityUpsertBulk

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

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

func (*ActivityUpsertBulk) UpdateRawJSON

func (u *ActivityUpsertBulk) UpdateRawJSON() *ActivityUpsertBulk

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

func (*ActivityUpsertBulk) UpdateShortSummary

func (u *ActivityUpsertBulk) UpdateShortSummary() *ActivityUpsertBulk

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

func (*ActivityUpsertBulk) UpdateSocialScore

func (u *ActivityUpsertBulk) UpdateSocialScore() *ActivityUpsertBulk

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

func (*ActivityUpsertBulk) UpdateSourceType

func (u *ActivityUpsertBulk) UpdateSourceType() *ActivityUpsertBulk

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

func (*ActivityUpsertBulk) UpdateSourceUids

func (u *ActivityUpsertBulk) UpdateSourceUids() *ActivityUpsertBulk

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

func (*ActivityUpsertBulk) UpdateTitle

func (u *ActivityUpsertBulk) UpdateTitle() *ActivityUpsertBulk

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

func (*ActivityUpsertBulk) UpdateUID

func (u *ActivityUpsertBulk) UpdateUID() *ActivityUpsertBulk

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

func (*ActivityUpsertBulk) UpdateURL

func (u *ActivityUpsertBulk) UpdateURL() *ActivityUpsertBulk

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

func (*ActivityUpsertBulk) UpdateUpdateCount

func (u *ActivityUpsertBulk) UpdateUpdateCount() *ActivityUpsertBulk

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

type ActivityUpsertOne

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

ActivityUpsertOne is the builder for "upsert"-ing

one Activity node.

func (*ActivityUpsertOne) AddSocialScore

func (u *ActivityUpsertOne) AddSocialScore(v float64) *ActivityUpsertOne

AddSocialScore adds v to the "social_score" field.

func (*ActivityUpsertOne) AddUpdateCount

func (u *ActivityUpsertOne) AddUpdateCount(v int) *ActivityUpsertOne

AddUpdateCount adds v to the "update_count" field.

func (*ActivityUpsertOne) ClearEmbedding1536

func (u *ActivityUpsertOne) ClearEmbedding1536() *ActivityUpsertOne

ClearEmbedding1536 clears the value of the "embedding_1536" field.

func (*ActivityUpsertOne) ClearEmbedding3072

func (u *ActivityUpsertOne) ClearEmbedding3072() *ActivityUpsertOne

ClearEmbedding3072 clears the value of the "embedding_3072" field.

func (*ActivityUpsertOne) DoNothing

func (u *ActivityUpsertOne) DoNothing() *ActivityUpsertOne

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

func (*ActivityUpsertOne) Exec

func (u *ActivityUpsertOne) Exec(ctx context.Context) error

Exec executes the query.

func (*ActivityUpsertOne) ExecX

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

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

func (*ActivityUpsertOne) ID

func (u *ActivityUpsertOne) ID(ctx context.Context) (id string, err error)

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

func (*ActivityUpsertOne) IDX

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

func (*ActivityUpsertOne) Ignore

func (u *ActivityUpsertOne) Ignore() *ActivityUpsertOne

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

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

func (*ActivityUpsertOne) SetBody

SetBody sets the "body" field.

func (*ActivityUpsertOne) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*ActivityUpsertOne) SetEmbedding1536

func (u *ActivityUpsertOne) SetEmbedding1536(v pgvector.Vector) *ActivityUpsertOne

SetEmbedding1536 sets the "embedding_1536" field.

func (*ActivityUpsertOne) SetEmbedding3072

func (u *ActivityUpsertOne) SetEmbedding3072(v pgvector.Vector) *ActivityUpsertOne

SetEmbedding3072 sets the "embedding_3072" field.

func (*ActivityUpsertOne) SetFullSummary

func (u *ActivityUpsertOne) SetFullSummary(v string) *ActivityUpsertOne

SetFullSummary sets the "full_summary" field.

func (*ActivityUpsertOne) SetImageURL

func (u *ActivityUpsertOne) SetImageURL(v string) *ActivityUpsertOne

SetImageURL sets the "image_url" field.

func (*ActivityUpsertOne) SetRawJSON

func (u *ActivityUpsertOne) SetRawJSON(v string) *ActivityUpsertOne

SetRawJSON sets the "raw_json" field.

func (*ActivityUpsertOne) SetShortSummary

func (u *ActivityUpsertOne) SetShortSummary(v string) *ActivityUpsertOne

SetShortSummary sets the "short_summary" field.

func (*ActivityUpsertOne) SetSocialScore

func (u *ActivityUpsertOne) SetSocialScore(v float64) *ActivityUpsertOne

SetSocialScore sets the "social_score" field.

func (*ActivityUpsertOne) SetSourceType

func (u *ActivityUpsertOne) SetSourceType(v string) *ActivityUpsertOne

SetSourceType sets the "source_type" field.

func (*ActivityUpsertOne) SetSourceUids

func (u *ActivityUpsertOne) SetSourceUids(v []string) *ActivityUpsertOne

SetSourceUids sets the "source_uids" field.

func (*ActivityUpsertOne) SetTitle

func (u *ActivityUpsertOne) SetTitle(v string) *ActivityUpsertOne

SetTitle sets the "title" field.

func (*ActivityUpsertOne) SetUID

SetUID sets the "uid" field.

func (*ActivityUpsertOne) SetURL

SetURL sets the "url" field.

func (*ActivityUpsertOne) SetUpdateCount

func (u *ActivityUpsertOne) SetUpdateCount(v int) *ActivityUpsertOne

SetUpdateCount sets the "update_count" field.

func (*ActivityUpsertOne) Update

func (u *ActivityUpsertOne) Update(set func(*ActivityUpsert)) *ActivityUpsertOne

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

func (*ActivityUpsertOne) UpdateBody

func (u *ActivityUpsertOne) UpdateBody() *ActivityUpsertOne

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

func (*ActivityUpsertOne) UpdateCreatedAt

func (u *ActivityUpsertOne) UpdateCreatedAt() *ActivityUpsertOne

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

func (*ActivityUpsertOne) UpdateEmbedding1536

func (u *ActivityUpsertOne) UpdateEmbedding1536() *ActivityUpsertOne

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

func (*ActivityUpsertOne) UpdateEmbedding3072

func (u *ActivityUpsertOne) UpdateEmbedding3072() *ActivityUpsertOne

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

func (*ActivityUpsertOne) UpdateFullSummary

func (u *ActivityUpsertOne) UpdateFullSummary() *ActivityUpsertOne

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

func (*ActivityUpsertOne) UpdateImageURL

func (u *ActivityUpsertOne) UpdateImageURL() *ActivityUpsertOne

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

func (*ActivityUpsertOne) UpdateNewValues

func (u *ActivityUpsertOne) UpdateNewValues() *ActivityUpsertOne

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

func (*ActivityUpsertOne) UpdateRawJSON

func (u *ActivityUpsertOne) UpdateRawJSON() *ActivityUpsertOne

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

func (*ActivityUpsertOne) UpdateShortSummary

func (u *ActivityUpsertOne) UpdateShortSummary() *ActivityUpsertOne

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

func (*ActivityUpsertOne) UpdateSocialScore

func (u *ActivityUpsertOne) UpdateSocialScore() *ActivityUpsertOne

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

func (*ActivityUpsertOne) UpdateSourceType

func (u *ActivityUpsertOne) UpdateSourceType() *ActivityUpsertOne

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

func (*ActivityUpsertOne) UpdateSourceUids

func (u *ActivityUpsertOne) UpdateSourceUids() *ActivityUpsertOne

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

func (*ActivityUpsertOne) UpdateTitle

func (u *ActivityUpsertOne) UpdateTitle() *ActivityUpsertOne

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

func (*ActivityUpsertOne) UpdateUID

func (u *ActivityUpsertOne) UpdateUID() *ActivityUpsertOne

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

func (*ActivityUpsertOne) UpdateURL

func (u *ActivityUpsertOne) UpdateURL() *ActivityUpsertOne

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

func (*ActivityUpsertOne) UpdateUpdateCount

func (u *ActivityUpsertOne) UpdateUpdateCount() *ActivityUpsertOne

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

type AggregateFunc

type AggregateFunc func(*sql.Selector) string

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

func As

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

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

func Count

func Count() AggregateFunc

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

func Max

func Max(field string) AggregateFunc

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

func Mean

func Mean(field string) AggregateFunc

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

func Min

func Min(field string) AggregateFunc

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

func Sum

func Sum(field string) AggregateFunc

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

type Client

type Client struct {

	// Schema is the client for creating, migrating and dropping schema.
	Schema *migrate.Schema
	// Activity is the client for interacting with the Activity builders.
	Activity *ActivityClient
	// Feed is the client for interacting with the Feed builders.
	Feed *FeedClient
	// Source is the client for interacting with the Source builders.
	Source *SourceClient
	// 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().
	Activity.
	Query().
	Count(ctx)

func (*Client) Intercept

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

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

func (*Client) Mutate

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

Mutate implements the ent.Mutator interface.

func (*Client) Tx

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

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

func (*Client) Use

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

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

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 Feed

type Feed struct {

	// ID of the ent.
	ID string `json:"id,omitempty"`
	// UserID holds the value of the "user_id" field.
	UserID string `json:"user_id,omitempty"`
	// Name holds the value of the "name" field.
	Name string `json:"name,omitempty"`
	// Icon holds the value of the "icon" field.
	Icon string `json:"icon,omitempty"`
	// Query holds the value of the "query" field.
	Query string `json:"query,omitempty"`
	// Public holds the value of the "public" field.
	Public bool `json:"public,omitempty"`
	// SourceUids holds the value of the "source_uids" field.
	SourceUids []string `json:"source_uids,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"`
	// contains filtered or unexported fields
}

Feed is the model entity for the Feed schema.

func (*Feed) String

func (f *Feed) String() string

String implements the fmt.Stringer.

func (*Feed) Unwrap

func (f *Feed) Unwrap() *Feed

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

func (f *Feed) Update() *FeedUpdateOne

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

func (*Feed) Value

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

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

type FeedClient

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

FeedClient is a client for the Feed schema.

func NewFeedClient

func NewFeedClient(c config) *FeedClient

NewFeedClient returns a client for the Feed from the given config.

func (*FeedClient) Create

func (c *FeedClient) Create() *FeedCreate

Create returns a builder for creating a Feed entity.

func (*FeedClient) CreateBulk

func (c *FeedClient) CreateBulk(builders ...*FeedCreate) *FeedCreateBulk

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

func (*FeedClient) Delete

func (c *FeedClient) Delete() *FeedDelete

Delete returns a delete builder for Feed.

func (*FeedClient) DeleteOne

func (c *FeedClient) DeleteOne(f *Feed) *FeedDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*FeedClient) DeleteOneID

func (c *FeedClient) DeleteOneID(id string) *FeedDeleteOne

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

func (*FeedClient) Get

func (c *FeedClient) Get(ctx context.Context, id string) (*Feed, error)

Get returns a Feed entity by its id.

func (*FeedClient) GetX

func (c *FeedClient) GetX(ctx context.Context, id string) *Feed

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

func (*FeedClient) Hooks

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

Hooks returns the client hooks.

func (*FeedClient) Intercept

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

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

func (*FeedClient) Interceptors

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

Interceptors returns the client interceptors.

func (*FeedClient) MapCreateBulk

func (c *FeedClient) MapCreateBulk(slice any, setFunc func(*FeedCreate, int)) *FeedCreateBulk

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 (*FeedClient) Query

func (c *FeedClient) Query() *FeedQuery

Query returns a query builder for Feed.

func (*FeedClient) Update

func (c *FeedClient) Update() *FeedUpdate

Update returns an update builder for Feed.

func (*FeedClient) UpdateOne

func (c *FeedClient) UpdateOne(f *Feed) *FeedUpdateOne

UpdateOne returns an update builder for the given entity.

func (*FeedClient) UpdateOneID

func (c *FeedClient) UpdateOneID(id string) *FeedUpdateOne

UpdateOneID returns an update builder for the given id.

func (*FeedClient) Use

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

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

type FeedCreate

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

FeedCreate is the builder for creating a Feed entity.

func (*FeedCreate) Exec

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

Exec executes the query.

func (*FeedCreate) ExecX

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

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

func (*FeedCreate) Mutation

func (fc *FeedCreate) Mutation() *FeedMutation

Mutation returns the FeedMutation object of the builder.

func (*FeedCreate) OnConflict

func (fc *FeedCreate) OnConflict(opts ...sql.ConflictOption) *FeedUpsertOne

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

client.Feed.Create().
	SetUserID(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.FeedUpsert) {
		SetUserID(v+v).
	}).
	Exec(ctx)

func (*FeedCreate) OnConflictColumns

func (fc *FeedCreate) OnConflictColumns(columns ...string) *FeedUpsertOne

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

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

func (*FeedCreate) Save

func (fc *FeedCreate) Save(ctx context.Context) (*Feed, error)

Save creates the Feed in the database.

func (*FeedCreate) SaveX

func (fc *FeedCreate) SaveX(ctx context.Context) *Feed

SaveX calls Save and panics if Save returns an error.

func (*FeedCreate) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*FeedCreate) SetID

func (fc *FeedCreate) SetID(s string) *FeedCreate

SetID sets the "id" field.

func (*FeedCreate) SetIcon

func (fc *FeedCreate) SetIcon(s string) *FeedCreate

SetIcon sets the "icon" field.

func (*FeedCreate) SetName

func (fc *FeedCreate) SetName(s string) *FeedCreate

SetName sets the "name" field.

func (*FeedCreate) SetPublic

func (fc *FeedCreate) SetPublic(b bool) *FeedCreate

SetPublic sets the "public" field.

func (*FeedCreate) SetQuery

func (fc *FeedCreate) SetQuery(s string) *FeedCreate

SetQuery sets the "query" field.

func (*FeedCreate) SetSourceUids

func (fc *FeedCreate) SetSourceUids(s []string) *FeedCreate

SetSourceUids sets the "source_uids" field.

func (*FeedCreate) SetUpdatedAt

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

SetUpdatedAt sets the "updated_at" field.

func (*FeedCreate) SetUserID

func (fc *FeedCreate) SetUserID(s string) *FeedCreate

SetUserID sets the "user_id" field.

type FeedCreateBulk

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

FeedCreateBulk is the builder for creating many Feed entities in bulk.

func (*FeedCreateBulk) Exec

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

Exec executes the query.

func (*FeedCreateBulk) ExecX

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

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

func (*FeedCreateBulk) OnConflict

func (fcb *FeedCreateBulk) OnConflict(opts ...sql.ConflictOption) *FeedUpsertBulk

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

client.Feed.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.FeedUpsert) {
		SetUserID(v+v).
	}).
	Exec(ctx)

func (*FeedCreateBulk) OnConflictColumns

func (fcb *FeedCreateBulk) OnConflictColumns(columns ...string) *FeedUpsertBulk

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

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

func (*FeedCreateBulk) Save

func (fcb *FeedCreateBulk) Save(ctx context.Context) ([]*Feed, error)

Save creates the Feed entities in the database.

func (*FeedCreateBulk) SaveX

func (fcb *FeedCreateBulk) SaveX(ctx context.Context) []*Feed

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

type FeedDelete

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

FeedDelete is the builder for deleting a Feed entity.

func (*FeedDelete) Exec

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

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

func (*FeedDelete) ExecX

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

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

func (*FeedDelete) Where

func (fd *FeedDelete) Where(ps ...predicate.Feed) *FeedDelete

Where appends a list predicates to the FeedDelete builder.

type FeedDeleteOne

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

FeedDeleteOne is the builder for deleting a single Feed entity.

func (*FeedDeleteOne) Exec

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

Exec executes the deletion query.

func (*FeedDeleteOne) ExecX

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

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

func (*FeedDeleteOne) Where

func (fdo *FeedDeleteOne) Where(ps ...predicate.Feed) *FeedDeleteOne

Where appends a list predicates to the FeedDelete builder.

type FeedGroupBy

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

FeedGroupBy is the group-by builder for Feed entities.

func (*FeedGroupBy) Aggregate

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

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

func (*FeedGroupBy) Bool

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

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

func (*FeedGroupBy) BoolX

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

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

func (*FeedGroupBy) Bools

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

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

func (*FeedGroupBy) BoolsX

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

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

func (*FeedGroupBy) Float64

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

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

func (*FeedGroupBy) Float64X

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

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

func (*FeedGroupBy) Float64s

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

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

func (*FeedGroupBy) Float64sX

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

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

func (*FeedGroupBy) Int

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

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

func (*FeedGroupBy) IntX

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

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

func (*FeedGroupBy) Ints

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

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

func (*FeedGroupBy) IntsX

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

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

func (*FeedGroupBy) Scan

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

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

func (*FeedGroupBy) ScanX

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

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

func (*FeedGroupBy) String

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

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

func (*FeedGroupBy) StringX

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

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

func (*FeedGroupBy) Strings

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

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

func (*FeedGroupBy) StringsX

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

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

type FeedMutation

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

FeedMutation represents an operation that mutates the Feed nodes in the graph.

func (*FeedMutation) AddField

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

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

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

func (*FeedMutation) AddedField

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

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

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

func (*FeedMutation) AddedIDs

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

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

func (*FeedMutation) AppendSourceUids

func (m *FeedMutation) AppendSourceUids(s []string)

AppendSourceUids adds s to the "source_uids" field.

func (*FeedMutation) AppendedSourceUids

func (m *FeedMutation) AppendedSourceUids() ([]string, bool)

AppendedSourceUids returns the list of values that were appended to the "source_uids" field in this mutation.

func (*FeedMutation) ClearEdge

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

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

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

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

func (*FeedMutation) ClearedFields

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

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

func (FeedMutation) Client

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

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

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

func (*FeedMutation) EdgeCleared

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

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

func (*FeedMutation) Field

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

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

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

func (*FeedMutation) Fields

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

func (m *FeedMutation) ID() (id string, 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 (*FeedMutation) IDs

func (m *FeedMutation) IDs(ctx context.Context) ([]string, 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 (*FeedMutation) Icon

func (m *FeedMutation) Icon() (r string, exists bool)

Icon returns the value of the "icon" field in the mutation.

func (*FeedMutation) Name

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

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

func (*FeedMutation) OldCreatedAt

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

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

func (m *FeedMutation) 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 (*FeedMutation) OldIcon

func (m *FeedMutation) OldIcon(ctx context.Context) (v string, err error)

OldIcon returns the old "icon" field's value of the Feed entity. If the Feed 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 (*FeedMutation) OldName

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

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

func (m *FeedMutation) OldPublic(ctx context.Context) (v bool, err error)

OldPublic returns the old "public" field's value of the Feed entity. If the Feed 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 (*FeedMutation) OldQuery

func (m *FeedMutation) OldQuery(ctx context.Context) (v string, err error)

OldQuery returns the old "query" field's value of the Feed entity. If the Feed 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 (*FeedMutation) OldSourceUids

func (m *FeedMutation) OldSourceUids(ctx context.Context) (v []string, err error)

OldSourceUids returns the old "source_uids" field's value of the Feed entity. If the Feed 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 (*FeedMutation) OldUpdatedAt

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

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

func (m *FeedMutation) OldUserID(ctx context.Context) (v string, err error)

OldUserID returns the old "user_id" field's value of the Feed entity. If the Feed 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 (*FeedMutation) Op

func (m *FeedMutation) Op() Op

Op returns the operation name.

func (*FeedMutation) Public

func (m *FeedMutation) Public() (r bool, exists bool)

Public returns the value of the "public" field in the mutation.

func (*FeedMutation) Query

func (m *FeedMutation) Query() (r string, exists bool)

Query returns the value of the "query" field in the mutation.

func (*FeedMutation) RemovedEdges

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

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

func (*FeedMutation) RemovedIDs

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

func (m *FeedMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*FeedMutation) ResetEdge

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

func (m *FeedMutation) 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 (*FeedMutation) ResetIcon

func (m *FeedMutation) ResetIcon()

ResetIcon resets all changes to the "icon" field.

func (*FeedMutation) ResetName

func (m *FeedMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*FeedMutation) ResetPublic

func (m *FeedMutation) ResetPublic()

ResetPublic resets all changes to the "public" field.

func (*FeedMutation) ResetQuery

func (m *FeedMutation) ResetQuery()

ResetQuery resets all changes to the "query" field.

func (*FeedMutation) ResetSourceUids

func (m *FeedMutation) ResetSourceUids()

ResetSourceUids resets all changes to the "source_uids" field.

func (*FeedMutation) ResetUpdatedAt

func (m *FeedMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*FeedMutation) ResetUserID

func (m *FeedMutation) ResetUserID()

ResetUserID resets all changes to the "user_id" field.

func (*FeedMutation) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*FeedMutation) SetField

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

func (m *FeedMutation) SetID(id string)

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

func (*FeedMutation) SetIcon

func (m *FeedMutation) SetIcon(s string)

SetIcon sets the "icon" field.

func (*FeedMutation) SetName

func (m *FeedMutation) SetName(s string)

SetName sets the "name" field.

func (*FeedMutation) SetOp

func (m *FeedMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*FeedMutation) SetPublic

func (m *FeedMutation) SetPublic(b bool)

SetPublic sets the "public" field.

func (*FeedMutation) SetQuery

func (m *FeedMutation) SetQuery(s string)

SetQuery sets the "query" field.

func (*FeedMutation) SetSourceUids

func (m *FeedMutation) SetSourceUids(s []string)

SetSourceUids sets the "source_uids" field.

func (*FeedMutation) SetUpdatedAt

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

SetUpdatedAt sets the "updated_at" field.

func (*FeedMutation) SetUserID

func (m *FeedMutation) SetUserID(s string)

SetUserID sets the "user_id" field.

func (*FeedMutation) SourceUids

func (m *FeedMutation) SourceUids() (r []string, exists bool)

SourceUids returns the value of the "source_uids" field in the mutation.

func (FeedMutation) Tx

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

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

func (*FeedMutation) Type

func (m *FeedMutation) Type() string

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

func (*FeedMutation) UpdatedAt

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

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

func (*FeedMutation) UserID

func (m *FeedMutation) UserID() (r string, exists bool)

UserID returns the value of the "user_id" field in the mutation.

func (*FeedMutation) Where

func (m *FeedMutation) Where(ps ...predicate.Feed)

Where appends a list predicates to the FeedMutation builder.

func (*FeedMutation) WhereP

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

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

type FeedQuery

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

FeedQuery is the builder for querying Feed entities.

func (*FeedQuery) Aggregate

func (fq *FeedQuery) Aggregate(fns ...AggregateFunc) *FeedSelect

Aggregate returns a FeedSelect configured with the given aggregations.

func (*FeedQuery) All

func (fq *FeedQuery) All(ctx context.Context) ([]*Feed, error)

All executes the query and returns a list of Feeds.

func (*FeedQuery) AllX

func (fq *FeedQuery) AllX(ctx context.Context) []*Feed

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

func (*FeedQuery) Clone

func (fq *FeedQuery) Clone() *FeedQuery

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

func (*FeedQuery) Count

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

Count returns the count of the given query.

func (*FeedQuery) CountX

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

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

func (*FeedQuery) Exist

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

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

func (*FeedQuery) ExistX

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

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

func (*FeedQuery) First

func (fq *FeedQuery) First(ctx context.Context) (*Feed, error)

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

func (*FeedQuery) FirstID

func (fq *FeedQuery) FirstID(ctx context.Context) (id string, err error)

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

func (*FeedQuery) FirstIDX

func (fq *FeedQuery) FirstIDX(ctx context.Context) string

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

func (*FeedQuery) FirstX

func (fq *FeedQuery) FirstX(ctx context.Context) *Feed

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

func (*FeedQuery) GroupBy

func (fq *FeedQuery) GroupBy(field string, fields ...string) *FeedGroupBy

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

client.Feed.Query().
	GroupBy(feed.FieldUserID).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*FeedQuery) IDs

func (fq *FeedQuery) IDs(ctx context.Context) (ids []string, err error)

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

func (*FeedQuery) IDsX

func (fq *FeedQuery) IDsX(ctx context.Context) []string

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

func (*FeedQuery) Limit

func (fq *FeedQuery) Limit(limit int) *FeedQuery

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

func (*FeedQuery) Offset

func (fq *FeedQuery) Offset(offset int) *FeedQuery

Offset to start from.

func (*FeedQuery) Only

func (fq *FeedQuery) Only(ctx context.Context) (*Feed, error)

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

func (*FeedQuery) OnlyID

func (fq *FeedQuery) OnlyID(ctx context.Context) (id string, err error)

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

func (*FeedQuery) OnlyIDX

func (fq *FeedQuery) OnlyIDX(ctx context.Context) string

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

func (*FeedQuery) OnlyX

func (fq *FeedQuery) OnlyX(ctx context.Context) *Feed

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

func (*FeedQuery) Order

func (fq *FeedQuery) Order(o ...feed.OrderOption) *FeedQuery

Order specifies how the records should be ordered.

func (*FeedQuery) Select

func (fq *FeedQuery) Select(fields ...string) *FeedSelect

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

client.Feed.Query().
	Select(feed.FieldUserID).
	Scan(ctx, &v)

func (*FeedQuery) Unique

func (fq *FeedQuery) Unique(unique bool) *FeedQuery

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

func (fq *FeedQuery) Where(ps ...predicate.Feed) *FeedQuery

Where adds a new predicate for the FeedQuery builder.

type FeedSelect

type FeedSelect struct {
	*FeedQuery
	// contains filtered or unexported fields
}

FeedSelect is the builder for selecting fields of Feed entities.

func (*FeedSelect) Aggregate

func (fs *FeedSelect) Aggregate(fns ...AggregateFunc) *FeedSelect

Aggregate adds the given aggregation functions to the selector query.

func (*FeedSelect) Bool

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

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

func (*FeedSelect) BoolX

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

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

func (*FeedSelect) Bools

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

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

func (*FeedSelect) BoolsX

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

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

func (*FeedSelect) Float64

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

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

func (*FeedSelect) Float64X

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

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

func (*FeedSelect) Float64s

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

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

func (*FeedSelect) Float64sX

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

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

func (*FeedSelect) Int

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

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

func (*FeedSelect) IntX

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

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

func (*FeedSelect) Ints

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

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

func (*FeedSelect) IntsX

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

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

func (*FeedSelect) Scan

func (fs *FeedSelect) Scan(ctx context.Context, v any) error

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

func (*FeedSelect) ScanX

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

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

func (*FeedSelect) String

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

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

func (*FeedSelect) StringX

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

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

func (*FeedSelect) Strings

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

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

func (*FeedSelect) StringsX

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

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

type FeedUpdate

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

FeedUpdate is the builder for updating Feed entities.

func (*FeedUpdate) AppendSourceUids

func (fu *FeedUpdate) AppendSourceUids(s []string) *FeedUpdate

AppendSourceUids appends s to the "source_uids" field.

func (*FeedUpdate) Exec

func (fu *FeedUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*FeedUpdate) ExecX

func (fu *FeedUpdate) ExecX(ctx context.Context)

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

func (*FeedUpdate) Mutation

func (fu *FeedUpdate) Mutation() *FeedMutation

Mutation returns the FeedMutation object of the builder.

func (*FeedUpdate) Save

func (fu *FeedUpdate) Save(ctx context.Context) (int, error)

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

func (*FeedUpdate) SaveX

func (fu *FeedUpdate) SaveX(ctx context.Context) int

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

func (*FeedUpdate) SetCreatedAt

func (fu *FeedUpdate) SetCreatedAt(t time.Time) *FeedUpdate

SetCreatedAt sets the "created_at" field.

func (*FeedUpdate) SetIcon

func (fu *FeedUpdate) SetIcon(s string) *FeedUpdate

SetIcon sets the "icon" field.

func (*FeedUpdate) SetName

func (fu *FeedUpdate) SetName(s string) *FeedUpdate

SetName sets the "name" field.

func (*FeedUpdate) SetNillableCreatedAt

func (fu *FeedUpdate) SetNillableCreatedAt(t *time.Time) *FeedUpdate

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

func (*FeedUpdate) SetNillableIcon

func (fu *FeedUpdate) SetNillableIcon(s *string) *FeedUpdate

SetNillableIcon sets the "icon" field if the given value is not nil.

func (*FeedUpdate) SetNillableName

func (fu *FeedUpdate) SetNillableName(s *string) *FeedUpdate

SetNillableName sets the "name" field if the given value is not nil.

func (*FeedUpdate) SetNillablePublic

func (fu *FeedUpdate) SetNillablePublic(b *bool) *FeedUpdate

SetNillablePublic sets the "public" field if the given value is not nil.

func (*FeedUpdate) SetNillableQuery

func (fu *FeedUpdate) SetNillableQuery(s *string) *FeedUpdate

SetNillableQuery sets the "query" field if the given value is not nil.

func (*FeedUpdate) SetNillableUpdatedAt

func (fu *FeedUpdate) SetNillableUpdatedAt(t *time.Time) *FeedUpdate

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

func (*FeedUpdate) SetNillableUserID

func (fu *FeedUpdate) SetNillableUserID(s *string) *FeedUpdate

SetNillableUserID sets the "user_id" field if the given value is not nil.

func (*FeedUpdate) SetPublic

func (fu *FeedUpdate) SetPublic(b bool) *FeedUpdate

SetPublic sets the "public" field.

func (*FeedUpdate) SetQuery

func (fu *FeedUpdate) SetQuery(s string) *FeedUpdate

SetQuery sets the "query" field.

func (*FeedUpdate) SetSourceUids

func (fu *FeedUpdate) SetSourceUids(s []string) *FeedUpdate

SetSourceUids sets the "source_uids" field.

func (*FeedUpdate) SetUpdatedAt

func (fu *FeedUpdate) SetUpdatedAt(t time.Time) *FeedUpdate

SetUpdatedAt sets the "updated_at" field.

func (*FeedUpdate) SetUserID

func (fu *FeedUpdate) SetUserID(s string) *FeedUpdate

SetUserID sets the "user_id" field.

func (*FeedUpdate) Where

func (fu *FeedUpdate) Where(ps ...predicate.Feed) *FeedUpdate

Where appends a list predicates to the FeedUpdate builder.

type FeedUpdateOne

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

FeedUpdateOne is the builder for updating a single Feed entity.

func (*FeedUpdateOne) AppendSourceUids

func (fuo *FeedUpdateOne) AppendSourceUids(s []string) *FeedUpdateOne

AppendSourceUids appends s to the "source_uids" field.

func (*FeedUpdateOne) Exec

func (fuo *FeedUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*FeedUpdateOne) ExecX

func (fuo *FeedUpdateOne) ExecX(ctx context.Context)

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

func (*FeedUpdateOne) Mutation

func (fuo *FeedUpdateOne) Mutation() *FeedMutation

Mutation returns the FeedMutation object of the builder.

func (*FeedUpdateOne) Save

func (fuo *FeedUpdateOne) Save(ctx context.Context) (*Feed, error)

Save executes the query and returns the updated Feed entity.

func (*FeedUpdateOne) SaveX

func (fuo *FeedUpdateOne) SaveX(ctx context.Context) *Feed

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

func (*FeedUpdateOne) Select

func (fuo *FeedUpdateOne) Select(field string, fields ...string) *FeedUpdateOne

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

func (*FeedUpdateOne) SetCreatedAt

func (fuo *FeedUpdateOne) SetCreatedAt(t time.Time) *FeedUpdateOne

SetCreatedAt sets the "created_at" field.

func (*FeedUpdateOne) SetIcon

func (fuo *FeedUpdateOne) SetIcon(s string) *FeedUpdateOne

SetIcon sets the "icon" field.

func (*FeedUpdateOne) SetName

func (fuo *FeedUpdateOne) SetName(s string) *FeedUpdateOne

SetName sets the "name" field.

func (*FeedUpdateOne) SetNillableCreatedAt

func (fuo *FeedUpdateOne) SetNillableCreatedAt(t *time.Time) *FeedUpdateOne

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

func (*FeedUpdateOne) SetNillableIcon

func (fuo *FeedUpdateOne) SetNillableIcon(s *string) *FeedUpdateOne

SetNillableIcon sets the "icon" field if the given value is not nil.

func (*FeedUpdateOne) SetNillableName

func (fuo *FeedUpdateOne) SetNillableName(s *string) *FeedUpdateOne

SetNillableName sets the "name" field if the given value is not nil.

func (*FeedUpdateOne) SetNillablePublic

func (fuo *FeedUpdateOne) SetNillablePublic(b *bool) *FeedUpdateOne

SetNillablePublic sets the "public" field if the given value is not nil.

func (*FeedUpdateOne) SetNillableQuery

func (fuo *FeedUpdateOne) SetNillableQuery(s *string) *FeedUpdateOne

SetNillableQuery sets the "query" field if the given value is not nil.

func (*FeedUpdateOne) SetNillableUpdatedAt

func (fuo *FeedUpdateOne) SetNillableUpdatedAt(t *time.Time) *FeedUpdateOne

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

func (*FeedUpdateOne) SetNillableUserID

func (fuo *FeedUpdateOne) SetNillableUserID(s *string) *FeedUpdateOne

SetNillableUserID sets the "user_id" field if the given value is not nil.

func (*FeedUpdateOne) SetPublic

func (fuo *FeedUpdateOne) SetPublic(b bool) *FeedUpdateOne

SetPublic sets the "public" field.

func (*FeedUpdateOne) SetQuery

func (fuo *FeedUpdateOne) SetQuery(s string) *FeedUpdateOne

SetQuery sets the "query" field.

func (*FeedUpdateOne) SetSourceUids

func (fuo *FeedUpdateOne) SetSourceUids(s []string) *FeedUpdateOne

SetSourceUids sets the "source_uids" field.

func (*FeedUpdateOne) SetUpdatedAt

func (fuo *FeedUpdateOne) SetUpdatedAt(t time.Time) *FeedUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*FeedUpdateOne) SetUserID

func (fuo *FeedUpdateOne) SetUserID(s string) *FeedUpdateOne

SetUserID sets the "user_id" field.

func (*FeedUpdateOne) Where

func (fuo *FeedUpdateOne) Where(ps ...predicate.Feed) *FeedUpdateOne

Where appends a list predicates to the FeedUpdate builder.

type FeedUpsert

type FeedUpsert struct {
	*sql.UpdateSet
}

FeedUpsert is the "OnConflict" setter.

func (*FeedUpsert) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*FeedUpsert) SetIcon

func (u *FeedUpsert) SetIcon(v string) *FeedUpsert

SetIcon sets the "icon" field.

func (*FeedUpsert) SetName

func (u *FeedUpsert) SetName(v string) *FeedUpsert

SetName sets the "name" field.

func (*FeedUpsert) SetPublic

func (u *FeedUpsert) SetPublic(v bool) *FeedUpsert

SetPublic sets the "public" field.

func (*FeedUpsert) SetQuery

func (u *FeedUpsert) SetQuery(v string) *FeedUpsert

SetQuery sets the "query" field.

func (*FeedUpsert) SetSourceUids

func (u *FeedUpsert) SetSourceUids(v []string) *FeedUpsert

SetSourceUids sets the "source_uids" field.

func (*FeedUpsert) SetUpdatedAt

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

SetUpdatedAt sets the "updated_at" field.

func (*FeedUpsert) SetUserID

func (u *FeedUpsert) SetUserID(v string) *FeedUpsert

SetUserID sets the "user_id" field.

func (*FeedUpsert) UpdateCreatedAt

func (u *FeedUpsert) UpdateCreatedAt() *FeedUpsert

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

func (*FeedUpsert) UpdateIcon

func (u *FeedUpsert) UpdateIcon() *FeedUpsert

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

func (*FeedUpsert) UpdateName

func (u *FeedUpsert) UpdateName() *FeedUpsert

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

func (*FeedUpsert) UpdatePublic

func (u *FeedUpsert) UpdatePublic() *FeedUpsert

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

func (*FeedUpsert) UpdateQuery

func (u *FeedUpsert) UpdateQuery() *FeedUpsert

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

func (*FeedUpsert) UpdateSourceUids

func (u *FeedUpsert) UpdateSourceUids() *FeedUpsert

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

func (*FeedUpsert) UpdateUpdatedAt

func (u *FeedUpsert) UpdateUpdatedAt() *FeedUpsert

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

func (*FeedUpsert) UpdateUserID

func (u *FeedUpsert) UpdateUserID() *FeedUpsert

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

type FeedUpsertBulk

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

FeedUpsertBulk is the builder for "upsert"-ing a bulk of Feed nodes.

func (*FeedUpsertBulk) DoNothing

func (u *FeedUpsertBulk) DoNothing() *FeedUpsertBulk

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

func (*FeedUpsertBulk) Exec

func (u *FeedUpsertBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*FeedUpsertBulk) ExecX

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

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

func (*FeedUpsertBulk) Ignore

func (u *FeedUpsertBulk) Ignore() *FeedUpsertBulk

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

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

func (*FeedUpsertBulk) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*FeedUpsertBulk) SetIcon

func (u *FeedUpsertBulk) SetIcon(v string) *FeedUpsertBulk

SetIcon sets the "icon" field.

func (*FeedUpsertBulk) SetName

func (u *FeedUpsertBulk) SetName(v string) *FeedUpsertBulk

SetName sets the "name" field.

func (*FeedUpsertBulk) SetPublic

func (u *FeedUpsertBulk) SetPublic(v bool) *FeedUpsertBulk

SetPublic sets the "public" field.

func (*FeedUpsertBulk) SetQuery

func (u *FeedUpsertBulk) SetQuery(v string) *FeedUpsertBulk

SetQuery sets the "query" field.

func (*FeedUpsertBulk) SetSourceUids

func (u *FeedUpsertBulk) SetSourceUids(v []string) *FeedUpsertBulk

SetSourceUids sets the "source_uids" field.

func (*FeedUpsertBulk) SetUpdatedAt

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

SetUpdatedAt sets the "updated_at" field.

func (*FeedUpsertBulk) SetUserID

func (u *FeedUpsertBulk) SetUserID(v string) *FeedUpsertBulk

SetUserID sets the "user_id" field.

func (*FeedUpsertBulk) Update

func (u *FeedUpsertBulk) Update(set func(*FeedUpsert)) *FeedUpsertBulk

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

func (*FeedUpsertBulk) UpdateCreatedAt

func (u *FeedUpsertBulk) UpdateCreatedAt() *FeedUpsertBulk

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

func (*FeedUpsertBulk) UpdateIcon

func (u *FeedUpsertBulk) UpdateIcon() *FeedUpsertBulk

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

func (*FeedUpsertBulk) UpdateName

func (u *FeedUpsertBulk) UpdateName() *FeedUpsertBulk

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

func (*FeedUpsertBulk) UpdateNewValues

func (u *FeedUpsertBulk) UpdateNewValues() *FeedUpsertBulk

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

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

func (*FeedUpsertBulk) UpdatePublic

func (u *FeedUpsertBulk) UpdatePublic() *FeedUpsertBulk

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

func (*FeedUpsertBulk) UpdateQuery

func (u *FeedUpsertBulk) UpdateQuery() *FeedUpsertBulk

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

func (*FeedUpsertBulk) UpdateSourceUids

func (u *FeedUpsertBulk) UpdateSourceUids() *FeedUpsertBulk

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

func (*FeedUpsertBulk) UpdateUpdatedAt

func (u *FeedUpsertBulk) UpdateUpdatedAt() *FeedUpsertBulk

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

func (*FeedUpsertBulk) UpdateUserID

func (u *FeedUpsertBulk) UpdateUserID() *FeedUpsertBulk

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

type FeedUpsertOne

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

FeedUpsertOne is the builder for "upsert"-ing

one Feed node.

func (*FeedUpsertOne) DoNothing

func (u *FeedUpsertOne) DoNothing() *FeedUpsertOne

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

func (*FeedUpsertOne) Exec

func (u *FeedUpsertOne) Exec(ctx context.Context) error

Exec executes the query.

func (*FeedUpsertOne) ExecX

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

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

func (*FeedUpsertOne) ID

func (u *FeedUpsertOne) ID(ctx context.Context) (id string, err error)

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

func (*FeedUpsertOne) IDX

func (u *FeedUpsertOne) IDX(ctx context.Context) string

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

func (*FeedUpsertOne) Ignore

func (u *FeedUpsertOne) Ignore() *FeedUpsertOne

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

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

func (*FeedUpsertOne) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*FeedUpsertOne) SetIcon

func (u *FeedUpsertOne) SetIcon(v string) *FeedUpsertOne

SetIcon sets the "icon" field.

func (*FeedUpsertOne) SetName

func (u *FeedUpsertOne) SetName(v string) *FeedUpsertOne

SetName sets the "name" field.

func (*FeedUpsertOne) SetPublic

func (u *FeedUpsertOne) SetPublic(v bool) *FeedUpsertOne

SetPublic sets the "public" field.

func (*FeedUpsertOne) SetQuery

func (u *FeedUpsertOne) SetQuery(v string) *FeedUpsertOne

SetQuery sets the "query" field.

func (*FeedUpsertOne) SetSourceUids

func (u *FeedUpsertOne) SetSourceUids(v []string) *FeedUpsertOne

SetSourceUids sets the "source_uids" field.

func (*FeedUpsertOne) SetUpdatedAt

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

SetUpdatedAt sets the "updated_at" field.

func (*FeedUpsertOne) SetUserID

func (u *FeedUpsertOne) SetUserID(v string) *FeedUpsertOne

SetUserID sets the "user_id" field.

func (*FeedUpsertOne) Update

func (u *FeedUpsertOne) Update(set func(*FeedUpsert)) *FeedUpsertOne

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

func (*FeedUpsertOne) UpdateCreatedAt

func (u *FeedUpsertOne) UpdateCreatedAt() *FeedUpsertOne

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

func (*FeedUpsertOne) UpdateIcon

func (u *FeedUpsertOne) UpdateIcon() *FeedUpsertOne

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

func (*FeedUpsertOne) UpdateName

func (u *FeedUpsertOne) UpdateName() *FeedUpsertOne

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

func (*FeedUpsertOne) UpdateNewValues

func (u *FeedUpsertOne) UpdateNewValues() *FeedUpsertOne

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

func (*FeedUpsertOne) UpdatePublic

func (u *FeedUpsertOne) UpdatePublic() *FeedUpsertOne

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

func (*FeedUpsertOne) UpdateQuery

func (u *FeedUpsertOne) UpdateQuery() *FeedUpsertOne

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

func (*FeedUpsertOne) UpdateSourceUids

func (u *FeedUpsertOne) UpdateSourceUids() *FeedUpsertOne

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

func (*FeedUpsertOne) UpdateUpdatedAt

func (u *FeedUpsertOne) UpdateUpdatedAt() *FeedUpsertOne

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

func (*FeedUpsertOne) UpdateUserID

func (u *FeedUpsertOne) UpdateUserID() *FeedUpsertOne

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

type Feeds

type Feeds []*Feed

Feeds is a parsable slice of Feed.

type Hook

type Hook = ent.Hook

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

type InterceptFunc

type InterceptFunc = ent.InterceptFunc

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

type Interceptor

type Interceptor = ent.Interceptor

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

type MutateFunc

type MutateFunc = ent.MutateFunc

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

type Mutation

type Mutation = ent.Mutation

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

type Mutator

type Mutator = ent.Mutator

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

type NotFoundError

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

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

func (*NotFoundError) Error

func (e *NotFoundError) Error() string

Error implements the error interface.

type NotLoadedError

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

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

func (*NotLoadedError) Error

func (e *NotLoadedError) Error() string

Error implements the error interface.

type NotSingularError

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

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

func (*NotSingularError) Error

func (e *NotSingularError) Error() string

Error implements the error interface.

type Op

type Op = ent.Op

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

type Option

type Option func(*config)

Option function to configure the client.

func Debug

func Debug() Option

Debug enables debug logging on the ent.Driver.

func Driver

func Driver(driver dialect.Driver) Option

Driver configures the client driver.

func Log

func Log(fn func(...any)) Option

Log sets the logging function for debug mode.

type OrderFunc

type OrderFunc func(*sql.Selector)

OrderFunc applies an ordering on the sql selector. 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 Source

type Source struct {

	// ID of the ent.
	ID string `json:"id,omitempty"`
	// Name holds the value of the "name" field.
	Name string `json:"name,omitempty"`
	// URL holds the value of the "url" field.
	URL string `json:"url,omitempty"`
	// Type holds the value of the "type" field.
	Type string `json:"type,omitempty"`
	// RawJSON holds the value of the "raw_json" field.
	RawJSON string `json:"raw_json,omitempty"`
	// contains filtered or unexported fields
}

Source is the model entity for the Source schema.

func (*Source) String

func (s *Source) String() string

String implements the fmt.Stringer.

func (*Source) Unwrap

func (s *Source) Unwrap() *Source

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

func (s *Source) Update() *SourceUpdateOne

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

func (*Source) Value

func (s *Source) Value(name string) (ent.Value, error)

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

type SourceClient

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

SourceClient is a client for the Source schema.

func NewSourceClient

func NewSourceClient(c config) *SourceClient

NewSourceClient returns a client for the Source from the given config.

func (*SourceClient) Create

func (c *SourceClient) Create() *SourceCreate

Create returns a builder for creating a Source entity.

func (*SourceClient) CreateBulk

func (c *SourceClient) CreateBulk(builders ...*SourceCreate) *SourceCreateBulk

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

func (*SourceClient) Delete

func (c *SourceClient) Delete() *SourceDelete

Delete returns a delete builder for Source.

func (*SourceClient) DeleteOne

func (c *SourceClient) DeleteOne(s *Source) *SourceDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*SourceClient) DeleteOneID

func (c *SourceClient) DeleteOneID(id string) *SourceDeleteOne

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

func (*SourceClient) Get

func (c *SourceClient) Get(ctx context.Context, id string) (*Source, error)

Get returns a Source entity by its id.

func (*SourceClient) GetX

func (c *SourceClient) GetX(ctx context.Context, id string) *Source

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

func (*SourceClient) Hooks

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

Hooks returns the client hooks.

func (*SourceClient) Intercept

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

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

func (*SourceClient) Interceptors

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

Interceptors returns the client interceptors.

func (*SourceClient) MapCreateBulk

func (c *SourceClient) MapCreateBulk(slice any, setFunc func(*SourceCreate, int)) *SourceCreateBulk

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 (*SourceClient) Query

func (c *SourceClient) Query() *SourceQuery

Query returns a query builder for Source.

func (*SourceClient) Update

func (c *SourceClient) Update() *SourceUpdate

Update returns an update builder for Source.

func (*SourceClient) UpdateOne

func (c *SourceClient) UpdateOne(s *Source) *SourceUpdateOne

UpdateOne returns an update builder for the given entity.

func (*SourceClient) UpdateOneID

func (c *SourceClient) UpdateOneID(id string) *SourceUpdateOne

UpdateOneID returns an update builder for the given id.

func (*SourceClient) Use

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

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

type SourceCreate

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

SourceCreate is the builder for creating a Source entity.

func (*SourceCreate) Exec

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

Exec executes the query.

func (*SourceCreate) ExecX

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

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

func (*SourceCreate) Mutation

func (sc *SourceCreate) Mutation() *SourceMutation

Mutation returns the SourceMutation object of the builder.

func (*SourceCreate) OnConflict

func (sc *SourceCreate) OnConflict(opts ...sql.ConflictOption) *SourceUpsertOne

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

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

func (*SourceCreate) OnConflictColumns

func (sc *SourceCreate) OnConflictColumns(columns ...string) *SourceUpsertOne

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

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

func (*SourceCreate) Save

func (sc *SourceCreate) Save(ctx context.Context) (*Source, error)

Save creates the Source in the database.

func (*SourceCreate) SaveX

func (sc *SourceCreate) SaveX(ctx context.Context) *Source

SaveX calls Save and panics if Save returns an error.

func (*SourceCreate) SetID

func (sc *SourceCreate) SetID(s string) *SourceCreate

SetID sets the "id" field.

func (*SourceCreate) SetName

func (sc *SourceCreate) SetName(s string) *SourceCreate

SetName sets the "name" field.

func (*SourceCreate) SetRawJSON

func (sc *SourceCreate) SetRawJSON(s string) *SourceCreate

SetRawJSON sets the "raw_json" field.

func (*SourceCreate) SetType

func (sc *SourceCreate) SetType(s string) *SourceCreate

SetType sets the "type" field.

func (*SourceCreate) SetURL

func (sc *SourceCreate) SetURL(s string) *SourceCreate

SetURL sets the "url" field.

type SourceCreateBulk

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

SourceCreateBulk is the builder for creating many Source entities in bulk.

func (*SourceCreateBulk) Exec

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

Exec executes the query.

func (*SourceCreateBulk) ExecX

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

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

func (*SourceCreateBulk) OnConflict

func (scb *SourceCreateBulk) OnConflict(opts ...sql.ConflictOption) *SourceUpsertBulk

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

client.Source.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.SourceUpsert) {
		SetName(v+v).
	}).
	Exec(ctx)

func (*SourceCreateBulk) OnConflictColumns

func (scb *SourceCreateBulk) OnConflictColumns(columns ...string) *SourceUpsertBulk

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

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

func (*SourceCreateBulk) Save

func (scb *SourceCreateBulk) Save(ctx context.Context) ([]*Source, error)

Save creates the Source entities in the database.

func (*SourceCreateBulk) SaveX

func (scb *SourceCreateBulk) SaveX(ctx context.Context) []*Source

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

type SourceDelete

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

SourceDelete is the builder for deleting a Source entity.

func (*SourceDelete) Exec

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

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

func (*SourceDelete) ExecX

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

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

func (*SourceDelete) Where

func (sd *SourceDelete) Where(ps ...predicate.Source) *SourceDelete

Where appends a list predicates to the SourceDelete builder.

type SourceDeleteOne

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

SourceDeleteOne is the builder for deleting a single Source entity.

func (*SourceDeleteOne) Exec

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

Exec executes the deletion query.

func (*SourceDeleteOne) ExecX

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

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

func (*SourceDeleteOne) Where

func (sdo *SourceDeleteOne) Where(ps ...predicate.Source) *SourceDeleteOne

Where appends a list predicates to the SourceDelete builder.

type SourceGroupBy

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

SourceGroupBy is the group-by builder for Source entities.

func (*SourceGroupBy) Aggregate

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

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

func (*SourceGroupBy) Bool

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

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

func (*SourceGroupBy) BoolX

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

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

func (*SourceGroupBy) Bools

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

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

func (*SourceGroupBy) BoolsX

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

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

func (*SourceGroupBy) Float64

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

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

func (*SourceGroupBy) Float64X

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

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

func (*SourceGroupBy) Float64s

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

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

func (*SourceGroupBy) Float64sX

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

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

func (*SourceGroupBy) Int

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

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

func (*SourceGroupBy) IntX

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

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

func (*SourceGroupBy) Ints

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

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

func (*SourceGroupBy) IntsX

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

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

func (*SourceGroupBy) Scan

func (sgb *SourceGroupBy) Scan(ctx context.Context, v any) error

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

func (*SourceGroupBy) ScanX

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

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

func (*SourceGroupBy) String

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

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

func (*SourceGroupBy) StringX

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

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

func (*SourceGroupBy) Strings

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

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

func (*SourceGroupBy) StringsX

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

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

type SourceMutation

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

SourceMutation represents an operation that mutates the Source nodes in the graph.

func (*SourceMutation) AddField

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

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

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

func (*SourceMutation) AddedField

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

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

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

func (*SourceMutation) AddedIDs

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

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

func (*SourceMutation) ClearEdge

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

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

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

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

func (*SourceMutation) ClearedFields

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

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

func (SourceMutation) Client

func (m SourceMutation) 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 (*SourceMutation) EdgeCleared

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

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

func (*SourceMutation) Field

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

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

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

func (*SourceMutation) Fields

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

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

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

func (*SourceMutation) ID

func (m *SourceMutation) ID() (id string, 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 (*SourceMutation) IDs

func (m *SourceMutation) IDs(ctx context.Context) ([]string, 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 (*SourceMutation) Name

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

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

func (*SourceMutation) OldField

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

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

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

func (m *SourceMutation) OldRawJSON(ctx context.Context) (v string, err error)

OldRawJSON returns the old "raw_json" field's value of the Source entity. If the Source 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 (*SourceMutation) OldType

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

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

func (m *SourceMutation) OldURL(ctx context.Context) (v string, err error)

OldURL returns the old "url" field's value of the Source entity. If the Source 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 (*SourceMutation) Op

func (m *SourceMutation) Op() Op

Op returns the operation name.

func (*SourceMutation) RawJSON

func (m *SourceMutation) RawJSON() (r string, exists bool)

RawJSON returns the value of the "raw_json" field in the mutation.

func (*SourceMutation) RemovedEdges

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

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

func (*SourceMutation) RemovedIDs

func (m *SourceMutation) 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 (*SourceMutation) ResetEdge

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

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

func (m *SourceMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*SourceMutation) ResetRawJSON

func (m *SourceMutation) ResetRawJSON()

ResetRawJSON resets all changes to the "raw_json" field.

func (*SourceMutation) ResetType

func (m *SourceMutation) ResetType()

ResetType resets all changes to the "type" field.

func (*SourceMutation) ResetURL

func (m *SourceMutation) ResetURL()

ResetURL resets all changes to the "url" field.

func (*SourceMutation) SetField

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

func (m *SourceMutation) SetID(id string)

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

func (*SourceMutation) SetName

func (m *SourceMutation) SetName(s string)

SetName sets the "name" field.

func (*SourceMutation) SetOp

func (m *SourceMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*SourceMutation) SetRawJSON

func (m *SourceMutation) SetRawJSON(s string)

SetRawJSON sets the "raw_json" field.

func (*SourceMutation) SetType

func (m *SourceMutation) SetType(s string)

SetType sets the "type" field.

func (*SourceMutation) SetURL

func (m *SourceMutation) SetURL(s string)

SetURL sets the "url" field.

func (SourceMutation) Tx

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

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

func (*SourceMutation) Type

func (m *SourceMutation) Type() string

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

func (*SourceMutation) URL

func (m *SourceMutation) URL() (r string, exists bool)

URL returns the value of the "url" field in the mutation.

func (*SourceMutation) Where

func (m *SourceMutation) Where(ps ...predicate.Source)

Where appends a list predicates to the SourceMutation builder.

func (*SourceMutation) WhereP

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

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

type SourceQuery

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

SourceQuery is the builder for querying Source entities.

func (*SourceQuery) Aggregate

func (sq *SourceQuery) Aggregate(fns ...AggregateFunc) *SourceSelect

Aggregate returns a SourceSelect configured with the given aggregations.

func (*SourceQuery) All

func (sq *SourceQuery) All(ctx context.Context) ([]*Source, error)

All executes the query and returns a list of Sources.

func (*SourceQuery) AllX

func (sq *SourceQuery) AllX(ctx context.Context) []*Source

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

func (*SourceQuery) Clone

func (sq *SourceQuery) Clone() *SourceQuery

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

func (*SourceQuery) Count

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

Count returns the count of the given query.

func (*SourceQuery) CountX

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

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

func (*SourceQuery) Exist

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

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

func (*SourceQuery) ExistX

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

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

func (*SourceQuery) First

func (sq *SourceQuery) First(ctx context.Context) (*Source, error)

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

func (*SourceQuery) FirstID

func (sq *SourceQuery) FirstID(ctx context.Context) (id string, err error)

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

func (*SourceQuery) FirstIDX

func (sq *SourceQuery) FirstIDX(ctx context.Context) string

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

func (*SourceQuery) FirstX

func (sq *SourceQuery) FirstX(ctx context.Context) *Source

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

func (*SourceQuery) GroupBy

func (sq *SourceQuery) GroupBy(field string, fields ...string) *SourceGroupBy

GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.

Example:

var v []struct {
	Name string `json:"name,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Source.Query().
	GroupBy(source.FieldName).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*SourceQuery) IDs

func (sq *SourceQuery) IDs(ctx context.Context) (ids []string, err error)

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

func (*SourceQuery) IDsX

func (sq *SourceQuery) IDsX(ctx context.Context) []string

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

func (*SourceQuery) Limit

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

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

func (*SourceQuery) Offset

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

Offset to start from.

func (*SourceQuery) Only

func (sq *SourceQuery) Only(ctx context.Context) (*Source, error)

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

func (*SourceQuery) OnlyID

func (sq *SourceQuery) OnlyID(ctx context.Context) (id string, err error)

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

func (*SourceQuery) OnlyIDX

func (sq *SourceQuery) OnlyIDX(ctx context.Context) string

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

func (*SourceQuery) OnlyX

func (sq *SourceQuery) OnlyX(ctx context.Context) *Source

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

func (*SourceQuery) Order

func (sq *SourceQuery) Order(o ...source.OrderOption) *SourceQuery

Order specifies how the records should be ordered.

func (*SourceQuery) Select

func (sq *SourceQuery) Select(fields ...string) *SourceSelect

Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.

Example:

var v []struct {
	Name string `json:"name,omitempty"`
}

client.Source.Query().
	Select(source.FieldName).
	Scan(ctx, &v)

func (*SourceQuery) Unique

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

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

func (sq *SourceQuery) Where(ps ...predicate.Source) *SourceQuery

Where adds a new predicate for the SourceQuery builder.

type SourceSelect

type SourceSelect struct {
	*SourceQuery
	// contains filtered or unexported fields
}

SourceSelect is the builder for selecting fields of Source entities.

func (*SourceSelect) Aggregate

func (ss *SourceSelect) Aggregate(fns ...AggregateFunc) *SourceSelect

Aggregate adds the given aggregation functions to the selector query.

func (*SourceSelect) Bool

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

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

func (*SourceSelect) BoolX

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

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

func (*SourceSelect) Bools

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

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

func (*SourceSelect) BoolsX

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

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

func (*SourceSelect) Float64

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

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

func (*SourceSelect) Float64X

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

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

func (*SourceSelect) Float64s

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

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

func (*SourceSelect) Float64sX

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

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

func (*SourceSelect) Int

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

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

func (*SourceSelect) IntX

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

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

func (*SourceSelect) Ints

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

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

func (*SourceSelect) IntsX

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

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

func (*SourceSelect) Scan

func (ss *SourceSelect) Scan(ctx context.Context, v any) error

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

func (*SourceSelect) ScanX

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

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

func (*SourceSelect) String

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

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

func (*SourceSelect) StringX

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

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

func (*SourceSelect) Strings

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

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

func (*SourceSelect) StringsX

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

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

type SourceUpdate

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

SourceUpdate is the builder for updating Source entities.

func (*SourceUpdate) Exec

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

Exec executes the query.

func (*SourceUpdate) ExecX

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

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

func (*SourceUpdate) Mutation

func (su *SourceUpdate) Mutation() *SourceMutation

Mutation returns the SourceMutation object of the builder.

func (*SourceUpdate) Save

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

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

func (*SourceUpdate) SaveX

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

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

func (*SourceUpdate) SetName

func (su *SourceUpdate) SetName(s string) *SourceUpdate

SetName sets the "name" field.

func (*SourceUpdate) SetNillableName

func (su *SourceUpdate) SetNillableName(s *string) *SourceUpdate

SetNillableName sets the "name" field if the given value is not nil.

func (*SourceUpdate) SetNillableRawJSON

func (su *SourceUpdate) SetNillableRawJSON(s *string) *SourceUpdate

SetNillableRawJSON sets the "raw_json" field if the given value is not nil.

func (*SourceUpdate) SetNillableType

func (su *SourceUpdate) SetNillableType(s *string) *SourceUpdate

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

func (*SourceUpdate) SetNillableURL

func (su *SourceUpdate) SetNillableURL(s *string) *SourceUpdate

SetNillableURL sets the "url" field if the given value is not nil.

func (*SourceUpdate) SetRawJSON

func (su *SourceUpdate) SetRawJSON(s string) *SourceUpdate

SetRawJSON sets the "raw_json" field.

func (*SourceUpdate) SetType

func (su *SourceUpdate) SetType(s string) *SourceUpdate

SetType sets the "type" field.

func (*SourceUpdate) SetURL

func (su *SourceUpdate) SetURL(s string) *SourceUpdate

SetURL sets the "url" field.

func (*SourceUpdate) Where

func (su *SourceUpdate) Where(ps ...predicate.Source) *SourceUpdate

Where appends a list predicates to the SourceUpdate builder.

type SourceUpdateOne

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

SourceUpdateOne is the builder for updating a single Source entity.

func (*SourceUpdateOne) Exec

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

Exec executes the query on the entity.

func (*SourceUpdateOne) ExecX

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

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

func (*SourceUpdateOne) Mutation

func (suo *SourceUpdateOne) Mutation() *SourceMutation

Mutation returns the SourceMutation object of the builder.

func (*SourceUpdateOne) Save

func (suo *SourceUpdateOne) Save(ctx context.Context) (*Source, error)

Save executes the query and returns the updated Source entity.

func (*SourceUpdateOne) SaveX

func (suo *SourceUpdateOne) SaveX(ctx context.Context) *Source

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

func (*SourceUpdateOne) Select

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

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

func (*SourceUpdateOne) SetName

func (suo *SourceUpdateOne) SetName(s string) *SourceUpdateOne

SetName sets the "name" field.

func (*SourceUpdateOne) SetNillableName

func (suo *SourceUpdateOne) SetNillableName(s *string) *SourceUpdateOne

SetNillableName sets the "name" field if the given value is not nil.

func (*SourceUpdateOne) SetNillableRawJSON

func (suo *SourceUpdateOne) SetNillableRawJSON(s *string) *SourceUpdateOne

SetNillableRawJSON sets the "raw_json" field if the given value is not nil.

func (*SourceUpdateOne) SetNillableType

func (suo *SourceUpdateOne) SetNillableType(s *string) *SourceUpdateOne

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

func (*SourceUpdateOne) SetNillableURL

func (suo *SourceUpdateOne) SetNillableURL(s *string) *SourceUpdateOne

SetNillableURL sets the "url" field if the given value is not nil.

func (*SourceUpdateOne) SetRawJSON

func (suo *SourceUpdateOne) SetRawJSON(s string) *SourceUpdateOne

SetRawJSON sets the "raw_json" field.

func (*SourceUpdateOne) SetType

func (suo *SourceUpdateOne) SetType(s string) *SourceUpdateOne

SetType sets the "type" field.

func (*SourceUpdateOne) SetURL

func (suo *SourceUpdateOne) SetURL(s string) *SourceUpdateOne

SetURL sets the "url" field.

func (*SourceUpdateOne) Where

func (suo *SourceUpdateOne) Where(ps ...predicate.Source) *SourceUpdateOne

Where appends a list predicates to the SourceUpdate builder.

type SourceUpsert

type SourceUpsert struct {
	*sql.UpdateSet
}

SourceUpsert is the "OnConflict" setter.

func (*SourceUpsert) SetName

func (u *SourceUpsert) SetName(v string) *SourceUpsert

SetName sets the "name" field.

func (*SourceUpsert) SetRawJSON

func (u *SourceUpsert) SetRawJSON(v string) *SourceUpsert

SetRawJSON sets the "raw_json" field.

func (*SourceUpsert) SetType

func (u *SourceUpsert) SetType(v string) *SourceUpsert

SetType sets the "type" field.

func (*SourceUpsert) SetURL

func (u *SourceUpsert) SetURL(v string) *SourceUpsert

SetURL sets the "url" field.

func (*SourceUpsert) UpdateName

func (u *SourceUpsert) UpdateName() *SourceUpsert

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

func (*SourceUpsert) UpdateRawJSON

func (u *SourceUpsert) UpdateRawJSON() *SourceUpsert

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

func (*SourceUpsert) UpdateType

func (u *SourceUpsert) UpdateType() *SourceUpsert

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

func (*SourceUpsert) UpdateURL

func (u *SourceUpsert) UpdateURL() *SourceUpsert

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

type SourceUpsertBulk

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

SourceUpsertBulk is the builder for "upsert"-ing a bulk of Source nodes.

func (*SourceUpsertBulk) DoNothing

func (u *SourceUpsertBulk) DoNothing() *SourceUpsertBulk

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

func (*SourceUpsertBulk) Exec

func (u *SourceUpsertBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*SourceUpsertBulk) ExecX

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

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

func (*SourceUpsertBulk) Ignore

func (u *SourceUpsertBulk) Ignore() *SourceUpsertBulk

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

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

func (*SourceUpsertBulk) SetName

func (u *SourceUpsertBulk) SetName(v string) *SourceUpsertBulk

SetName sets the "name" field.

func (*SourceUpsertBulk) SetRawJSON

func (u *SourceUpsertBulk) SetRawJSON(v string) *SourceUpsertBulk

SetRawJSON sets the "raw_json" field.

func (*SourceUpsertBulk) SetType

func (u *SourceUpsertBulk) SetType(v string) *SourceUpsertBulk

SetType sets the "type" field.

func (*SourceUpsertBulk) SetURL

SetURL sets the "url" field.

func (*SourceUpsertBulk) Update

func (u *SourceUpsertBulk) Update(set func(*SourceUpsert)) *SourceUpsertBulk

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

func (*SourceUpsertBulk) UpdateName

func (u *SourceUpsertBulk) UpdateName() *SourceUpsertBulk

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

func (*SourceUpsertBulk) UpdateNewValues

func (u *SourceUpsertBulk) UpdateNewValues() *SourceUpsertBulk

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

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

func (*SourceUpsertBulk) UpdateRawJSON

func (u *SourceUpsertBulk) UpdateRawJSON() *SourceUpsertBulk

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

func (*SourceUpsertBulk) UpdateType

func (u *SourceUpsertBulk) UpdateType() *SourceUpsertBulk

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

func (*SourceUpsertBulk) UpdateURL

func (u *SourceUpsertBulk) UpdateURL() *SourceUpsertBulk

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

type SourceUpsertOne

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

SourceUpsertOne is the builder for "upsert"-ing

one Source node.

func (*SourceUpsertOne) DoNothing

func (u *SourceUpsertOne) DoNothing() *SourceUpsertOne

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

func (*SourceUpsertOne) Exec

func (u *SourceUpsertOne) Exec(ctx context.Context) error

Exec executes the query.

func (*SourceUpsertOne) ExecX

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

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

func (*SourceUpsertOne) ID

func (u *SourceUpsertOne) ID(ctx context.Context) (id string, err error)

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

func (*SourceUpsertOne) IDX

func (u *SourceUpsertOne) IDX(ctx context.Context) string

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

func (*SourceUpsertOne) Ignore

func (u *SourceUpsertOne) Ignore() *SourceUpsertOne

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

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

func (*SourceUpsertOne) SetName

func (u *SourceUpsertOne) SetName(v string) *SourceUpsertOne

SetName sets the "name" field.

func (*SourceUpsertOne) SetRawJSON

func (u *SourceUpsertOne) SetRawJSON(v string) *SourceUpsertOne

SetRawJSON sets the "raw_json" field.

func (*SourceUpsertOne) SetType

func (u *SourceUpsertOne) SetType(v string) *SourceUpsertOne

SetType sets the "type" field.

func (*SourceUpsertOne) SetURL

func (u *SourceUpsertOne) SetURL(v string) *SourceUpsertOne

SetURL sets the "url" field.

func (*SourceUpsertOne) Update

func (u *SourceUpsertOne) Update(set func(*SourceUpsert)) *SourceUpsertOne

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

func (*SourceUpsertOne) UpdateName

func (u *SourceUpsertOne) UpdateName() *SourceUpsertOne

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

func (*SourceUpsertOne) UpdateNewValues

func (u *SourceUpsertOne) UpdateNewValues() *SourceUpsertOne

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

func (*SourceUpsertOne) UpdateRawJSON

func (u *SourceUpsertOne) UpdateRawJSON() *SourceUpsertOne

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

func (*SourceUpsertOne) UpdateType

func (u *SourceUpsertOne) UpdateType() *SourceUpsertOne

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

func (*SourceUpsertOne) UpdateURL

func (u *SourceUpsertOne) UpdateURL() *SourceUpsertOne

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

type Sources

type Sources []*Source

Sources is a parsable slice of Source.

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 {

	// Activity is the client for interacting with the Activity builders.
	Activity *ActivityClient
	// Feed is the client for interacting with the Feed builders.
	Feed *FeedClient
	// Source is the client for interacting with the Source builders.
	Source *SourceClient
	// contains filtered or unexported fields
}

Tx is a transactional client that is created by calling Client.Tx().

func TxFromContext

func TxFromContext(ctx context.Context) *Tx

TxFromContext returns a Tx stored inside a context, or nil if there isn't one.

func (*Tx) Client

func (tx *Tx) Client() *Client

Client returns a Client that binds to current transaction.

func (*Tx) Commit

func (tx *Tx) Commit() error

Commit commits the transaction.

func (*Tx) OnCommit

func (tx *Tx) OnCommit(f CommitHook)

OnCommit adds a hook to call on commit.

func (*Tx) OnRollback

func (tx *Tx) OnRollback(f RollbackHook)

OnRollback adds a hook to call on rollback.

func (*Tx) Rollback

func (tx *Tx) Rollback() error

Rollback rollbacks the transaction.

type ValidationError

type ValidationError struct {
	Name string // Field or edge name.
	// contains filtered or unexported fields
}

ValidationError returns when validating a field or edge fails.

func (*ValidationError) Error

func (e *ValidationError) Error() string

Error implements the error interface.

func (*ValidationError) Unwrap

func (e *ValidationError) Unwrap() error

Unwrap implements the errors.Wrapper interface.

type Value

type Value = ent.Value

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL