ent

package
v0.12.2 Latest Latest
Warning

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

Go to latest
Published: May 30, 2024 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.
	TypeGitCommit    = "GitCommit"
	TypeOrganization = "Organization"
	TypeRepository   = "Repository"
)

Variables

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

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

Functions

func Asc

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

Asc applies the given fields in ASC order.

func Desc

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

Desc applies the given fields in DESC order.

func IsConstraintError

func IsConstraintError(err error) bool

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

func IsNotFound

func IsNotFound(err error) bool

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

func IsNotLoaded

func IsNotLoaded(err error) bool

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

func IsNotSingular

func IsNotSingular(err error) bool

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

func IsValidationError

func IsValidationError(err error) bool

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

func MaskNotFound

func MaskNotFound(err error) error

MaskNotFound masks not found error.

func NewContext

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

NewContext returns a new context with the given Client attached.

func NewTxContext

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

NewTxContext returns a new context with the given Tx attached.

Types

type AggregateFunc

type AggregateFunc func(*sql.Selector) string

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

func As

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

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

func Count

func Count() AggregateFunc

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

func Max

func Max(field string) AggregateFunc

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

func Mean

func Mean(field string) AggregateFunc

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

func Min

func Min(field string) AggregateFunc

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

func Sum

func Sum(field string) AggregateFunc

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

type Client

type Client struct {

	// Schema is the client for creating, migrating and dropping schema.
	Schema *migrate.Schema
	// GitCommit is the client for interacting with the GitCommit builders.
	GitCommit *GitCommitClient
	// Organization is the client for interacting with the Organization builders.
	Organization *OrganizationClient
	// Repository is the client for interacting with the Repository builders.
	Repository *RepositoryClient
	// 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().
	GitCommit.
	Query().
	Count(ctx)

func (*Client) Intercept

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

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

func (*Client) Mutate

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

Mutate implements the ent.Mutator interface.

func (*Client) Tx

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

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

func (*Client) Use

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

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

type CommitFunc

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

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

func (CommitFunc) Commit

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

Commit calls f(ctx, m).

type CommitHook

type CommitHook func(Committer) Committer

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

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

type Committer

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

Committer is the interface that wraps the Commit method.

type ConstraintError

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

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

func (ConstraintError) Error

func (e ConstraintError) Error() string

Error implements the error interface.

func (*ConstraintError) Unwrap

func (e *ConstraintError) Unwrap() error

Unwrap implements the errors.Wrapper interface.

type GitCommit

type GitCommit struct {

	// ID of the ent.
	// GitCommit SHA.
	ID string `json:"id,omitempty"`
	// GitCommit message.
	Message string `json:"message,omitempty"`
	// GitCommit author.
	AuthorLogin string `json:"author_login,omitempty"`
	// GitCommit author ID.
	AuthorID int64 `json:"author_id,omitempty"`
	// GitCommit date.
	Date time.Time `json:"date,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the GitCommitQuery when eager-loading is set.
	Edges GitCommitEdges `json:"edges"`
	// contains filtered or unexported fields
}

GitCommit is the model entity for the GitCommit schema.

func (*GitCommit) QueryRepository

func (gc *GitCommit) QueryRepository() *RepositoryQuery

QueryRepository queries the "repository" edge of the GitCommit entity.

func (*GitCommit) String

func (gc *GitCommit) String() string

String implements the fmt.Stringer.

func (*GitCommit) Unwrap

func (gc *GitCommit) Unwrap() *GitCommit

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

func (gc *GitCommit) Update() *GitCommitUpdateOne

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

func (*GitCommit) Value

func (gc *GitCommit) Value(name string) (ent.Value, error)

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

type GitCommitClient

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

GitCommitClient is a client for the GitCommit schema.

func NewGitCommitClient

func NewGitCommitClient(c config) *GitCommitClient

NewGitCommitClient returns a client for the GitCommit from the given config.

func (*GitCommitClient) Create

func (c *GitCommitClient) Create() *GitCommitCreate

Create returns a builder for creating a GitCommit entity.

func (*GitCommitClient) CreateBulk

func (c *GitCommitClient) CreateBulk(builders ...*GitCommitCreate) *GitCommitCreateBulk

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

func (*GitCommitClient) Delete

func (c *GitCommitClient) Delete() *GitCommitDelete

Delete returns a delete builder for GitCommit.

func (*GitCommitClient) DeleteOne

func (c *GitCommitClient) DeleteOne(gc *GitCommit) *GitCommitDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*GitCommitClient) DeleteOneID

func (c *GitCommitClient) DeleteOneID(id string) *GitCommitDeleteOne

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

func (*GitCommitClient) Get

func (c *GitCommitClient) Get(ctx context.Context, id string) (*GitCommit, error)

Get returns a GitCommit entity by its id.

func (*GitCommitClient) GetX

func (c *GitCommitClient) GetX(ctx context.Context, id string) *GitCommit

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

func (*GitCommitClient) Hooks

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

Hooks returns the client hooks.

func (*GitCommitClient) Intercept

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

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

func (*GitCommitClient) Interceptors

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

Interceptors returns the client interceptors.

func (*GitCommitClient) MapCreateBulk

func (c *GitCommitClient) MapCreateBulk(slice any, setFunc func(*GitCommitCreate, int)) *GitCommitCreateBulk

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

func (*GitCommitClient) Query

func (c *GitCommitClient) Query() *GitCommitQuery

Query returns a query builder for GitCommit.

func (*GitCommitClient) QueryRepository

func (c *GitCommitClient) QueryRepository(gc *GitCommit) *RepositoryQuery

QueryRepository queries the repository edge of a GitCommit.

func (*GitCommitClient) Update

func (c *GitCommitClient) Update() *GitCommitUpdate

Update returns an update builder for GitCommit.

func (*GitCommitClient) UpdateOne

func (c *GitCommitClient) UpdateOne(gc *GitCommit) *GitCommitUpdateOne

UpdateOne returns an update builder for the given entity.

func (*GitCommitClient) UpdateOneID

func (c *GitCommitClient) UpdateOneID(id string) *GitCommitUpdateOne

UpdateOneID returns an update builder for the given id.

func (*GitCommitClient) Use

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

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

type GitCommitCreate

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

GitCommitCreate is the builder for creating a GitCommit entity.

func (*GitCommitCreate) Exec

func (gcc *GitCommitCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*GitCommitCreate) ExecX

func (gcc *GitCommitCreate) ExecX(ctx context.Context)

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

func (*GitCommitCreate) Mutation

func (gcc *GitCommitCreate) Mutation() *GitCommitMutation

Mutation returns the GitCommitMutation object of the builder.

func (*GitCommitCreate) OnConflict

func (gcc *GitCommitCreate) OnConflict(opts ...sql.ConflictOption) *GitCommitUpsertOne

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

client.GitCommit.Create().
	SetMessage(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.GitCommitUpsert) {
		SetMessage(v+v).
	}).
	Exec(ctx)

func (*GitCommitCreate) OnConflictColumns

func (gcc *GitCommitCreate) OnConflictColumns(columns ...string) *GitCommitUpsertOne

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

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

func (*GitCommitCreate) Save

func (gcc *GitCommitCreate) Save(ctx context.Context) (*GitCommit, error)

Save creates the GitCommit in the database.

func (*GitCommitCreate) SaveX

func (gcc *GitCommitCreate) SaveX(ctx context.Context) *GitCommit

SaveX calls Save and panics if Save returns an error.

func (*GitCommitCreate) SetAuthorID

func (gcc *GitCommitCreate) SetAuthorID(i int64) *GitCommitCreate

SetAuthorID sets the "author_id" field.

func (*GitCommitCreate) SetAuthorLogin

func (gcc *GitCommitCreate) SetAuthorLogin(s string) *GitCommitCreate

SetAuthorLogin sets the "author_login" field.

func (*GitCommitCreate) SetDate

func (gcc *GitCommitCreate) SetDate(t time.Time) *GitCommitCreate

SetDate sets the "date" field.

func (*GitCommitCreate) SetID

func (gcc *GitCommitCreate) SetID(s string) *GitCommitCreate

SetID sets the "id" field.

func (*GitCommitCreate) SetMessage

func (gcc *GitCommitCreate) SetMessage(s string) *GitCommitCreate

SetMessage sets the "message" field.

func (*GitCommitCreate) SetNillableRepositoryID

func (gcc *GitCommitCreate) SetNillableRepositoryID(id *int64) *GitCommitCreate

SetNillableRepositoryID sets the "repository" edge to the Repository entity by ID if the given value is not nil.

func (*GitCommitCreate) SetRepository

func (gcc *GitCommitCreate) SetRepository(r *Repository) *GitCommitCreate

SetRepository sets the "repository" edge to the Repository entity.

func (*GitCommitCreate) SetRepositoryID

func (gcc *GitCommitCreate) SetRepositoryID(id int64) *GitCommitCreate

SetRepositoryID sets the "repository" edge to the Repository entity by ID.

type GitCommitCreateBulk

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

GitCommitCreateBulk is the builder for creating many GitCommit entities in bulk.

func (*GitCommitCreateBulk) Exec

func (gccb *GitCommitCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*GitCommitCreateBulk) ExecX

func (gccb *GitCommitCreateBulk) ExecX(ctx context.Context)

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

func (*GitCommitCreateBulk) OnConflict

func (gccb *GitCommitCreateBulk) OnConflict(opts ...sql.ConflictOption) *GitCommitUpsertBulk

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

client.GitCommit.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.GitCommitUpsert) {
		SetMessage(v+v).
	}).
	Exec(ctx)

func (*GitCommitCreateBulk) OnConflictColumns

func (gccb *GitCommitCreateBulk) OnConflictColumns(columns ...string) *GitCommitUpsertBulk

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

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

func (*GitCommitCreateBulk) Save

func (gccb *GitCommitCreateBulk) Save(ctx context.Context) ([]*GitCommit, error)

Save creates the GitCommit entities in the database.

func (*GitCommitCreateBulk) SaveX

func (gccb *GitCommitCreateBulk) SaveX(ctx context.Context) []*GitCommit

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

type GitCommitDelete

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

GitCommitDelete is the builder for deleting a GitCommit entity.

func (*GitCommitDelete) Exec

func (gcd *GitCommitDelete) Exec(ctx context.Context) (int, error)

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

func (*GitCommitDelete) ExecX

func (gcd *GitCommitDelete) ExecX(ctx context.Context) int

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

func (*GitCommitDelete) Where

Where appends a list predicates to the GitCommitDelete builder.

type GitCommitDeleteOne

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

GitCommitDeleteOne is the builder for deleting a single GitCommit entity.

func (*GitCommitDeleteOne) Exec

func (gcdo *GitCommitDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*GitCommitDeleteOne) ExecX

func (gcdo *GitCommitDeleteOne) ExecX(ctx context.Context)

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

func (*GitCommitDeleteOne) Where

Where appends a list predicates to the GitCommitDelete builder.

type GitCommitEdges

type GitCommitEdges struct {
	// GitHub Repository.
	Repository *Repository `json:"repository,omitempty"`
	// contains filtered or unexported fields
}

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

func (GitCommitEdges) RepositoryOrErr

func (e GitCommitEdges) RepositoryOrErr() (*Repository, error)

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

type GitCommitGroupBy

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

GitCommitGroupBy is the group-by builder for GitCommit entities.

func (*GitCommitGroupBy) Aggregate

func (gcgb *GitCommitGroupBy) Aggregate(fns ...AggregateFunc) *GitCommitGroupBy

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

func (*GitCommitGroupBy) Bool

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

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

func (*GitCommitGroupBy) BoolX

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

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

func (*GitCommitGroupBy) Bools

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

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

func (*GitCommitGroupBy) BoolsX

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

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

func (*GitCommitGroupBy) Float64

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

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

func (*GitCommitGroupBy) Float64X

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

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

func (*GitCommitGroupBy) Float64s

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

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

func (*GitCommitGroupBy) Float64sX

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

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

func (*GitCommitGroupBy) Int

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

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

func (*GitCommitGroupBy) IntX

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

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

func (*GitCommitGroupBy) Ints

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

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

func (*GitCommitGroupBy) IntsX

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

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

func (*GitCommitGroupBy) Scan

func (gcgb *GitCommitGroupBy) Scan(ctx context.Context, v any) error

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

func (*GitCommitGroupBy) ScanX

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

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

func (*GitCommitGroupBy) String

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

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

func (*GitCommitGroupBy) StringX

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

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

func (*GitCommitGroupBy) Strings

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

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

func (*GitCommitGroupBy) StringsX

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

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

type GitCommitMutation

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

GitCommitMutation represents an operation that mutates the GitCommit nodes in the graph.

func (*GitCommitMutation) AddAuthorID

func (m *GitCommitMutation) AddAuthorID(i int64)

AddAuthorID adds i to the "author_id" field.

func (*GitCommitMutation) AddField

func (m *GitCommitMutation) 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 (*GitCommitMutation) AddedAuthorID

func (m *GitCommitMutation) AddedAuthorID() (r int64, exists bool)

AddedAuthorID returns the value that was added to the "author_id" field in this mutation.

func (*GitCommitMutation) AddedEdges

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

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

func (*GitCommitMutation) AddedField

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

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

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

func (*GitCommitMutation) AddedIDs

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

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

func (*GitCommitMutation) AuthorID

func (m *GitCommitMutation) AuthorID() (r int64, exists bool)

AuthorID returns the value of the "author_id" field in the mutation.

func (*GitCommitMutation) AuthorLogin

func (m *GitCommitMutation) AuthorLogin() (r string, exists bool)

AuthorLogin returns the value of the "author_login" field in the mutation.

func (*GitCommitMutation) ClearEdge

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

func (m *GitCommitMutation) 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 (*GitCommitMutation) ClearRepository

func (m *GitCommitMutation) ClearRepository()

ClearRepository clears the "repository" edge to the Repository entity.

func (*GitCommitMutation) ClearedEdges

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

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

func (*GitCommitMutation) ClearedFields

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

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

func (GitCommitMutation) Client

func (m GitCommitMutation) 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 (*GitCommitMutation) Date

func (m *GitCommitMutation) Date() (r time.Time, exists bool)

Date returns the value of the "date" field in the mutation.

func (*GitCommitMutation) EdgeCleared

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

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

func (*GitCommitMutation) Field

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

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

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

func (*GitCommitMutation) Fields

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

func (m *GitCommitMutation) ID() (id string, exists bool)

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

func (*GitCommitMutation) IDs

func (m *GitCommitMutation) IDs(ctx context.Context) ([]string, error)

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

func (*GitCommitMutation) Message

func (m *GitCommitMutation) Message() (r string, exists bool)

Message returns the value of the "message" field in the mutation.

func (*GitCommitMutation) OldAuthorID

func (m *GitCommitMutation) OldAuthorID(ctx context.Context) (v int64, err error)

OldAuthorID returns the old "author_id" field's value of the GitCommit entity. If the GitCommit 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 (*GitCommitMutation) OldAuthorLogin

func (m *GitCommitMutation) OldAuthorLogin(ctx context.Context) (v string, err error)

OldAuthorLogin returns the old "author_login" field's value of the GitCommit entity. If the GitCommit 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 (*GitCommitMutation) OldDate

func (m *GitCommitMutation) OldDate(ctx context.Context) (v time.Time, err error)

OldDate returns the old "date" field's value of the GitCommit entity. If the GitCommit 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 (*GitCommitMutation) OldField

func (m *GitCommitMutation) 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 (*GitCommitMutation) OldMessage

func (m *GitCommitMutation) OldMessage(ctx context.Context) (v string, err error)

OldMessage returns the old "message" field's value of the GitCommit entity. If the GitCommit 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 (*GitCommitMutation) Op

func (m *GitCommitMutation) Op() Op

Op returns the operation name.

func (*GitCommitMutation) RemovedEdges

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

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

func (*GitCommitMutation) RemovedIDs

func (m *GitCommitMutation) 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 (*GitCommitMutation) RepositoryCleared

func (m *GitCommitMutation) RepositoryCleared() bool

RepositoryCleared reports if the "repository" edge to the Repository entity was cleared.

func (*GitCommitMutation) RepositoryID

func (m *GitCommitMutation) RepositoryID() (id int64, exists bool)

RepositoryID returns the "repository" edge ID in the mutation.

func (*GitCommitMutation) RepositoryIDs

func (m *GitCommitMutation) RepositoryIDs() (ids []int64)

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

func (*GitCommitMutation) ResetAuthorID

func (m *GitCommitMutation) ResetAuthorID()

ResetAuthorID resets all changes to the "author_id" field.

func (*GitCommitMutation) ResetAuthorLogin

func (m *GitCommitMutation) ResetAuthorLogin()

ResetAuthorLogin resets all changes to the "author_login" field.

func (*GitCommitMutation) ResetDate

func (m *GitCommitMutation) ResetDate()

ResetDate resets all changes to the "date" field.

func (*GitCommitMutation) ResetEdge

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

func (m *GitCommitMutation) 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 (*GitCommitMutation) ResetMessage

func (m *GitCommitMutation) ResetMessage()

ResetMessage resets all changes to the "message" field.

func (*GitCommitMutation) ResetRepository

func (m *GitCommitMutation) ResetRepository()

ResetRepository resets all changes to the "repository" edge.

func (*GitCommitMutation) SetAuthorID

func (m *GitCommitMutation) SetAuthorID(i int64)

SetAuthorID sets the "author_id" field.

func (*GitCommitMutation) SetAuthorLogin

func (m *GitCommitMutation) SetAuthorLogin(s string)

SetAuthorLogin sets the "author_login" field.

func (*GitCommitMutation) SetDate

func (m *GitCommitMutation) SetDate(t time.Time)

SetDate sets the "date" field.

func (*GitCommitMutation) SetField

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

func (m *GitCommitMutation) SetID(id string)

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

func (*GitCommitMutation) SetMessage

func (m *GitCommitMutation) SetMessage(s string)

SetMessage sets the "message" field.

func (*GitCommitMutation) SetOp

func (m *GitCommitMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*GitCommitMutation) SetRepositoryID

func (m *GitCommitMutation) SetRepositoryID(id int64)

SetRepositoryID sets the "repository" edge to the Repository entity by id.

func (GitCommitMutation) Tx

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

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

func (*GitCommitMutation) Type

func (m *GitCommitMutation) Type() string

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

func (*GitCommitMutation) Where

func (m *GitCommitMutation) Where(ps ...predicate.GitCommit)

Where appends a list predicates to the GitCommitMutation builder.

func (*GitCommitMutation) WhereP

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

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

type GitCommitQuery

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

GitCommitQuery is the builder for querying GitCommit entities.

func (*GitCommitQuery) Aggregate

func (gcq *GitCommitQuery) Aggregate(fns ...AggregateFunc) *GitCommitSelect

Aggregate returns a GitCommitSelect configured with the given aggregations.

func (*GitCommitQuery) All

func (gcq *GitCommitQuery) All(ctx context.Context) ([]*GitCommit, error)

All executes the query and returns a list of GitCommits.

func (*GitCommitQuery) AllX

func (gcq *GitCommitQuery) AllX(ctx context.Context) []*GitCommit

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

func (*GitCommitQuery) Clone

func (gcq *GitCommitQuery) Clone() *GitCommitQuery

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

func (*GitCommitQuery) Count

func (gcq *GitCommitQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*GitCommitQuery) CountX

func (gcq *GitCommitQuery) CountX(ctx context.Context) int

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

func (*GitCommitQuery) Exist

func (gcq *GitCommitQuery) Exist(ctx context.Context) (bool, error)

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

func (*GitCommitQuery) ExistX

func (gcq *GitCommitQuery) ExistX(ctx context.Context) bool

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

func (*GitCommitQuery) First

func (gcq *GitCommitQuery) First(ctx context.Context) (*GitCommit, error)

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

func (*GitCommitQuery) FirstID

func (gcq *GitCommitQuery) FirstID(ctx context.Context) (id string, err error)

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

func (*GitCommitQuery) FirstIDX

func (gcq *GitCommitQuery) FirstIDX(ctx context.Context) string

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

func (*GitCommitQuery) FirstX

func (gcq *GitCommitQuery) FirstX(ctx context.Context) *GitCommit

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

func (*GitCommitQuery) GroupBy

func (gcq *GitCommitQuery) GroupBy(field string, fields ...string) *GitCommitGroupBy

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

client.GitCommit.Query().
	GroupBy(gitcommit.FieldMessage).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*GitCommitQuery) IDs

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

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

func (*GitCommitQuery) IDsX

func (gcq *GitCommitQuery) IDsX(ctx context.Context) []string

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

func (*GitCommitQuery) Limit

func (gcq *GitCommitQuery) Limit(limit int) *GitCommitQuery

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

func (*GitCommitQuery) Offset

func (gcq *GitCommitQuery) Offset(offset int) *GitCommitQuery

Offset to start from.

func (*GitCommitQuery) Only

func (gcq *GitCommitQuery) Only(ctx context.Context) (*GitCommit, error)

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

func (*GitCommitQuery) OnlyID

func (gcq *GitCommitQuery) OnlyID(ctx context.Context) (id string, err error)

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

func (*GitCommitQuery) OnlyIDX

func (gcq *GitCommitQuery) OnlyIDX(ctx context.Context) string

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

func (*GitCommitQuery) OnlyX

func (gcq *GitCommitQuery) OnlyX(ctx context.Context) *GitCommit

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

func (*GitCommitQuery) Order

Order specifies how the records should be ordered.

func (*GitCommitQuery) QueryRepository

func (gcq *GitCommitQuery) QueryRepository() *RepositoryQuery

QueryRepository chains the current query on the "repository" edge.

func (*GitCommitQuery) Select

func (gcq *GitCommitQuery) Select(fields ...string) *GitCommitSelect

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

client.GitCommit.Query().
	Select(gitcommit.FieldMessage).
	Scan(ctx, &v)

func (*GitCommitQuery) Unique

func (gcq *GitCommitQuery) Unique(unique bool) *GitCommitQuery

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

func (gcq *GitCommitQuery) Where(ps ...predicate.GitCommit) *GitCommitQuery

Where adds a new predicate for the GitCommitQuery builder.

func (*GitCommitQuery) WithRepository

func (gcq *GitCommitQuery) WithRepository(opts ...func(*RepositoryQuery)) *GitCommitQuery

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

type GitCommitSelect

type GitCommitSelect struct {
	*GitCommitQuery
	// contains filtered or unexported fields
}

GitCommitSelect is the builder for selecting fields of GitCommit entities.

func (*GitCommitSelect) Aggregate

func (gcs *GitCommitSelect) Aggregate(fns ...AggregateFunc) *GitCommitSelect

Aggregate adds the given aggregation functions to the selector query.

func (*GitCommitSelect) Bool

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

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

func (*GitCommitSelect) BoolX

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

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

func (*GitCommitSelect) Bools

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

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

func (*GitCommitSelect) BoolsX

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

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

func (*GitCommitSelect) Float64

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

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

func (*GitCommitSelect) Float64X

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

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

func (*GitCommitSelect) Float64s

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

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

func (*GitCommitSelect) Float64sX

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

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

func (*GitCommitSelect) Int

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

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

func (*GitCommitSelect) IntX

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

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

func (*GitCommitSelect) Ints

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

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

func (*GitCommitSelect) IntsX

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

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

func (*GitCommitSelect) Scan

func (gcs *GitCommitSelect) Scan(ctx context.Context, v any) error

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

func (*GitCommitSelect) ScanX

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

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

func (*GitCommitSelect) String

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

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

func (*GitCommitSelect) StringX

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

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

func (*GitCommitSelect) Strings

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

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

func (*GitCommitSelect) StringsX

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

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

type GitCommitUpdate

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

GitCommitUpdate is the builder for updating GitCommit entities.

func (*GitCommitUpdate) AddAuthorID

func (gcu *GitCommitUpdate) AddAuthorID(i int64) *GitCommitUpdate

AddAuthorID adds i to the "author_id" field.

func (*GitCommitUpdate) ClearRepository

func (gcu *GitCommitUpdate) ClearRepository() *GitCommitUpdate

ClearRepository clears the "repository" edge to the Repository entity.

func (*GitCommitUpdate) Exec

func (gcu *GitCommitUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*GitCommitUpdate) ExecX

func (gcu *GitCommitUpdate) ExecX(ctx context.Context)

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

func (*GitCommitUpdate) Mutation

func (gcu *GitCommitUpdate) Mutation() *GitCommitMutation

Mutation returns the GitCommitMutation object of the builder.

func (*GitCommitUpdate) Save

func (gcu *GitCommitUpdate) Save(ctx context.Context) (int, error)

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

func (*GitCommitUpdate) SaveX

func (gcu *GitCommitUpdate) SaveX(ctx context.Context) int

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

func (*GitCommitUpdate) SetAuthorID

func (gcu *GitCommitUpdate) SetAuthorID(i int64) *GitCommitUpdate

SetAuthorID sets the "author_id" field.

func (*GitCommitUpdate) SetAuthorLogin

func (gcu *GitCommitUpdate) SetAuthorLogin(s string) *GitCommitUpdate

SetAuthorLogin sets the "author_login" field.

func (*GitCommitUpdate) SetDate

func (gcu *GitCommitUpdate) SetDate(t time.Time) *GitCommitUpdate

SetDate sets the "date" field.

func (*GitCommitUpdate) SetMessage

func (gcu *GitCommitUpdate) SetMessage(s string) *GitCommitUpdate

SetMessage sets the "message" field.

func (*GitCommitUpdate) SetNillableAuthorID

func (gcu *GitCommitUpdate) SetNillableAuthorID(i *int64) *GitCommitUpdate

SetNillableAuthorID sets the "author_id" field if the given value is not nil.

func (*GitCommitUpdate) SetNillableAuthorLogin

func (gcu *GitCommitUpdate) SetNillableAuthorLogin(s *string) *GitCommitUpdate

SetNillableAuthorLogin sets the "author_login" field if the given value is not nil.

func (*GitCommitUpdate) SetNillableDate

func (gcu *GitCommitUpdate) SetNillableDate(t *time.Time) *GitCommitUpdate

SetNillableDate sets the "date" field if the given value is not nil.

func (*GitCommitUpdate) SetNillableMessage

func (gcu *GitCommitUpdate) SetNillableMessage(s *string) *GitCommitUpdate

SetNillableMessage sets the "message" field if the given value is not nil.

func (*GitCommitUpdate) SetNillableRepositoryID

func (gcu *GitCommitUpdate) SetNillableRepositoryID(id *int64) *GitCommitUpdate

SetNillableRepositoryID sets the "repository" edge to the Repository entity by ID if the given value is not nil.

func (*GitCommitUpdate) SetRepository

func (gcu *GitCommitUpdate) SetRepository(r *Repository) *GitCommitUpdate

SetRepository sets the "repository" edge to the Repository entity.

func (*GitCommitUpdate) SetRepositoryID

func (gcu *GitCommitUpdate) SetRepositoryID(id int64) *GitCommitUpdate

SetRepositoryID sets the "repository" edge to the Repository entity by ID.

func (*GitCommitUpdate) Where

Where appends a list predicates to the GitCommitUpdate builder.

type GitCommitUpdateOne

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

GitCommitUpdateOne is the builder for updating a single GitCommit entity.

func (*GitCommitUpdateOne) AddAuthorID

func (gcuo *GitCommitUpdateOne) AddAuthorID(i int64) *GitCommitUpdateOne

AddAuthorID adds i to the "author_id" field.

func (*GitCommitUpdateOne) ClearRepository

func (gcuo *GitCommitUpdateOne) ClearRepository() *GitCommitUpdateOne

ClearRepository clears the "repository" edge to the Repository entity.

func (*GitCommitUpdateOne) Exec

func (gcuo *GitCommitUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*GitCommitUpdateOne) ExecX

func (gcuo *GitCommitUpdateOne) ExecX(ctx context.Context)

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

func (*GitCommitUpdateOne) Mutation

func (gcuo *GitCommitUpdateOne) Mutation() *GitCommitMutation

Mutation returns the GitCommitMutation object of the builder.

func (*GitCommitUpdateOne) Save

func (gcuo *GitCommitUpdateOne) Save(ctx context.Context) (*GitCommit, error)

Save executes the query and returns the updated GitCommit entity.

func (*GitCommitUpdateOne) SaveX

func (gcuo *GitCommitUpdateOne) SaveX(ctx context.Context) *GitCommit

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

func (*GitCommitUpdateOne) Select

func (gcuo *GitCommitUpdateOne) Select(field string, fields ...string) *GitCommitUpdateOne

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

func (*GitCommitUpdateOne) SetAuthorID

func (gcuo *GitCommitUpdateOne) SetAuthorID(i int64) *GitCommitUpdateOne

SetAuthorID sets the "author_id" field.

func (*GitCommitUpdateOne) SetAuthorLogin

func (gcuo *GitCommitUpdateOne) SetAuthorLogin(s string) *GitCommitUpdateOne

SetAuthorLogin sets the "author_login" field.

func (*GitCommitUpdateOne) SetDate

func (gcuo *GitCommitUpdateOne) SetDate(t time.Time) *GitCommitUpdateOne

SetDate sets the "date" field.

func (*GitCommitUpdateOne) SetMessage

func (gcuo *GitCommitUpdateOne) SetMessage(s string) *GitCommitUpdateOne

SetMessage sets the "message" field.

func (*GitCommitUpdateOne) SetNillableAuthorID

func (gcuo *GitCommitUpdateOne) SetNillableAuthorID(i *int64) *GitCommitUpdateOne

SetNillableAuthorID sets the "author_id" field if the given value is not nil.

func (*GitCommitUpdateOne) SetNillableAuthorLogin

func (gcuo *GitCommitUpdateOne) SetNillableAuthorLogin(s *string) *GitCommitUpdateOne

SetNillableAuthorLogin sets the "author_login" field if the given value is not nil.

func (*GitCommitUpdateOne) SetNillableDate

func (gcuo *GitCommitUpdateOne) SetNillableDate(t *time.Time) *GitCommitUpdateOne

SetNillableDate sets the "date" field if the given value is not nil.

func (*GitCommitUpdateOne) SetNillableMessage

func (gcuo *GitCommitUpdateOne) SetNillableMessage(s *string) *GitCommitUpdateOne

SetNillableMessage sets the "message" field if the given value is not nil.

func (*GitCommitUpdateOne) SetNillableRepositoryID

func (gcuo *GitCommitUpdateOne) SetNillableRepositoryID(id *int64) *GitCommitUpdateOne

SetNillableRepositoryID sets the "repository" edge to the Repository entity by ID if the given value is not nil.

func (*GitCommitUpdateOne) SetRepository

func (gcuo *GitCommitUpdateOne) SetRepository(r *Repository) *GitCommitUpdateOne

SetRepository sets the "repository" edge to the Repository entity.

func (*GitCommitUpdateOne) SetRepositoryID

func (gcuo *GitCommitUpdateOne) SetRepositoryID(id int64) *GitCommitUpdateOne

SetRepositoryID sets the "repository" edge to the Repository entity by ID.

func (*GitCommitUpdateOne) Where

Where appends a list predicates to the GitCommitUpdate builder.

type GitCommitUpsert

type GitCommitUpsert struct {
	*sql.UpdateSet
}

GitCommitUpsert is the "OnConflict" setter.

func (*GitCommitUpsert) AddAuthorID

func (u *GitCommitUpsert) AddAuthorID(v int64) *GitCommitUpsert

AddAuthorID adds v to the "author_id" field.

func (*GitCommitUpsert) SetAuthorID

func (u *GitCommitUpsert) SetAuthorID(v int64) *GitCommitUpsert

SetAuthorID sets the "author_id" field.

func (*GitCommitUpsert) SetAuthorLogin

func (u *GitCommitUpsert) SetAuthorLogin(v string) *GitCommitUpsert

SetAuthorLogin sets the "author_login" field.

func (*GitCommitUpsert) SetDate

func (u *GitCommitUpsert) SetDate(v time.Time) *GitCommitUpsert

SetDate sets the "date" field.

func (*GitCommitUpsert) SetMessage

func (u *GitCommitUpsert) SetMessage(v string) *GitCommitUpsert

SetMessage sets the "message" field.

func (*GitCommitUpsert) UpdateAuthorID

func (u *GitCommitUpsert) UpdateAuthorID() *GitCommitUpsert

UpdateAuthorID sets the "author_id" field to the value that was provided on create.

func (*GitCommitUpsert) UpdateAuthorLogin

func (u *GitCommitUpsert) UpdateAuthorLogin() *GitCommitUpsert

UpdateAuthorLogin sets the "author_login" field to the value that was provided on create.

func (*GitCommitUpsert) UpdateDate

func (u *GitCommitUpsert) UpdateDate() *GitCommitUpsert

UpdateDate sets the "date" field to the value that was provided on create.

func (*GitCommitUpsert) UpdateMessage

func (u *GitCommitUpsert) UpdateMessage() *GitCommitUpsert

UpdateMessage sets the "message" field to the value that was provided on create.

type GitCommitUpsertBulk

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

GitCommitUpsertBulk is the builder for "upsert"-ing a bulk of GitCommit nodes.

func (*GitCommitUpsertBulk) AddAuthorID

func (u *GitCommitUpsertBulk) AddAuthorID(v int64) *GitCommitUpsertBulk

AddAuthorID adds v to the "author_id" field.

func (*GitCommitUpsertBulk) DoNothing

func (u *GitCommitUpsertBulk) DoNothing() *GitCommitUpsertBulk

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

func (*GitCommitUpsertBulk) Exec

Exec executes the query.

func (*GitCommitUpsertBulk) ExecX

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

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

func (*GitCommitUpsertBulk) Ignore

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

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

func (*GitCommitUpsertBulk) SetAuthorID

func (u *GitCommitUpsertBulk) SetAuthorID(v int64) *GitCommitUpsertBulk

SetAuthorID sets the "author_id" field.

func (*GitCommitUpsertBulk) SetAuthorLogin

func (u *GitCommitUpsertBulk) SetAuthorLogin(v string) *GitCommitUpsertBulk

SetAuthorLogin sets the "author_login" field.

func (*GitCommitUpsertBulk) SetDate

SetDate sets the "date" field.

func (*GitCommitUpsertBulk) SetMessage

SetMessage sets the "message" field.

func (*GitCommitUpsertBulk) Update

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

func (*GitCommitUpsertBulk) UpdateAuthorID

func (u *GitCommitUpsertBulk) UpdateAuthorID() *GitCommitUpsertBulk

UpdateAuthorID sets the "author_id" field to the value that was provided on create.

func (*GitCommitUpsertBulk) UpdateAuthorLogin

func (u *GitCommitUpsertBulk) UpdateAuthorLogin() *GitCommitUpsertBulk

UpdateAuthorLogin sets the "author_login" field to the value that was provided on create.

func (*GitCommitUpsertBulk) UpdateDate

func (u *GitCommitUpsertBulk) UpdateDate() *GitCommitUpsertBulk

UpdateDate sets the "date" field to the value that was provided on create.

func (*GitCommitUpsertBulk) UpdateMessage

func (u *GitCommitUpsertBulk) UpdateMessage() *GitCommitUpsertBulk

UpdateMessage sets the "message" field to the value that was provided on create.

func (*GitCommitUpsertBulk) UpdateNewValues

func (u *GitCommitUpsertBulk) UpdateNewValues() *GitCommitUpsertBulk

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

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

type GitCommitUpsertOne

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

GitCommitUpsertOne is the builder for "upsert"-ing

one GitCommit node.

func (*GitCommitUpsertOne) AddAuthorID

func (u *GitCommitUpsertOne) AddAuthorID(v int64) *GitCommitUpsertOne

AddAuthorID adds v to the "author_id" field.

func (*GitCommitUpsertOne) DoNothing

func (u *GitCommitUpsertOne) DoNothing() *GitCommitUpsertOne

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

func (*GitCommitUpsertOne) Exec

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

Exec executes the query.

func (*GitCommitUpsertOne) ExecX

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

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

func (*GitCommitUpsertOne) ID

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

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

func (*GitCommitUpsertOne) IDX

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

func (*GitCommitUpsertOne) Ignore

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

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

func (*GitCommitUpsertOne) SetAuthorID

func (u *GitCommitUpsertOne) SetAuthorID(v int64) *GitCommitUpsertOne

SetAuthorID sets the "author_id" field.

func (*GitCommitUpsertOne) SetAuthorLogin

func (u *GitCommitUpsertOne) SetAuthorLogin(v string) *GitCommitUpsertOne

SetAuthorLogin sets the "author_login" field.

func (*GitCommitUpsertOne) SetDate

SetDate sets the "date" field.

func (*GitCommitUpsertOne) SetMessage

func (u *GitCommitUpsertOne) SetMessage(v string) *GitCommitUpsertOne

SetMessage sets the "message" field.

func (*GitCommitUpsertOne) Update

func (u *GitCommitUpsertOne) Update(set func(*GitCommitUpsert)) *GitCommitUpsertOne

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

func (*GitCommitUpsertOne) UpdateAuthorID

func (u *GitCommitUpsertOne) UpdateAuthorID() *GitCommitUpsertOne

UpdateAuthorID sets the "author_id" field to the value that was provided on create.

func (*GitCommitUpsertOne) UpdateAuthorLogin

func (u *GitCommitUpsertOne) UpdateAuthorLogin() *GitCommitUpsertOne

UpdateAuthorLogin sets the "author_login" field to the value that was provided on create.

func (*GitCommitUpsertOne) UpdateDate

func (u *GitCommitUpsertOne) UpdateDate() *GitCommitUpsertOne

UpdateDate sets the "date" field to the value that was provided on create.

func (*GitCommitUpsertOne) UpdateMessage

func (u *GitCommitUpsertOne) UpdateMessage() *GitCommitUpsertOne

UpdateMessage sets the "message" field to the value that was provided on create.

func (*GitCommitUpsertOne) UpdateNewValues

func (u *GitCommitUpsertOne) UpdateNewValues() *GitCommitUpsertOne

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

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

type GitCommits

type GitCommits []*GitCommit

GitCommits is a parsable slice of GitCommit.

type Hook

type Hook = ent.Hook

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

type InterceptFunc

type InterceptFunc = ent.InterceptFunc

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

type Interceptor

type Interceptor = ent.Interceptor

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

type MutateFunc

type MutateFunc = ent.MutateFunc

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

type Mutation

type Mutation = ent.Mutation

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

type Mutator

type Mutator = ent.Mutator

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

type NotFoundError

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

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

func (*NotFoundError) Error

func (e *NotFoundError) Error() string

Error implements the error interface.

type NotLoadedError

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

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

func (*NotLoadedError) Error

func (e *NotLoadedError) Error() string

Error implements the error interface.

type NotSingularError

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

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

func (*NotSingularError) Error

func (e *NotSingularError) Error() string

Error implements the error interface.

type Op

type Op = ent.Op

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

type Option

type Option func(*config)

Option function to configure the client.

func Debug

func Debug() Option

Debug enables debug logging on the ent.Driver.

func Driver

func Driver(driver dialect.Driver) Option

Driver configures the client driver.

func Log

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

Log sets the logging function for debug mode.

type OrderFunc

type OrderFunc func(*sql.Selector)

OrderFunc applies an ordering on the sql selector. Deprecated: Use Asc/Desc functions or the package builders instead.

type Organization

type Organization struct {

	// ID of the ent.
	// GitHub organization ID.
	ID int64 `json:"id,omitempty"`
	// GitHub organization name.
	Name string `json:"name,omitempty"`
	// GitHub organization URL.
	HTMLURL string `json:"html_url,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the OrganizationQuery when eager-loading is set.
	Edges OrganizationEdges `json:"edges"`
	// contains filtered or unexported fields
}

Organization is the model entity for the Organization schema.

func (*Organization) NamedRepositories

func (o *Organization) NamedRepositories(name string) ([]*Repository, error)

NamedRepositories returns the Repositories named value or an error if the edge was not loaded in eager-loading with this name.

func (*Organization) QueryRepositories

func (o *Organization) QueryRepositories() *RepositoryQuery

QueryRepositories queries the "repositories" edge of the Organization entity.

func (*Organization) String

func (o *Organization) String() string

String implements the fmt.Stringer.

func (*Organization) Unwrap

func (o *Organization) Unwrap() *Organization

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

func (o *Organization) Update() *OrganizationUpdateOne

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

func (*Organization) Value

func (o *Organization) Value(name string) (ent.Value, error)

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

type OrganizationClient

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

OrganizationClient is a client for the Organization schema.

func NewOrganizationClient

func NewOrganizationClient(c config) *OrganizationClient

NewOrganizationClient returns a client for the Organization from the given config.

func (*OrganizationClient) Create

Create returns a builder for creating a Organization entity.

func (*OrganizationClient) CreateBulk

func (c *OrganizationClient) CreateBulk(builders ...*OrganizationCreate) *OrganizationCreateBulk

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

func (*OrganizationClient) Delete

Delete returns a delete builder for Organization.

func (*OrganizationClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*OrganizationClient) DeleteOneID

func (c *OrganizationClient) DeleteOneID(id int64) *OrganizationDeleteOne

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

func (*OrganizationClient) Get

Get returns a Organization entity by its id.

func (*OrganizationClient) GetX

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

func (*OrganizationClient) Hooks

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

Hooks returns the client hooks.

func (*OrganizationClient) Intercept

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

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

func (*OrganizationClient) Interceptors

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

Interceptors returns the client interceptors.

func (*OrganizationClient) MapCreateBulk

func (c *OrganizationClient) MapCreateBulk(slice any, setFunc func(*OrganizationCreate, int)) *OrganizationCreateBulk

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

func (*OrganizationClient) Query

Query returns a query builder for Organization.

func (*OrganizationClient) QueryRepositories

func (c *OrganizationClient) QueryRepositories(o *Organization) *RepositoryQuery

QueryRepositories queries the repositories edge of a Organization.

func (*OrganizationClient) Update

Update returns an update builder for Organization.

func (*OrganizationClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*OrganizationClient) UpdateOneID

func (c *OrganizationClient) UpdateOneID(id int64) *OrganizationUpdateOne

UpdateOneID returns an update builder for the given id.

func (*OrganizationClient) Use

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

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

type OrganizationCreate

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

OrganizationCreate is the builder for creating a Organization entity.

func (*OrganizationCreate) AddRepositories

func (oc *OrganizationCreate) AddRepositories(r ...*Repository) *OrganizationCreate

AddRepositories adds the "repositories" edges to the Repository entity.

func (*OrganizationCreate) AddRepositoryIDs

func (oc *OrganizationCreate) AddRepositoryIDs(ids ...int64) *OrganizationCreate

AddRepositoryIDs adds the "repositories" edge to the Repository entity by IDs.

func (*OrganizationCreate) Exec

func (oc *OrganizationCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*OrganizationCreate) ExecX

func (oc *OrganizationCreate) ExecX(ctx context.Context)

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

func (*OrganizationCreate) Mutation

func (oc *OrganizationCreate) Mutation() *OrganizationMutation

Mutation returns the OrganizationMutation object of the builder.

func (*OrganizationCreate) OnConflict

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

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

func (*OrganizationCreate) OnConflictColumns

func (oc *OrganizationCreate) OnConflictColumns(columns ...string) *OrganizationUpsertOne

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

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

func (*OrganizationCreate) Save

Save creates the Organization in the database.

func (*OrganizationCreate) SaveX

SaveX calls Save and panics if Save returns an error.

func (*OrganizationCreate) SetHTMLURL

func (oc *OrganizationCreate) SetHTMLURL(s string) *OrganizationCreate

SetHTMLURL sets the "html_url" field.

func (*OrganizationCreate) SetID

SetID sets the "id" field.

func (*OrganizationCreate) SetName

SetName sets the "name" field.

func (*OrganizationCreate) SetNillableHTMLURL

func (oc *OrganizationCreate) SetNillableHTMLURL(s *string) *OrganizationCreate

SetNillableHTMLURL sets the "html_url" field if the given value is not nil.

type OrganizationCreateBulk

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

OrganizationCreateBulk is the builder for creating many Organization entities in bulk.

func (*OrganizationCreateBulk) Exec

Exec executes the query.

func (*OrganizationCreateBulk) ExecX

func (ocb *OrganizationCreateBulk) ExecX(ctx context.Context)

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

func (*OrganizationCreateBulk) OnConflict

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

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

func (*OrganizationCreateBulk) OnConflictColumns

func (ocb *OrganizationCreateBulk) OnConflictColumns(columns ...string) *OrganizationUpsertBulk

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

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

func (*OrganizationCreateBulk) Save

Save creates the Organization entities in the database.

func (*OrganizationCreateBulk) SaveX

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

type OrganizationDelete

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

OrganizationDelete is the builder for deleting a Organization entity.

func (*OrganizationDelete) Exec

func (od *OrganizationDelete) Exec(ctx context.Context) (int, error)

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

func (*OrganizationDelete) ExecX

func (od *OrganizationDelete) ExecX(ctx context.Context) int

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

func (*OrganizationDelete) Where

Where appends a list predicates to the OrganizationDelete builder.

type OrganizationDeleteOne

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

OrganizationDeleteOne is the builder for deleting a single Organization entity.

func (*OrganizationDeleteOne) Exec

func (odo *OrganizationDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*OrganizationDeleteOne) ExecX

func (odo *OrganizationDeleteOne) ExecX(ctx context.Context)

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

func (*OrganizationDeleteOne) Where

Where appends a list predicates to the OrganizationDelete builder.

type OrganizationEdges

type OrganizationEdges struct {
	// GitHub repositories.
	Repositories []*Repository `json:"repositories,omitempty"`
	// contains filtered or unexported fields
}

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

func (OrganizationEdges) RepositoriesOrErr

func (e OrganizationEdges) RepositoriesOrErr() ([]*Repository, error)

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

type OrganizationGroupBy

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

OrganizationGroupBy is the group-by builder for Organization entities.

func (*OrganizationGroupBy) Aggregate

func (ogb *OrganizationGroupBy) Aggregate(fns ...AggregateFunc) *OrganizationGroupBy

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

func (*OrganizationGroupBy) Bool

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

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

func (*OrganizationGroupBy) BoolX

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

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

func (*OrganizationGroupBy) Bools

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

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

func (*OrganizationGroupBy) BoolsX

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

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

func (*OrganizationGroupBy) Float64

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

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

func (*OrganizationGroupBy) Float64X

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

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

func (*OrganizationGroupBy) Float64s

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

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

func (*OrganizationGroupBy) Float64sX

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

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

func (*OrganizationGroupBy) Int

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

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

func (*OrganizationGroupBy) IntX

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

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

func (*OrganizationGroupBy) Ints

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

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

func (*OrganizationGroupBy) IntsX

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

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

func (*OrganizationGroupBy) Scan

func (ogb *OrganizationGroupBy) Scan(ctx context.Context, v any) error

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

func (*OrganizationGroupBy) ScanX

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

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

func (*OrganizationGroupBy) String

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

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

func (*OrganizationGroupBy) StringX

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

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

func (*OrganizationGroupBy) Strings

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

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

func (*OrganizationGroupBy) StringsX

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

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

type OrganizationMutation

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

OrganizationMutation represents an operation that mutates the Organization nodes in the graph.

func (*OrganizationMutation) AddField

func (m *OrganizationMutation) 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 (*OrganizationMutation) AddRepositoryIDs

func (m *OrganizationMutation) AddRepositoryIDs(ids ...int64)

AddRepositoryIDs adds the "repositories" edge to the Repository entity by ids.

func (*OrganizationMutation) AddedEdges

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

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

func (*OrganizationMutation) AddedField

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

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

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

func (*OrganizationMutation) AddedIDs

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

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

func (*OrganizationMutation) ClearEdge

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

func (m *OrganizationMutation) 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 (*OrganizationMutation) ClearHTMLURL

func (m *OrganizationMutation) ClearHTMLURL()

ClearHTMLURL clears the value of the "html_url" field.

func (*OrganizationMutation) ClearRepositories

func (m *OrganizationMutation) ClearRepositories()

ClearRepositories clears the "repositories" edge to the Repository entity.

func (*OrganizationMutation) ClearedEdges

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

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

func (*OrganizationMutation) ClearedFields

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

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

func (OrganizationMutation) Client

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

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

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

func (*OrganizationMutation) Field

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

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

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

func (*OrganizationMutation) Fields

func (m *OrganizationMutation) 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 (*OrganizationMutation) HTMLURL

func (m *OrganizationMutation) HTMLURL() (r string, exists bool)

HTMLURL returns the value of the "html_url" field in the mutation.

func (*OrganizationMutation) HTMLURLCleared

func (m *OrganizationMutation) HTMLURLCleared() bool

HTMLURLCleared returns if the "html_url" field was cleared in this mutation.

func (*OrganizationMutation) ID

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

func (m *OrganizationMutation) IDs(ctx context.Context) ([]int64, 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 (*OrganizationMutation) Name

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

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

func (*OrganizationMutation) OldField

func (m *OrganizationMutation) 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 (*OrganizationMutation) OldHTMLURL

func (m *OrganizationMutation) OldHTMLURL(ctx context.Context) (v string, err error)

OldHTMLURL returns the old "html_url" field's value of the Organization entity. If the Organization 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 (*OrganizationMutation) OldName

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

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

func (m *OrganizationMutation) Op() Op

Op returns the operation name.

func (*OrganizationMutation) RemoveRepositoryIDs

func (m *OrganizationMutation) RemoveRepositoryIDs(ids ...int64)

RemoveRepositoryIDs removes the "repositories" edge to the Repository entity by IDs.

func (*OrganizationMutation) RemovedEdges

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

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

func (*OrganizationMutation) RemovedIDs

func (m *OrganizationMutation) 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 (*OrganizationMutation) RemovedRepositoriesIDs

func (m *OrganizationMutation) RemovedRepositoriesIDs() (ids []int64)

RemovedRepositories returns the removed IDs of the "repositories" edge to the Repository entity.

func (*OrganizationMutation) RepositoriesCleared

func (m *OrganizationMutation) RepositoriesCleared() bool

RepositoriesCleared reports if the "repositories" edge to the Repository entity was cleared.

func (*OrganizationMutation) RepositoriesIDs

func (m *OrganizationMutation) RepositoriesIDs() (ids []int64)

RepositoriesIDs returns the "repositories" edge IDs in the mutation.

func (*OrganizationMutation) ResetEdge

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

func (m *OrganizationMutation) 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 (*OrganizationMutation) ResetHTMLURL

func (m *OrganizationMutation) ResetHTMLURL()

ResetHTMLURL resets all changes to the "html_url" field.

func (*OrganizationMutation) ResetName

func (m *OrganizationMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*OrganizationMutation) ResetRepositories

func (m *OrganizationMutation) ResetRepositories()

ResetRepositories resets all changes to the "repositories" edge.

func (*OrganizationMutation) SetField

func (m *OrganizationMutation) 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 (*OrganizationMutation) SetHTMLURL

func (m *OrganizationMutation) SetHTMLURL(s string)

SetHTMLURL sets the "html_url" field.

func (*OrganizationMutation) SetID

func (m *OrganizationMutation) SetID(id int64)

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

func (*OrganizationMutation) SetName

func (m *OrganizationMutation) SetName(s string)

SetName sets the "name" field.

func (*OrganizationMutation) SetOp

func (m *OrganizationMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (OrganizationMutation) Tx

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

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

func (*OrganizationMutation) Type

func (m *OrganizationMutation) Type() string

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

func (*OrganizationMutation) Where

Where appends a list predicates to the OrganizationMutation builder.

func (*OrganizationMutation) WhereP

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

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

type OrganizationQuery

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

OrganizationQuery is the builder for querying Organization entities.

func (*OrganizationQuery) Aggregate

func (oq *OrganizationQuery) Aggregate(fns ...AggregateFunc) *OrganizationSelect

Aggregate returns a OrganizationSelect configured with the given aggregations.

func (*OrganizationQuery) All

func (oq *OrganizationQuery) All(ctx context.Context) ([]*Organization, error)

All executes the query and returns a list of Organizations.

func (*OrganizationQuery) AllX

func (oq *OrganizationQuery) AllX(ctx context.Context) []*Organization

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

func (*OrganizationQuery) Clone

func (oq *OrganizationQuery) Clone() *OrganizationQuery

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

func (*OrganizationQuery) Count

func (oq *OrganizationQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*OrganizationQuery) CountX

func (oq *OrganizationQuery) CountX(ctx context.Context) int

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

func (*OrganizationQuery) Exist

func (oq *OrganizationQuery) Exist(ctx context.Context) (bool, error)

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

func (*OrganizationQuery) ExistX

func (oq *OrganizationQuery) ExistX(ctx context.Context) bool

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

func (*OrganizationQuery) First

func (oq *OrganizationQuery) First(ctx context.Context) (*Organization, error)

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

func (*OrganizationQuery) FirstID

func (oq *OrganizationQuery) FirstID(ctx context.Context) (id int64, err error)

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

func (*OrganizationQuery) FirstIDX

func (oq *OrganizationQuery) FirstIDX(ctx context.Context) int64

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

func (*OrganizationQuery) FirstX

func (oq *OrganizationQuery) FirstX(ctx context.Context) *Organization

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

func (*OrganizationQuery) GroupBy

func (oq *OrganizationQuery) GroupBy(field string, fields ...string) *OrganizationGroupBy

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

func (*OrganizationQuery) IDs

func (oq *OrganizationQuery) IDs(ctx context.Context) (ids []int64, err error)

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

func (*OrganizationQuery) IDsX

func (oq *OrganizationQuery) IDsX(ctx context.Context) []int64

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

func (*OrganizationQuery) Limit

func (oq *OrganizationQuery) Limit(limit int) *OrganizationQuery

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

func (*OrganizationQuery) Offset

func (oq *OrganizationQuery) Offset(offset int) *OrganizationQuery

Offset to start from.

func (*OrganizationQuery) Only

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

func (*OrganizationQuery) OnlyID

func (oq *OrganizationQuery) OnlyID(ctx context.Context) (id int64, err error)

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

func (*OrganizationQuery) OnlyIDX

func (oq *OrganizationQuery) OnlyIDX(ctx context.Context) int64

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

func (*OrganizationQuery) OnlyX

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

func (*OrganizationQuery) Order

Order specifies how the records should be ordered.

func (*OrganizationQuery) QueryRepositories

func (oq *OrganizationQuery) QueryRepositories() *RepositoryQuery

QueryRepositories chains the current query on the "repositories" edge.

func (*OrganizationQuery) Select

func (oq *OrganizationQuery) Select(fields ...string) *OrganizationSelect

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

func (*OrganizationQuery) Unique

func (oq *OrganizationQuery) Unique(unique bool) *OrganizationQuery

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

Where adds a new predicate for the OrganizationQuery builder.

func (*OrganizationQuery) WithNamedRepositories

func (oq *OrganizationQuery) WithNamedRepositories(name string, opts ...func(*RepositoryQuery)) *OrganizationQuery

WithNamedRepositories tells the query-builder to eager-load the nodes that are connected to the "repositories" edge with the given name. The optional arguments are used to configure the query builder of the edge.

func (*OrganizationQuery) WithRepositories

func (oq *OrganizationQuery) WithRepositories(opts ...func(*RepositoryQuery)) *OrganizationQuery

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

type OrganizationSelect

type OrganizationSelect struct {
	*OrganizationQuery
	// contains filtered or unexported fields
}

OrganizationSelect is the builder for selecting fields of Organization entities.

func (*OrganizationSelect) Aggregate

func (os *OrganizationSelect) Aggregate(fns ...AggregateFunc) *OrganizationSelect

Aggregate adds the given aggregation functions to the selector query.

func (*OrganizationSelect) Bool

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

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

func (*OrganizationSelect) BoolX

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

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

func (*OrganizationSelect) Bools

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

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

func (*OrganizationSelect) BoolsX

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

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

func (*OrganizationSelect) Float64

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

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

func (*OrganizationSelect) Float64X

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

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

func (*OrganizationSelect) Float64s

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

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

func (*OrganizationSelect) Float64sX

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

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

func (*OrganizationSelect) Int

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

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

func (*OrganizationSelect) IntX

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

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

func (*OrganizationSelect) Ints

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

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

func (*OrganizationSelect) IntsX

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

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

func (*OrganizationSelect) Scan

func (os *OrganizationSelect) Scan(ctx context.Context, v any) error

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

func (*OrganizationSelect) ScanX

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

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

func (*OrganizationSelect) String

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

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

func (*OrganizationSelect) StringX

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

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

func (*OrganizationSelect) Strings

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

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

func (*OrganizationSelect) StringsX

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

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

type OrganizationUpdate

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

OrganizationUpdate is the builder for updating Organization entities.

func (*OrganizationUpdate) AddRepositories

func (ou *OrganizationUpdate) AddRepositories(r ...*Repository) *OrganizationUpdate

AddRepositories adds the "repositories" edges to the Repository entity.

func (*OrganizationUpdate) AddRepositoryIDs

func (ou *OrganizationUpdate) AddRepositoryIDs(ids ...int64) *OrganizationUpdate

AddRepositoryIDs adds the "repositories" edge to the Repository entity by IDs.

func (*OrganizationUpdate) ClearHTMLURL

func (ou *OrganizationUpdate) ClearHTMLURL() *OrganizationUpdate

ClearHTMLURL clears the value of the "html_url" field.

func (*OrganizationUpdate) ClearRepositories

func (ou *OrganizationUpdate) ClearRepositories() *OrganizationUpdate

ClearRepositories clears all "repositories" edges to the Repository entity.

func (*OrganizationUpdate) Exec

func (ou *OrganizationUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*OrganizationUpdate) ExecX

func (ou *OrganizationUpdate) ExecX(ctx context.Context)

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

func (*OrganizationUpdate) Mutation

func (ou *OrganizationUpdate) Mutation() *OrganizationMutation

Mutation returns the OrganizationMutation object of the builder.

func (*OrganizationUpdate) RemoveRepositories

func (ou *OrganizationUpdate) RemoveRepositories(r ...*Repository) *OrganizationUpdate

RemoveRepositories removes "repositories" edges to Repository entities.

func (*OrganizationUpdate) RemoveRepositoryIDs

func (ou *OrganizationUpdate) RemoveRepositoryIDs(ids ...int64) *OrganizationUpdate

RemoveRepositoryIDs removes the "repositories" edge to Repository entities by IDs.

func (*OrganizationUpdate) Save

func (ou *OrganizationUpdate) Save(ctx context.Context) (int, error)

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

func (*OrganizationUpdate) SaveX

func (ou *OrganizationUpdate) SaveX(ctx context.Context) int

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

func (*OrganizationUpdate) SetHTMLURL

func (ou *OrganizationUpdate) SetHTMLURL(s string) *OrganizationUpdate

SetHTMLURL sets the "html_url" field.

func (*OrganizationUpdate) SetName

SetName sets the "name" field.

func (*OrganizationUpdate) SetNillableHTMLURL

func (ou *OrganizationUpdate) SetNillableHTMLURL(s *string) *OrganizationUpdate

SetNillableHTMLURL sets the "html_url" field if the given value is not nil.

func (*OrganizationUpdate) SetNillableName

func (ou *OrganizationUpdate) SetNillableName(s *string) *OrganizationUpdate

SetNillableName sets the "name" field if the given value is not nil.

func (*OrganizationUpdate) Where

Where appends a list predicates to the OrganizationUpdate builder.

type OrganizationUpdateOne

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

OrganizationUpdateOne is the builder for updating a single Organization entity.

func (*OrganizationUpdateOne) AddRepositories

func (ouo *OrganizationUpdateOne) AddRepositories(r ...*Repository) *OrganizationUpdateOne

AddRepositories adds the "repositories" edges to the Repository entity.

func (*OrganizationUpdateOne) AddRepositoryIDs

func (ouo *OrganizationUpdateOne) AddRepositoryIDs(ids ...int64) *OrganizationUpdateOne

AddRepositoryIDs adds the "repositories" edge to the Repository entity by IDs.

func (*OrganizationUpdateOne) ClearHTMLURL

func (ouo *OrganizationUpdateOne) ClearHTMLURL() *OrganizationUpdateOne

ClearHTMLURL clears the value of the "html_url" field.

func (*OrganizationUpdateOne) ClearRepositories

func (ouo *OrganizationUpdateOne) ClearRepositories() *OrganizationUpdateOne

ClearRepositories clears all "repositories" edges to the Repository entity.

func (*OrganizationUpdateOne) Exec

func (ouo *OrganizationUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*OrganizationUpdateOne) ExecX

func (ouo *OrganizationUpdateOne) ExecX(ctx context.Context)

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

func (*OrganizationUpdateOne) Mutation

Mutation returns the OrganizationMutation object of the builder.

func (*OrganizationUpdateOne) RemoveRepositories

func (ouo *OrganizationUpdateOne) RemoveRepositories(r ...*Repository) *OrganizationUpdateOne

RemoveRepositories removes "repositories" edges to Repository entities.

func (*OrganizationUpdateOne) RemoveRepositoryIDs

func (ouo *OrganizationUpdateOne) RemoveRepositoryIDs(ids ...int64) *OrganizationUpdateOne

RemoveRepositoryIDs removes the "repositories" edge to Repository entities by IDs.

func (*OrganizationUpdateOne) Save

Save executes the query and returns the updated Organization entity.

func (*OrganizationUpdateOne) SaveX

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

func (*OrganizationUpdateOne) Select

func (ouo *OrganizationUpdateOne) Select(field string, fields ...string) *OrganizationUpdateOne

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

func (*OrganizationUpdateOne) SetHTMLURL

SetHTMLURL sets the "html_url" field.

func (*OrganizationUpdateOne) SetName

SetName sets the "name" field.

func (*OrganizationUpdateOne) SetNillableHTMLURL

func (ouo *OrganizationUpdateOne) SetNillableHTMLURL(s *string) *OrganizationUpdateOne

SetNillableHTMLURL sets the "html_url" field if the given value is not nil.

func (*OrganizationUpdateOne) SetNillableName

func (ouo *OrganizationUpdateOne) SetNillableName(s *string) *OrganizationUpdateOne

SetNillableName sets the "name" field if the given value is not nil.

func (*OrganizationUpdateOne) Where

Where appends a list predicates to the OrganizationUpdate builder.

type OrganizationUpsert

type OrganizationUpsert struct {
	*sql.UpdateSet
}

OrganizationUpsert is the "OnConflict" setter.

func (*OrganizationUpsert) ClearHTMLURL

func (u *OrganizationUpsert) ClearHTMLURL() *OrganizationUpsert

ClearHTMLURL clears the value of the "html_url" field.

func (*OrganizationUpsert) SetHTMLURL

func (u *OrganizationUpsert) SetHTMLURL(v string) *OrganizationUpsert

SetHTMLURL sets the "html_url" field.

func (*OrganizationUpsert) SetName

SetName sets the "name" field.

func (*OrganizationUpsert) UpdateHTMLURL

func (u *OrganizationUpsert) UpdateHTMLURL() *OrganizationUpsert

UpdateHTMLURL sets the "html_url" field to the value that was provided on create.

func (*OrganizationUpsert) UpdateName

func (u *OrganizationUpsert) UpdateName() *OrganizationUpsert

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

type OrganizationUpsertBulk

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

OrganizationUpsertBulk is the builder for "upsert"-ing a bulk of Organization nodes.

func (*OrganizationUpsertBulk) ClearHTMLURL

ClearHTMLURL clears the value of the "html_url" field.

func (*OrganizationUpsertBulk) DoNothing

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

func (*OrganizationUpsertBulk) Exec

Exec executes the query.

func (*OrganizationUpsertBulk) ExecX

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

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

func (*OrganizationUpsertBulk) Ignore

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

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

func (*OrganizationUpsertBulk) SetHTMLURL

SetHTMLURL sets the "html_url" field.

func (*OrganizationUpsertBulk) SetName

SetName sets the "name" field.

func (*OrganizationUpsertBulk) Update

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

func (*OrganizationUpsertBulk) UpdateHTMLURL

func (u *OrganizationUpsertBulk) UpdateHTMLURL() *OrganizationUpsertBulk

UpdateHTMLURL sets the "html_url" field to the value that was provided on create.

func (*OrganizationUpsertBulk) UpdateName

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

func (*OrganizationUpsertBulk) UpdateNewValues

func (u *OrganizationUpsertBulk) UpdateNewValues() *OrganizationUpsertBulk

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

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

type OrganizationUpsertOne

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

OrganizationUpsertOne is the builder for "upsert"-ing

one Organization node.

func (*OrganizationUpsertOne) ClearHTMLURL

func (u *OrganizationUpsertOne) ClearHTMLURL() *OrganizationUpsertOne

ClearHTMLURL clears the value of the "html_url" field.

func (*OrganizationUpsertOne) DoNothing

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

func (*OrganizationUpsertOne) Exec

Exec executes the query.

func (*OrganizationUpsertOne) ExecX

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

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

func (*OrganizationUpsertOne) ID

func (u *OrganizationUpsertOne) ID(ctx context.Context) (id int64, err error)

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

func (*OrganizationUpsertOne) IDX

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

func (*OrganizationUpsertOne) Ignore

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

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

func (*OrganizationUpsertOne) SetHTMLURL

SetHTMLURL sets the "html_url" field.

func (*OrganizationUpsertOne) SetName

SetName sets the "name" field.

func (*OrganizationUpsertOne) Update

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

func (*OrganizationUpsertOne) UpdateHTMLURL

func (u *OrganizationUpsertOne) UpdateHTMLURL() *OrganizationUpsertOne

UpdateHTMLURL sets the "html_url" field to the value that was provided on create.

func (*OrganizationUpsertOne) UpdateName

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

func (*OrganizationUpsertOne) UpdateNewValues

func (u *OrganizationUpsertOne) UpdateNewValues() *OrganizationUpsertOne

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

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

type Organizations

type Organizations []*Organization

Organizations is a parsable slice of Organization.

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 Repositories

type Repositories []*Repository

Repositories is a parsable slice of Repository.

type Repository

type Repository struct {

	// ID of the ent.
	// GitHub repository ID.
	ID int64 `json:"id,omitempty"`
	// GitHub repository name.
	Name string `json:"name,omitempty"`
	// GitHub repository full name.
	FullName string `json:"full_name,omitempty"`
	// GitHub repository URL.
	HTMLURL string `json:"html_url,omitempty"`
	// GitHub repository description.
	Description string `json:"description,omitempty"`
	// LastPushedAt holds the value of the "last_pushed_at" field.
	LastPushedAt time.Time `json:"last_pushed_at,omitempty"`
	// LastEventAt holds the value of the "last_event_at" field.
	LastEventAt time.Time `json:"last_event_at,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the RepositoryQuery when eager-loading is set.
	Edges RepositoryEdges `json:"edges"`
	// contains filtered or unexported fields
}

Repository is the model entity for the Repository schema.

func (*Repository) NamedCommits

func (r *Repository) NamedCommits(name string) ([]*GitCommit, error)

NamedCommits returns the Commits named value or an error if the edge was not loaded in eager-loading with this name.

func (*Repository) QueryCommits

func (r *Repository) QueryCommits() *GitCommitQuery

QueryCommits queries the "commits" edge of the Repository entity.

func (*Repository) QueryOrganization

func (r *Repository) QueryOrganization() *OrganizationQuery

QueryOrganization queries the "organization" edge of the Repository entity.

func (*Repository) String

func (r *Repository) String() string

String implements the fmt.Stringer.

func (*Repository) Unwrap

func (r *Repository) Unwrap() *Repository

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

func (r *Repository) Update() *RepositoryUpdateOne

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

func (*Repository) Value

func (r *Repository) Value(name string) (ent.Value, error)

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

type RepositoryClient

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

RepositoryClient is a client for the Repository schema.

func NewRepositoryClient

func NewRepositoryClient(c config) *RepositoryClient

NewRepositoryClient returns a client for the Repository from the given config.

func (*RepositoryClient) Create

func (c *RepositoryClient) Create() *RepositoryCreate

Create returns a builder for creating a Repository entity.

func (*RepositoryClient) CreateBulk

func (c *RepositoryClient) CreateBulk(builders ...*RepositoryCreate) *RepositoryCreateBulk

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

func (*RepositoryClient) Delete

func (c *RepositoryClient) Delete() *RepositoryDelete

Delete returns a delete builder for Repository.

func (*RepositoryClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*RepositoryClient) DeleteOneID

func (c *RepositoryClient) DeleteOneID(id int64) *RepositoryDeleteOne

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

func (*RepositoryClient) Get

func (c *RepositoryClient) Get(ctx context.Context, id int64) (*Repository, error)

Get returns a Repository entity by its id.

func (*RepositoryClient) GetX

func (c *RepositoryClient) GetX(ctx context.Context, id int64) *Repository

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

func (*RepositoryClient) Hooks

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

Hooks returns the client hooks.

func (*RepositoryClient) Intercept

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

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

func (*RepositoryClient) Interceptors

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

Interceptors returns the client interceptors.

func (*RepositoryClient) MapCreateBulk

func (c *RepositoryClient) MapCreateBulk(slice any, setFunc func(*RepositoryCreate, int)) *RepositoryCreateBulk

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

func (*RepositoryClient) Query

func (c *RepositoryClient) Query() *RepositoryQuery

Query returns a query builder for Repository.

func (*RepositoryClient) QueryCommits

func (c *RepositoryClient) QueryCommits(r *Repository) *GitCommitQuery

QueryCommits queries the commits edge of a Repository.

func (*RepositoryClient) QueryOrganization

func (c *RepositoryClient) QueryOrganization(r *Repository) *OrganizationQuery

QueryOrganization queries the organization edge of a Repository.

func (*RepositoryClient) Update

func (c *RepositoryClient) Update() *RepositoryUpdate

Update returns an update builder for Repository.

func (*RepositoryClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*RepositoryClient) UpdateOneID

func (c *RepositoryClient) UpdateOneID(id int64) *RepositoryUpdateOne

UpdateOneID returns an update builder for the given id.

func (*RepositoryClient) Use

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

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

type RepositoryCreate

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

RepositoryCreate is the builder for creating a Repository entity.

func (*RepositoryCreate) AddCommitIDs

func (rc *RepositoryCreate) AddCommitIDs(ids ...string) *RepositoryCreate

AddCommitIDs adds the "commits" edge to the GitCommit entity by IDs.

func (*RepositoryCreate) AddCommits

func (rc *RepositoryCreate) AddCommits(g ...*GitCommit) *RepositoryCreate

AddCommits adds the "commits" edges to the GitCommit entity.

func (*RepositoryCreate) Exec

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

Exec executes the query.

func (*RepositoryCreate) ExecX

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

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

func (*RepositoryCreate) Mutation

func (rc *RepositoryCreate) Mutation() *RepositoryMutation

Mutation returns the RepositoryMutation object of the builder.

func (*RepositoryCreate) OnConflict

func (rc *RepositoryCreate) OnConflict(opts ...sql.ConflictOption) *RepositoryUpsertOne

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

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

func (*RepositoryCreate) OnConflictColumns

func (rc *RepositoryCreate) OnConflictColumns(columns ...string) *RepositoryUpsertOne

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

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

func (*RepositoryCreate) Save

func (rc *RepositoryCreate) Save(ctx context.Context) (*Repository, error)

Save creates the Repository in the database.

func (*RepositoryCreate) SaveX

func (rc *RepositoryCreate) SaveX(ctx context.Context) *Repository

SaveX calls Save and panics if Save returns an error.

func (*RepositoryCreate) SetDescription

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

SetDescription sets the "description" field.

func (*RepositoryCreate) SetFullName

func (rc *RepositoryCreate) SetFullName(s string) *RepositoryCreate

SetFullName sets the "full_name" field.

func (*RepositoryCreate) SetHTMLURL

func (rc *RepositoryCreate) SetHTMLURL(s string) *RepositoryCreate

SetHTMLURL sets the "html_url" field.

func (*RepositoryCreate) SetID

func (rc *RepositoryCreate) SetID(i int64) *RepositoryCreate

SetID sets the "id" field.

func (*RepositoryCreate) SetLastEventAt

func (rc *RepositoryCreate) SetLastEventAt(t time.Time) *RepositoryCreate

SetLastEventAt sets the "last_event_at" field.

func (*RepositoryCreate) SetLastPushedAt

func (rc *RepositoryCreate) SetLastPushedAt(t time.Time) *RepositoryCreate

SetLastPushedAt sets the "last_pushed_at" field.

func (*RepositoryCreate) SetName

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

SetName sets the "name" field.

func (*RepositoryCreate) SetNillableDescription

func (rc *RepositoryCreate) SetNillableDescription(s *string) *RepositoryCreate

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

func (*RepositoryCreate) SetNillableHTMLURL

func (rc *RepositoryCreate) SetNillableHTMLURL(s *string) *RepositoryCreate

SetNillableHTMLURL sets the "html_url" field if the given value is not nil.

func (*RepositoryCreate) SetNillableLastEventAt

func (rc *RepositoryCreate) SetNillableLastEventAt(t *time.Time) *RepositoryCreate

SetNillableLastEventAt sets the "last_event_at" field if the given value is not nil.

func (*RepositoryCreate) SetNillableLastPushedAt

func (rc *RepositoryCreate) SetNillableLastPushedAt(t *time.Time) *RepositoryCreate

SetNillableLastPushedAt sets the "last_pushed_at" field if the given value is not nil.

func (*RepositoryCreate) SetNillableOrganizationID

func (rc *RepositoryCreate) SetNillableOrganizationID(id *int64) *RepositoryCreate

SetNillableOrganizationID sets the "organization" edge to the Organization entity by ID if the given value is not nil.

func (*RepositoryCreate) SetOrganization

func (rc *RepositoryCreate) SetOrganization(o *Organization) *RepositoryCreate

SetOrganization sets the "organization" edge to the Organization entity.

func (*RepositoryCreate) SetOrganizationID

func (rc *RepositoryCreate) SetOrganizationID(id int64) *RepositoryCreate

SetOrganizationID sets the "organization" edge to the Organization entity by ID.

type RepositoryCreateBulk

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

RepositoryCreateBulk is the builder for creating many Repository entities in bulk.

func (*RepositoryCreateBulk) Exec

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

Exec executes the query.

func (*RepositoryCreateBulk) ExecX

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

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

func (*RepositoryCreateBulk) OnConflict

func (rcb *RepositoryCreateBulk) OnConflict(opts ...sql.ConflictOption) *RepositoryUpsertBulk

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

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

func (*RepositoryCreateBulk) OnConflictColumns

func (rcb *RepositoryCreateBulk) OnConflictColumns(columns ...string) *RepositoryUpsertBulk

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

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

func (*RepositoryCreateBulk) Save

func (rcb *RepositoryCreateBulk) Save(ctx context.Context) ([]*Repository, error)

Save creates the Repository entities in the database.

func (*RepositoryCreateBulk) SaveX

func (rcb *RepositoryCreateBulk) SaveX(ctx context.Context) []*Repository

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

type RepositoryDelete

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

RepositoryDelete is the builder for deleting a Repository entity.

func (*RepositoryDelete) Exec

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

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

func (*RepositoryDelete) ExecX

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

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

func (*RepositoryDelete) Where

Where appends a list predicates to the RepositoryDelete builder.

type RepositoryDeleteOne

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

RepositoryDeleteOne is the builder for deleting a single Repository entity.

func (*RepositoryDeleteOne) Exec

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

Exec executes the deletion query.

func (*RepositoryDeleteOne) ExecX

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

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

func (*RepositoryDeleteOne) Where

Where appends a list predicates to the RepositoryDelete builder.

type RepositoryEdges

type RepositoryEdges struct {
	// GitHub organization.
	Organization *Organization `json:"organization,omitempty"`
	// Commits.
	Commits []*GitCommit `json:"commits,omitempty"`
	// contains filtered or unexported fields
}

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

func (RepositoryEdges) CommitsOrErr

func (e RepositoryEdges) CommitsOrErr() ([]*GitCommit, error)

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

func (RepositoryEdges) OrganizationOrErr

func (e RepositoryEdges) OrganizationOrErr() (*Organization, error)

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

type RepositoryGroupBy

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

RepositoryGroupBy is the group-by builder for Repository entities.

func (*RepositoryGroupBy) Aggregate

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

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

func (*RepositoryGroupBy) Bool

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

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

func (*RepositoryGroupBy) BoolX

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

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

func (*RepositoryGroupBy) Bools

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

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

func (*RepositoryGroupBy) BoolsX

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

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

func (*RepositoryGroupBy) Float64

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

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

func (*RepositoryGroupBy) Float64X

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

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

func (*RepositoryGroupBy) Float64s

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

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

func (*RepositoryGroupBy) Float64sX

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

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

func (*RepositoryGroupBy) Int

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

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

func (*RepositoryGroupBy) IntX

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

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

func (*RepositoryGroupBy) Ints

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

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

func (*RepositoryGroupBy) IntsX

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

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

func (*RepositoryGroupBy) Scan

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

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

func (*RepositoryGroupBy) ScanX

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

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

func (*RepositoryGroupBy) String

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

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

func (*RepositoryGroupBy) StringX

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

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

func (*RepositoryGroupBy) Strings

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

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

func (*RepositoryGroupBy) StringsX

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

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

type RepositoryMutation

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

RepositoryMutation represents an operation that mutates the Repository nodes in the graph.

func (*RepositoryMutation) AddCommitIDs

func (m *RepositoryMutation) AddCommitIDs(ids ...string)

AddCommitIDs adds the "commits" edge to the GitCommit entity by ids.

func (*RepositoryMutation) AddField

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

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

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

func (*RepositoryMutation) AddedField

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

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

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

func (*RepositoryMutation) AddedIDs

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

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

func (*RepositoryMutation) ClearCommits

func (m *RepositoryMutation) ClearCommits()

ClearCommits clears the "commits" edge to the GitCommit entity.

func (*RepositoryMutation) ClearEdge

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

func (m *RepositoryMutation) 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 (*RepositoryMutation) ClearHTMLURL

func (m *RepositoryMutation) ClearHTMLURL()

ClearHTMLURL clears the value of the "html_url" field.

func (*RepositoryMutation) ClearLastEventAt

func (m *RepositoryMutation) ClearLastEventAt()

ClearLastEventAt clears the value of the "last_event_at" field.

func (*RepositoryMutation) ClearLastPushedAt

func (m *RepositoryMutation) ClearLastPushedAt()

ClearLastPushedAt clears the value of the "last_pushed_at" field.

func (*RepositoryMutation) ClearOrganization

func (m *RepositoryMutation) ClearOrganization()

ClearOrganization clears the "organization" edge to the Organization entity.

func (*RepositoryMutation) ClearedEdges

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

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

func (*RepositoryMutation) ClearedFields

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

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

func (RepositoryMutation) Client

func (m RepositoryMutation) 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 (*RepositoryMutation) CommitsCleared

func (m *RepositoryMutation) CommitsCleared() bool

CommitsCleared reports if the "commits" edge to the GitCommit entity was cleared.

func (*RepositoryMutation) CommitsIDs

func (m *RepositoryMutation) CommitsIDs() (ids []string)

CommitsIDs returns the "commits" edge IDs in the mutation.

func (*RepositoryMutation) Description

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

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

func (*RepositoryMutation) EdgeCleared

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

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

func (*RepositoryMutation) Field

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

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

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

func (*RepositoryMutation) Fields

func (m *RepositoryMutation) 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 (*RepositoryMutation) FullName

func (m *RepositoryMutation) FullName() (r string, exists bool)

FullName returns the value of the "full_name" field in the mutation.

func (*RepositoryMutation) HTMLURL

func (m *RepositoryMutation) HTMLURL() (r string, exists bool)

HTMLURL returns the value of the "html_url" field in the mutation.

func (*RepositoryMutation) HTMLURLCleared

func (m *RepositoryMutation) HTMLURLCleared() bool

HTMLURLCleared returns if the "html_url" field was cleared in this mutation.

func (*RepositoryMutation) ID

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

func (m *RepositoryMutation) IDs(ctx context.Context) ([]int64, 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 (*RepositoryMutation) LastEventAt

func (m *RepositoryMutation) LastEventAt() (r time.Time, exists bool)

LastEventAt returns the value of the "last_event_at" field in the mutation.

func (*RepositoryMutation) LastEventAtCleared

func (m *RepositoryMutation) LastEventAtCleared() bool

LastEventAtCleared returns if the "last_event_at" field was cleared in this mutation.

func (*RepositoryMutation) LastPushedAt

func (m *RepositoryMutation) LastPushedAt() (r time.Time, exists bool)

LastPushedAt returns the value of the "last_pushed_at" field in the mutation.

func (*RepositoryMutation) LastPushedAtCleared

func (m *RepositoryMutation) LastPushedAtCleared() bool

LastPushedAtCleared returns if the "last_pushed_at" field was cleared in this mutation.

func (*RepositoryMutation) Name

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

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

func (*RepositoryMutation) OldDescription

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

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

func (m *RepositoryMutation) 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 (*RepositoryMutation) OldFullName

func (m *RepositoryMutation) OldFullName(ctx context.Context) (v string, err error)

OldFullName returns the old "full_name" field's value of the Repository entity. If the Repository 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 (*RepositoryMutation) OldHTMLURL

func (m *RepositoryMutation) OldHTMLURL(ctx context.Context) (v string, err error)

OldHTMLURL returns the old "html_url" field's value of the Repository entity. If the Repository 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 (*RepositoryMutation) OldLastEventAt

func (m *RepositoryMutation) OldLastEventAt(ctx context.Context) (v time.Time, err error)

OldLastEventAt returns the old "last_event_at" field's value of the Repository entity. If the Repository 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 (*RepositoryMutation) OldLastPushedAt

func (m *RepositoryMutation) OldLastPushedAt(ctx context.Context) (v time.Time, err error)

OldLastPushedAt returns the old "last_pushed_at" field's value of the Repository entity. If the Repository 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 (*RepositoryMutation) OldName

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

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

func (m *RepositoryMutation) Op() Op

Op returns the operation name.

func (*RepositoryMutation) OrganizationCleared

func (m *RepositoryMutation) OrganizationCleared() bool

OrganizationCleared reports if the "organization" edge to the Organization entity was cleared.

func (*RepositoryMutation) OrganizationID

func (m *RepositoryMutation) OrganizationID() (id int64, exists bool)

OrganizationID returns the "organization" edge ID in the mutation.

func (*RepositoryMutation) OrganizationIDs

func (m *RepositoryMutation) OrganizationIDs() (ids []int64)

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

func (*RepositoryMutation) RemoveCommitIDs

func (m *RepositoryMutation) RemoveCommitIDs(ids ...string)

RemoveCommitIDs removes the "commits" edge to the GitCommit entity by IDs.

func (*RepositoryMutation) RemovedCommitsIDs

func (m *RepositoryMutation) RemovedCommitsIDs() (ids []string)

RemovedCommits returns the removed IDs of the "commits" edge to the GitCommit entity.

func (*RepositoryMutation) RemovedEdges

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

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

func (*RepositoryMutation) RemovedIDs

func (m *RepositoryMutation) 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 (*RepositoryMutation) ResetCommits

func (m *RepositoryMutation) ResetCommits()

ResetCommits resets all changes to the "commits" edge.

func (*RepositoryMutation) ResetDescription

func (m *RepositoryMutation) ResetDescription()

ResetDescription resets all changes to the "description" field.

func (*RepositoryMutation) ResetEdge

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

func (m *RepositoryMutation) 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 (*RepositoryMutation) ResetFullName

func (m *RepositoryMutation) ResetFullName()

ResetFullName resets all changes to the "full_name" field.

func (*RepositoryMutation) ResetHTMLURL

func (m *RepositoryMutation) ResetHTMLURL()

ResetHTMLURL resets all changes to the "html_url" field.

func (*RepositoryMutation) ResetLastEventAt

func (m *RepositoryMutation) ResetLastEventAt()

ResetLastEventAt resets all changes to the "last_event_at" field.

func (*RepositoryMutation) ResetLastPushedAt

func (m *RepositoryMutation) ResetLastPushedAt()

ResetLastPushedAt resets all changes to the "last_pushed_at" field.

func (*RepositoryMutation) ResetName

func (m *RepositoryMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*RepositoryMutation) ResetOrganization

func (m *RepositoryMutation) ResetOrganization()

ResetOrganization resets all changes to the "organization" edge.

func (*RepositoryMutation) SetDescription

func (m *RepositoryMutation) SetDescription(s string)

SetDescription sets the "description" field.

func (*RepositoryMutation) SetField

func (m *RepositoryMutation) 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 (*RepositoryMutation) SetFullName

func (m *RepositoryMutation) SetFullName(s string)

SetFullName sets the "full_name" field.

func (*RepositoryMutation) SetHTMLURL

func (m *RepositoryMutation) SetHTMLURL(s string)

SetHTMLURL sets the "html_url" field.

func (*RepositoryMutation) SetID

func (m *RepositoryMutation) SetID(id int64)

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

func (*RepositoryMutation) SetLastEventAt

func (m *RepositoryMutation) SetLastEventAt(t time.Time)

SetLastEventAt sets the "last_event_at" field.

func (*RepositoryMutation) SetLastPushedAt

func (m *RepositoryMutation) SetLastPushedAt(t time.Time)

SetLastPushedAt sets the "last_pushed_at" field.

func (*RepositoryMutation) SetName

func (m *RepositoryMutation) SetName(s string)

SetName sets the "name" field.

func (*RepositoryMutation) SetOp

func (m *RepositoryMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*RepositoryMutation) SetOrganizationID

func (m *RepositoryMutation) SetOrganizationID(id int64)

SetOrganizationID sets the "organization" edge to the Organization entity by id.

func (RepositoryMutation) Tx

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

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

func (*RepositoryMutation) Type

func (m *RepositoryMutation) Type() string

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

func (*RepositoryMutation) Where

func (m *RepositoryMutation) Where(ps ...predicate.Repository)

Where appends a list predicates to the RepositoryMutation builder.

func (*RepositoryMutation) WhereP

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

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

type RepositoryQuery

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

RepositoryQuery is the builder for querying Repository entities.

func (*RepositoryQuery) Aggregate

func (rq *RepositoryQuery) Aggregate(fns ...AggregateFunc) *RepositorySelect

Aggregate returns a RepositorySelect configured with the given aggregations.

func (*RepositoryQuery) All

func (rq *RepositoryQuery) All(ctx context.Context) ([]*Repository, error)

All executes the query and returns a list of Repositories.

func (*RepositoryQuery) AllX

func (rq *RepositoryQuery) AllX(ctx context.Context) []*Repository

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

func (*RepositoryQuery) Clone

func (rq *RepositoryQuery) Clone() *RepositoryQuery

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

func (*RepositoryQuery) Count

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

Count returns the count of the given query.

func (*RepositoryQuery) CountX

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

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

func (*RepositoryQuery) Exist

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

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

func (*RepositoryQuery) ExistX

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

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

func (*RepositoryQuery) First

func (rq *RepositoryQuery) First(ctx context.Context) (*Repository, error)

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

func (*RepositoryQuery) FirstID

func (rq *RepositoryQuery) FirstID(ctx context.Context) (id int64, err error)

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

func (*RepositoryQuery) FirstIDX

func (rq *RepositoryQuery) FirstIDX(ctx context.Context) int64

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

func (*RepositoryQuery) FirstX

func (rq *RepositoryQuery) FirstX(ctx context.Context) *Repository

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

func (*RepositoryQuery) GroupBy

func (rq *RepositoryQuery) GroupBy(field string, fields ...string) *RepositoryGroupBy

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

func (*RepositoryQuery) IDs

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

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

func (*RepositoryQuery) IDsX

func (rq *RepositoryQuery) IDsX(ctx context.Context) []int64

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

func (*RepositoryQuery) Limit

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

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

func (*RepositoryQuery) Offset

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

Offset to start from.

func (*RepositoryQuery) Only

func (rq *RepositoryQuery) Only(ctx context.Context) (*Repository, error)

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

func (*RepositoryQuery) OnlyID

func (rq *RepositoryQuery) OnlyID(ctx context.Context) (id int64, err error)

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

func (*RepositoryQuery) OnlyIDX

func (rq *RepositoryQuery) OnlyIDX(ctx context.Context) int64

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

func (*RepositoryQuery) OnlyX

func (rq *RepositoryQuery) OnlyX(ctx context.Context) *Repository

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

func (*RepositoryQuery) Order

Order specifies how the records should be ordered.

func (*RepositoryQuery) QueryCommits

func (rq *RepositoryQuery) QueryCommits() *GitCommitQuery

QueryCommits chains the current query on the "commits" edge.

func (*RepositoryQuery) QueryOrganization

func (rq *RepositoryQuery) QueryOrganization() *OrganizationQuery

QueryOrganization chains the current query on the "organization" edge.

func (*RepositoryQuery) Select

func (rq *RepositoryQuery) Select(fields ...string) *RepositorySelect

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

func (*RepositoryQuery) Unique

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

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

Where adds a new predicate for the RepositoryQuery builder.

func (*RepositoryQuery) WithCommits

func (rq *RepositoryQuery) WithCommits(opts ...func(*GitCommitQuery)) *RepositoryQuery

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

func (*RepositoryQuery) WithNamedCommits

func (rq *RepositoryQuery) WithNamedCommits(name string, opts ...func(*GitCommitQuery)) *RepositoryQuery

WithNamedCommits tells the query-builder to eager-load the nodes that are connected to the "commits" edge with the given name. The optional arguments are used to configure the query builder of the edge.

func (*RepositoryQuery) WithOrganization

func (rq *RepositoryQuery) WithOrganization(opts ...func(*OrganizationQuery)) *RepositoryQuery

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

type RepositorySelect

type RepositorySelect struct {
	*RepositoryQuery
	// contains filtered or unexported fields
}

RepositorySelect is the builder for selecting fields of Repository entities.

func (*RepositorySelect) Aggregate

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

Aggregate adds the given aggregation functions to the selector query.

func (*RepositorySelect) Bool

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

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

func (*RepositorySelect) BoolX

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

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

func (*RepositorySelect) Bools

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

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

func (*RepositorySelect) BoolsX

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

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

func (*RepositorySelect) Float64

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

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

func (*RepositorySelect) Float64X

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

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

func (*RepositorySelect) Float64s

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

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

func (*RepositorySelect) Float64sX

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

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

func (*RepositorySelect) Int

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

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

func (*RepositorySelect) IntX

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

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

func (*RepositorySelect) Ints

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

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

func (*RepositorySelect) IntsX

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

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

func (*RepositorySelect) Scan

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

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

func (*RepositorySelect) ScanX

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

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

func (*RepositorySelect) String

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

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

func (*RepositorySelect) StringX

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

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

func (*RepositorySelect) Strings

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

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

func (*RepositorySelect) StringsX

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

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

type RepositoryUpdate

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

RepositoryUpdate is the builder for updating Repository entities.

func (*RepositoryUpdate) AddCommitIDs

func (ru *RepositoryUpdate) AddCommitIDs(ids ...string) *RepositoryUpdate

AddCommitIDs adds the "commits" edge to the GitCommit entity by IDs.

func (*RepositoryUpdate) AddCommits

func (ru *RepositoryUpdate) AddCommits(g ...*GitCommit) *RepositoryUpdate

AddCommits adds the "commits" edges to the GitCommit entity.

func (*RepositoryUpdate) ClearCommits

func (ru *RepositoryUpdate) ClearCommits() *RepositoryUpdate

ClearCommits clears all "commits" edges to the GitCommit entity.

func (*RepositoryUpdate) ClearHTMLURL

func (ru *RepositoryUpdate) ClearHTMLURL() *RepositoryUpdate

ClearHTMLURL clears the value of the "html_url" field.

func (*RepositoryUpdate) ClearLastEventAt

func (ru *RepositoryUpdate) ClearLastEventAt() *RepositoryUpdate

ClearLastEventAt clears the value of the "last_event_at" field.

func (*RepositoryUpdate) ClearLastPushedAt

func (ru *RepositoryUpdate) ClearLastPushedAt() *RepositoryUpdate

ClearLastPushedAt clears the value of the "last_pushed_at" field.

func (*RepositoryUpdate) ClearOrganization

func (ru *RepositoryUpdate) ClearOrganization() *RepositoryUpdate

ClearOrganization clears the "organization" edge to the Organization entity.

func (*RepositoryUpdate) Exec

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

Exec executes the query.

func (*RepositoryUpdate) ExecX

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

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

func (*RepositoryUpdate) Mutation

func (ru *RepositoryUpdate) Mutation() *RepositoryMutation

Mutation returns the RepositoryMutation object of the builder.

func (*RepositoryUpdate) RemoveCommitIDs

func (ru *RepositoryUpdate) RemoveCommitIDs(ids ...string) *RepositoryUpdate

RemoveCommitIDs removes the "commits" edge to GitCommit entities by IDs.

func (*RepositoryUpdate) RemoveCommits

func (ru *RepositoryUpdate) RemoveCommits(g ...*GitCommit) *RepositoryUpdate

RemoveCommits removes "commits" edges to GitCommit entities.

func (*RepositoryUpdate) Save

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

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

func (*RepositoryUpdate) SaveX

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

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

func (*RepositoryUpdate) SetDescription

func (ru *RepositoryUpdate) SetDescription(s string) *RepositoryUpdate

SetDescription sets the "description" field.

func (*RepositoryUpdate) SetFullName

func (ru *RepositoryUpdate) SetFullName(s string) *RepositoryUpdate

SetFullName sets the "full_name" field.

func (*RepositoryUpdate) SetHTMLURL

func (ru *RepositoryUpdate) SetHTMLURL(s string) *RepositoryUpdate

SetHTMLURL sets the "html_url" field.

func (*RepositoryUpdate) SetLastEventAt

func (ru *RepositoryUpdate) SetLastEventAt(t time.Time) *RepositoryUpdate

SetLastEventAt sets the "last_event_at" field.

func (*RepositoryUpdate) SetLastPushedAt

func (ru *RepositoryUpdate) SetLastPushedAt(t time.Time) *RepositoryUpdate

SetLastPushedAt sets the "last_pushed_at" field.

func (*RepositoryUpdate) SetName

func (ru *RepositoryUpdate) SetName(s string) *RepositoryUpdate

SetName sets the "name" field.

func (*RepositoryUpdate) SetNillableDescription

func (ru *RepositoryUpdate) SetNillableDescription(s *string) *RepositoryUpdate

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

func (*RepositoryUpdate) SetNillableFullName

func (ru *RepositoryUpdate) SetNillableFullName(s *string) *RepositoryUpdate

SetNillableFullName sets the "full_name" field if the given value is not nil.

func (*RepositoryUpdate) SetNillableHTMLURL

func (ru *RepositoryUpdate) SetNillableHTMLURL(s *string) *RepositoryUpdate

SetNillableHTMLURL sets the "html_url" field if the given value is not nil.

func (*RepositoryUpdate) SetNillableLastEventAt

func (ru *RepositoryUpdate) SetNillableLastEventAt(t *time.Time) *RepositoryUpdate

SetNillableLastEventAt sets the "last_event_at" field if the given value is not nil.

func (*RepositoryUpdate) SetNillableLastPushedAt

func (ru *RepositoryUpdate) SetNillableLastPushedAt(t *time.Time) *RepositoryUpdate

SetNillableLastPushedAt sets the "last_pushed_at" field if the given value is not nil.

func (*RepositoryUpdate) SetNillableName

func (ru *RepositoryUpdate) SetNillableName(s *string) *RepositoryUpdate

SetNillableName sets the "name" field if the given value is not nil.

func (*RepositoryUpdate) SetNillableOrganizationID

func (ru *RepositoryUpdate) SetNillableOrganizationID(id *int64) *RepositoryUpdate

SetNillableOrganizationID sets the "organization" edge to the Organization entity by ID if the given value is not nil.

func (*RepositoryUpdate) SetOrganization

func (ru *RepositoryUpdate) SetOrganization(o *Organization) *RepositoryUpdate

SetOrganization sets the "organization" edge to the Organization entity.

func (*RepositoryUpdate) SetOrganizationID

func (ru *RepositoryUpdate) SetOrganizationID(id int64) *RepositoryUpdate

SetOrganizationID sets the "organization" edge to the Organization entity by ID.

func (*RepositoryUpdate) Where

Where appends a list predicates to the RepositoryUpdate builder.

type RepositoryUpdateOne

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

RepositoryUpdateOne is the builder for updating a single Repository entity.

func (*RepositoryUpdateOne) AddCommitIDs

func (ruo *RepositoryUpdateOne) AddCommitIDs(ids ...string) *RepositoryUpdateOne

AddCommitIDs adds the "commits" edge to the GitCommit entity by IDs.

func (*RepositoryUpdateOne) AddCommits

func (ruo *RepositoryUpdateOne) AddCommits(g ...*GitCommit) *RepositoryUpdateOne

AddCommits adds the "commits" edges to the GitCommit entity.

func (*RepositoryUpdateOne) ClearCommits

func (ruo *RepositoryUpdateOne) ClearCommits() *RepositoryUpdateOne

ClearCommits clears all "commits" edges to the GitCommit entity.

func (*RepositoryUpdateOne) ClearHTMLURL

func (ruo *RepositoryUpdateOne) ClearHTMLURL() *RepositoryUpdateOne

ClearHTMLURL clears the value of the "html_url" field.

func (*RepositoryUpdateOne) ClearLastEventAt

func (ruo *RepositoryUpdateOne) ClearLastEventAt() *RepositoryUpdateOne

ClearLastEventAt clears the value of the "last_event_at" field.

func (*RepositoryUpdateOne) ClearLastPushedAt

func (ruo *RepositoryUpdateOne) ClearLastPushedAt() *RepositoryUpdateOne

ClearLastPushedAt clears the value of the "last_pushed_at" field.

func (*RepositoryUpdateOne) ClearOrganization

func (ruo *RepositoryUpdateOne) ClearOrganization() *RepositoryUpdateOne

ClearOrganization clears the "organization" edge to the Organization entity.

func (*RepositoryUpdateOne) Exec

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

Exec executes the query on the entity.

func (*RepositoryUpdateOne) ExecX

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

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

func (*RepositoryUpdateOne) Mutation

func (ruo *RepositoryUpdateOne) Mutation() *RepositoryMutation

Mutation returns the RepositoryMutation object of the builder.

func (*RepositoryUpdateOne) RemoveCommitIDs

func (ruo *RepositoryUpdateOne) RemoveCommitIDs(ids ...string) *RepositoryUpdateOne

RemoveCommitIDs removes the "commits" edge to GitCommit entities by IDs.

func (*RepositoryUpdateOne) RemoveCommits

func (ruo *RepositoryUpdateOne) RemoveCommits(g ...*GitCommit) *RepositoryUpdateOne

RemoveCommits removes "commits" edges to GitCommit entities.

func (*RepositoryUpdateOne) Save

func (ruo *RepositoryUpdateOne) Save(ctx context.Context) (*Repository, error)

Save executes the query and returns the updated Repository entity.

func (*RepositoryUpdateOne) SaveX

func (ruo *RepositoryUpdateOne) SaveX(ctx context.Context) *Repository

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

func (*RepositoryUpdateOne) Select

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

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

func (*RepositoryUpdateOne) SetDescription

func (ruo *RepositoryUpdateOne) SetDescription(s string) *RepositoryUpdateOne

SetDescription sets the "description" field.

func (*RepositoryUpdateOne) SetFullName

func (ruo *RepositoryUpdateOne) SetFullName(s string) *RepositoryUpdateOne

SetFullName sets the "full_name" field.

func (*RepositoryUpdateOne) SetHTMLURL

func (ruo *RepositoryUpdateOne) SetHTMLURL(s string) *RepositoryUpdateOne

SetHTMLURL sets the "html_url" field.

func (*RepositoryUpdateOne) SetLastEventAt

func (ruo *RepositoryUpdateOne) SetLastEventAt(t time.Time) *RepositoryUpdateOne

SetLastEventAt sets the "last_event_at" field.

func (*RepositoryUpdateOne) SetLastPushedAt

func (ruo *RepositoryUpdateOne) SetLastPushedAt(t time.Time) *RepositoryUpdateOne

SetLastPushedAt sets the "last_pushed_at" field.

func (*RepositoryUpdateOne) SetName

SetName sets the "name" field.

func (*RepositoryUpdateOne) SetNillableDescription

func (ruo *RepositoryUpdateOne) SetNillableDescription(s *string) *RepositoryUpdateOne

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

func (*RepositoryUpdateOne) SetNillableFullName

func (ruo *RepositoryUpdateOne) SetNillableFullName(s *string) *RepositoryUpdateOne

SetNillableFullName sets the "full_name" field if the given value is not nil.

func (*RepositoryUpdateOne) SetNillableHTMLURL

func (ruo *RepositoryUpdateOne) SetNillableHTMLURL(s *string) *RepositoryUpdateOne

SetNillableHTMLURL sets the "html_url" field if the given value is not nil.

func (*RepositoryUpdateOne) SetNillableLastEventAt

func (ruo *RepositoryUpdateOne) SetNillableLastEventAt(t *time.Time) *RepositoryUpdateOne

SetNillableLastEventAt sets the "last_event_at" field if the given value is not nil.

func (*RepositoryUpdateOne) SetNillableLastPushedAt

func (ruo *RepositoryUpdateOne) SetNillableLastPushedAt(t *time.Time) *RepositoryUpdateOne

SetNillableLastPushedAt sets the "last_pushed_at" field if the given value is not nil.

func (*RepositoryUpdateOne) SetNillableName

func (ruo *RepositoryUpdateOne) SetNillableName(s *string) *RepositoryUpdateOne

SetNillableName sets the "name" field if the given value is not nil.

func (*RepositoryUpdateOne) SetNillableOrganizationID

func (ruo *RepositoryUpdateOne) SetNillableOrganizationID(id *int64) *RepositoryUpdateOne

SetNillableOrganizationID sets the "organization" edge to the Organization entity by ID if the given value is not nil.

func (*RepositoryUpdateOne) SetOrganization

func (ruo *RepositoryUpdateOne) SetOrganization(o *Organization) *RepositoryUpdateOne

SetOrganization sets the "organization" edge to the Organization entity.

func (*RepositoryUpdateOne) SetOrganizationID

func (ruo *RepositoryUpdateOne) SetOrganizationID(id int64) *RepositoryUpdateOne

SetOrganizationID sets the "organization" edge to the Organization entity by ID.

func (*RepositoryUpdateOne) Where

Where appends a list predicates to the RepositoryUpdate builder.

type RepositoryUpsert

type RepositoryUpsert struct {
	*sql.UpdateSet
}

RepositoryUpsert is the "OnConflict" setter.

func (*RepositoryUpsert) ClearHTMLURL

func (u *RepositoryUpsert) ClearHTMLURL() *RepositoryUpsert

ClearHTMLURL clears the value of the "html_url" field.

func (*RepositoryUpsert) ClearLastEventAt

func (u *RepositoryUpsert) ClearLastEventAt() *RepositoryUpsert

ClearLastEventAt clears the value of the "last_event_at" field.

func (*RepositoryUpsert) ClearLastPushedAt

func (u *RepositoryUpsert) ClearLastPushedAt() *RepositoryUpsert

ClearLastPushedAt clears the value of the "last_pushed_at" field.

func (*RepositoryUpsert) SetDescription

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

SetDescription sets the "description" field.

func (*RepositoryUpsert) SetFullName

func (u *RepositoryUpsert) SetFullName(v string) *RepositoryUpsert

SetFullName sets the "full_name" field.

func (*RepositoryUpsert) SetHTMLURL

func (u *RepositoryUpsert) SetHTMLURL(v string) *RepositoryUpsert

SetHTMLURL sets the "html_url" field.

func (*RepositoryUpsert) SetLastEventAt

func (u *RepositoryUpsert) SetLastEventAt(v time.Time) *RepositoryUpsert

SetLastEventAt sets the "last_event_at" field.

func (*RepositoryUpsert) SetLastPushedAt

func (u *RepositoryUpsert) SetLastPushedAt(v time.Time) *RepositoryUpsert

SetLastPushedAt sets the "last_pushed_at" field.

func (*RepositoryUpsert) SetName

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

SetName sets the "name" field.

func (*RepositoryUpsert) UpdateDescription

func (u *RepositoryUpsert) UpdateDescription() *RepositoryUpsert

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

func (*RepositoryUpsert) UpdateFullName

func (u *RepositoryUpsert) UpdateFullName() *RepositoryUpsert

UpdateFullName sets the "full_name" field to the value that was provided on create.

func (*RepositoryUpsert) UpdateHTMLURL

func (u *RepositoryUpsert) UpdateHTMLURL() *RepositoryUpsert

UpdateHTMLURL sets the "html_url" field to the value that was provided on create.

func (*RepositoryUpsert) UpdateLastEventAt

func (u *RepositoryUpsert) UpdateLastEventAt() *RepositoryUpsert

UpdateLastEventAt sets the "last_event_at" field to the value that was provided on create.

func (*RepositoryUpsert) UpdateLastPushedAt

func (u *RepositoryUpsert) UpdateLastPushedAt() *RepositoryUpsert

UpdateLastPushedAt sets the "last_pushed_at" field to the value that was provided on create.

func (*RepositoryUpsert) UpdateName

func (u *RepositoryUpsert) UpdateName() *RepositoryUpsert

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

type RepositoryUpsertBulk

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

RepositoryUpsertBulk is the builder for "upsert"-ing a bulk of Repository nodes.

func (*RepositoryUpsertBulk) ClearHTMLURL

func (u *RepositoryUpsertBulk) ClearHTMLURL() *RepositoryUpsertBulk

ClearHTMLURL clears the value of the "html_url" field.

func (*RepositoryUpsertBulk) ClearLastEventAt

func (u *RepositoryUpsertBulk) ClearLastEventAt() *RepositoryUpsertBulk

ClearLastEventAt clears the value of the "last_event_at" field.

func (*RepositoryUpsertBulk) ClearLastPushedAt

func (u *RepositoryUpsertBulk) ClearLastPushedAt() *RepositoryUpsertBulk

ClearLastPushedAt clears the value of the "last_pushed_at" field.

func (*RepositoryUpsertBulk) DoNothing

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

func (*RepositoryUpsertBulk) Exec

Exec executes the query.

func (*RepositoryUpsertBulk) ExecX

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

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

func (*RepositoryUpsertBulk) Ignore

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

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

func (*RepositoryUpsertBulk) SetDescription

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

SetDescription sets the "description" field.

func (*RepositoryUpsertBulk) SetFullName

SetFullName sets the "full_name" field.

func (*RepositoryUpsertBulk) SetHTMLURL

SetHTMLURL sets the "html_url" field.

func (*RepositoryUpsertBulk) SetLastEventAt

func (u *RepositoryUpsertBulk) SetLastEventAt(v time.Time) *RepositoryUpsertBulk

SetLastEventAt sets the "last_event_at" field.

func (*RepositoryUpsertBulk) SetLastPushedAt

func (u *RepositoryUpsertBulk) SetLastPushedAt(v time.Time) *RepositoryUpsertBulk

SetLastPushedAt sets the "last_pushed_at" field.

func (*RepositoryUpsertBulk) SetName

SetName sets the "name" field.

func (*RepositoryUpsertBulk) Update

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

func (*RepositoryUpsertBulk) UpdateDescription

func (u *RepositoryUpsertBulk) UpdateDescription() *RepositoryUpsertBulk

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

func (*RepositoryUpsertBulk) UpdateFullName

func (u *RepositoryUpsertBulk) UpdateFullName() *RepositoryUpsertBulk

UpdateFullName sets the "full_name" field to the value that was provided on create.

func (*RepositoryUpsertBulk) UpdateHTMLURL

func (u *RepositoryUpsertBulk) UpdateHTMLURL() *RepositoryUpsertBulk

UpdateHTMLURL sets the "html_url" field to the value that was provided on create.

func (*RepositoryUpsertBulk) UpdateLastEventAt

func (u *RepositoryUpsertBulk) UpdateLastEventAt() *RepositoryUpsertBulk

UpdateLastEventAt sets the "last_event_at" field to the value that was provided on create.

func (*RepositoryUpsertBulk) UpdateLastPushedAt

func (u *RepositoryUpsertBulk) UpdateLastPushedAt() *RepositoryUpsertBulk

UpdateLastPushedAt sets the "last_pushed_at" field to the value that was provided on create.

func (*RepositoryUpsertBulk) UpdateName

func (u *RepositoryUpsertBulk) UpdateName() *RepositoryUpsertBulk

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

func (*RepositoryUpsertBulk) UpdateNewValues

func (u *RepositoryUpsertBulk) UpdateNewValues() *RepositoryUpsertBulk

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

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

type RepositoryUpsertOne

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

RepositoryUpsertOne is the builder for "upsert"-ing

one Repository node.

func (*RepositoryUpsertOne) ClearHTMLURL

func (u *RepositoryUpsertOne) ClearHTMLURL() *RepositoryUpsertOne

ClearHTMLURL clears the value of the "html_url" field.

func (*RepositoryUpsertOne) ClearLastEventAt

func (u *RepositoryUpsertOne) ClearLastEventAt() *RepositoryUpsertOne

ClearLastEventAt clears the value of the "last_event_at" field.

func (*RepositoryUpsertOne) ClearLastPushedAt

func (u *RepositoryUpsertOne) ClearLastPushedAt() *RepositoryUpsertOne

ClearLastPushedAt clears the value of the "last_pushed_at" field.

func (*RepositoryUpsertOne) DoNothing

func (u *RepositoryUpsertOne) DoNothing() *RepositoryUpsertOne

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

func (*RepositoryUpsertOne) Exec

Exec executes the query.

func (*RepositoryUpsertOne) ExecX

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

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

func (*RepositoryUpsertOne) ID

func (u *RepositoryUpsertOne) ID(ctx context.Context) (id int64, err error)

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

func (*RepositoryUpsertOne) IDX

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

func (*RepositoryUpsertOne) Ignore

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

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

func (*RepositoryUpsertOne) SetDescription

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

SetDescription sets the "description" field.

func (*RepositoryUpsertOne) SetFullName

func (u *RepositoryUpsertOne) SetFullName(v string) *RepositoryUpsertOne

SetFullName sets the "full_name" field.

func (*RepositoryUpsertOne) SetHTMLURL

SetHTMLURL sets the "html_url" field.

func (*RepositoryUpsertOne) SetLastEventAt

func (u *RepositoryUpsertOne) SetLastEventAt(v time.Time) *RepositoryUpsertOne

SetLastEventAt sets the "last_event_at" field.

func (*RepositoryUpsertOne) SetLastPushedAt

func (u *RepositoryUpsertOne) SetLastPushedAt(v time.Time) *RepositoryUpsertOne

SetLastPushedAt sets the "last_pushed_at" field.

func (*RepositoryUpsertOne) SetName

SetName sets the "name" field.

func (*RepositoryUpsertOne) Update

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

func (*RepositoryUpsertOne) UpdateDescription

func (u *RepositoryUpsertOne) UpdateDescription() *RepositoryUpsertOne

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

func (*RepositoryUpsertOne) UpdateFullName

func (u *RepositoryUpsertOne) UpdateFullName() *RepositoryUpsertOne

UpdateFullName sets the "full_name" field to the value that was provided on create.

func (*RepositoryUpsertOne) UpdateHTMLURL

func (u *RepositoryUpsertOne) UpdateHTMLURL() *RepositoryUpsertOne

UpdateHTMLURL sets the "html_url" field to the value that was provided on create.

func (*RepositoryUpsertOne) UpdateLastEventAt

func (u *RepositoryUpsertOne) UpdateLastEventAt() *RepositoryUpsertOne

UpdateLastEventAt sets the "last_event_at" field to the value that was provided on create.

func (*RepositoryUpsertOne) UpdateLastPushedAt

func (u *RepositoryUpsertOne) UpdateLastPushedAt() *RepositoryUpsertOne

UpdateLastPushedAt sets the "last_pushed_at" field to the value that was provided on create.

func (*RepositoryUpsertOne) UpdateName

func (u *RepositoryUpsertOne) UpdateName() *RepositoryUpsertOne

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

func (*RepositoryUpsertOne) UpdateNewValues

func (u *RepositoryUpsertOne) UpdateNewValues() *RepositoryUpsertOne

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

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

type RollbackFunc

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

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

func (RollbackFunc) Rollback

func (f RollbackFunc) Rollback(ctx context.Context, tx *Tx) error

Rollback calls f(ctx, m).

type RollbackHook

type RollbackHook func(Rollbacker) Rollbacker

RollbackHook defines the "rollback middleware". A function that gets a Rollbacker and returns a Rollbacker. For example:

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

type Rollbacker

type Rollbacker interface {
	Rollback(context.Context, *Tx) error
}

Rollbacker is the interface that wraps the Rollback method.

type TraverseFunc

type TraverseFunc = ent.TraverseFunc

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

type Traverser

type Traverser = ent.Traverser

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

type Tx

type Tx struct {

	// GitCommit is the client for interacting with the GitCommit builders.
	GitCommit *GitCommitClient
	// Organization is the client for interacting with the Organization builders.
	Organization *OrganizationClient
	// Repository is the client for interacting with the Repository builders.
	Repository *RepositoryClient
	// contains filtered or unexported fields
}

Tx is a transactional client that is created by calling Client.Tx().

func TxFromContext

func TxFromContext(ctx context.Context) *Tx

TxFromContext returns a Tx stored inside a context, or nil if there isn't one.

func (*Tx) Client

func (tx *Tx) Client() *Client

Client returns a Client that binds to current transaction.

func (*Tx) Commit

func (tx *Tx) Commit() error

Commit commits the transaction.

func (*Tx) OnCommit

func (tx *Tx) OnCommit(f CommitHook)

OnCommit adds a hook to call on commit.

func (*Tx) OnRollback

func (tx *Tx) OnRollback(f RollbackHook)

OnRollback adds a hook to call on rollback.

func (*Tx) Rollback

func (tx *Tx) Rollback() error

Rollback rollbacks the transaction.

type ValidationError

type ValidationError struct {
	Name string // Field or edge name.
	// contains filtered or unexported fields
}

ValidationError returns when validating a field or edge fails.

func (*ValidationError) Error

func (e *ValidationError) Error() string

Error implements the error interface.

func (*ValidationError) Unwrap

func (e *ValidationError) Unwrap() error

Unwrap implements the errors.Wrapper interface.

type Value

type Value = ent.Value

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL