ent

package
v0.0.0-...-187b2eb Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2023 License: Apache-2.0 Imports: 21 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.
	TypePlatform = "Platform"
	TypeRepo     = "Repo"
	TypeTopic    = "Topic"
)

Variables

This section is empty.

Functions

func IsConstraintError

func IsConstraintError(err error) bool

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

func IsNotFound

func IsNotFound(err error) bool

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

func IsNotLoaded

func IsNotLoaded(err error) bool

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

func IsNotSingular

func IsNotSingular(err error) bool

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

func IsValidationError

func IsValidationError(err error) bool

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

func MaskNotFound

func MaskNotFound(err error) error

MaskNotFound masks not found error.

func NewContext

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

NewContext returns a new context with the given Client attached.

func NewTxContext

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

NewTxContext returns a new context with the given Tx attached.

Types

type AggregateFunc

type AggregateFunc func(*sql.Selector) string

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

func As

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

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

func Count

func Count() AggregateFunc

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

func Max

func Max(field string) AggregateFunc

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

func Mean

func Mean(field string) AggregateFunc

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

func Min

func Min(field string) AggregateFunc

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

func Sum

func Sum(field string) AggregateFunc

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

type Client

type Client struct {

	// Schema is the client for creating, migrating and dropping schema.
	Schema *migrate.Schema
	// Platform is the client for interacting with the Platform builders.
	Platform *PlatformClient
	// Repo is the client for interacting with the Repo builders.
	Repo *RepoClient
	// Topic is the client for interacting with the Topic builders.
	Topic *TopicClient
	// 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().
	Platform.
	Query().
	Count(ctx)

func (*Client) ExecContext

func (c *Client) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

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

func (c *Client) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*Client) Tx

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

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

func (*Client) Use

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

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

type CommitFunc

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

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

func (CommitFunc) Commit

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

Commit calls f(ctx, m).

type CommitHook

type CommitHook func(Committer) Committer

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

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

type Committer

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

Committer is the interface that wraps the Commit method.

type ConstraintError

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

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

func (ConstraintError) Error

func (e ConstraintError) Error() string

Error implements the error interface.

func (*ConstraintError) Unwrap

func (e *ConstraintError) Unwrap() error

Unwrap implements the errors.Wrapper interface.

type Hook

type Hook = ent.Hook

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

type InterceptFunc

type InterceptFunc = ent.InterceptFunc

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

type Interceptor

type Interceptor = ent.Interceptor

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

type MutateFunc

type MutateFunc = ent.MutateFunc

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

type Mutation

type Mutation = ent.Mutation

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

type Mutator

type Mutator = ent.Mutator

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

type NotFoundError

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

NotFoundError returns when trying to fetch a specific entity and it was not found in the database.

func (*NotFoundError) Error

func (e *NotFoundError) Error() string

Error implements the error interface.

type NotLoadedError

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

NotLoadedError returns when trying to get a node that was not loaded by the query.

func (*NotLoadedError) Error

func (e *NotLoadedError) Error() string

Error implements the error interface.

type NotSingularError

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

NotSingularError returns when trying to fetch a singular entity and more then one was found in the database.

func (*NotSingularError) Error

func (e *NotSingularError) Error() string

Error implements the error interface.

type Op

type Op = ent.Op

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

type Option

type Option func(*config)

Option function to configure the client.

func Debug

func Debug() Option

Debug enables debug logging on the ent.Driver.

func Driver

func Driver(driver dialect.Driver) Option

Driver configures the client driver.

func Log

func Log(fn func(...any)) Option

Log sets the logging function for debug mode.

type OrderFunc

type OrderFunc func(*sql.Selector)

OrderFunc applies an ordering on the sql selector.

func Asc

func Asc(fields ...string) OrderFunc

Asc applies the given fields in ASC order.

func Desc

func Desc(fields ...string) OrderFunc

Desc applies the given fields in DESC order.

type Platform

type Platform struct {

	// ID of the ent.
	ID int `json:"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"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the PlatformQuery when eager-loading is set.
	Edges PlatformEdges `json:"-"`
	// contains filtered or unexported fields
}

Platform is the model entity for the Platform schema.

func (*Platform) ExecContext

func (c *Platform) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*Platform) QueryContext

func (c *Platform) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*Platform) QueryTopics

func (pl *Platform) QueryTopics() *TopicQuery

QueryTopics queries the "topics" edge of the Platform entity.

func (*Platform) String

func (pl *Platform) String() string

String implements the fmt.Stringer.

func (*Platform) Unwrap

func (pl *Platform) Unwrap() *Platform

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

func (pl *Platform) Update() *PlatformUpdateOne

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

type PlatformClient

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

PlatformClient is a client for the Platform schema.

func NewPlatformClient

func NewPlatformClient(c config) *PlatformClient

NewPlatformClient returns a client for the Platform from the given config.

func (*PlatformClient) Create

func (c *PlatformClient) Create() *PlatformCreate

Create returns a builder for creating a Platform entity.

func (*PlatformClient) CreateBulk

func (c *PlatformClient) CreateBulk(builders ...*PlatformCreate) *PlatformCreateBulk

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

func (*PlatformClient) Delete

func (c *PlatformClient) Delete() *PlatformDelete

Delete returns a delete builder for Platform.

func (*PlatformClient) DeleteOne

func (c *PlatformClient) DeleteOne(pl *Platform) *PlatformDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*PlatformClient) DeleteOneID

func (c *PlatformClient) DeleteOneID(id int) *PlatformDeleteOne

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

func (*PlatformClient) ExecContext

func (c *PlatformClient) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*PlatformClient) Get

func (c *PlatformClient) Get(ctx context.Context, id int) (*Platform, error)

Get returns a Platform entity by its id.

func (*PlatformClient) GetX

func (c *PlatformClient) GetX(ctx context.Context, id int) *Platform

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

func (*PlatformClient) Hooks

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

Hooks returns the client hooks.

func (*PlatformClient) Intercept

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

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

func (*PlatformClient) Interceptors

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

Interceptors returns the client interceptors.

func (*PlatformClient) Query

func (c *PlatformClient) Query() *PlatformQuery

Query returns a query builder for Platform.

func (*PlatformClient) QueryContext

func (c *PlatformClient) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*PlatformClient) QueryTopics

func (c *PlatformClient) QueryTopics(pl *Platform) *TopicQuery

QueryTopics queries the topics edge of a Platform.

func (*PlatformClient) Update

func (c *PlatformClient) Update() *PlatformUpdate

Update returns an update builder for Platform.

func (*PlatformClient) UpdateOne

func (c *PlatformClient) UpdateOne(pl *Platform) *PlatformUpdateOne

UpdateOne returns an update builder for the given entity.

func (*PlatformClient) UpdateOneID

func (c *PlatformClient) UpdateOneID(id int) *PlatformUpdateOne

UpdateOneID returns an update builder for the given id.

func (*PlatformClient) Use

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

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

type PlatformCreate

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

PlatformCreate is the builder for creating a Platform entity.

func (*PlatformCreate) AddTopicIDs

func (pc *PlatformCreate) AddTopicIDs(ids ...int) *PlatformCreate

AddTopicIDs adds the "topics" edge to the Topic entity by IDs.

func (*PlatformCreate) AddTopics

func (pc *PlatformCreate) AddTopics(t ...*Topic) *PlatformCreate

AddTopics adds the "topics" edges to the Topic entity.

func (*PlatformCreate) Exec

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

Exec executes the query.

func (*PlatformCreate) ExecContext

func (c *PlatformCreate) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*PlatformCreate) ExecX

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

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

func (*PlatformCreate) Mutation

func (pc *PlatformCreate) Mutation() *PlatformMutation

Mutation returns the PlatformMutation object of the builder.

func (*PlatformCreate) OnConflict

func (pc *PlatformCreate) OnConflict(opts ...sql.ConflictOption) *PlatformUpsertOne

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

client.Platform.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.PlatformUpsert) {
		SetName(v+v).
	}).
	Exec(ctx)

func (*PlatformCreate) OnConflictColumns

func (pc *PlatformCreate) OnConflictColumns(columns ...string) *PlatformUpsertOne

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

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

func (*PlatformCreate) QueryContext

func (c *PlatformCreate) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*PlatformCreate) Save

func (pc *PlatformCreate) Save(ctx context.Context) (*Platform, error)

Save creates the Platform in the database.

func (*PlatformCreate) SaveX

func (pc *PlatformCreate) SaveX(ctx context.Context) *Platform

SaveX calls Save and panics if Save returns an error.

func (*PlatformCreate) SetIcon

func (pc *PlatformCreate) SetIcon(s string) *PlatformCreate

SetIcon sets the "icon" field.

func (*PlatformCreate) SetName

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

SetName sets the "name" field.

func (*PlatformCreate) SetNillableIcon

func (pc *PlatformCreate) SetNillableIcon(s *string) *PlatformCreate

SetNillableIcon sets the "icon" field if the given value is not nil.

type PlatformCreateBulk

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

PlatformCreateBulk is the builder for creating many Platform entities in bulk.

func (*PlatformCreateBulk) Exec

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

Exec executes the query.

func (*PlatformCreateBulk) ExecContext

func (c *PlatformCreateBulk) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*PlatformCreateBulk) ExecX

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

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

func (*PlatformCreateBulk) OnConflict

func (pcb *PlatformCreateBulk) OnConflict(opts ...sql.ConflictOption) *PlatformUpsertBulk

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

client.Platform.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.PlatformUpsert) {
		SetName(v+v).
	}).
	Exec(ctx)

func (*PlatformCreateBulk) OnConflictColumns

func (pcb *PlatformCreateBulk) OnConflictColumns(columns ...string) *PlatformUpsertBulk

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

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

func (*PlatformCreateBulk) QueryContext

func (c *PlatformCreateBulk) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*PlatformCreateBulk) Save

func (pcb *PlatformCreateBulk) Save(ctx context.Context) ([]*Platform, error)

Save creates the Platform entities in the database.

func (*PlatformCreateBulk) SaveX

func (pcb *PlatformCreateBulk) SaveX(ctx context.Context) []*Platform

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

type PlatformDelete

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

PlatformDelete is the builder for deleting a Platform entity.

func (*PlatformDelete) Exec

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

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

func (*PlatformDelete) ExecContext

func (c *PlatformDelete) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*PlatformDelete) ExecX

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

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

func (*PlatformDelete) QueryContext

func (c *PlatformDelete) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*PlatformDelete) Where

func (pd *PlatformDelete) Where(ps ...predicate.Platform) *PlatformDelete

Where appends a list predicates to the PlatformDelete builder.

type PlatformDeleteOne

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

PlatformDeleteOne is the builder for deleting a single Platform entity.

func (*PlatformDeleteOne) Exec

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

Exec executes the deletion query.

func (*PlatformDeleteOne) ExecX

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

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

func (*PlatformDeleteOne) Where

Where appends a list predicates to the PlatformDelete builder.

type PlatformEdges

type PlatformEdges struct {
	// Topics holds the value of the topics edge.
	Topics []*Topic `json:"topics,omitempty"`
	// contains filtered or unexported fields
}

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

func (PlatformEdges) TopicsOrErr

func (e PlatformEdges) TopicsOrErr() ([]*Topic, error)

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

type PlatformGroupBy

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

PlatformGroupBy is the group-by builder for Platform entities.

func (*PlatformGroupBy) Aggregate

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

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

func (*PlatformGroupBy) Bool

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

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

func (*PlatformGroupBy) BoolX

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

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

func (*PlatformGroupBy) Bools

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

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

func (*PlatformGroupBy) BoolsX

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

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

func (*PlatformGroupBy) Float64

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

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

func (*PlatformGroupBy) Float64X

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

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

func (*PlatformGroupBy) Float64s

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

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

func (*PlatformGroupBy) Float64sX

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

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

func (*PlatformGroupBy) Int

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

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

func (*PlatformGroupBy) IntX

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

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

func (*PlatformGroupBy) Ints

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

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

func (*PlatformGroupBy) IntsX

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

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

func (*PlatformGroupBy) Scan

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

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

func (*PlatformGroupBy) ScanX

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

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

func (*PlatformGroupBy) String

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

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

func (*PlatformGroupBy) StringX

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

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

func (*PlatformGroupBy) Strings

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

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

func (*PlatformGroupBy) StringsX

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

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

type PlatformMutation

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

PlatformMutation represents an operation that mutates the Platform nodes in the graph.

func (*PlatformMutation) AddField

func (m *PlatformMutation) 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 (*PlatformMutation) AddTopicIDs

func (m *PlatformMutation) AddTopicIDs(ids ...int)

AddTopicIDs adds the "topics" edge to the Topic entity by ids.

func (*PlatformMutation) AddedEdges

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

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

func (*PlatformMutation) AddedField

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

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

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

func (*PlatformMutation) AddedIDs

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

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

func (*PlatformMutation) ClearEdge

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

func (m *PlatformMutation) 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 (*PlatformMutation) ClearIcon

func (m *PlatformMutation) ClearIcon()

ClearIcon clears the value of the "icon" field.

func (*PlatformMutation) ClearTopics

func (m *PlatformMutation) ClearTopics()

ClearTopics clears the "topics" edge to the Topic entity.

func (*PlatformMutation) ClearedEdges

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

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

func (*PlatformMutation) ClearedFields

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

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

func (PlatformMutation) Client

func (m PlatformMutation) 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 (*PlatformMutation) EdgeCleared

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

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

func (*PlatformMutation) ExecContext

func (c *PlatformMutation) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*PlatformMutation) Field

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

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

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

func (*PlatformMutation) Fields

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

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

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

func (*PlatformMutation) IDs

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

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

func (*PlatformMutation) Icon

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

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

func (*PlatformMutation) IconCleared

func (m *PlatformMutation) IconCleared() bool

IconCleared returns if the "icon" field was cleared in this mutation.

func (*PlatformMutation) Name

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

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

func (*PlatformMutation) OldField

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

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

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

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

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

func (m *PlatformMutation) Op() Op

Op returns the operation name.

func (*PlatformMutation) QueryContext

func (c *PlatformMutation) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*PlatformMutation) RemoveTopicIDs

func (m *PlatformMutation) RemoveTopicIDs(ids ...int)

RemoveTopicIDs removes the "topics" edge to the Topic entity by IDs.

func (*PlatformMutation) RemovedEdges

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

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

func (*PlatformMutation) RemovedIDs

func (m *PlatformMutation) 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 (*PlatformMutation) RemovedTopicsIDs

func (m *PlatformMutation) RemovedTopicsIDs() (ids []int)

RemovedTopics returns the removed IDs of the "topics" edge to the Topic entity.

func (*PlatformMutation) ResetEdge

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

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

func (m *PlatformMutation) ResetIcon()

ResetIcon resets all changes to the "icon" field.

func (*PlatformMutation) ResetName

func (m *PlatformMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*PlatformMutation) ResetTopics

func (m *PlatformMutation) ResetTopics()

ResetTopics resets all changes to the "topics" edge.

func (*PlatformMutation) SetField

func (m *PlatformMutation) 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 (*PlatformMutation) SetIcon

func (m *PlatformMutation) SetIcon(s string)

SetIcon sets the "icon" field.

func (*PlatformMutation) SetName

func (m *PlatformMutation) SetName(s string)

SetName sets the "name" field.

func (*PlatformMutation) SetOp

func (m *PlatformMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*PlatformMutation) TopicsCleared

func (m *PlatformMutation) TopicsCleared() bool

TopicsCleared reports if the "topics" edge to the Topic entity was cleared.

func (*PlatformMutation) TopicsIDs

func (m *PlatformMutation) TopicsIDs() (ids []int)

TopicsIDs returns the "topics" edge IDs in the mutation.

func (PlatformMutation) Tx

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

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

func (*PlatformMutation) Type

func (m *PlatformMutation) Type() string

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

func (*PlatformMutation) Where

func (m *PlatformMutation) Where(ps ...predicate.Platform)

Where appends a list predicates to the PlatformMutation builder.

func (*PlatformMutation) WhereP

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

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

type PlatformQuery

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

PlatformQuery is the builder for querying Platform entities.

func (*PlatformQuery) Aggregate

func (pq *PlatformQuery) Aggregate(fns ...AggregateFunc) *PlatformSelect

Aggregate returns a PlatformSelect configured with the given aggregations.

func (*PlatformQuery) All

func (pq *PlatformQuery) All(ctx context.Context) ([]*Platform, error)

All executes the query and returns a list of Platforms.

func (*PlatformQuery) AllX

func (pq *PlatformQuery) AllX(ctx context.Context) []*Platform

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

func (*PlatformQuery) Clone

func (pq *PlatformQuery) Clone() *PlatformQuery

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

func (*PlatformQuery) Count

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

Count returns the count of the given query.

func (*PlatformQuery) CountX

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

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

func (*PlatformQuery) ExecContext

func (c *PlatformQuery) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*PlatformQuery) Exist

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

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

func (*PlatformQuery) ExistX

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

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

func (*PlatformQuery) First

func (pq *PlatformQuery) First(ctx context.Context) (*Platform, error)

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

func (*PlatformQuery) FirstID

func (pq *PlatformQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*PlatformQuery) FirstIDX

func (pq *PlatformQuery) FirstIDX(ctx context.Context) int

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

func (*PlatformQuery) FirstX

func (pq *PlatformQuery) FirstX(ctx context.Context) *Platform

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

func (*PlatformQuery) ForShare

func (pq *PlatformQuery) ForShare(opts ...sql.LockOption) *PlatformQuery

ForShare behaves similarly to ForUpdate, except that it acquires a shared mode lock on any rows that are read. Other sessions can read the rows, but cannot modify them until your transaction commits.

func (*PlatformQuery) ForUpdate

func (pq *PlatformQuery) ForUpdate(opts ...sql.LockOption) *PlatformQuery

ForUpdate locks the selected rows against concurrent updates, and prevent them from being updated, deleted or "selected ... for update" by other sessions, until the transaction is either committed or rolled-back.

func (*PlatformQuery) GroupBy

func (pq *PlatformQuery) GroupBy(field string, fields ...string) *PlatformGroupBy

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.Platform.Query().
	GroupBy(platform.FieldName).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*PlatformQuery) IDs

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

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

func (*PlatformQuery) IDsX

func (pq *PlatformQuery) IDsX(ctx context.Context) []int

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

func (*PlatformQuery) Limit

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

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

func (*PlatformQuery) Modify

func (pq *PlatformQuery) Modify(modifiers ...func(s *sql.Selector)) *PlatformSelect

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

func (*PlatformQuery) Offset

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

Offset to start from.

func (*PlatformQuery) Only

func (pq *PlatformQuery) Only(ctx context.Context) (*Platform, error)

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

func (*PlatformQuery) OnlyID

func (pq *PlatformQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*PlatformQuery) OnlyIDX

func (pq *PlatformQuery) OnlyIDX(ctx context.Context) int

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

func (*PlatformQuery) OnlyX

func (pq *PlatformQuery) OnlyX(ctx context.Context) *Platform

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

func (*PlatformQuery) Order

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

Order specifies how the records should be ordered.

func (*PlatformQuery) QueryContext

func (c *PlatformQuery) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*PlatformQuery) QueryTopics

func (pq *PlatformQuery) QueryTopics() *TopicQuery

QueryTopics chains the current query on the "topics" edge.

func (*PlatformQuery) Select

func (pq *PlatformQuery) Select(fields ...string) *PlatformSelect

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.Platform.Query().
	Select(platform.FieldName).
	Scan(ctx, &v)

func (*PlatformQuery) Unique

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

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

func (pq *PlatformQuery) Where(ps ...predicate.Platform) *PlatformQuery

Where adds a new predicate for the PlatformQuery builder.

func (*PlatformQuery) WithTopics

func (pq *PlatformQuery) WithTopics(opts ...func(*TopicQuery)) *PlatformQuery

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

type PlatformSelect

type PlatformSelect struct {
	*PlatformQuery
	// contains filtered or unexported fields
}

PlatformSelect is the builder for selecting fields of Platform entities.

func (*PlatformSelect) Aggregate

func (ps *PlatformSelect) Aggregate(fns ...AggregateFunc) *PlatformSelect

Aggregate adds the given aggregation functions to the selector query.

func (*PlatformSelect) Bool

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

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

func (*PlatformSelect) BoolX

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

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

func (*PlatformSelect) Bools

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

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

func (*PlatformSelect) BoolsX

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

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

func (PlatformSelect) ExecContext

func (c PlatformSelect) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*PlatformSelect) Float64

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

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

func (*PlatformSelect) Float64X

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

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

func (*PlatformSelect) Float64s

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

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

func (*PlatformSelect) Float64sX

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

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

func (*PlatformSelect) Int

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

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

func (*PlatformSelect) IntX

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

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

func (*PlatformSelect) Ints

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

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

func (*PlatformSelect) IntsX

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

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

func (*PlatformSelect) Modify

func (ps *PlatformSelect) Modify(modifiers ...func(s *sql.Selector)) *PlatformSelect

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

func (PlatformSelect) QueryContext

func (c PlatformSelect) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*PlatformSelect) Scan

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

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

func (*PlatformSelect) ScanX

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

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

func (*PlatformSelect) String

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

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

func (*PlatformSelect) StringX

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

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

func (*PlatformSelect) Strings

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

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

func (*PlatformSelect) StringsX

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

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

type PlatformUpdate

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

PlatformUpdate is the builder for updating Platform entities.

func (*PlatformUpdate) AddTopicIDs

func (pu *PlatformUpdate) AddTopicIDs(ids ...int) *PlatformUpdate

AddTopicIDs adds the "topics" edge to the Topic entity by IDs.

func (*PlatformUpdate) AddTopics

func (pu *PlatformUpdate) AddTopics(t ...*Topic) *PlatformUpdate

AddTopics adds the "topics" edges to the Topic entity.

func (*PlatformUpdate) ClearIcon

func (pu *PlatformUpdate) ClearIcon() *PlatformUpdate

ClearIcon clears the value of the "icon" field.

func (*PlatformUpdate) ClearTopics

func (pu *PlatformUpdate) ClearTopics() *PlatformUpdate

ClearTopics clears all "topics" edges to the Topic entity.

func (*PlatformUpdate) Exec

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

Exec executes the query.

func (*PlatformUpdate) ExecContext

func (c *PlatformUpdate) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*PlatformUpdate) ExecX

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

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

func (*PlatformUpdate) Modify

func (pu *PlatformUpdate) Modify(modifiers ...func(u *sql.UpdateBuilder)) *PlatformUpdate

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

func (*PlatformUpdate) Mutation

func (pu *PlatformUpdate) Mutation() *PlatformMutation

Mutation returns the PlatformMutation object of the builder.

func (*PlatformUpdate) QueryContext

func (c *PlatformUpdate) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*PlatformUpdate) RemoveTopicIDs

func (pu *PlatformUpdate) RemoveTopicIDs(ids ...int) *PlatformUpdate

RemoveTopicIDs removes the "topics" edge to Topic entities by IDs.

func (*PlatformUpdate) RemoveTopics

func (pu *PlatformUpdate) RemoveTopics(t ...*Topic) *PlatformUpdate

RemoveTopics removes "topics" edges to Topic entities.

func (*PlatformUpdate) Save

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

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

func (*PlatformUpdate) SaveX

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

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

func (*PlatformUpdate) SetIcon

func (pu *PlatformUpdate) SetIcon(s string) *PlatformUpdate

SetIcon sets the "icon" field.

func (*PlatformUpdate) SetName

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

SetName sets the "name" field.

func (*PlatformUpdate) SetNillableIcon

func (pu *PlatformUpdate) SetNillableIcon(s *string) *PlatformUpdate

SetNillableIcon sets the "icon" field if the given value is not nil.

func (*PlatformUpdate) Where

func (pu *PlatformUpdate) Where(ps ...predicate.Platform) *PlatformUpdate

Where appends a list predicates to the PlatformUpdate builder.

type PlatformUpdateOne

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

PlatformUpdateOne is the builder for updating a single Platform entity.

func (*PlatformUpdateOne) AddTopicIDs

func (puo *PlatformUpdateOne) AddTopicIDs(ids ...int) *PlatformUpdateOne

AddTopicIDs adds the "topics" edge to the Topic entity by IDs.

func (*PlatformUpdateOne) AddTopics

func (puo *PlatformUpdateOne) AddTopics(t ...*Topic) *PlatformUpdateOne

AddTopics adds the "topics" edges to the Topic entity.

func (*PlatformUpdateOne) ClearIcon

func (puo *PlatformUpdateOne) ClearIcon() *PlatformUpdateOne

ClearIcon clears the value of the "icon" field.

func (*PlatformUpdateOne) ClearTopics

func (puo *PlatformUpdateOne) ClearTopics() *PlatformUpdateOne

ClearTopics clears all "topics" edges to the Topic entity.

func (*PlatformUpdateOne) Exec

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

Exec executes the query on the entity.

func (*PlatformUpdateOne) ExecContext

func (c *PlatformUpdateOne) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*PlatformUpdateOne) ExecX

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

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

func (*PlatformUpdateOne) Modify

func (puo *PlatformUpdateOne) Modify(modifiers ...func(u *sql.UpdateBuilder)) *PlatformUpdateOne

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

func (*PlatformUpdateOne) Mutation

func (puo *PlatformUpdateOne) Mutation() *PlatformMutation

Mutation returns the PlatformMutation object of the builder.

func (*PlatformUpdateOne) QueryContext

func (c *PlatformUpdateOne) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*PlatformUpdateOne) RemoveTopicIDs

func (puo *PlatformUpdateOne) RemoveTopicIDs(ids ...int) *PlatformUpdateOne

RemoveTopicIDs removes the "topics" edge to Topic entities by IDs.

func (*PlatformUpdateOne) RemoveTopics

func (puo *PlatformUpdateOne) RemoveTopics(t ...*Topic) *PlatformUpdateOne

RemoveTopics removes "topics" edges to Topic entities.

func (*PlatformUpdateOne) Save

func (puo *PlatformUpdateOne) Save(ctx context.Context) (*Platform, error)

Save executes the query and returns the updated Platform entity.

func (*PlatformUpdateOne) SaveX

func (puo *PlatformUpdateOne) SaveX(ctx context.Context) *Platform

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

func (*PlatformUpdateOne) Select

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

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

func (*PlatformUpdateOne) SetIcon

func (puo *PlatformUpdateOne) SetIcon(s string) *PlatformUpdateOne

SetIcon sets the "icon" field.

func (*PlatformUpdateOne) SetName

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

SetName sets the "name" field.

func (*PlatformUpdateOne) SetNillableIcon

func (puo *PlatformUpdateOne) SetNillableIcon(s *string) *PlatformUpdateOne

SetNillableIcon sets the "icon" field if the given value is not nil.

func (*PlatformUpdateOne) Where

Where appends a list predicates to the PlatformUpdate builder.

type PlatformUpsert

type PlatformUpsert struct {
	*sql.UpdateSet
}

PlatformUpsert is the "OnConflict" setter.

func (*PlatformUpsert) ClearIcon

func (u *PlatformUpsert) ClearIcon() *PlatformUpsert

ClearIcon clears the value of the "icon" field.

func (*PlatformUpsert) SetIcon

func (u *PlatformUpsert) SetIcon(v string) *PlatformUpsert

SetIcon sets the "icon" field.

func (*PlatformUpsert) SetName

func (u *PlatformUpsert) SetName(v string) *PlatformUpsert

SetName sets the "name" field.

func (*PlatformUpsert) UpdateIcon

func (u *PlatformUpsert) UpdateIcon() *PlatformUpsert

UpdateIcon sets the "icon" field to the value that was provided on create.

func (*PlatformUpsert) UpdateName

func (u *PlatformUpsert) UpdateName() *PlatformUpsert

UpdateName sets the "name" field to the value that was provided on create.

type PlatformUpsertBulk

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

PlatformUpsertBulk is the builder for "upsert"-ing a bulk of Platform nodes.

func (*PlatformUpsertBulk) ClearIcon

func (u *PlatformUpsertBulk) ClearIcon() *PlatformUpsertBulk

ClearIcon clears the value of the "icon" field.

func (*PlatformUpsertBulk) DoNothing

func (u *PlatformUpsertBulk) DoNothing() *PlatformUpsertBulk

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

func (*PlatformUpsertBulk) Exec

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

Exec executes the query.

func (*PlatformUpsertBulk) ExecX

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

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

func (*PlatformUpsertBulk) Ignore

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

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

func (*PlatformUpsertBulk) SetIcon

SetIcon sets the "icon" field.

func (*PlatformUpsertBulk) SetName

SetName sets the "name" field.

func (*PlatformUpsertBulk) Update

func (u *PlatformUpsertBulk) Update(set func(*PlatformUpsert)) *PlatformUpsertBulk

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

func (*PlatformUpsertBulk) UpdateIcon

func (u *PlatformUpsertBulk) UpdateIcon() *PlatformUpsertBulk

UpdateIcon sets the "icon" field to the value that was provided on create.

func (*PlatformUpsertBulk) UpdateName

func (u *PlatformUpsertBulk) UpdateName() *PlatformUpsertBulk

UpdateName sets the "name" field to the value that was provided on create.

func (*PlatformUpsertBulk) UpdateNewValues

func (u *PlatformUpsertBulk) UpdateNewValues() *PlatformUpsertBulk

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

client.Platform.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
	).
	Exec(ctx)

type PlatformUpsertOne

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

PlatformUpsertOne is the builder for "upsert"-ing

one Platform node.

func (*PlatformUpsertOne) ClearIcon

func (u *PlatformUpsertOne) ClearIcon() *PlatformUpsertOne

ClearIcon clears the value of the "icon" field.

func (*PlatformUpsertOne) DoNothing

func (u *PlatformUpsertOne) DoNothing() *PlatformUpsertOne

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

func (*PlatformUpsertOne) Exec

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

Exec executes the query.

func (*PlatformUpsertOne) ExecX

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

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

func (*PlatformUpsertOne) ID

func (u *PlatformUpsertOne) ID(ctx context.Context) (id int, err error)

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

func (*PlatformUpsertOne) IDX

func (u *PlatformUpsertOne) IDX(ctx context.Context) int

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

func (*PlatformUpsertOne) Ignore

func (u *PlatformUpsertOne) Ignore() *PlatformUpsertOne

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

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

func (*PlatformUpsertOne) SetIcon

SetIcon sets the "icon" field.

func (*PlatformUpsertOne) SetName

SetName sets the "name" field.

func (*PlatformUpsertOne) Update

func (u *PlatformUpsertOne) Update(set func(*PlatformUpsert)) *PlatformUpsertOne

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

func (*PlatformUpsertOne) UpdateIcon

func (u *PlatformUpsertOne) UpdateIcon() *PlatformUpsertOne

UpdateIcon sets the "icon" field to the value that was provided on create.

func (*PlatformUpsertOne) UpdateName

func (u *PlatformUpsertOne) UpdateName() *PlatformUpsertOne

UpdateName sets the "name" field to the value that was provided on create.

func (*PlatformUpsertOne) UpdateNewValues

func (u *PlatformUpsertOne) UpdateNewValues() *PlatformUpsertOne

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

client.Platform.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
	).
	Exec(ctx)

type Platforms

type Platforms []*Platform

Platforms is a parsable slice of Platform.

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 Repo

type Repo struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// Name holds the value of the "name" field.
	Name string `json:"name,omitempty"`
	// Description holds the value of the "description" field.
	Description string `json:"description,omitempty"`
	// URL holds the value of the "url" field.
	URL string `json:"url,omitempty"`
	// SubTopic holds the value of the "sub_topic" field.
	SubTopic string `json:"sub_topic,omitempty"`
	// Type holds the value of the "type" field.
	Type repo.Type `json:"type,omitempty"`
	// StarCount holds the value of the "star_count" field.
	StarCount int `json:"star_count,omitempty"`
	// ForkCount holds the value of the "fork_count" field.
	ForkCount int `json:"fork_count,omitempty"`
	// WatchCount holds the value of the "watch_count" field.
	WatchCount int `json:"watch_count,omitempty"`
	// UpdatedAt holds the value of the "updated_at" field.
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	// TopicID holds the value of the "topic_id" field.
	TopicID int `json:"topic_id,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the RepoQuery when eager-loading is set.
	Edges RepoEdges `json:"-"`
	// contains filtered or unexported fields
}

Repo is the model entity for the Repo schema.

func (*Repo) ExecContext

func (c *Repo) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*Repo) QueryContext

func (c *Repo) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*Repo) QueryTopics

func (r *Repo) QueryTopics() *TopicQuery

QueryTopics queries the "topics" edge of the Repo entity.

func (*Repo) String

func (r *Repo) String() string

String implements the fmt.Stringer.

func (*Repo) Unwrap

func (r *Repo) Unwrap() *Repo

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

func (r *Repo) Update() *RepoUpdateOne

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

type RepoClient

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

RepoClient is a client for the Repo schema.

func NewRepoClient

func NewRepoClient(c config) *RepoClient

NewRepoClient returns a client for the Repo from the given config.

func (*RepoClient) Create

func (c *RepoClient) Create() *RepoCreate

Create returns a builder for creating a Repo entity.

func (*RepoClient) CreateBulk

func (c *RepoClient) CreateBulk(builders ...*RepoCreate) *RepoCreateBulk

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

func (*RepoClient) Delete

func (c *RepoClient) Delete() *RepoDelete

Delete returns a delete builder for Repo.

func (*RepoClient) DeleteOne

func (c *RepoClient) DeleteOne(r *Repo) *RepoDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*RepoClient) DeleteOneID

func (c *RepoClient) DeleteOneID(id int) *RepoDeleteOne

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

func (*RepoClient) ExecContext

func (c *RepoClient) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*RepoClient) Get

func (c *RepoClient) Get(ctx context.Context, id int) (*Repo, error)

Get returns a Repo entity by its id.

func (*RepoClient) GetX

func (c *RepoClient) GetX(ctx context.Context, id int) *Repo

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

func (*RepoClient) Hooks

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

Hooks returns the client hooks.

func (*RepoClient) Intercept

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

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

func (*RepoClient) Interceptors

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

Interceptors returns the client interceptors.

func (*RepoClient) Query

func (c *RepoClient) Query() *RepoQuery

Query returns a query builder for Repo.

func (*RepoClient) QueryContext

func (c *RepoClient) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*RepoClient) QueryTopics

func (c *RepoClient) QueryTopics(r *Repo) *TopicQuery

QueryTopics queries the topics edge of a Repo.

func (*RepoClient) Update

func (c *RepoClient) Update() *RepoUpdate

Update returns an update builder for Repo.

func (*RepoClient) UpdateOne

func (c *RepoClient) UpdateOne(r *Repo) *RepoUpdateOne

UpdateOne returns an update builder for the given entity.

func (*RepoClient) UpdateOneID

func (c *RepoClient) UpdateOneID(id int) *RepoUpdateOne

UpdateOneID returns an update builder for the given id.

func (*RepoClient) Use

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

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

type RepoCreate

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

RepoCreate is the builder for creating a Repo entity.

func (*RepoCreate) Exec

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

Exec executes the query.

func (*RepoCreate) ExecContext

func (c *RepoCreate) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*RepoCreate) ExecX

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

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

func (*RepoCreate) Mutation

func (rc *RepoCreate) Mutation() *RepoMutation

Mutation returns the RepoMutation object of the builder.

func (*RepoCreate) OnConflict

func (rc *RepoCreate) OnConflict(opts ...sql.ConflictOption) *RepoUpsertOne

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

client.Repo.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.RepoUpsert) {
		SetName(v+v).
	}).
	Exec(ctx)

func (*RepoCreate) OnConflictColumns

func (rc *RepoCreate) OnConflictColumns(columns ...string) *RepoUpsertOne

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

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

func (*RepoCreate) QueryContext

func (c *RepoCreate) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*RepoCreate) Save

func (rc *RepoCreate) Save(ctx context.Context) (*Repo, error)

Save creates the Repo in the database.

func (*RepoCreate) SaveX

func (rc *RepoCreate) SaveX(ctx context.Context) *Repo

SaveX calls Save and panics if Save returns an error.

func (*RepoCreate) SetDescription

func (rc *RepoCreate) SetDescription(s string) *RepoCreate

SetDescription sets the "description" field.

func (*RepoCreate) SetForkCount

func (rc *RepoCreate) SetForkCount(i int) *RepoCreate

SetForkCount sets the "fork_count" field.

func (*RepoCreate) SetName

func (rc *RepoCreate) SetName(s string) *RepoCreate

SetName sets the "name" field.

func (*RepoCreate) SetNillableForkCount

func (rc *RepoCreate) SetNillableForkCount(i *int) *RepoCreate

SetNillableForkCount sets the "fork_count" field if the given value is not nil.

func (*RepoCreate) SetNillableStarCount

func (rc *RepoCreate) SetNillableStarCount(i *int) *RepoCreate

SetNillableStarCount sets the "star_count" field if the given value is not nil.

func (*RepoCreate) SetNillableUpdatedAt

func (rc *RepoCreate) SetNillableUpdatedAt(t *time.Time) *RepoCreate

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

func (*RepoCreate) SetNillableWatchCount

func (rc *RepoCreate) SetNillableWatchCount(i *int) *RepoCreate

SetNillableWatchCount sets the "watch_count" field if the given value is not nil.

func (*RepoCreate) SetStarCount

func (rc *RepoCreate) SetStarCount(i int) *RepoCreate

SetStarCount sets the "star_count" field.

func (*RepoCreate) SetSubTopic

func (rc *RepoCreate) SetSubTopic(s string) *RepoCreate

SetSubTopic sets the "sub_topic" field.

func (*RepoCreate) SetTopicID

func (rc *RepoCreate) SetTopicID(i int) *RepoCreate

SetTopicID sets the "topic_id" field.

func (*RepoCreate) SetTopics

func (rc *RepoCreate) SetTopics(t *Topic) *RepoCreate

SetTopics sets the "topics" edge to the Topic entity.

func (*RepoCreate) SetTopicsID

func (rc *RepoCreate) SetTopicsID(id int) *RepoCreate

SetTopicsID sets the "topics" edge to the Topic entity by ID.

func (*RepoCreate) SetType

func (rc *RepoCreate) SetType(r repo.Type) *RepoCreate

SetType sets the "type" field.

func (*RepoCreate) SetURL

func (rc *RepoCreate) SetURL(s string) *RepoCreate

SetURL sets the "url" field.

func (*RepoCreate) SetUpdatedAt

func (rc *RepoCreate) SetUpdatedAt(t time.Time) *RepoCreate

SetUpdatedAt sets the "updated_at" field.

func (*RepoCreate) SetWatchCount

func (rc *RepoCreate) SetWatchCount(i int) *RepoCreate

SetWatchCount sets the "watch_count" field.

type RepoCreateBulk

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

RepoCreateBulk is the builder for creating many Repo entities in bulk.

func (*RepoCreateBulk) Exec

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

Exec executes the query.

func (*RepoCreateBulk) ExecContext

func (c *RepoCreateBulk) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*RepoCreateBulk) ExecX

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

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

func (*RepoCreateBulk) OnConflict

func (rcb *RepoCreateBulk) OnConflict(opts ...sql.ConflictOption) *RepoUpsertBulk

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

client.Repo.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.RepoUpsert) {
		SetName(v+v).
	}).
	Exec(ctx)

func (*RepoCreateBulk) OnConflictColumns

func (rcb *RepoCreateBulk) OnConflictColumns(columns ...string) *RepoUpsertBulk

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

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

func (*RepoCreateBulk) QueryContext

func (c *RepoCreateBulk) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*RepoCreateBulk) Save

func (rcb *RepoCreateBulk) Save(ctx context.Context) ([]*Repo, error)

Save creates the Repo entities in the database.

func (*RepoCreateBulk) SaveX

func (rcb *RepoCreateBulk) SaveX(ctx context.Context) []*Repo

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

type RepoDelete

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

RepoDelete is the builder for deleting a Repo entity.

func (*RepoDelete) Exec

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

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

func (*RepoDelete) ExecContext

func (c *RepoDelete) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*RepoDelete) ExecX

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

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

func (*RepoDelete) QueryContext

func (c *RepoDelete) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*RepoDelete) Where

func (rd *RepoDelete) Where(ps ...predicate.Repo) *RepoDelete

Where appends a list predicates to the RepoDelete builder.

type RepoDeleteOne

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

RepoDeleteOne is the builder for deleting a single Repo entity.

func (*RepoDeleteOne) Exec

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

Exec executes the deletion query.

func (*RepoDeleteOne) ExecX

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

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

func (*RepoDeleteOne) Where

func (rdo *RepoDeleteOne) Where(ps ...predicate.Repo) *RepoDeleteOne

Where appends a list predicates to the RepoDelete builder.

type RepoEdges

type RepoEdges struct {
	// Topics holds the value of the topics edge.
	Topics *Topic `json:"topics,omitempty"`
	// contains filtered or unexported fields
}

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

func (RepoEdges) TopicsOrErr

func (e RepoEdges) TopicsOrErr() (*Topic, error)

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

type RepoGroupBy

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

RepoGroupBy is the group-by builder for Repo entities.

func (*RepoGroupBy) Aggregate

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

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

func (*RepoGroupBy) Bool

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

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

func (*RepoGroupBy) BoolX

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

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

func (*RepoGroupBy) Bools

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

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

func (*RepoGroupBy) BoolsX

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

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

func (*RepoGroupBy) Float64

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

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

func (*RepoGroupBy) Float64X

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

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

func (*RepoGroupBy) Float64s

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

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

func (*RepoGroupBy) Float64sX

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

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

func (*RepoGroupBy) Int

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

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

func (*RepoGroupBy) IntX

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

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

func (*RepoGroupBy) Ints

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

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

func (*RepoGroupBy) IntsX

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

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

func (*RepoGroupBy) Scan

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

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

func (*RepoGroupBy) ScanX

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

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

func (*RepoGroupBy) String

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

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

func (*RepoGroupBy) StringX

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

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

func (*RepoGroupBy) Strings

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

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

func (*RepoGroupBy) StringsX

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

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

type RepoMutation

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

RepoMutation represents an operation that mutates the Repo nodes in the graph.

func (*RepoMutation) AddField

func (m *RepoMutation) 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 (*RepoMutation) AddForkCount

func (m *RepoMutation) AddForkCount(i int)

AddForkCount adds i to the "fork_count" field.

func (*RepoMutation) AddStarCount

func (m *RepoMutation) AddStarCount(i int)

AddStarCount adds i to the "star_count" field.

func (*RepoMutation) AddWatchCount

func (m *RepoMutation) AddWatchCount(i int)

AddWatchCount adds i to the "watch_count" field.

func (*RepoMutation) AddedEdges

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

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

func (*RepoMutation) AddedField

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

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

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

func (*RepoMutation) AddedForkCount

func (m *RepoMutation) AddedForkCount() (r int, exists bool)

AddedForkCount returns the value that was added to the "fork_count" field in this mutation.

func (*RepoMutation) AddedIDs

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

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

func (*RepoMutation) AddedStarCount

func (m *RepoMutation) AddedStarCount() (r int, exists bool)

AddedStarCount returns the value that was added to the "star_count" field in this mutation.

func (*RepoMutation) AddedWatchCount

func (m *RepoMutation) AddedWatchCount() (r int, exists bool)

AddedWatchCount returns the value that was added to the "watch_count" field in this mutation.

func (*RepoMutation) ClearEdge

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

func (m *RepoMutation) 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 (*RepoMutation) ClearForkCount

func (m *RepoMutation) ClearForkCount()

ClearForkCount clears the value of the "fork_count" field.

func (*RepoMutation) ClearStarCount

func (m *RepoMutation) ClearStarCount()

ClearStarCount clears the value of the "star_count" field.

func (*RepoMutation) ClearTopics

func (m *RepoMutation) ClearTopics()

ClearTopics clears the "topics" edge to the Topic entity.

func (*RepoMutation) ClearUpdatedAt

func (m *RepoMutation) ClearUpdatedAt()

ClearUpdatedAt clears the value of the "updated_at" field.

func (*RepoMutation) ClearWatchCount

func (m *RepoMutation) ClearWatchCount()

ClearWatchCount clears the value of the "watch_count" field.

func (*RepoMutation) ClearedEdges

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

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

func (*RepoMutation) ClearedFields

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

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

func (RepoMutation) Client

func (m RepoMutation) 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 (*RepoMutation) Description

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

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

func (*RepoMutation) EdgeCleared

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

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

func (*RepoMutation) ExecContext

func (c *RepoMutation) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*RepoMutation) Field

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

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

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

func (*RepoMutation) Fields

func (m *RepoMutation) 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 (*RepoMutation) ForkCount

func (m *RepoMutation) ForkCount() (r int, exists bool)

ForkCount returns the value of the "fork_count" field in the mutation.

func (*RepoMutation) ForkCountCleared

func (m *RepoMutation) ForkCountCleared() bool

ForkCountCleared returns if the "fork_count" field was cleared in this mutation.

func (*RepoMutation) GetType

func (m *RepoMutation) GetType() (r repo.Type, exists bool)

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

func (*RepoMutation) ID

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

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

func (*RepoMutation) IDs

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

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

func (*RepoMutation) Name

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

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

func (*RepoMutation) OldDescription

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

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

func (m *RepoMutation) 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 (*RepoMutation) OldForkCount

func (m *RepoMutation) OldForkCount(ctx context.Context) (v int, err error)

OldForkCount returns the old "fork_count" field's value of the Repo entity. If the Repo 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 (*RepoMutation) OldName

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

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

func (m *RepoMutation) OldStarCount(ctx context.Context) (v int, err error)

OldStarCount returns the old "star_count" field's value of the Repo entity. If the Repo 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 (*RepoMutation) OldSubTopic

func (m *RepoMutation) OldSubTopic(ctx context.Context) (v string, err error)

OldSubTopic returns the old "sub_topic" field's value of the Repo entity. If the Repo 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 (*RepoMutation) OldTopicID

func (m *RepoMutation) OldTopicID(ctx context.Context) (v int, err error)

OldTopicID returns the old "topic_id" field's value of the Repo entity. If the Repo 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 (*RepoMutation) OldType

func (m *RepoMutation) OldType(ctx context.Context) (v repo.Type, err error)

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

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

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

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

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

func (m *RepoMutation) OldWatchCount(ctx context.Context) (v int, err error)

OldWatchCount returns the old "watch_count" field's value of the Repo entity. If the Repo 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 (*RepoMutation) Op

func (m *RepoMutation) Op() Op

Op returns the operation name.

func (*RepoMutation) QueryContext

func (c *RepoMutation) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*RepoMutation) RemovedEdges

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

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

func (*RepoMutation) RemovedIDs

func (m *RepoMutation) 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 (*RepoMutation) ResetDescription

func (m *RepoMutation) ResetDescription()

ResetDescription resets all changes to the "description" field.

func (*RepoMutation) ResetEdge

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

func (m *RepoMutation) 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 (*RepoMutation) ResetForkCount

func (m *RepoMutation) ResetForkCount()

ResetForkCount resets all changes to the "fork_count" field.

func (*RepoMutation) ResetName

func (m *RepoMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*RepoMutation) ResetStarCount

func (m *RepoMutation) ResetStarCount()

ResetStarCount resets all changes to the "star_count" field.

func (*RepoMutation) ResetSubTopic

func (m *RepoMutation) ResetSubTopic()

ResetSubTopic resets all changes to the "sub_topic" field.

func (*RepoMutation) ResetTopicID

func (m *RepoMutation) ResetTopicID()

ResetTopicID resets all changes to the "topic_id" field.

func (*RepoMutation) ResetTopics

func (m *RepoMutation) ResetTopics()

ResetTopics resets all changes to the "topics" edge.

func (*RepoMutation) ResetType

func (m *RepoMutation) ResetType()

ResetType resets all changes to the "type" field.

func (*RepoMutation) ResetURL

func (m *RepoMutation) ResetURL()

ResetURL resets all changes to the "url" field.

func (*RepoMutation) ResetUpdatedAt

func (m *RepoMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*RepoMutation) ResetWatchCount

func (m *RepoMutation) ResetWatchCount()

ResetWatchCount resets all changes to the "watch_count" field.

func (*RepoMutation) SetDescription

func (m *RepoMutation) SetDescription(s string)

SetDescription sets the "description" field.

func (*RepoMutation) SetField

func (m *RepoMutation) 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 (*RepoMutation) SetForkCount

func (m *RepoMutation) SetForkCount(i int)

SetForkCount sets the "fork_count" field.

func (*RepoMutation) SetName

func (m *RepoMutation) SetName(s string)

SetName sets the "name" field.

func (*RepoMutation) SetOp

func (m *RepoMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*RepoMutation) SetStarCount

func (m *RepoMutation) SetStarCount(i int)

SetStarCount sets the "star_count" field.

func (*RepoMutation) SetSubTopic

func (m *RepoMutation) SetSubTopic(s string)

SetSubTopic sets the "sub_topic" field.

func (*RepoMutation) SetTopicID

func (m *RepoMutation) SetTopicID(i int)

SetTopicID sets the "topic_id" field.

func (*RepoMutation) SetTopicsID

func (m *RepoMutation) SetTopicsID(id int)

SetTopicsID sets the "topics" edge to the Topic entity by id.

func (*RepoMutation) SetType

func (m *RepoMutation) SetType(r repo.Type)

SetType sets the "type" field.

func (*RepoMutation) SetURL

func (m *RepoMutation) SetURL(s string)

SetURL sets the "url" field.

func (*RepoMutation) SetUpdatedAt

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

SetUpdatedAt sets the "updated_at" field.

func (*RepoMutation) SetWatchCount

func (m *RepoMutation) SetWatchCount(i int)

SetWatchCount sets the "watch_count" field.

func (*RepoMutation) StarCount

func (m *RepoMutation) StarCount() (r int, exists bool)

StarCount returns the value of the "star_count" field in the mutation.

func (*RepoMutation) StarCountCleared

func (m *RepoMutation) StarCountCleared() bool

StarCountCleared returns if the "star_count" field was cleared in this mutation.

func (*RepoMutation) SubTopic

func (m *RepoMutation) SubTopic() (r string, exists bool)

SubTopic returns the value of the "sub_topic" field in the mutation.

func (*RepoMutation) TopicID

func (m *RepoMutation) TopicID() (r int, exists bool)

TopicID returns the value of the "topic_id" field in the mutation.

func (*RepoMutation) TopicsCleared

func (m *RepoMutation) TopicsCleared() bool

TopicsCleared reports if the "topics" edge to the Topic entity was cleared.

func (*RepoMutation) TopicsID

func (m *RepoMutation) TopicsID() (id int, exists bool)

TopicsID returns the "topics" edge ID in the mutation.

func (*RepoMutation) TopicsIDs

func (m *RepoMutation) TopicsIDs() (ids []int)

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

func (RepoMutation) Tx

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

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

func (*RepoMutation) Type

func (m *RepoMutation) Type() string

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

func (*RepoMutation) URL

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

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

func (*RepoMutation) UpdatedAt

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

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

func (*RepoMutation) UpdatedAtCleared

func (m *RepoMutation) UpdatedAtCleared() bool

UpdatedAtCleared returns if the "updated_at" field was cleared in this mutation.

func (*RepoMutation) WatchCount

func (m *RepoMutation) WatchCount() (r int, exists bool)

WatchCount returns the value of the "watch_count" field in the mutation.

func (*RepoMutation) WatchCountCleared

func (m *RepoMutation) WatchCountCleared() bool

WatchCountCleared returns if the "watch_count" field was cleared in this mutation.

func (*RepoMutation) Where

func (m *RepoMutation) Where(ps ...predicate.Repo)

Where appends a list predicates to the RepoMutation builder.

func (*RepoMutation) WhereP

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

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

type RepoQuery

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

RepoQuery is the builder for querying Repo entities.

func (*RepoQuery) Aggregate

func (rq *RepoQuery) Aggregate(fns ...AggregateFunc) *RepoSelect

Aggregate returns a RepoSelect configured with the given aggregations.

func (*RepoQuery) All

func (rq *RepoQuery) All(ctx context.Context) ([]*Repo, error)

All executes the query and returns a list of Repos.

func (*RepoQuery) AllX

func (rq *RepoQuery) AllX(ctx context.Context) []*Repo

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

func (*RepoQuery) Clone

func (rq *RepoQuery) Clone() *RepoQuery

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

func (*RepoQuery) Count

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

Count returns the count of the given query.

func (*RepoQuery) CountX

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

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

func (*RepoQuery) ExecContext

func (c *RepoQuery) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*RepoQuery) Exist

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

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

func (*RepoQuery) ExistX

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

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

func (*RepoQuery) First

func (rq *RepoQuery) First(ctx context.Context) (*Repo, error)

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

func (*RepoQuery) FirstID

func (rq *RepoQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*RepoQuery) FirstIDX

func (rq *RepoQuery) FirstIDX(ctx context.Context) int

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

func (*RepoQuery) FirstX

func (rq *RepoQuery) FirstX(ctx context.Context) *Repo

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

func (*RepoQuery) ForShare

func (rq *RepoQuery) ForShare(opts ...sql.LockOption) *RepoQuery

ForShare behaves similarly to ForUpdate, except that it acquires a shared mode lock on any rows that are read. Other sessions can read the rows, but cannot modify them until your transaction commits.

func (*RepoQuery) ForUpdate

func (rq *RepoQuery) ForUpdate(opts ...sql.LockOption) *RepoQuery

ForUpdate locks the selected rows against concurrent updates, and prevent them from being updated, deleted or "selected ... for update" by other sessions, until the transaction is either committed or rolled-back.

func (*RepoQuery) GroupBy

func (rq *RepoQuery) GroupBy(field string, fields ...string) *RepoGroupBy

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.Repo.Query().
	GroupBy(repo.FieldName).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*RepoQuery) IDs

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

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

func (*RepoQuery) IDsX

func (rq *RepoQuery) IDsX(ctx context.Context) []int

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

func (*RepoQuery) Limit

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

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

func (*RepoQuery) Modify

func (rq *RepoQuery) Modify(modifiers ...func(s *sql.Selector)) *RepoSelect

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

func (*RepoQuery) Offset

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

Offset to start from.

func (*RepoQuery) Only

func (rq *RepoQuery) Only(ctx context.Context) (*Repo, error)

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

func (*RepoQuery) OnlyID

func (rq *RepoQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*RepoQuery) OnlyIDX

func (rq *RepoQuery) OnlyIDX(ctx context.Context) int

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

func (*RepoQuery) OnlyX

func (rq *RepoQuery) OnlyX(ctx context.Context) *Repo

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

func (*RepoQuery) Order

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

Order specifies how the records should be ordered.

func (*RepoQuery) QueryContext

func (c *RepoQuery) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*RepoQuery) QueryTopics

func (rq *RepoQuery) QueryTopics() *TopicQuery

QueryTopics chains the current query on the "topics" edge.

func (*RepoQuery) Select

func (rq *RepoQuery) Select(fields ...string) *RepoSelect

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.Repo.Query().
	Select(repo.FieldName).
	Scan(ctx, &v)

func (*RepoQuery) Unique

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

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

func (rq *RepoQuery) Where(ps ...predicate.Repo) *RepoQuery

Where adds a new predicate for the RepoQuery builder.

func (*RepoQuery) WithTopics

func (rq *RepoQuery) WithTopics(opts ...func(*TopicQuery)) *RepoQuery

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

type RepoSelect

type RepoSelect struct {
	*RepoQuery
	// contains filtered or unexported fields
}

RepoSelect is the builder for selecting fields of Repo entities.

func (*RepoSelect) Aggregate

func (rs *RepoSelect) Aggregate(fns ...AggregateFunc) *RepoSelect

Aggregate adds the given aggregation functions to the selector query.

func (*RepoSelect) Bool

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

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

func (*RepoSelect) BoolX

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

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

func (*RepoSelect) Bools

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

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

func (*RepoSelect) BoolsX

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

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

func (RepoSelect) ExecContext

func (c RepoSelect) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*RepoSelect) Float64

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

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

func (*RepoSelect) Float64X

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

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

func (*RepoSelect) Float64s

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

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

func (*RepoSelect) Float64sX

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

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

func (*RepoSelect) Int

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

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

func (*RepoSelect) IntX

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

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

func (*RepoSelect) Ints

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

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

func (*RepoSelect) IntsX

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

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

func (*RepoSelect) Modify

func (rs *RepoSelect) Modify(modifiers ...func(s *sql.Selector)) *RepoSelect

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

func (RepoSelect) QueryContext

func (c RepoSelect) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*RepoSelect) Scan

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

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

func (*RepoSelect) ScanX

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

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

func (*RepoSelect) String

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

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

func (*RepoSelect) StringX

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

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

func (*RepoSelect) Strings

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

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

func (*RepoSelect) StringsX

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

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

type RepoUpdate

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

RepoUpdate is the builder for updating Repo entities.

func (*RepoUpdate) AddForkCount

func (ru *RepoUpdate) AddForkCount(i int) *RepoUpdate

AddForkCount adds i to the "fork_count" field.

func (*RepoUpdate) AddStarCount

func (ru *RepoUpdate) AddStarCount(i int) *RepoUpdate

AddStarCount adds i to the "star_count" field.

func (*RepoUpdate) AddWatchCount

func (ru *RepoUpdate) AddWatchCount(i int) *RepoUpdate

AddWatchCount adds i to the "watch_count" field.

func (*RepoUpdate) ClearForkCount

func (ru *RepoUpdate) ClearForkCount() *RepoUpdate

ClearForkCount clears the value of the "fork_count" field.

func (*RepoUpdate) ClearStarCount

func (ru *RepoUpdate) ClearStarCount() *RepoUpdate

ClearStarCount clears the value of the "star_count" field.

func (*RepoUpdate) ClearTopics

func (ru *RepoUpdate) ClearTopics() *RepoUpdate

ClearTopics clears the "topics" edge to the Topic entity.

func (*RepoUpdate) ClearUpdatedAt

func (ru *RepoUpdate) ClearUpdatedAt() *RepoUpdate

ClearUpdatedAt clears the value of the "updated_at" field.

func (*RepoUpdate) ClearWatchCount

func (ru *RepoUpdate) ClearWatchCount() *RepoUpdate

ClearWatchCount clears the value of the "watch_count" field.

func (*RepoUpdate) Exec

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

Exec executes the query.

func (*RepoUpdate) ExecContext

func (c *RepoUpdate) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*RepoUpdate) ExecX

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

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

func (*RepoUpdate) Modify

func (ru *RepoUpdate) Modify(modifiers ...func(u *sql.UpdateBuilder)) *RepoUpdate

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

func (*RepoUpdate) Mutation

func (ru *RepoUpdate) Mutation() *RepoMutation

Mutation returns the RepoMutation object of the builder.

func (*RepoUpdate) QueryContext

func (c *RepoUpdate) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*RepoUpdate) Save

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

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

func (*RepoUpdate) SaveX

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

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

func (*RepoUpdate) SetDescription

func (ru *RepoUpdate) SetDescription(s string) *RepoUpdate

SetDescription sets the "description" field.

func (*RepoUpdate) SetForkCount

func (ru *RepoUpdate) SetForkCount(i int) *RepoUpdate

SetForkCount sets the "fork_count" field.

func (*RepoUpdate) SetName

func (ru *RepoUpdate) SetName(s string) *RepoUpdate

SetName sets the "name" field.

func (*RepoUpdate) SetNillableForkCount

func (ru *RepoUpdate) SetNillableForkCount(i *int) *RepoUpdate

SetNillableForkCount sets the "fork_count" field if the given value is not nil.

func (*RepoUpdate) SetNillableStarCount

func (ru *RepoUpdate) SetNillableStarCount(i *int) *RepoUpdate

SetNillableStarCount sets the "star_count" field if the given value is not nil.

func (*RepoUpdate) SetNillableUpdatedAt

func (ru *RepoUpdate) SetNillableUpdatedAt(t *time.Time) *RepoUpdate

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

func (*RepoUpdate) SetNillableWatchCount

func (ru *RepoUpdate) SetNillableWatchCount(i *int) *RepoUpdate

SetNillableWatchCount sets the "watch_count" field if the given value is not nil.

func (*RepoUpdate) SetStarCount

func (ru *RepoUpdate) SetStarCount(i int) *RepoUpdate

SetStarCount sets the "star_count" field.

func (*RepoUpdate) SetSubTopic

func (ru *RepoUpdate) SetSubTopic(s string) *RepoUpdate

SetSubTopic sets the "sub_topic" field.

func (*RepoUpdate) SetTopicID

func (ru *RepoUpdate) SetTopicID(i int) *RepoUpdate

SetTopicID sets the "topic_id" field.

func (*RepoUpdate) SetTopics

func (ru *RepoUpdate) SetTopics(t *Topic) *RepoUpdate

SetTopics sets the "topics" edge to the Topic entity.

func (*RepoUpdate) SetTopicsID

func (ru *RepoUpdate) SetTopicsID(id int) *RepoUpdate

SetTopicsID sets the "topics" edge to the Topic entity by ID.

func (*RepoUpdate) SetType

func (ru *RepoUpdate) SetType(r repo.Type) *RepoUpdate

SetType sets the "type" field.

func (*RepoUpdate) SetURL

func (ru *RepoUpdate) SetURL(s string) *RepoUpdate

SetURL sets the "url" field.

func (*RepoUpdate) SetUpdatedAt

func (ru *RepoUpdate) SetUpdatedAt(t time.Time) *RepoUpdate

SetUpdatedAt sets the "updated_at" field.

func (*RepoUpdate) SetWatchCount

func (ru *RepoUpdate) SetWatchCount(i int) *RepoUpdate

SetWatchCount sets the "watch_count" field.

func (*RepoUpdate) Where

func (ru *RepoUpdate) Where(ps ...predicate.Repo) *RepoUpdate

Where appends a list predicates to the RepoUpdate builder.

type RepoUpdateOne

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

RepoUpdateOne is the builder for updating a single Repo entity.

func (*RepoUpdateOne) AddForkCount

func (ruo *RepoUpdateOne) AddForkCount(i int) *RepoUpdateOne

AddForkCount adds i to the "fork_count" field.

func (*RepoUpdateOne) AddStarCount

func (ruo *RepoUpdateOne) AddStarCount(i int) *RepoUpdateOne

AddStarCount adds i to the "star_count" field.

func (*RepoUpdateOne) AddWatchCount

func (ruo *RepoUpdateOne) AddWatchCount(i int) *RepoUpdateOne

AddWatchCount adds i to the "watch_count" field.

func (*RepoUpdateOne) ClearForkCount

func (ruo *RepoUpdateOne) ClearForkCount() *RepoUpdateOne

ClearForkCount clears the value of the "fork_count" field.

func (*RepoUpdateOne) ClearStarCount

func (ruo *RepoUpdateOne) ClearStarCount() *RepoUpdateOne

ClearStarCount clears the value of the "star_count" field.

func (*RepoUpdateOne) ClearTopics

func (ruo *RepoUpdateOne) ClearTopics() *RepoUpdateOne

ClearTopics clears the "topics" edge to the Topic entity.

func (*RepoUpdateOne) ClearUpdatedAt

func (ruo *RepoUpdateOne) ClearUpdatedAt() *RepoUpdateOne

ClearUpdatedAt clears the value of the "updated_at" field.

func (*RepoUpdateOne) ClearWatchCount

func (ruo *RepoUpdateOne) ClearWatchCount() *RepoUpdateOne

ClearWatchCount clears the value of the "watch_count" field.

func (*RepoUpdateOne) Exec

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

Exec executes the query on the entity.

func (*RepoUpdateOne) ExecContext

func (c *RepoUpdateOne) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*RepoUpdateOne) ExecX

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

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

func (*RepoUpdateOne) Modify

func (ruo *RepoUpdateOne) Modify(modifiers ...func(u *sql.UpdateBuilder)) *RepoUpdateOne

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

func (*RepoUpdateOne) Mutation

func (ruo *RepoUpdateOne) Mutation() *RepoMutation

Mutation returns the RepoMutation object of the builder.

func (*RepoUpdateOne) QueryContext

func (c *RepoUpdateOne) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*RepoUpdateOne) Save

func (ruo *RepoUpdateOne) Save(ctx context.Context) (*Repo, error)

Save executes the query and returns the updated Repo entity.

func (*RepoUpdateOne) SaveX

func (ruo *RepoUpdateOne) SaveX(ctx context.Context) *Repo

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

func (*RepoUpdateOne) Select

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

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

func (*RepoUpdateOne) SetDescription

func (ruo *RepoUpdateOne) SetDescription(s string) *RepoUpdateOne

SetDescription sets the "description" field.

func (*RepoUpdateOne) SetForkCount

func (ruo *RepoUpdateOne) SetForkCount(i int) *RepoUpdateOne

SetForkCount sets the "fork_count" field.

func (*RepoUpdateOne) SetName

func (ruo *RepoUpdateOne) SetName(s string) *RepoUpdateOne

SetName sets the "name" field.

func (*RepoUpdateOne) SetNillableForkCount

func (ruo *RepoUpdateOne) SetNillableForkCount(i *int) *RepoUpdateOne

SetNillableForkCount sets the "fork_count" field if the given value is not nil.

func (*RepoUpdateOne) SetNillableStarCount

func (ruo *RepoUpdateOne) SetNillableStarCount(i *int) *RepoUpdateOne

SetNillableStarCount sets the "star_count" field if the given value is not nil.

func (*RepoUpdateOne) SetNillableUpdatedAt

func (ruo *RepoUpdateOne) SetNillableUpdatedAt(t *time.Time) *RepoUpdateOne

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

func (*RepoUpdateOne) SetNillableWatchCount

func (ruo *RepoUpdateOne) SetNillableWatchCount(i *int) *RepoUpdateOne

SetNillableWatchCount sets the "watch_count" field if the given value is not nil.

func (*RepoUpdateOne) SetStarCount

func (ruo *RepoUpdateOne) SetStarCount(i int) *RepoUpdateOne

SetStarCount sets the "star_count" field.

func (*RepoUpdateOne) SetSubTopic

func (ruo *RepoUpdateOne) SetSubTopic(s string) *RepoUpdateOne

SetSubTopic sets the "sub_topic" field.

func (*RepoUpdateOne) SetTopicID

func (ruo *RepoUpdateOne) SetTopicID(i int) *RepoUpdateOne

SetTopicID sets the "topic_id" field.

func (*RepoUpdateOne) SetTopics

func (ruo *RepoUpdateOne) SetTopics(t *Topic) *RepoUpdateOne

SetTopics sets the "topics" edge to the Topic entity.

func (*RepoUpdateOne) SetTopicsID

func (ruo *RepoUpdateOne) SetTopicsID(id int) *RepoUpdateOne

SetTopicsID sets the "topics" edge to the Topic entity by ID.

func (*RepoUpdateOne) SetType

func (ruo *RepoUpdateOne) SetType(r repo.Type) *RepoUpdateOne

SetType sets the "type" field.

func (*RepoUpdateOne) SetURL

func (ruo *RepoUpdateOne) SetURL(s string) *RepoUpdateOne

SetURL sets the "url" field.

func (*RepoUpdateOne) SetUpdatedAt

func (ruo *RepoUpdateOne) SetUpdatedAt(t time.Time) *RepoUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*RepoUpdateOne) SetWatchCount

func (ruo *RepoUpdateOne) SetWatchCount(i int) *RepoUpdateOne

SetWatchCount sets the "watch_count" field.

func (*RepoUpdateOne) Where

func (ruo *RepoUpdateOne) Where(ps ...predicate.Repo) *RepoUpdateOne

Where appends a list predicates to the RepoUpdate builder.

type RepoUpsert

type RepoUpsert struct {
	*sql.UpdateSet
}

RepoUpsert is the "OnConflict" setter.

func (*RepoUpsert) AddForkCount

func (u *RepoUpsert) AddForkCount(v int) *RepoUpsert

AddForkCount adds v to the "fork_count" field.

func (*RepoUpsert) AddStarCount

func (u *RepoUpsert) AddStarCount(v int) *RepoUpsert

AddStarCount adds v to the "star_count" field.

func (*RepoUpsert) AddWatchCount

func (u *RepoUpsert) AddWatchCount(v int) *RepoUpsert

AddWatchCount adds v to the "watch_count" field.

func (*RepoUpsert) ClearForkCount

func (u *RepoUpsert) ClearForkCount() *RepoUpsert

ClearForkCount clears the value of the "fork_count" field.

func (*RepoUpsert) ClearStarCount

func (u *RepoUpsert) ClearStarCount() *RepoUpsert

ClearStarCount clears the value of the "star_count" field.

func (*RepoUpsert) ClearUpdatedAt

func (u *RepoUpsert) ClearUpdatedAt() *RepoUpsert

ClearUpdatedAt clears the value of the "updated_at" field.

func (*RepoUpsert) ClearWatchCount

func (u *RepoUpsert) ClearWatchCount() *RepoUpsert

ClearWatchCount clears the value of the "watch_count" field.

func (*RepoUpsert) SetDescription

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

SetDescription sets the "description" field.

func (*RepoUpsert) SetForkCount

func (u *RepoUpsert) SetForkCount(v int) *RepoUpsert

SetForkCount sets the "fork_count" field.

func (*RepoUpsert) SetName

func (u *RepoUpsert) SetName(v string) *RepoUpsert

SetName sets the "name" field.

func (*RepoUpsert) SetStarCount

func (u *RepoUpsert) SetStarCount(v int) *RepoUpsert

SetStarCount sets the "star_count" field.

func (*RepoUpsert) SetSubTopic

func (u *RepoUpsert) SetSubTopic(v string) *RepoUpsert

SetSubTopic sets the "sub_topic" field.

func (*RepoUpsert) SetTopicID

func (u *RepoUpsert) SetTopicID(v int) *RepoUpsert

SetTopicID sets the "topic_id" field.

func (*RepoUpsert) SetType

func (u *RepoUpsert) SetType(v repo.Type) *RepoUpsert

SetType sets the "type" field.

func (*RepoUpsert) SetURL

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

SetURL sets the "url" field.

func (*RepoUpsert) SetUpdatedAt

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

SetUpdatedAt sets the "updated_at" field.

func (*RepoUpsert) SetWatchCount

func (u *RepoUpsert) SetWatchCount(v int) *RepoUpsert

SetWatchCount sets the "watch_count" field.

func (*RepoUpsert) UpdateDescription

func (u *RepoUpsert) UpdateDescription() *RepoUpsert

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

func (*RepoUpsert) UpdateForkCount

func (u *RepoUpsert) UpdateForkCount() *RepoUpsert

UpdateForkCount sets the "fork_count" field to the value that was provided on create.

func (*RepoUpsert) UpdateName

func (u *RepoUpsert) UpdateName() *RepoUpsert

UpdateName sets the "name" field to the value that was provided on create.

func (*RepoUpsert) UpdateStarCount

func (u *RepoUpsert) UpdateStarCount() *RepoUpsert

UpdateStarCount sets the "star_count" field to the value that was provided on create.

func (*RepoUpsert) UpdateSubTopic

func (u *RepoUpsert) UpdateSubTopic() *RepoUpsert

UpdateSubTopic sets the "sub_topic" field to the value that was provided on create.

func (*RepoUpsert) UpdateTopicID

func (u *RepoUpsert) UpdateTopicID() *RepoUpsert

UpdateTopicID sets the "topic_id" field to the value that was provided on create.

func (*RepoUpsert) UpdateType

func (u *RepoUpsert) UpdateType() *RepoUpsert

UpdateType sets the "type" field to the value that was provided on create.

func (*RepoUpsert) UpdateURL

func (u *RepoUpsert) UpdateURL() *RepoUpsert

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

func (*RepoUpsert) UpdateUpdatedAt

func (u *RepoUpsert) UpdateUpdatedAt() *RepoUpsert

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

func (*RepoUpsert) UpdateWatchCount

func (u *RepoUpsert) UpdateWatchCount() *RepoUpsert

UpdateWatchCount sets the "watch_count" field to the value that was provided on create.

type RepoUpsertBulk

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

RepoUpsertBulk is the builder for "upsert"-ing a bulk of Repo nodes.

func (*RepoUpsertBulk) AddForkCount

func (u *RepoUpsertBulk) AddForkCount(v int) *RepoUpsertBulk

AddForkCount adds v to the "fork_count" field.

func (*RepoUpsertBulk) AddStarCount

func (u *RepoUpsertBulk) AddStarCount(v int) *RepoUpsertBulk

AddStarCount adds v to the "star_count" field.

func (*RepoUpsertBulk) AddWatchCount

func (u *RepoUpsertBulk) AddWatchCount(v int) *RepoUpsertBulk

AddWatchCount adds v to the "watch_count" field.

func (*RepoUpsertBulk) ClearForkCount

func (u *RepoUpsertBulk) ClearForkCount() *RepoUpsertBulk

ClearForkCount clears the value of the "fork_count" field.

func (*RepoUpsertBulk) ClearStarCount

func (u *RepoUpsertBulk) ClearStarCount() *RepoUpsertBulk

ClearStarCount clears the value of the "star_count" field.

func (*RepoUpsertBulk) ClearUpdatedAt

func (u *RepoUpsertBulk) ClearUpdatedAt() *RepoUpsertBulk

ClearUpdatedAt clears the value of the "updated_at" field.

func (*RepoUpsertBulk) ClearWatchCount

func (u *RepoUpsertBulk) ClearWatchCount() *RepoUpsertBulk

ClearWatchCount clears the value of the "watch_count" field.

func (*RepoUpsertBulk) DoNothing

func (u *RepoUpsertBulk) DoNothing() *RepoUpsertBulk

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

func (*RepoUpsertBulk) Exec

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

Exec executes the query.

func (*RepoUpsertBulk) ExecX

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

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

func (*RepoUpsertBulk) Ignore

func (u *RepoUpsertBulk) Ignore() *RepoUpsertBulk

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

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

func (*RepoUpsertBulk) SetDescription

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

SetDescription sets the "description" field.

func (*RepoUpsertBulk) SetForkCount

func (u *RepoUpsertBulk) SetForkCount(v int) *RepoUpsertBulk

SetForkCount sets the "fork_count" field.

func (*RepoUpsertBulk) SetName

func (u *RepoUpsertBulk) SetName(v string) *RepoUpsertBulk

SetName sets the "name" field.

func (*RepoUpsertBulk) SetStarCount

func (u *RepoUpsertBulk) SetStarCount(v int) *RepoUpsertBulk

SetStarCount sets the "star_count" field.

func (*RepoUpsertBulk) SetSubTopic

func (u *RepoUpsertBulk) SetSubTopic(v string) *RepoUpsertBulk

SetSubTopic sets the "sub_topic" field.

func (*RepoUpsertBulk) SetTopicID

func (u *RepoUpsertBulk) SetTopicID(v int) *RepoUpsertBulk

SetTopicID sets the "topic_id" field.

func (*RepoUpsertBulk) SetType

func (u *RepoUpsertBulk) SetType(v repo.Type) *RepoUpsertBulk

SetType sets the "type" field.

func (*RepoUpsertBulk) SetURL

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

SetURL sets the "url" field.

func (*RepoUpsertBulk) SetUpdatedAt

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

SetUpdatedAt sets the "updated_at" field.

func (*RepoUpsertBulk) SetWatchCount

func (u *RepoUpsertBulk) SetWatchCount(v int) *RepoUpsertBulk

SetWatchCount sets the "watch_count" field.

func (*RepoUpsertBulk) Update

func (u *RepoUpsertBulk) Update(set func(*RepoUpsert)) *RepoUpsertBulk

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

func (*RepoUpsertBulk) UpdateDescription

func (u *RepoUpsertBulk) UpdateDescription() *RepoUpsertBulk

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

func (*RepoUpsertBulk) UpdateForkCount

func (u *RepoUpsertBulk) UpdateForkCount() *RepoUpsertBulk

UpdateForkCount sets the "fork_count" field to the value that was provided on create.

func (*RepoUpsertBulk) UpdateName

func (u *RepoUpsertBulk) UpdateName() *RepoUpsertBulk

UpdateName sets the "name" field to the value that was provided on create.

func (*RepoUpsertBulk) UpdateNewValues

func (u *RepoUpsertBulk) UpdateNewValues() *RepoUpsertBulk

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

client.Repo.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
	).
	Exec(ctx)

func (*RepoUpsertBulk) UpdateStarCount

func (u *RepoUpsertBulk) UpdateStarCount() *RepoUpsertBulk

UpdateStarCount sets the "star_count" field to the value that was provided on create.

func (*RepoUpsertBulk) UpdateSubTopic

func (u *RepoUpsertBulk) UpdateSubTopic() *RepoUpsertBulk

UpdateSubTopic sets the "sub_topic" field to the value that was provided on create.

func (*RepoUpsertBulk) UpdateTopicID

func (u *RepoUpsertBulk) UpdateTopicID() *RepoUpsertBulk

UpdateTopicID sets the "topic_id" field to the value that was provided on create.

func (*RepoUpsertBulk) UpdateType

func (u *RepoUpsertBulk) UpdateType() *RepoUpsertBulk

UpdateType sets the "type" field to the value that was provided on create.

func (*RepoUpsertBulk) UpdateURL

func (u *RepoUpsertBulk) UpdateURL() *RepoUpsertBulk

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

func (*RepoUpsertBulk) UpdateUpdatedAt

func (u *RepoUpsertBulk) UpdateUpdatedAt() *RepoUpsertBulk

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

func (*RepoUpsertBulk) UpdateWatchCount

func (u *RepoUpsertBulk) UpdateWatchCount() *RepoUpsertBulk

UpdateWatchCount sets the "watch_count" field to the value that was provided on create.

type RepoUpsertOne

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

RepoUpsertOne is the builder for "upsert"-ing

one Repo node.

func (*RepoUpsertOne) AddForkCount

func (u *RepoUpsertOne) AddForkCount(v int) *RepoUpsertOne

AddForkCount adds v to the "fork_count" field.

func (*RepoUpsertOne) AddStarCount

func (u *RepoUpsertOne) AddStarCount(v int) *RepoUpsertOne

AddStarCount adds v to the "star_count" field.

func (*RepoUpsertOne) AddWatchCount

func (u *RepoUpsertOne) AddWatchCount(v int) *RepoUpsertOne

AddWatchCount adds v to the "watch_count" field.

func (*RepoUpsertOne) ClearForkCount

func (u *RepoUpsertOne) ClearForkCount() *RepoUpsertOne

ClearForkCount clears the value of the "fork_count" field.

func (*RepoUpsertOne) ClearStarCount

func (u *RepoUpsertOne) ClearStarCount() *RepoUpsertOne

ClearStarCount clears the value of the "star_count" field.

func (*RepoUpsertOne) ClearUpdatedAt

func (u *RepoUpsertOne) ClearUpdatedAt() *RepoUpsertOne

ClearUpdatedAt clears the value of the "updated_at" field.

func (*RepoUpsertOne) ClearWatchCount

func (u *RepoUpsertOne) ClearWatchCount() *RepoUpsertOne

ClearWatchCount clears the value of the "watch_count" field.

func (*RepoUpsertOne) DoNothing

func (u *RepoUpsertOne) DoNothing() *RepoUpsertOne

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

func (*RepoUpsertOne) Exec

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

Exec executes the query.

func (*RepoUpsertOne) ExecX

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

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

func (*RepoUpsertOne) ID

func (u *RepoUpsertOne) ID(ctx context.Context) (id int, err error)

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

func (*RepoUpsertOne) IDX

func (u *RepoUpsertOne) IDX(ctx context.Context) int

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

func (*RepoUpsertOne) Ignore

func (u *RepoUpsertOne) Ignore() *RepoUpsertOne

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

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

func (*RepoUpsertOne) SetDescription

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

SetDescription sets the "description" field.

func (*RepoUpsertOne) SetForkCount

func (u *RepoUpsertOne) SetForkCount(v int) *RepoUpsertOne

SetForkCount sets the "fork_count" field.

func (*RepoUpsertOne) SetName

func (u *RepoUpsertOne) SetName(v string) *RepoUpsertOne

SetName sets the "name" field.

func (*RepoUpsertOne) SetStarCount

func (u *RepoUpsertOne) SetStarCount(v int) *RepoUpsertOne

SetStarCount sets the "star_count" field.

func (*RepoUpsertOne) SetSubTopic

func (u *RepoUpsertOne) SetSubTopic(v string) *RepoUpsertOne

SetSubTopic sets the "sub_topic" field.

func (*RepoUpsertOne) SetTopicID

func (u *RepoUpsertOne) SetTopicID(v int) *RepoUpsertOne

SetTopicID sets the "topic_id" field.

func (*RepoUpsertOne) SetType

func (u *RepoUpsertOne) SetType(v repo.Type) *RepoUpsertOne

SetType sets the "type" field.

func (*RepoUpsertOne) SetURL

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

SetURL sets the "url" field.

func (*RepoUpsertOne) SetUpdatedAt

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

SetUpdatedAt sets the "updated_at" field.

func (*RepoUpsertOne) SetWatchCount

func (u *RepoUpsertOne) SetWatchCount(v int) *RepoUpsertOne

SetWatchCount sets the "watch_count" field.

func (*RepoUpsertOne) Update

func (u *RepoUpsertOne) Update(set func(*RepoUpsert)) *RepoUpsertOne

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

func (*RepoUpsertOne) UpdateDescription

func (u *RepoUpsertOne) UpdateDescription() *RepoUpsertOne

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

func (*RepoUpsertOne) UpdateForkCount

func (u *RepoUpsertOne) UpdateForkCount() *RepoUpsertOne

UpdateForkCount sets the "fork_count" field to the value that was provided on create.

func (*RepoUpsertOne) UpdateName

func (u *RepoUpsertOne) UpdateName() *RepoUpsertOne

UpdateName sets the "name" field to the value that was provided on create.

func (*RepoUpsertOne) UpdateNewValues

func (u *RepoUpsertOne) UpdateNewValues() *RepoUpsertOne

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

client.Repo.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
	).
	Exec(ctx)

func (*RepoUpsertOne) UpdateStarCount

func (u *RepoUpsertOne) UpdateStarCount() *RepoUpsertOne

UpdateStarCount sets the "star_count" field to the value that was provided on create.

func (*RepoUpsertOne) UpdateSubTopic

func (u *RepoUpsertOne) UpdateSubTopic() *RepoUpsertOne

UpdateSubTopic sets the "sub_topic" field to the value that was provided on create.

func (*RepoUpsertOne) UpdateTopicID

func (u *RepoUpsertOne) UpdateTopicID() *RepoUpsertOne

UpdateTopicID sets the "topic_id" field to the value that was provided on create.

func (*RepoUpsertOne) UpdateType

func (u *RepoUpsertOne) UpdateType() *RepoUpsertOne

UpdateType sets the "type" field to the value that was provided on create.

func (*RepoUpsertOne) UpdateURL

func (u *RepoUpsertOne) UpdateURL() *RepoUpsertOne

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

func (*RepoUpsertOne) UpdateUpdatedAt

func (u *RepoUpsertOne) UpdateUpdatedAt() *RepoUpsertOne

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

func (*RepoUpsertOne) UpdateWatchCount

func (u *RepoUpsertOne) UpdateWatchCount() *RepoUpsertOne

UpdateWatchCount sets the "watch_count" field to the value that was provided on create.

type Repos

type Repos []*Repo

Repos is a parsable slice of Repo.

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 Topic

type Topic struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// Name holds the value of the "name" field.
	Name string `json:"name,omitempty"`
	// SubName holds the value of the "sub_name" field.
	SubName string `json:"sub_name,omitempty"`
	// Description holds the value of the "description" field.
	Description string `json:"description,omitempty"`
	// URL holds the value of the "url" field.
	URL string `json:"url,omitempty"`
	// GithubURL holds the value of the "github_url" field.
	GithubURL string `json:"github_url,omitempty"`
	// PlatformID holds the value of the "platform_id" field.
	PlatformID int `json:"platform_id,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the TopicQuery when eager-loading is set.
	Edges TopicEdges `json:"-"`
	// contains filtered or unexported fields
}

Topic is the model entity for the Topic schema.

func (*Topic) ExecContext

func (c *Topic) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*Topic) QueryContext

func (c *Topic) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*Topic) QueryPlatform

func (t *Topic) QueryPlatform() *PlatformQuery

QueryPlatform queries the "platform" edge of the Topic entity.

func (*Topic) QueryRepos

func (t *Topic) QueryRepos() *RepoQuery

QueryRepos queries the "repos" edge of the Topic entity.

func (*Topic) String

func (t *Topic) String() string

String implements the fmt.Stringer.

func (*Topic) Unwrap

func (t *Topic) Unwrap() *Topic

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

func (t *Topic) Update() *TopicUpdateOne

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

type TopicClient

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

TopicClient is a client for the Topic schema.

func NewTopicClient

func NewTopicClient(c config) *TopicClient

NewTopicClient returns a client for the Topic from the given config.

func (*TopicClient) Create

func (c *TopicClient) Create() *TopicCreate

Create returns a builder for creating a Topic entity.

func (*TopicClient) CreateBulk

func (c *TopicClient) CreateBulk(builders ...*TopicCreate) *TopicCreateBulk

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

func (*TopicClient) Delete

func (c *TopicClient) Delete() *TopicDelete

Delete returns a delete builder for Topic.

func (*TopicClient) DeleteOne

func (c *TopicClient) DeleteOne(t *Topic) *TopicDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*TopicClient) DeleteOneID

func (c *TopicClient) DeleteOneID(id int) *TopicDeleteOne

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

func (*TopicClient) ExecContext

func (c *TopicClient) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*TopicClient) Get

func (c *TopicClient) Get(ctx context.Context, id int) (*Topic, error)

Get returns a Topic entity by its id.

func (*TopicClient) GetX

func (c *TopicClient) GetX(ctx context.Context, id int) *Topic

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

func (*TopicClient) Hooks

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

Hooks returns the client hooks.

func (*TopicClient) Intercept

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

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

func (*TopicClient) Interceptors

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

Interceptors returns the client interceptors.

func (*TopicClient) Query

func (c *TopicClient) Query() *TopicQuery

Query returns a query builder for Topic.

func (*TopicClient) QueryContext

func (c *TopicClient) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*TopicClient) QueryPlatform

func (c *TopicClient) QueryPlatform(t *Topic) *PlatformQuery

QueryPlatform queries the platform edge of a Topic.

func (*TopicClient) QueryRepos

func (c *TopicClient) QueryRepos(t *Topic) *RepoQuery

QueryRepos queries the repos edge of a Topic.

func (*TopicClient) Update

func (c *TopicClient) Update() *TopicUpdate

Update returns an update builder for Topic.

func (*TopicClient) UpdateOne

func (c *TopicClient) UpdateOne(t *Topic) *TopicUpdateOne

UpdateOne returns an update builder for the given entity.

func (*TopicClient) UpdateOneID

func (c *TopicClient) UpdateOneID(id int) *TopicUpdateOne

UpdateOneID returns an update builder for the given id.

func (*TopicClient) Use

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

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

type TopicCreate

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

TopicCreate is the builder for creating a Topic entity.

func (*TopicCreate) AddRepoIDs

func (tc *TopicCreate) AddRepoIDs(ids ...int) *TopicCreate

AddRepoIDs adds the "repos" edge to the Repo entity by IDs.

func (*TopicCreate) AddRepos

func (tc *TopicCreate) AddRepos(r ...*Repo) *TopicCreate

AddRepos adds the "repos" edges to the Repo entity.

func (*TopicCreate) Exec

func (tc *TopicCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*TopicCreate) ExecContext

func (c *TopicCreate) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*TopicCreate) ExecX

func (tc *TopicCreate) ExecX(ctx context.Context)

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

func (*TopicCreate) Mutation

func (tc *TopicCreate) Mutation() *TopicMutation

Mutation returns the TopicMutation object of the builder.

func (*TopicCreate) OnConflict

func (tc *TopicCreate) OnConflict(opts ...sql.ConflictOption) *TopicUpsertOne

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

client.Topic.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.TopicUpsert) {
		SetName(v+v).
	}).
	Exec(ctx)

func (*TopicCreate) OnConflictColumns

func (tc *TopicCreate) OnConflictColumns(columns ...string) *TopicUpsertOne

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

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

func (*TopicCreate) QueryContext

func (c *TopicCreate) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*TopicCreate) Save

func (tc *TopicCreate) Save(ctx context.Context) (*Topic, error)

Save creates the Topic in the database.

func (*TopicCreate) SaveX

func (tc *TopicCreate) SaveX(ctx context.Context) *Topic

SaveX calls Save and panics if Save returns an error.

func (*TopicCreate) SetDescription

func (tc *TopicCreate) SetDescription(s string) *TopicCreate

SetDescription sets the "description" field.

func (*TopicCreate) SetGithubURL

func (tc *TopicCreate) SetGithubURL(s string) *TopicCreate

SetGithubURL sets the "github_url" field.

func (*TopicCreate) SetName

func (tc *TopicCreate) SetName(s string) *TopicCreate

SetName sets the "name" field.

func (*TopicCreate) SetPlatform

func (tc *TopicCreate) SetPlatform(p *Platform) *TopicCreate

SetPlatform sets the "platform" edge to the Platform entity.

func (*TopicCreate) SetPlatformID

func (tc *TopicCreate) SetPlatformID(i int) *TopicCreate

SetPlatformID sets the "platform_id" field.

func (*TopicCreate) SetSubName

func (tc *TopicCreate) SetSubName(s string) *TopicCreate

SetSubName sets the "sub_name" field.

func (*TopicCreate) SetURL

func (tc *TopicCreate) SetURL(s string) *TopicCreate

SetURL sets the "url" field.

type TopicCreateBulk

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

TopicCreateBulk is the builder for creating many Topic entities in bulk.

func (*TopicCreateBulk) Exec

func (tcb *TopicCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*TopicCreateBulk) ExecContext

func (c *TopicCreateBulk) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*TopicCreateBulk) ExecX

func (tcb *TopicCreateBulk) ExecX(ctx context.Context)

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

func (*TopicCreateBulk) OnConflict

func (tcb *TopicCreateBulk) OnConflict(opts ...sql.ConflictOption) *TopicUpsertBulk

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

client.Topic.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.TopicUpsert) {
		SetName(v+v).
	}).
	Exec(ctx)

func (*TopicCreateBulk) OnConflictColumns

func (tcb *TopicCreateBulk) OnConflictColumns(columns ...string) *TopicUpsertBulk

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

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

func (*TopicCreateBulk) QueryContext

func (c *TopicCreateBulk) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*TopicCreateBulk) Save

func (tcb *TopicCreateBulk) Save(ctx context.Context) ([]*Topic, error)

Save creates the Topic entities in the database.

func (*TopicCreateBulk) SaveX

func (tcb *TopicCreateBulk) SaveX(ctx context.Context) []*Topic

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

type TopicDelete

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

TopicDelete is the builder for deleting a Topic entity.

func (*TopicDelete) Exec

func (td *TopicDelete) Exec(ctx context.Context) (int, error)

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

func (*TopicDelete) ExecContext

func (c *TopicDelete) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*TopicDelete) ExecX

func (td *TopicDelete) ExecX(ctx context.Context) int

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

func (*TopicDelete) QueryContext

func (c *TopicDelete) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*TopicDelete) Where

func (td *TopicDelete) Where(ps ...predicate.Topic) *TopicDelete

Where appends a list predicates to the TopicDelete builder.

type TopicDeleteOne

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

TopicDeleteOne is the builder for deleting a single Topic entity.

func (*TopicDeleteOne) Exec

func (tdo *TopicDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*TopicDeleteOne) ExecX

func (tdo *TopicDeleteOne) ExecX(ctx context.Context)

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

func (*TopicDeleteOne) Where

func (tdo *TopicDeleteOne) Where(ps ...predicate.Topic) *TopicDeleteOne

Where appends a list predicates to the TopicDelete builder.

type TopicEdges

type TopicEdges struct {
	// Platform holds the value of the platform edge.
	Platform *Platform `json:"platform,omitempty"`
	// Repos holds the value of the repos edge.
	Repos []*Repo `json:"repos,omitempty"`
	// contains filtered or unexported fields
}

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

func (TopicEdges) PlatformOrErr

func (e TopicEdges) PlatformOrErr() (*Platform, error)

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

func (TopicEdges) ReposOrErr

func (e TopicEdges) ReposOrErr() ([]*Repo, error)

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

type TopicGroupBy

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

TopicGroupBy is the group-by builder for Topic entities.

func (*TopicGroupBy) Aggregate

func (tgb *TopicGroupBy) Aggregate(fns ...AggregateFunc) *TopicGroupBy

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

func (*TopicGroupBy) Bool

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

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

func (*TopicGroupBy) BoolX

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

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

func (*TopicGroupBy) Bools

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

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

func (*TopicGroupBy) BoolsX

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

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

func (*TopicGroupBy) Float64

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

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

func (*TopicGroupBy) Float64X

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

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

func (*TopicGroupBy) Float64s

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

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

func (*TopicGroupBy) Float64sX

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

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

func (*TopicGroupBy) Int

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

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

func (*TopicGroupBy) IntX

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

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

func (*TopicGroupBy) Ints

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

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

func (*TopicGroupBy) IntsX

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

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

func (*TopicGroupBy) Scan

func (tgb *TopicGroupBy) Scan(ctx context.Context, v any) error

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

func (*TopicGroupBy) ScanX

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

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

func (*TopicGroupBy) String

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

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

func (*TopicGroupBy) StringX

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

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

func (*TopicGroupBy) Strings

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

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

func (*TopicGroupBy) StringsX

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

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

type TopicMutation

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

TopicMutation represents an operation that mutates the Topic nodes in the graph.

func (*TopicMutation) AddField

func (m *TopicMutation) 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 (*TopicMutation) AddRepoIDs

func (m *TopicMutation) AddRepoIDs(ids ...int)

AddRepoIDs adds the "repos" edge to the Repo entity by ids.

func (*TopicMutation) AddedEdges

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

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

func (*TopicMutation) AddedField

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

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

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

func (*TopicMutation) AddedIDs

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

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

func (*TopicMutation) ClearEdge

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

func (m *TopicMutation) 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 (*TopicMutation) ClearPlatform

func (m *TopicMutation) ClearPlatform()

ClearPlatform clears the "platform" edge to the Platform entity.

func (*TopicMutation) ClearRepos

func (m *TopicMutation) ClearRepos()

ClearRepos clears the "repos" edge to the Repo entity.

func (*TopicMutation) ClearedEdges

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

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

func (*TopicMutation) ClearedFields

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

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

func (TopicMutation) Client

func (m TopicMutation) 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 (*TopicMutation) Description

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

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

func (*TopicMutation) EdgeCleared

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

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

func (*TopicMutation) ExecContext

func (c *TopicMutation) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*TopicMutation) Field

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

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

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

func (*TopicMutation) Fields

func (m *TopicMutation) 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 (*TopicMutation) GithubURL

func (m *TopicMutation) GithubURL() (r string, exists bool)

GithubURL returns the value of the "github_url" field in the mutation.

func (*TopicMutation) ID

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

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

func (*TopicMutation) IDs

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

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

func (*TopicMutation) Name

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

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

func (*TopicMutation) OldDescription

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

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

func (m *TopicMutation) 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 (*TopicMutation) OldGithubURL

func (m *TopicMutation) OldGithubURL(ctx context.Context) (v string, err error)

OldGithubURL returns the old "github_url" field's value of the Topic entity. If the Topic 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 (*TopicMutation) OldName

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

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

func (m *TopicMutation) OldPlatformID(ctx context.Context) (v int, err error)

OldPlatformID returns the old "platform_id" field's value of the Topic entity. If the Topic 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 (*TopicMutation) OldSubName

func (m *TopicMutation) OldSubName(ctx context.Context) (v string, err error)

OldSubName returns the old "sub_name" field's value of the Topic entity. If the Topic 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 (*TopicMutation) OldURL

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

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

func (m *TopicMutation) Op() Op

Op returns the operation name.

func (*TopicMutation) PlatformCleared

func (m *TopicMutation) PlatformCleared() bool

PlatformCleared reports if the "platform" edge to the Platform entity was cleared.

func (*TopicMutation) PlatformID

func (m *TopicMutation) PlatformID() (r int, exists bool)

PlatformID returns the value of the "platform_id" field in the mutation.

func (*TopicMutation) PlatformIDs

func (m *TopicMutation) PlatformIDs() (ids []int)

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

func (*TopicMutation) QueryContext

func (c *TopicMutation) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*TopicMutation) RemoveRepoIDs

func (m *TopicMutation) RemoveRepoIDs(ids ...int)

RemoveRepoIDs removes the "repos" edge to the Repo entity by IDs.

func (*TopicMutation) RemovedEdges

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

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

func (*TopicMutation) RemovedIDs

func (m *TopicMutation) 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 (*TopicMutation) RemovedReposIDs

func (m *TopicMutation) RemovedReposIDs() (ids []int)

RemovedRepos returns the removed IDs of the "repos" edge to the Repo entity.

func (*TopicMutation) ReposCleared

func (m *TopicMutation) ReposCleared() bool

ReposCleared reports if the "repos" edge to the Repo entity was cleared.

func (*TopicMutation) ReposIDs

func (m *TopicMutation) ReposIDs() (ids []int)

ReposIDs returns the "repos" edge IDs in the mutation.

func (*TopicMutation) ResetDescription

func (m *TopicMutation) ResetDescription()

ResetDescription resets all changes to the "description" field.

func (*TopicMutation) ResetEdge

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

func (m *TopicMutation) 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 (*TopicMutation) ResetGithubURL

func (m *TopicMutation) ResetGithubURL()

ResetGithubURL resets all changes to the "github_url" field.

func (*TopicMutation) ResetName

func (m *TopicMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*TopicMutation) ResetPlatform

func (m *TopicMutation) ResetPlatform()

ResetPlatform resets all changes to the "platform" edge.

func (*TopicMutation) ResetPlatformID

func (m *TopicMutation) ResetPlatformID()

ResetPlatformID resets all changes to the "platform_id" field.

func (*TopicMutation) ResetRepos

func (m *TopicMutation) ResetRepos()

ResetRepos resets all changes to the "repos" edge.

func (*TopicMutation) ResetSubName

func (m *TopicMutation) ResetSubName()

ResetSubName resets all changes to the "sub_name" field.

func (*TopicMutation) ResetURL

func (m *TopicMutation) ResetURL()

ResetURL resets all changes to the "url" field.

func (*TopicMutation) SetDescription

func (m *TopicMutation) SetDescription(s string)

SetDescription sets the "description" field.

func (*TopicMutation) SetField

func (m *TopicMutation) 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 (*TopicMutation) SetGithubURL

func (m *TopicMutation) SetGithubURL(s string)

SetGithubURL sets the "github_url" field.

func (*TopicMutation) SetName

func (m *TopicMutation) SetName(s string)

SetName sets the "name" field.

func (*TopicMutation) SetOp

func (m *TopicMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*TopicMutation) SetPlatformID

func (m *TopicMutation) SetPlatformID(i int)

SetPlatformID sets the "platform_id" field.

func (*TopicMutation) SetSubName

func (m *TopicMutation) SetSubName(s string)

SetSubName sets the "sub_name" field.

func (*TopicMutation) SetURL

func (m *TopicMutation) SetURL(s string)

SetURL sets the "url" field.

func (*TopicMutation) SubName

func (m *TopicMutation) SubName() (r string, exists bool)

SubName returns the value of the "sub_name" field in the mutation.

func (TopicMutation) Tx

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

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

func (*TopicMutation) Type

func (m *TopicMutation) Type() string

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

func (*TopicMutation) URL

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

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

func (*TopicMutation) Where

func (m *TopicMutation) Where(ps ...predicate.Topic)

Where appends a list predicates to the TopicMutation builder.

func (*TopicMutation) WhereP

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

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

type TopicQuery

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

TopicQuery is the builder for querying Topic entities.

func (*TopicQuery) Aggregate

func (tq *TopicQuery) Aggregate(fns ...AggregateFunc) *TopicSelect

Aggregate returns a TopicSelect configured with the given aggregations.

func (*TopicQuery) All

func (tq *TopicQuery) All(ctx context.Context) ([]*Topic, error)

All executes the query and returns a list of Topics.

func (*TopicQuery) AllX

func (tq *TopicQuery) AllX(ctx context.Context) []*Topic

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

func (*TopicQuery) Clone

func (tq *TopicQuery) Clone() *TopicQuery

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

func (*TopicQuery) Count

func (tq *TopicQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*TopicQuery) CountX

func (tq *TopicQuery) CountX(ctx context.Context) int

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

func (*TopicQuery) ExecContext

func (c *TopicQuery) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*TopicQuery) Exist

func (tq *TopicQuery) Exist(ctx context.Context) (bool, error)

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

func (*TopicQuery) ExistX

func (tq *TopicQuery) ExistX(ctx context.Context) bool

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

func (*TopicQuery) First

func (tq *TopicQuery) First(ctx context.Context) (*Topic, error)

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

func (*TopicQuery) FirstID

func (tq *TopicQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*TopicQuery) FirstIDX

func (tq *TopicQuery) FirstIDX(ctx context.Context) int

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

func (*TopicQuery) FirstX

func (tq *TopicQuery) FirstX(ctx context.Context) *Topic

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

func (*TopicQuery) ForShare

func (tq *TopicQuery) ForShare(opts ...sql.LockOption) *TopicQuery

ForShare behaves similarly to ForUpdate, except that it acquires a shared mode lock on any rows that are read. Other sessions can read the rows, but cannot modify them until your transaction commits.

func (*TopicQuery) ForUpdate

func (tq *TopicQuery) ForUpdate(opts ...sql.LockOption) *TopicQuery

ForUpdate locks the selected rows against concurrent updates, and prevent them from being updated, deleted or "selected ... for update" by other sessions, until the transaction is either committed or rolled-back.

func (*TopicQuery) GroupBy

func (tq *TopicQuery) GroupBy(field string, fields ...string) *TopicGroupBy

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.Topic.Query().
	GroupBy(topic.FieldName).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*TopicQuery) IDs

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

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

func (*TopicQuery) IDsX

func (tq *TopicQuery) IDsX(ctx context.Context) []int

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

func (*TopicQuery) Limit

func (tq *TopicQuery) Limit(limit int) *TopicQuery

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

func (*TopicQuery) Modify

func (tq *TopicQuery) Modify(modifiers ...func(s *sql.Selector)) *TopicSelect

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

func (*TopicQuery) Offset

func (tq *TopicQuery) Offset(offset int) *TopicQuery

Offset to start from.

func (*TopicQuery) Only

func (tq *TopicQuery) Only(ctx context.Context) (*Topic, error)

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

func (*TopicQuery) OnlyID

func (tq *TopicQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*TopicQuery) OnlyIDX

func (tq *TopicQuery) OnlyIDX(ctx context.Context) int

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

func (*TopicQuery) OnlyX

func (tq *TopicQuery) OnlyX(ctx context.Context) *Topic

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

func (*TopicQuery) Order

func (tq *TopicQuery) Order(o ...OrderFunc) *TopicQuery

Order specifies how the records should be ordered.

func (*TopicQuery) QueryContext

func (c *TopicQuery) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*TopicQuery) QueryPlatform

func (tq *TopicQuery) QueryPlatform() *PlatformQuery

QueryPlatform chains the current query on the "platform" edge.

func (*TopicQuery) QueryRepos

func (tq *TopicQuery) QueryRepos() *RepoQuery

QueryRepos chains the current query on the "repos" edge.

func (*TopicQuery) Select

func (tq *TopicQuery) Select(fields ...string) *TopicSelect

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.Topic.Query().
	Select(topic.FieldName).
	Scan(ctx, &v)

func (*TopicQuery) Unique

func (tq *TopicQuery) Unique(unique bool) *TopicQuery

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

func (tq *TopicQuery) Where(ps ...predicate.Topic) *TopicQuery

Where adds a new predicate for the TopicQuery builder.

func (*TopicQuery) WithPlatform

func (tq *TopicQuery) WithPlatform(opts ...func(*PlatformQuery)) *TopicQuery

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

func (*TopicQuery) WithRepos

func (tq *TopicQuery) WithRepos(opts ...func(*RepoQuery)) *TopicQuery

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

type TopicSelect

type TopicSelect struct {
	*TopicQuery
	// contains filtered or unexported fields
}

TopicSelect is the builder for selecting fields of Topic entities.

func (*TopicSelect) Aggregate

func (ts *TopicSelect) Aggregate(fns ...AggregateFunc) *TopicSelect

Aggregate adds the given aggregation functions to the selector query.

func (*TopicSelect) Bool

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

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

func (*TopicSelect) BoolX

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

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

func (*TopicSelect) Bools

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

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

func (*TopicSelect) BoolsX

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

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

func (TopicSelect) ExecContext

func (c TopicSelect) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*TopicSelect) Float64

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

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

func (*TopicSelect) Float64X

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

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

func (*TopicSelect) Float64s

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

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

func (*TopicSelect) Float64sX

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

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

func (*TopicSelect) Int

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

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

func (*TopicSelect) IntX

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

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

func (*TopicSelect) Ints

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

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

func (*TopicSelect) IntsX

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

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

func (*TopicSelect) Modify

func (ts *TopicSelect) Modify(modifiers ...func(s *sql.Selector)) *TopicSelect

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

func (TopicSelect) QueryContext

func (c TopicSelect) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*TopicSelect) Scan

func (ts *TopicSelect) Scan(ctx context.Context, v any) error

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

func (*TopicSelect) ScanX

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

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

func (*TopicSelect) String

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

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

func (*TopicSelect) StringX

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

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

func (*TopicSelect) Strings

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

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

func (*TopicSelect) StringsX

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

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

type TopicUpdate

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

TopicUpdate is the builder for updating Topic entities.

func (*TopicUpdate) AddRepoIDs

func (tu *TopicUpdate) AddRepoIDs(ids ...int) *TopicUpdate

AddRepoIDs adds the "repos" edge to the Repo entity by IDs.

func (*TopicUpdate) AddRepos

func (tu *TopicUpdate) AddRepos(r ...*Repo) *TopicUpdate

AddRepos adds the "repos" edges to the Repo entity.

func (*TopicUpdate) ClearPlatform

func (tu *TopicUpdate) ClearPlatform() *TopicUpdate

ClearPlatform clears the "platform" edge to the Platform entity.

func (*TopicUpdate) ClearRepos

func (tu *TopicUpdate) ClearRepos() *TopicUpdate

ClearRepos clears all "repos" edges to the Repo entity.

func (*TopicUpdate) Exec

func (tu *TopicUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*TopicUpdate) ExecContext

func (c *TopicUpdate) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*TopicUpdate) ExecX

func (tu *TopicUpdate) ExecX(ctx context.Context)

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

func (*TopicUpdate) Modify

func (tu *TopicUpdate) Modify(modifiers ...func(u *sql.UpdateBuilder)) *TopicUpdate

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

func (*TopicUpdate) Mutation

func (tu *TopicUpdate) Mutation() *TopicMutation

Mutation returns the TopicMutation object of the builder.

func (*TopicUpdate) QueryContext

func (c *TopicUpdate) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*TopicUpdate) RemoveRepoIDs

func (tu *TopicUpdate) RemoveRepoIDs(ids ...int) *TopicUpdate

RemoveRepoIDs removes the "repos" edge to Repo entities by IDs.

func (*TopicUpdate) RemoveRepos

func (tu *TopicUpdate) RemoveRepos(r ...*Repo) *TopicUpdate

RemoveRepos removes "repos" edges to Repo entities.

func (*TopicUpdate) Save

func (tu *TopicUpdate) Save(ctx context.Context) (int, error)

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

func (*TopicUpdate) SaveX

func (tu *TopicUpdate) SaveX(ctx context.Context) int

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

func (*TopicUpdate) SetDescription

func (tu *TopicUpdate) SetDescription(s string) *TopicUpdate

SetDescription sets the "description" field.

func (*TopicUpdate) SetGithubURL

func (tu *TopicUpdate) SetGithubURL(s string) *TopicUpdate

SetGithubURL sets the "github_url" field.

func (*TopicUpdate) SetName

func (tu *TopicUpdate) SetName(s string) *TopicUpdate

SetName sets the "name" field.

func (*TopicUpdate) SetPlatform

func (tu *TopicUpdate) SetPlatform(p *Platform) *TopicUpdate

SetPlatform sets the "platform" edge to the Platform entity.

func (*TopicUpdate) SetPlatformID

func (tu *TopicUpdate) SetPlatformID(i int) *TopicUpdate

SetPlatformID sets the "platform_id" field.

func (*TopicUpdate) SetSubName

func (tu *TopicUpdate) SetSubName(s string) *TopicUpdate

SetSubName sets the "sub_name" field.

func (*TopicUpdate) SetURL

func (tu *TopicUpdate) SetURL(s string) *TopicUpdate

SetURL sets the "url" field.

func (*TopicUpdate) Where

func (tu *TopicUpdate) Where(ps ...predicate.Topic) *TopicUpdate

Where appends a list predicates to the TopicUpdate builder.

type TopicUpdateOne

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

TopicUpdateOne is the builder for updating a single Topic entity.

func (*TopicUpdateOne) AddRepoIDs

func (tuo *TopicUpdateOne) AddRepoIDs(ids ...int) *TopicUpdateOne

AddRepoIDs adds the "repos" edge to the Repo entity by IDs.

func (*TopicUpdateOne) AddRepos

func (tuo *TopicUpdateOne) AddRepos(r ...*Repo) *TopicUpdateOne

AddRepos adds the "repos" edges to the Repo entity.

func (*TopicUpdateOne) ClearPlatform

func (tuo *TopicUpdateOne) ClearPlatform() *TopicUpdateOne

ClearPlatform clears the "platform" edge to the Platform entity.

func (*TopicUpdateOne) ClearRepos

func (tuo *TopicUpdateOne) ClearRepos() *TopicUpdateOne

ClearRepos clears all "repos" edges to the Repo entity.

func (*TopicUpdateOne) Exec

func (tuo *TopicUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*TopicUpdateOne) ExecContext

func (c *TopicUpdateOne) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*TopicUpdateOne) ExecX

func (tuo *TopicUpdateOne) ExecX(ctx context.Context)

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

func (*TopicUpdateOne) Modify

func (tuo *TopicUpdateOne) Modify(modifiers ...func(u *sql.UpdateBuilder)) *TopicUpdateOne

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

func (*TopicUpdateOne) Mutation

func (tuo *TopicUpdateOne) Mutation() *TopicMutation

Mutation returns the TopicMutation object of the builder.

func (*TopicUpdateOne) QueryContext

func (c *TopicUpdateOne) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*TopicUpdateOne) RemoveRepoIDs

func (tuo *TopicUpdateOne) RemoveRepoIDs(ids ...int) *TopicUpdateOne

RemoveRepoIDs removes the "repos" edge to Repo entities by IDs.

func (*TopicUpdateOne) RemoveRepos

func (tuo *TopicUpdateOne) RemoveRepos(r ...*Repo) *TopicUpdateOne

RemoveRepos removes "repos" edges to Repo entities.

func (*TopicUpdateOne) Save

func (tuo *TopicUpdateOne) Save(ctx context.Context) (*Topic, error)

Save executes the query and returns the updated Topic entity.

func (*TopicUpdateOne) SaveX

func (tuo *TopicUpdateOne) SaveX(ctx context.Context) *Topic

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

func (*TopicUpdateOne) Select

func (tuo *TopicUpdateOne) Select(field string, fields ...string) *TopicUpdateOne

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

func (*TopicUpdateOne) SetDescription

func (tuo *TopicUpdateOne) SetDescription(s string) *TopicUpdateOne

SetDescription sets the "description" field.

func (*TopicUpdateOne) SetGithubURL

func (tuo *TopicUpdateOne) SetGithubURL(s string) *TopicUpdateOne

SetGithubURL sets the "github_url" field.

func (*TopicUpdateOne) SetName

func (tuo *TopicUpdateOne) SetName(s string) *TopicUpdateOne

SetName sets the "name" field.

func (*TopicUpdateOne) SetPlatform

func (tuo *TopicUpdateOne) SetPlatform(p *Platform) *TopicUpdateOne

SetPlatform sets the "platform" edge to the Platform entity.

func (*TopicUpdateOne) SetPlatformID

func (tuo *TopicUpdateOne) SetPlatformID(i int) *TopicUpdateOne

SetPlatformID sets the "platform_id" field.

func (*TopicUpdateOne) SetSubName

func (tuo *TopicUpdateOne) SetSubName(s string) *TopicUpdateOne

SetSubName sets the "sub_name" field.

func (*TopicUpdateOne) SetURL

func (tuo *TopicUpdateOne) SetURL(s string) *TopicUpdateOne

SetURL sets the "url" field.

func (*TopicUpdateOne) Where

func (tuo *TopicUpdateOne) Where(ps ...predicate.Topic) *TopicUpdateOne

Where appends a list predicates to the TopicUpdate builder.

type TopicUpsert

type TopicUpsert struct {
	*sql.UpdateSet
}

TopicUpsert is the "OnConflict" setter.

func (*TopicUpsert) SetDescription

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

SetDescription sets the "description" field.

func (*TopicUpsert) SetGithubURL

func (u *TopicUpsert) SetGithubURL(v string) *TopicUpsert

SetGithubURL sets the "github_url" field.

func (*TopicUpsert) SetName

func (u *TopicUpsert) SetName(v string) *TopicUpsert

SetName sets the "name" field.

func (*TopicUpsert) SetPlatformID

func (u *TopicUpsert) SetPlatformID(v int) *TopicUpsert

SetPlatformID sets the "platform_id" field.

func (*TopicUpsert) SetSubName

func (u *TopicUpsert) SetSubName(v string) *TopicUpsert

SetSubName sets the "sub_name" field.

func (*TopicUpsert) SetURL

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

SetURL sets the "url" field.

func (*TopicUpsert) UpdateDescription

func (u *TopicUpsert) UpdateDescription() *TopicUpsert

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

func (*TopicUpsert) UpdateGithubURL

func (u *TopicUpsert) UpdateGithubURL() *TopicUpsert

UpdateGithubURL sets the "github_url" field to the value that was provided on create.

func (*TopicUpsert) UpdateName

func (u *TopicUpsert) UpdateName() *TopicUpsert

UpdateName sets the "name" field to the value that was provided on create.

func (*TopicUpsert) UpdatePlatformID

func (u *TopicUpsert) UpdatePlatformID() *TopicUpsert

UpdatePlatformID sets the "platform_id" field to the value that was provided on create.

func (*TopicUpsert) UpdateSubName

func (u *TopicUpsert) UpdateSubName() *TopicUpsert

UpdateSubName sets the "sub_name" field to the value that was provided on create.

func (*TopicUpsert) UpdateURL

func (u *TopicUpsert) UpdateURL() *TopicUpsert

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

type TopicUpsertBulk

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

TopicUpsertBulk is the builder for "upsert"-ing a bulk of Topic nodes.

func (*TopicUpsertBulk) DoNothing

func (u *TopicUpsertBulk) DoNothing() *TopicUpsertBulk

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

func (*TopicUpsertBulk) Exec

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

Exec executes the query.

func (*TopicUpsertBulk) ExecX

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

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

func (*TopicUpsertBulk) Ignore

func (u *TopicUpsertBulk) Ignore() *TopicUpsertBulk

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

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

func (*TopicUpsertBulk) SetDescription

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

SetDescription sets the "description" field.

func (*TopicUpsertBulk) SetGithubURL

func (u *TopicUpsertBulk) SetGithubURL(v string) *TopicUpsertBulk

SetGithubURL sets the "github_url" field.

func (*TopicUpsertBulk) SetName

func (u *TopicUpsertBulk) SetName(v string) *TopicUpsertBulk

SetName sets the "name" field.

func (*TopicUpsertBulk) SetPlatformID

func (u *TopicUpsertBulk) SetPlatformID(v int) *TopicUpsertBulk

SetPlatformID sets the "platform_id" field.

func (*TopicUpsertBulk) SetSubName

func (u *TopicUpsertBulk) SetSubName(v string) *TopicUpsertBulk

SetSubName sets the "sub_name" field.

func (*TopicUpsertBulk) SetURL

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

SetURL sets the "url" field.

func (*TopicUpsertBulk) Update

func (u *TopicUpsertBulk) Update(set func(*TopicUpsert)) *TopicUpsertBulk

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

func (*TopicUpsertBulk) UpdateDescription

func (u *TopicUpsertBulk) UpdateDescription() *TopicUpsertBulk

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

func (*TopicUpsertBulk) UpdateGithubURL

func (u *TopicUpsertBulk) UpdateGithubURL() *TopicUpsertBulk

UpdateGithubURL sets the "github_url" field to the value that was provided on create.

func (*TopicUpsertBulk) UpdateName

func (u *TopicUpsertBulk) UpdateName() *TopicUpsertBulk

UpdateName sets the "name" field to the value that was provided on create.

func (*TopicUpsertBulk) UpdateNewValues

func (u *TopicUpsertBulk) UpdateNewValues() *TopicUpsertBulk

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

client.Topic.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
	).
	Exec(ctx)

func (*TopicUpsertBulk) UpdatePlatformID

func (u *TopicUpsertBulk) UpdatePlatformID() *TopicUpsertBulk

UpdatePlatformID sets the "platform_id" field to the value that was provided on create.

func (*TopicUpsertBulk) UpdateSubName

func (u *TopicUpsertBulk) UpdateSubName() *TopicUpsertBulk

UpdateSubName sets the "sub_name" field to the value that was provided on create.

func (*TopicUpsertBulk) UpdateURL

func (u *TopicUpsertBulk) UpdateURL() *TopicUpsertBulk

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

type TopicUpsertOne

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

TopicUpsertOne is the builder for "upsert"-ing

one Topic node.

func (*TopicUpsertOne) DoNothing

func (u *TopicUpsertOne) DoNothing() *TopicUpsertOne

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

func (*TopicUpsertOne) Exec

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

Exec executes the query.

func (*TopicUpsertOne) ExecX

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

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

func (*TopicUpsertOne) ID

func (u *TopicUpsertOne) ID(ctx context.Context) (id int, err error)

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

func (*TopicUpsertOne) IDX

func (u *TopicUpsertOne) IDX(ctx context.Context) int

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

func (*TopicUpsertOne) Ignore

func (u *TopicUpsertOne) Ignore() *TopicUpsertOne

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

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

func (*TopicUpsertOne) SetDescription

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

SetDescription sets the "description" field.

func (*TopicUpsertOne) SetGithubURL

func (u *TopicUpsertOne) SetGithubURL(v string) *TopicUpsertOne

SetGithubURL sets the "github_url" field.

func (*TopicUpsertOne) SetName

func (u *TopicUpsertOne) SetName(v string) *TopicUpsertOne

SetName sets the "name" field.

func (*TopicUpsertOne) SetPlatformID

func (u *TopicUpsertOne) SetPlatformID(v int) *TopicUpsertOne

SetPlatformID sets the "platform_id" field.

func (*TopicUpsertOne) SetSubName

func (u *TopicUpsertOne) SetSubName(v string) *TopicUpsertOne

SetSubName sets the "sub_name" field.

func (*TopicUpsertOne) SetURL

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

SetURL sets the "url" field.

func (*TopicUpsertOne) Update

func (u *TopicUpsertOne) Update(set func(*TopicUpsert)) *TopicUpsertOne

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

func (*TopicUpsertOne) UpdateDescription

func (u *TopicUpsertOne) UpdateDescription() *TopicUpsertOne

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

func (*TopicUpsertOne) UpdateGithubURL

func (u *TopicUpsertOne) UpdateGithubURL() *TopicUpsertOne

UpdateGithubURL sets the "github_url" field to the value that was provided on create.

func (*TopicUpsertOne) UpdateName

func (u *TopicUpsertOne) UpdateName() *TopicUpsertOne

UpdateName sets the "name" field to the value that was provided on create.

func (*TopicUpsertOne) UpdateNewValues

func (u *TopicUpsertOne) UpdateNewValues() *TopicUpsertOne

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

client.Topic.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
	).
	Exec(ctx)

func (*TopicUpsertOne) UpdatePlatformID

func (u *TopicUpsertOne) UpdatePlatformID() *TopicUpsertOne

UpdatePlatformID sets the "platform_id" field to the value that was provided on create.

func (*TopicUpsertOne) UpdateSubName

func (u *TopicUpsertOne) UpdateSubName() *TopicUpsertOne

UpdateSubName sets the "sub_name" field to the value that was provided on create.

func (*TopicUpsertOne) UpdateURL

func (u *TopicUpsertOne) UpdateURL() *TopicUpsertOne

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

type Topics

type Topics []*Topic

Topics is a parsable slice of Topic.

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 {

	// Platform is the client for interacting with the Platform builders.
	Platform *PlatformClient
	// Repo is the client for interacting with the Repo builders.
	Repo *RepoClient
	// Topic is the client for interacting with the Topic builders.
	Topic *TopicClient
	// 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) ExecContext

func (c *Tx) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

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

func (c *Tx) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

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