data

package
v0.0.0-...-312b4c0 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2026 License: Apache-2.0 Imports: 22 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.
	TypeProject         = "Project"
	TypeProjectMember   = "ProjectMember"
	TypeRetentionPolicy = "RetentionPolicy"
	TypeUser            = "User"
)

Variables

View Source
var ErrTxStarted = errors.New("data: 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(data.As(data.Sum(field1), "sum_field1"), (data.As(data.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
	// Project is the client for interacting with the Project builders.
	Project *ProjectClient
	// ProjectMember is the client for interacting with the ProjectMember builders.
	ProjectMember *ProjectMemberClient
	// RetentionPolicy is the client for interacting with the RetentionPolicy builders.
	RetentionPolicy *RetentionPolicyClient
	// User is the client for interacting with the User builders.
	User *UserClient
	// contains filtered or unexported fields
}

Client is the client that holds all ent builders.

func FromContext

func FromContext(ctx context.Context) *Client

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

func NewClient

func NewClient(opts ...Option) *Client

NewClient creates a new client configured with the given options.

func Open

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

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

func (*Client) BeginTx

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

BeginTx returns a transactional client with specified options.

func (*Client) Close

func (c *Client) Close() error

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

func (*Client) Debug

func (c *Client) Debug() *Client

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

client.Debug().
	Project.
	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 Hook

type Hook = ent.Hook

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

type InterceptFunc

type InterceptFunc = ent.InterceptFunc

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

type Interceptor

type Interceptor = ent.Interceptor

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

type MutateFunc

type MutateFunc = ent.MutateFunc

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

type Mutation

type Mutation = ent.Mutation

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

type Mutator

type Mutator = ent.Mutator

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

type NotFoundError

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

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

func (*NotFoundError) Error

func (e *NotFoundError) Error() string

Error implements the error interface.

type NotLoadedError

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

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

func (*NotLoadedError) Error

func (e *NotLoadedError) Error() string

Error implements the error interface.

type NotSingularError

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

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

func (*NotSingularError) Error

func (e *NotSingularError) Error() string

Error implements the error interface.

type Op

type Op = ent.Op

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

type Option

type Option func(*config)

Option function to configure the client.

func Debug

func Debug() Option

Debug enables debug logging on the ent.Driver.

func Driver

func Driver(driver dialect.Driver) Option

Driver configures the client driver.

func Log

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

Log sets the logging function for debug mode.

type OrderFunc

type OrderFunc func(*sql.Selector)

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

type Policy

type Policy = ent.Policy

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

type Project

type Project struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// Project name
	Name string `json:"name,omitempty"`
	// Project description
	Description string `json:"description,omitempty"`
	// Data Source Name for the project
	Dsn string `json:"dsn,omitempty"`
	// Project status: active, inactive, archived
	Status string `json:"status,omitempty"`
	// When the project was created
	CreatedAt time.Time `json:"created_at,omitempty"`
	// When the project was last updated
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the ProjectQuery when eager-loading is set.
	Edges ProjectEdges `json:"edges"`
	// contains filtered or unexported fields
}

Project is the model entity for the Project schema.

func (*Project) QueryMembers

func (_m *Project) QueryMembers() *ProjectMemberQuery

QueryMembers queries the "members" edge of the Project entity.

func (*Project) QueryOwner

func (_m *Project) QueryOwner() *UserQuery

QueryOwner queries the "owner" edge of the Project entity.

func (*Project) QueryRetentionPolicies

func (_m *Project) QueryRetentionPolicies() *RetentionPolicyQuery

QueryRetentionPolicies queries the "retention_policies" edge of the Project entity.

func (*Project) String

func (_m *Project) String() string

String implements the fmt.Stringer.

func (*Project) Unwrap

func (_m *Project) Unwrap() *Project

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

func (_m *Project) Update() *ProjectUpdateOne

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

func (*Project) Value

func (_m *Project) Value(name string) (ent.Value, error)

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

type ProjectClient

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

ProjectClient is a client for the Project schema.

func NewProjectClient

func NewProjectClient(c config) *ProjectClient

NewProjectClient returns a client for the Project from the given config.

func (*ProjectClient) Create

func (c *ProjectClient) Create() *ProjectCreate

Create returns a builder for creating a Project entity.

func (*ProjectClient) CreateBulk

func (c *ProjectClient) CreateBulk(builders ...*ProjectCreate) *ProjectCreateBulk

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

func (*ProjectClient) Delete

func (c *ProjectClient) Delete() *ProjectDelete

Delete returns a delete builder for Project.

func (*ProjectClient) DeleteOne

func (c *ProjectClient) DeleteOne(_m *Project) *ProjectDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*ProjectClient) DeleteOneID

func (c *ProjectClient) DeleteOneID(id int) *ProjectDeleteOne

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

func (*ProjectClient) Get

func (c *ProjectClient) Get(ctx context.Context, id int) (*Project, error)

Get returns a Project entity by its id.

func (*ProjectClient) GetX

func (c *ProjectClient) GetX(ctx context.Context, id int) *Project

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

func (*ProjectClient) Hooks

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

Hooks returns the client hooks.

func (*ProjectClient) Intercept

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

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

func (*ProjectClient) Interceptors

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

Interceptors returns the client interceptors.

func (*ProjectClient) MapCreateBulk

func (c *ProjectClient) MapCreateBulk(slice any, setFunc func(*ProjectCreate, int)) *ProjectCreateBulk

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

func (c *ProjectClient) Query() *ProjectQuery

Query returns a query builder for Project.

func (*ProjectClient) QueryMembers

func (c *ProjectClient) QueryMembers(_m *Project) *ProjectMemberQuery

QueryMembers queries the members edge of a Project.

func (*ProjectClient) QueryOwner

func (c *ProjectClient) QueryOwner(_m *Project) *UserQuery

QueryOwner queries the owner edge of a Project.

func (*ProjectClient) QueryRetentionPolicies

func (c *ProjectClient) QueryRetentionPolicies(_m *Project) *RetentionPolicyQuery

QueryRetentionPolicies queries the retention_policies edge of a Project.

func (*ProjectClient) Update

func (c *ProjectClient) Update() *ProjectUpdate

Update returns an update builder for Project.

func (*ProjectClient) UpdateOne

func (c *ProjectClient) UpdateOne(_m *Project) *ProjectUpdateOne

UpdateOne returns an update builder for the given entity.

func (*ProjectClient) UpdateOneID

func (c *ProjectClient) UpdateOneID(id int) *ProjectUpdateOne

UpdateOneID returns an update builder for the given id.

func (*ProjectClient) Use

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

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

type ProjectCreate

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

ProjectCreate is the builder for creating a Project entity.

func (*ProjectCreate) AddMemberIDs

func (_c *ProjectCreate) AddMemberIDs(ids ...int) *ProjectCreate

AddMemberIDs adds the "members" edge to the ProjectMember entity by IDs.

func (*ProjectCreate) AddMembers

func (_c *ProjectCreate) AddMembers(v ...*ProjectMember) *ProjectCreate

AddMembers adds the "members" edges to the ProjectMember entity.

func (*ProjectCreate) AddRetentionPolicies

func (_c *ProjectCreate) AddRetentionPolicies(v ...*RetentionPolicy) *ProjectCreate

AddRetentionPolicies adds the "retention_policies" edges to the RetentionPolicy entity.

func (*ProjectCreate) AddRetentionPolicyIDs

func (_c *ProjectCreate) AddRetentionPolicyIDs(ids ...int) *ProjectCreate

AddRetentionPolicyIDs adds the "retention_policies" edge to the RetentionPolicy entity by IDs.

func (*ProjectCreate) Exec

func (_c *ProjectCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*ProjectCreate) ExecX

func (_c *ProjectCreate) ExecX(ctx context.Context)

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

func (*ProjectCreate) Mutation

func (_c *ProjectCreate) Mutation() *ProjectMutation

Mutation returns the ProjectMutation object of the builder.

func (*ProjectCreate) Save

func (_c *ProjectCreate) Save(ctx context.Context) (*Project, error)

Save creates the Project in the database.

func (*ProjectCreate) SaveX

func (_c *ProjectCreate) SaveX(ctx context.Context) *Project

SaveX calls Save and panics if Save returns an error.

func (*ProjectCreate) SetCreatedAt

func (_c *ProjectCreate) SetCreatedAt(v time.Time) *ProjectCreate

SetCreatedAt sets the "created_at" field.

func (*ProjectCreate) SetDescription

func (_c *ProjectCreate) SetDescription(v string) *ProjectCreate

SetDescription sets the "description" field.

func (*ProjectCreate) SetDsn

func (_c *ProjectCreate) SetDsn(v string) *ProjectCreate

SetDsn sets the "dsn" field.

func (*ProjectCreate) SetName

func (_c *ProjectCreate) SetName(v string) *ProjectCreate

SetName sets the "name" field.

func (*ProjectCreate) SetNillableCreatedAt

func (_c *ProjectCreate) SetNillableCreatedAt(v *time.Time) *ProjectCreate

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

func (*ProjectCreate) SetNillableDescription

func (_c *ProjectCreate) SetNillableDescription(v *string) *ProjectCreate

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

func (*ProjectCreate) SetNillableStatus

func (_c *ProjectCreate) SetNillableStatus(v *string) *ProjectCreate

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

func (*ProjectCreate) SetNillableUpdatedAt

func (_c *ProjectCreate) SetNillableUpdatedAt(v *time.Time) *ProjectCreate

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

func (*ProjectCreate) SetOwner

func (_c *ProjectCreate) SetOwner(v *User) *ProjectCreate

SetOwner sets the "owner" edge to the User entity.

func (*ProjectCreate) SetOwnerID

func (_c *ProjectCreate) SetOwnerID(id int) *ProjectCreate

SetOwnerID sets the "owner" edge to the User entity by ID.

func (*ProjectCreate) SetStatus

func (_c *ProjectCreate) SetStatus(v string) *ProjectCreate

SetStatus sets the "status" field.

func (*ProjectCreate) SetUpdatedAt

func (_c *ProjectCreate) SetUpdatedAt(v time.Time) *ProjectCreate

SetUpdatedAt sets the "updated_at" field.

type ProjectCreateBulk

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

ProjectCreateBulk is the builder for creating many Project entities in bulk.

func (*ProjectCreateBulk) Exec

func (_c *ProjectCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*ProjectCreateBulk) ExecX

func (_c *ProjectCreateBulk) ExecX(ctx context.Context)

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

func (*ProjectCreateBulk) Save

func (_c *ProjectCreateBulk) Save(ctx context.Context) ([]*Project, error)

Save creates the Project entities in the database.

func (*ProjectCreateBulk) SaveX

func (_c *ProjectCreateBulk) SaveX(ctx context.Context) []*Project

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

type ProjectDelete

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

ProjectDelete is the builder for deleting a Project entity.

func (*ProjectDelete) Exec

func (_d *ProjectDelete) Exec(ctx context.Context) (int, error)

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

func (*ProjectDelete) ExecX

func (_d *ProjectDelete) ExecX(ctx context.Context) int

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

func (*ProjectDelete) Where

func (_d *ProjectDelete) Where(ps ...predicate.Project) *ProjectDelete

Where appends a list predicates to the ProjectDelete builder.

type ProjectDeleteOne

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

ProjectDeleteOne is the builder for deleting a single Project entity.

func (*ProjectDeleteOne) Exec

func (_d *ProjectDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*ProjectDeleteOne) ExecX

func (_d *ProjectDeleteOne) ExecX(ctx context.Context)

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

func (*ProjectDeleteOne) Where

Where appends a list predicates to the ProjectDelete builder.

type ProjectEdges

type ProjectEdges struct {
	// User who owns this project
	Owner *User `json:"owner,omitempty"`
	// Retention policies for this project
	RetentionPolicies []*RetentionPolicy `json:"retention_policies,omitempty"`
	// Members of this project
	Members []*ProjectMember `json:"members,omitempty"`
	// contains filtered or unexported fields
}

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

func (ProjectEdges) MembersOrErr

func (e ProjectEdges) MembersOrErr() ([]*ProjectMember, error)

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

func (ProjectEdges) OwnerOrErr

func (e ProjectEdges) OwnerOrErr() (*User, error)

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

func (ProjectEdges) RetentionPoliciesOrErr

func (e ProjectEdges) RetentionPoliciesOrErr() ([]*RetentionPolicy, error)

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

type ProjectGroupBy

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

ProjectGroupBy is the group-by builder for Project entities.

func (*ProjectGroupBy) Aggregate

func (_g *ProjectGroupBy) Aggregate(fns ...AggregateFunc) *ProjectGroupBy

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

func (*ProjectGroupBy) Bool

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

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

func (*ProjectGroupBy) BoolX

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

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

func (*ProjectGroupBy) Bools

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

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

func (*ProjectGroupBy) BoolsX

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

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

func (*ProjectGroupBy) Float64

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

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

func (*ProjectGroupBy) Float64X

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

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

func (*ProjectGroupBy) Float64s

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

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

func (*ProjectGroupBy) Float64sX

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

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

func (*ProjectGroupBy) Int

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

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

func (*ProjectGroupBy) IntX

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

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

func (*ProjectGroupBy) Ints

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

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

func (*ProjectGroupBy) IntsX

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

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

func (*ProjectGroupBy) Scan

func (_g *ProjectGroupBy) Scan(ctx context.Context, v any) error

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

func (*ProjectGroupBy) ScanX

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

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

func (*ProjectGroupBy) String

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

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

func (*ProjectGroupBy) StringX

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

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

func (*ProjectGroupBy) Strings

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

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

func (*ProjectGroupBy) StringsX

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

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

type ProjectMember

type ProjectMember struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// The project this membership belongs to
	ProjectID int `json:"project_id,omitempty"`
	// The user this membership belongs to
	UserID int `json:"user_id,omitempty"`
	// Member role: owner, editor, viewer
	Role string `json:"role,omitempty"`
	// When the membership was created
	CreatedAt time.Time `json:"created_at,omitempty"`
	// When the membership was last updated
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the ProjectMemberQuery when eager-loading is set.
	Edges ProjectMemberEdges `json:"edges"`
	// contains filtered or unexported fields
}

ProjectMember is the model entity for the ProjectMember schema.

func (*ProjectMember) QueryProject

func (_m *ProjectMember) QueryProject() *ProjectQuery

QueryProject queries the "project" edge of the ProjectMember entity.

func (*ProjectMember) QueryUser

func (_m *ProjectMember) QueryUser() *UserQuery

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

func (*ProjectMember) String

func (_m *ProjectMember) String() string

String implements the fmt.Stringer.

func (*ProjectMember) Unwrap

func (_m *ProjectMember) Unwrap() *ProjectMember

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

func (_m *ProjectMember) Update() *ProjectMemberUpdateOne

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

func (*ProjectMember) Value

func (_m *ProjectMember) Value(name string) (ent.Value, error)

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

type ProjectMemberClient

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

ProjectMemberClient is a client for the ProjectMember schema.

func NewProjectMemberClient

func NewProjectMemberClient(c config) *ProjectMemberClient

NewProjectMemberClient returns a client for the ProjectMember from the given config.

func (*ProjectMemberClient) Create

Create returns a builder for creating a ProjectMember entity.

func (*ProjectMemberClient) CreateBulk

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

func (*ProjectMemberClient) Delete

Delete returns a delete builder for ProjectMember.

func (*ProjectMemberClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*ProjectMemberClient) DeleteOneID

func (c *ProjectMemberClient) DeleteOneID(id int) *ProjectMemberDeleteOne

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

func (*ProjectMemberClient) Get

Get returns a ProjectMember entity by its id.

func (*ProjectMemberClient) GetX

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

func (*ProjectMemberClient) Hooks

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

Hooks returns the client hooks.

func (*ProjectMemberClient) Intercept

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

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

func (*ProjectMemberClient) Interceptors

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

Interceptors returns the client interceptors.

func (*ProjectMemberClient) MapCreateBulk

func (c *ProjectMemberClient) MapCreateBulk(slice any, setFunc func(*ProjectMemberCreate, int)) *ProjectMemberCreateBulk

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

Query returns a query builder for ProjectMember.

func (*ProjectMemberClient) QueryProject

func (c *ProjectMemberClient) QueryProject(_m *ProjectMember) *ProjectQuery

QueryProject queries the project edge of a ProjectMember.

func (*ProjectMemberClient) QueryUser

func (c *ProjectMemberClient) QueryUser(_m *ProjectMember) *UserQuery

QueryUser queries the user edge of a ProjectMember.

func (*ProjectMemberClient) Update

Update returns an update builder for ProjectMember.

func (*ProjectMemberClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*ProjectMemberClient) UpdateOneID

func (c *ProjectMemberClient) UpdateOneID(id int) *ProjectMemberUpdateOne

UpdateOneID returns an update builder for the given id.

func (*ProjectMemberClient) Use

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

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

type ProjectMemberCreate

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

ProjectMemberCreate is the builder for creating a ProjectMember entity.

func (*ProjectMemberCreate) Exec

func (_c *ProjectMemberCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*ProjectMemberCreate) ExecX

func (_c *ProjectMemberCreate) ExecX(ctx context.Context)

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

func (*ProjectMemberCreate) Mutation

Mutation returns the ProjectMemberMutation object of the builder.

func (*ProjectMemberCreate) Save

Save creates the ProjectMember in the database.

func (*ProjectMemberCreate) SaveX

SaveX calls Save and panics if Save returns an error.

func (*ProjectMemberCreate) SetCreatedAt

func (_c *ProjectMemberCreate) SetCreatedAt(v time.Time) *ProjectMemberCreate

SetCreatedAt sets the "created_at" field.

func (*ProjectMemberCreate) SetNillableCreatedAt

func (_c *ProjectMemberCreate) SetNillableCreatedAt(v *time.Time) *ProjectMemberCreate

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

func (*ProjectMemberCreate) SetNillableRole

func (_c *ProjectMemberCreate) SetNillableRole(v *string) *ProjectMemberCreate

SetNillableRole sets the "role" field if the given value is not nil.

func (*ProjectMemberCreate) SetNillableUpdatedAt

func (_c *ProjectMemberCreate) SetNillableUpdatedAt(v *time.Time) *ProjectMemberCreate

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

func (*ProjectMemberCreate) SetProject

func (_c *ProjectMemberCreate) SetProject(v *Project) *ProjectMemberCreate

SetProject sets the "project" edge to the Project entity.

func (*ProjectMemberCreate) SetProjectID

func (_c *ProjectMemberCreate) SetProjectID(v int) *ProjectMemberCreate

SetProjectID sets the "project_id" field.

func (*ProjectMemberCreate) SetRole

SetRole sets the "role" field.

func (*ProjectMemberCreate) SetUpdatedAt

func (_c *ProjectMemberCreate) SetUpdatedAt(v time.Time) *ProjectMemberCreate

SetUpdatedAt sets the "updated_at" field.

func (*ProjectMemberCreate) SetUser

func (_c *ProjectMemberCreate) SetUser(v *User) *ProjectMemberCreate

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

func (*ProjectMemberCreate) SetUserID

func (_c *ProjectMemberCreate) SetUserID(v int) *ProjectMemberCreate

SetUserID sets the "user_id" field.

type ProjectMemberCreateBulk

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

ProjectMemberCreateBulk is the builder for creating many ProjectMember entities in bulk.

func (*ProjectMemberCreateBulk) Exec

Exec executes the query.

func (*ProjectMemberCreateBulk) ExecX

func (_c *ProjectMemberCreateBulk) ExecX(ctx context.Context)

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

func (*ProjectMemberCreateBulk) Save

Save creates the ProjectMember entities in the database.

func (*ProjectMemberCreateBulk) SaveX

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

type ProjectMemberDelete

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

ProjectMemberDelete is the builder for deleting a ProjectMember entity.

func (*ProjectMemberDelete) Exec

func (_d *ProjectMemberDelete) Exec(ctx context.Context) (int, error)

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

func (*ProjectMemberDelete) ExecX

func (_d *ProjectMemberDelete) ExecX(ctx context.Context) int

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

func (*ProjectMemberDelete) Where

Where appends a list predicates to the ProjectMemberDelete builder.

type ProjectMemberDeleteOne

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

ProjectMemberDeleteOne is the builder for deleting a single ProjectMember entity.

func (*ProjectMemberDeleteOne) Exec

Exec executes the deletion query.

func (*ProjectMemberDeleteOne) ExecX

func (_d *ProjectMemberDeleteOne) ExecX(ctx context.Context)

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

func (*ProjectMemberDeleteOne) Where

Where appends a list predicates to the ProjectMemberDelete builder.

type ProjectMemberEdges

type ProjectMemberEdges struct {
	// The project this membership belongs to
	Project *Project `json:"project,omitempty"`
	// The user this membership belongs to
	User *User `json:"user,omitempty"`
	// contains filtered or unexported fields
}

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

func (ProjectMemberEdges) ProjectOrErr

func (e ProjectMemberEdges) ProjectOrErr() (*Project, error)

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

func (ProjectMemberEdges) UserOrErr

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

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

type ProjectMemberGroupBy

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

ProjectMemberGroupBy is the group-by builder for ProjectMember entities.

func (*ProjectMemberGroupBy) Aggregate

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

func (*ProjectMemberGroupBy) Bool

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

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

func (*ProjectMemberGroupBy) BoolX

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

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

func (*ProjectMemberGroupBy) Bools

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

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

func (*ProjectMemberGroupBy) BoolsX

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

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

func (*ProjectMemberGroupBy) Float64

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

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

func (*ProjectMemberGroupBy) Float64X

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

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

func (*ProjectMemberGroupBy) Float64s

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

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

func (*ProjectMemberGroupBy) Float64sX

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

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

func (*ProjectMemberGroupBy) Int

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

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

func (*ProjectMemberGroupBy) IntX

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

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

func (*ProjectMemberGroupBy) Ints

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

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

func (*ProjectMemberGroupBy) IntsX

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

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

func (*ProjectMemberGroupBy) Scan

func (_g *ProjectMemberGroupBy) Scan(ctx context.Context, v any) error

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

func (*ProjectMemberGroupBy) ScanX

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

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

func (*ProjectMemberGroupBy) String

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

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

func (*ProjectMemberGroupBy) StringX

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

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

func (*ProjectMemberGroupBy) Strings

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

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

func (*ProjectMemberGroupBy) StringsX

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

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

type ProjectMemberMutation

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

ProjectMemberMutation represents an operation that mutates the ProjectMember nodes in the graph.

func (*ProjectMemberMutation) AddField

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

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

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

func (*ProjectMemberMutation) AddedField

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

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

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

func (*ProjectMemberMutation) AddedIDs

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

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

func (*ProjectMemberMutation) ClearEdge

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

func (m *ProjectMemberMutation) 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 (*ProjectMemberMutation) ClearProject

func (m *ProjectMemberMutation) ClearProject()

ClearProject clears the "project" edge to the Project entity.

func (*ProjectMemberMutation) ClearUser

func (m *ProjectMemberMutation) ClearUser()

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

func (*ProjectMemberMutation) ClearedEdges

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

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

func (*ProjectMemberMutation) ClearedFields

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

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

func (ProjectMemberMutation) Client

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

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

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

func (*ProjectMemberMutation) EdgeCleared

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

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

func (*ProjectMemberMutation) Field

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

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

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

func (*ProjectMemberMutation) Fields

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

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

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

func (*ProjectMemberMutation) IDs

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

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

func (*ProjectMemberMutation) OldCreatedAt

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

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

func (m *ProjectMemberMutation) 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 (*ProjectMemberMutation) OldProjectID

func (m *ProjectMemberMutation) OldProjectID(ctx context.Context) (v int, err error)

OldProjectID returns the old "project_id" field's value of the ProjectMember entity. If the ProjectMember 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 (*ProjectMemberMutation) OldRole

func (m *ProjectMemberMutation) OldRole(ctx context.Context) (v string, err error)

OldRole returns the old "role" field's value of the ProjectMember entity. If the ProjectMember 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 (*ProjectMemberMutation) OldUpdatedAt

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

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

func (m *ProjectMemberMutation) OldUserID(ctx context.Context) (v int, err error)

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

func (m *ProjectMemberMutation) Op() Op

Op returns the operation name.

func (*ProjectMemberMutation) ProjectCleared

func (m *ProjectMemberMutation) ProjectCleared() bool

ProjectCleared reports if the "project" edge to the Project entity was cleared.

func (*ProjectMemberMutation) ProjectID

func (m *ProjectMemberMutation) ProjectID() (r int, exists bool)

ProjectID returns the value of the "project_id" field in the mutation.

func (*ProjectMemberMutation) ProjectIDs

func (m *ProjectMemberMutation) ProjectIDs() (ids []int)

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

func (*ProjectMemberMutation) RemovedEdges

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

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

func (*ProjectMemberMutation) RemovedIDs

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

func (m *ProjectMemberMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*ProjectMemberMutation) ResetEdge

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

func (m *ProjectMemberMutation) 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 (*ProjectMemberMutation) ResetProject

func (m *ProjectMemberMutation) ResetProject()

ResetProject resets all changes to the "project" edge.

func (*ProjectMemberMutation) ResetProjectID

func (m *ProjectMemberMutation) ResetProjectID()

ResetProjectID resets all changes to the "project_id" field.

func (*ProjectMemberMutation) ResetRole

func (m *ProjectMemberMutation) ResetRole()

ResetRole resets all changes to the "role" field.

func (*ProjectMemberMutation) ResetUpdatedAt

func (m *ProjectMemberMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*ProjectMemberMutation) ResetUser

func (m *ProjectMemberMutation) ResetUser()

ResetUser resets all changes to the "user" edge.

func (*ProjectMemberMutation) ResetUserID

func (m *ProjectMemberMutation) ResetUserID()

ResetUserID resets all changes to the "user_id" field.

func (*ProjectMemberMutation) Role

func (m *ProjectMemberMutation) Role() (r string, exists bool)

Role returns the value of the "role" field in the mutation.

func (*ProjectMemberMutation) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*ProjectMemberMutation) SetField

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

func (m *ProjectMemberMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*ProjectMemberMutation) SetProjectID

func (m *ProjectMemberMutation) SetProjectID(i int)

SetProjectID sets the "project_id" field.

func (*ProjectMemberMutation) SetRole

func (m *ProjectMemberMutation) SetRole(s string)

SetRole sets the "role" field.

func (*ProjectMemberMutation) SetUpdatedAt

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

SetUpdatedAt sets the "updated_at" field.

func (*ProjectMemberMutation) SetUserID

func (m *ProjectMemberMutation) SetUserID(i int)

SetUserID sets the "user_id" field.

func (ProjectMemberMutation) Tx

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

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

func (*ProjectMemberMutation) Type

func (m *ProjectMemberMutation) Type() string

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

func (*ProjectMemberMutation) UpdatedAt

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

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

func (*ProjectMemberMutation) UserCleared

func (m *ProjectMemberMutation) UserCleared() bool

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

func (*ProjectMemberMutation) UserID

func (m *ProjectMemberMutation) UserID() (r int, exists bool)

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

func (*ProjectMemberMutation) UserIDs

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

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

func (*ProjectMemberMutation) Where

Where appends a list predicates to the ProjectMemberMutation builder.

func (*ProjectMemberMutation) WhereP

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

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

type ProjectMemberQuery

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

ProjectMemberQuery is the builder for querying ProjectMember entities.

func (*ProjectMemberQuery) Aggregate

func (_q *ProjectMemberQuery) Aggregate(fns ...AggregateFunc) *ProjectMemberSelect

Aggregate returns a ProjectMemberSelect configured with the given aggregations.

func (*ProjectMemberQuery) All

All executes the query and returns a list of ProjectMembers.

func (*ProjectMemberQuery) AllX

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

func (*ProjectMemberQuery) Clone

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

func (*ProjectMemberQuery) Count

func (_q *ProjectMemberQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*ProjectMemberQuery) CountX

func (_q *ProjectMemberQuery) CountX(ctx context.Context) int

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

func (*ProjectMemberQuery) Exist

func (_q *ProjectMemberQuery) Exist(ctx context.Context) (bool, error)

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

func (*ProjectMemberQuery) ExistX

func (_q *ProjectMemberQuery) ExistX(ctx context.Context) bool

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

func (*ProjectMemberQuery) First

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

func (*ProjectMemberQuery) FirstID

func (_q *ProjectMemberQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*ProjectMemberQuery) FirstIDX

func (_q *ProjectMemberQuery) FirstIDX(ctx context.Context) int

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

func (*ProjectMemberQuery) FirstX

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

func (*ProjectMemberQuery) GroupBy

func (_q *ProjectMemberQuery) GroupBy(field string, fields ...string) *ProjectMemberGroupBy

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 {
	ProjectID int `json:"project_id,omitempty"`
	Count int `json:"count,omitempty"`
}

client.ProjectMember.Query().
	GroupBy(projectmember.FieldProjectID).
	Aggregate(data.Count()).
	Scan(ctx, &v)

func (*ProjectMemberQuery) IDs

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

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

func (*ProjectMemberQuery) IDsX

func (_q *ProjectMemberQuery) IDsX(ctx context.Context) []int

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

func (*ProjectMemberQuery) Limit

func (_q *ProjectMemberQuery) Limit(limit int) *ProjectMemberQuery

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

func (*ProjectMemberQuery) Offset

func (_q *ProjectMemberQuery) Offset(offset int) *ProjectMemberQuery

Offset to start from.

func (*ProjectMemberQuery) Only

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

func (*ProjectMemberQuery) OnlyID

func (_q *ProjectMemberQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*ProjectMemberQuery) OnlyIDX

func (_q *ProjectMemberQuery) OnlyIDX(ctx context.Context) int

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

func (*ProjectMemberQuery) OnlyX

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

func (*ProjectMemberQuery) Order

Order specifies how the records should be ordered.

func (*ProjectMemberQuery) QueryProject

func (_q *ProjectMemberQuery) QueryProject() *ProjectQuery

QueryProject chains the current query on the "project" edge.

func (*ProjectMemberQuery) QueryUser

func (_q *ProjectMemberQuery) QueryUser() *UserQuery

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

func (*ProjectMemberQuery) Select

func (_q *ProjectMemberQuery) Select(fields ...string) *ProjectMemberSelect

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 {
	ProjectID int `json:"project_id,omitempty"`
}

client.ProjectMember.Query().
	Select(projectmember.FieldProjectID).
	Scan(ctx, &v)

func (*ProjectMemberQuery) Unique

func (_q *ProjectMemberQuery) Unique(unique bool) *ProjectMemberQuery

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

Where adds a new predicate for the ProjectMemberQuery builder.

func (*ProjectMemberQuery) WithProject

func (_q *ProjectMemberQuery) WithProject(opts ...func(*ProjectQuery)) *ProjectMemberQuery

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

func (*ProjectMemberQuery) WithUser

func (_q *ProjectMemberQuery) WithUser(opts ...func(*UserQuery)) *ProjectMemberQuery

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

type ProjectMemberSelect

type ProjectMemberSelect struct {
	*ProjectMemberQuery
	// contains filtered or unexported fields
}

ProjectMemberSelect is the builder for selecting fields of ProjectMember entities.

func (*ProjectMemberSelect) Aggregate

func (_s *ProjectMemberSelect) Aggregate(fns ...AggregateFunc) *ProjectMemberSelect

Aggregate adds the given aggregation functions to the selector query.

func (*ProjectMemberSelect) Bool

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

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

func (*ProjectMemberSelect) BoolX

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

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

func (*ProjectMemberSelect) Bools

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

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

func (*ProjectMemberSelect) BoolsX

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

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

func (*ProjectMemberSelect) Float64

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

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

func (*ProjectMemberSelect) Float64X

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

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

func (*ProjectMemberSelect) Float64s

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

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

func (*ProjectMemberSelect) Float64sX

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

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

func (*ProjectMemberSelect) Int

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

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

func (*ProjectMemberSelect) IntX

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

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

func (*ProjectMemberSelect) Ints

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

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

func (*ProjectMemberSelect) IntsX

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

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

func (*ProjectMemberSelect) Scan

func (_s *ProjectMemberSelect) Scan(ctx context.Context, v any) error

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

func (*ProjectMemberSelect) ScanX

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

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

func (*ProjectMemberSelect) String

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

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

func (*ProjectMemberSelect) StringX

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

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

func (*ProjectMemberSelect) Strings

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

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

func (*ProjectMemberSelect) StringsX

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

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

type ProjectMemberUpdate

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

ProjectMemberUpdate is the builder for updating ProjectMember entities.

func (*ProjectMemberUpdate) ClearProject

func (_u *ProjectMemberUpdate) ClearProject() *ProjectMemberUpdate

ClearProject clears the "project" edge to the Project entity.

func (*ProjectMemberUpdate) ClearUser

func (_u *ProjectMemberUpdate) ClearUser() *ProjectMemberUpdate

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

func (*ProjectMemberUpdate) Exec

func (_u *ProjectMemberUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*ProjectMemberUpdate) ExecX

func (_u *ProjectMemberUpdate) ExecX(ctx context.Context)

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

func (*ProjectMemberUpdate) Mutation

Mutation returns the ProjectMemberMutation object of the builder.

func (*ProjectMemberUpdate) Save

func (_u *ProjectMemberUpdate) Save(ctx context.Context) (int, error)

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

func (*ProjectMemberUpdate) SaveX

func (_u *ProjectMemberUpdate) SaveX(ctx context.Context) int

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

func (*ProjectMemberUpdate) SetNillableProjectID

func (_u *ProjectMemberUpdate) SetNillableProjectID(v *int) *ProjectMemberUpdate

SetNillableProjectID sets the "project_id" field if the given value is not nil.

func (*ProjectMemberUpdate) SetNillableRole

func (_u *ProjectMemberUpdate) SetNillableRole(v *string) *ProjectMemberUpdate

SetNillableRole sets the "role" field if the given value is not nil.

func (*ProjectMemberUpdate) SetNillableUserID

func (_u *ProjectMemberUpdate) SetNillableUserID(v *int) *ProjectMemberUpdate

SetNillableUserID sets the "user_id" field if the given value is not nil.

func (*ProjectMemberUpdate) SetProject

func (_u *ProjectMemberUpdate) SetProject(v *Project) *ProjectMemberUpdate

SetProject sets the "project" edge to the Project entity.

func (*ProjectMemberUpdate) SetProjectID

func (_u *ProjectMemberUpdate) SetProjectID(v int) *ProjectMemberUpdate

SetProjectID sets the "project_id" field.

func (*ProjectMemberUpdate) SetRole

SetRole sets the "role" field.

func (*ProjectMemberUpdate) SetUpdatedAt

func (_u *ProjectMemberUpdate) SetUpdatedAt(v time.Time) *ProjectMemberUpdate

SetUpdatedAt sets the "updated_at" field.

func (*ProjectMemberUpdate) SetUser

func (_u *ProjectMemberUpdate) SetUser(v *User) *ProjectMemberUpdate

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

func (*ProjectMemberUpdate) SetUserID

func (_u *ProjectMemberUpdate) SetUserID(v int) *ProjectMemberUpdate

SetUserID sets the "user_id" field.

func (*ProjectMemberUpdate) Where

Where appends a list predicates to the ProjectMemberUpdate builder.

type ProjectMemberUpdateOne

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

ProjectMemberUpdateOne is the builder for updating a single ProjectMember entity.

func (*ProjectMemberUpdateOne) ClearProject

func (_u *ProjectMemberUpdateOne) ClearProject() *ProjectMemberUpdateOne

ClearProject clears the "project" edge to the Project entity.

func (*ProjectMemberUpdateOne) ClearUser

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

func (*ProjectMemberUpdateOne) Exec

Exec executes the query on the entity.

func (*ProjectMemberUpdateOne) ExecX

func (_u *ProjectMemberUpdateOne) ExecX(ctx context.Context)

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

func (*ProjectMemberUpdateOne) Mutation

Mutation returns the ProjectMemberMutation object of the builder.

func (*ProjectMemberUpdateOne) Save

Save executes the query and returns the updated ProjectMember entity.

func (*ProjectMemberUpdateOne) SaveX

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

func (*ProjectMemberUpdateOne) Select

func (_u *ProjectMemberUpdateOne) Select(field string, fields ...string) *ProjectMemberUpdateOne

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

func (*ProjectMemberUpdateOne) SetNillableProjectID

func (_u *ProjectMemberUpdateOne) SetNillableProjectID(v *int) *ProjectMemberUpdateOne

SetNillableProjectID sets the "project_id" field if the given value is not nil.

func (*ProjectMemberUpdateOne) SetNillableRole

func (_u *ProjectMemberUpdateOne) SetNillableRole(v *string) *ProjectMemberUpdateOne

SetNillableRole sets the "role" field if the given value is not nil.

func (*ProjectMemberUpdateOne) SetNillableUserID

func (_u *ProjectMemberUpdateOne) SetNillableUserID(v *int) *ProjectMemberUpdateOne

SetNillableUserID sets the "user_id" field if the given value is not nil.

func (*ProjectMemberUpdateOne) SetProject

SetProject sets the "project" edge to the Project entity.

func (*ProjectMemberUpdateOne) SetProjectID

func (_u *ProjectMemberUpdateOne) SetProjectID(v int) *ProjectMemberUpdateOne

SetProjectID sets the "project_id" field.

func (*ProjectMemberUpdateOne) SetRole

SetRole sets the "role" field.

func (*ProjectMemberUpdateOne) SetUpdatedAt

SetUpdatedAt sets the "updated_at" field.

func (*ProjectMemberUpdateOne) SetUser

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

func (*ProjectMemberUpdateOne) SetUserID

SetUserID sets the "user_id" field.

func (*ProjectMemberUpdateOne) Where

Where appends a list predicates to the ProjectMemberUpdate builder.

type ProjectMembers

type ProjectMembers []*ProjectMember

ProjectMembers is a parsable slice of ProjectMember.

type ProjectMutation

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

ProjectMutation represents an operation that mutates the Project nodes in the graph.

func (*ProjectMutation) AddField

func (m *ProjectMutation) 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 (*ProjectMutation) AddMemberIDs

func (m *ProjectMutation) AddMemberIDs(ids ...int)

AddMemberIDs adds the "members" edge to the ProjectMember entity by ids.

func (*ProjectMutation) AddRetentionPolicyIDs

func (m *ProjectMutation) AddRetentionPolicyIDs(ids ...int)

AddRetentionPolicyIDs adds the "retention_policies" edge to the RetentionPolicy entity by ids.

func (*ProjectMutation) AddedEdges

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

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

func (*ProjectMutation) AddedField

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

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

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

func (*ProjectMutation) AddedIDs

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

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

func (*ProjectMutation) ClearDescription

func (m *ProjectMutation) ClearDescription()

ClearDescription clears the value of the "description" field.

func (*ProjectMutation) ClearEdge

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

func (m *ProjectMutation) 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 (*ProjectMutation) ClearMembers

func (m *ProjectMutation) ClearMembers()

ClearMembers clears the "members" edge to the ProjectMember entity.

func (*ProjectMutation) ClearOwner

func (m *ProjectMutation) ClearOwner()

ClearOwner clears the "owner" edge to the User entity.

func (*ProjectMutation) ClearRetentionPolicies

func (m *ProjectMutation) ClearRetentionPolicies()

ClearRetentionPolicies clears the "retention_policies" edge to the RetentionPolicy entity.

func (*ProjectMutation) ClearedEdges

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

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

func (*ProjectMutation) ClearedFields

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

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

func (ProjectMutation) Client

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

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

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

func (*ProjectMutation) Description

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

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

func (*ProjectMutation) DescriptionCleared

func (m *ProjectMutation) DescriptionCleared() bool

DescriptionCleared returns if the "description" field was cleared in this mutation.

func (*ProjectMutation) Dsn

func (m *ProjectMutation) Dsn() (r string, exists bool)

Dsn returns the value of the "dsn" field in the mutation.

func (*ProjectMutation) EdgeCleared

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

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

func (*ProjectMutation) Field

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

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

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

func (*ProjectMutation) Fields

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

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

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

func (*ProjectMutation) IDs

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

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

func (*ProjectMutation) MembersCleared

func (m *ProjectMutation) MembersCleared() bool

MembersCleared reports if the "members" edge to the ProjectMember entity was cleared.

func (*ProjectMutation) MembersIDs

func (m *ProjectMutation) MembersIDs() (ids []int)

MembersIDs returns the "members" edge IDs in the mutation.

func (*ProjectMutation) Name

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

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

func (*ProjectMutation) OldCreatedAt

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

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

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

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

func (m *ProjectMutation) OldDsn(ctx context.Context) (v string, err error)

OldDsn returns the old "dsn" field's value of the Project entity. If the Project 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 (*ProjectMutation) OldField

func (m *ProjectMutation) 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 (*ProjectMutation) OldName

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

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

func (m *ProjectMutation) OldStatus(ctx context.Context) (v string, err error)

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

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

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

func (m *ProjectMutation) Op() Op

Op returns the operation name.

func (*ProjectMutation) OwnerCleared

func (m *ProjectMutation) OwnerCleared() bool

OwnerCleared reports if the "owner" edge to the User entity was cleared.

func (*ProjectMutation) OwnerID

func (m *ProjectMutation) OwnerID() (id int, exists bool)

OwnerID returns the "owner" edge ID in the mutation.

func (*ProjectMutation) OwnerIDs

func (m *ProjectMutation) OwnerIDs() (ids []int)

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

func (*ProjectMutation) RemoveMemberIDs

func (m *ProjectMutation) RemoveMemberIDs(ids ...int)

RemoveMemberIDs removes the "members" edge to the ProjectMember entity by IDs.

func (*ProjectMutation) RemoveRetentionPolicyIDs

func (m *ProjectMutation) RemoveRetentionPolicyIDs(ids ...int)

RemoveRetentionPolicyIDs removes the "retention_policies" edge to the RetentionPolicy entity by IDs.

func (*ProjectMutation) RemovedEdges

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

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

func (*ProjectMutation) RemovedIDs

func (m *ProjectMutation) 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 (*ProjectMutation) RemovedMembersIDs

func (m *ProjectMutation) RemovedMembersIDs() (ids []int)

RemovedMembers returns the removed IDs of the "members" edge to the ProjectMember entity.

func (*ProjectMutation) RemovedRetentionPoliciesIDs

func (m *ProjectMutation) RemovedRetentionPoliciesIDs() (ids []int)

RemovedRetentionPolicies returns the removed IDs of the "retention_policies" edge to the RetentionPolicy entity.

func (*ProjectMutation) ResetCreatedAt

func (m *ProjectMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*ProjectMutation) ResetDescription

func (m *ProjectMutation) ResetDescription()

ResetDescription resets all changes to the "description" field.

func (*ProjectMutation) ResetDsn

func (m *ProjectMutation) ResetDsn()

ResetDsn resets all changes to the "dsn" field.

func (*ProjectMutation) ResetEdge

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

func (m *ProjectMutation) 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 (*ProjectMutation) ResetMembers

func (m *ProjectMutation) ResetMembers()

ResetMembers resets all changes to the "members" edge.

func (*ProjectMutation) ResetName

func (m *ProjectMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*ProjectMutation) ResetOwner

func (m *ProjectMutation) ResetOwner()

ResetOwner resets all changes to the "owner" edge.

func (*ProjectMutation) ResetRetentionPolicies

func (m *ProjectMutation) ResetRetentionPolicies()

ResetRetentionPolicies resets all changes to the "retention_policies" edge.

func (*ProjectMutation) ResetStatus

func (m *ProjectMutation) ResetStatus()

ResetStatus resets all changes to the "status" field.

func (*ProjectMutation) ResetUpdatedAt

func (m *ProjectMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*ProjectMutation) RetentionPoliciesCleared

func (m *ProjectMutation) RetentionPoliciesCleared() bool

RetentionPoliciesCleared reports if the "retention_policies" edge to the RetentionPolicy entity was cleared.

func (*ProjectMutation) RetentionPoliciesIDs

func (m *ProjectMutation) RetentionPoliciesIDs() (ids []int)

RetentionPoliciesIDs returns the "retention_policies" edge IDs in the mutation.

func (*ProjectMutation) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*ProjectMutation) SetDescription

func (m *ProjectMutation) SetDescription(s string)

SetDescription sets the "description" field.

func (*ProjectMutation) SetDsn

func (m *ProjectMutation) SetDsn(s string)

SetDsn sets the "dsn" field.

func (*ProjectMutation) SetField

func (m *ProjectMutation) 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 (*ProjectMutation) SetName

func (m *ProjectMutation) SetName(s string)

SetName sets the "name" field.

func (*ProjectMutation) SetOp

func (m *ProjectMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*ProjectMutation) SetOwnerID

func (m *ProjectMutation) SetOwnerID(id int)

SetOwnerID sets the "owner" edge to the User entity by id.

func (*ProjectMutation) SetStatus

func (m *ProjectMutation) SetStatus(s string)

SetStatus sets the "status" field.

func (*ProjectMutation) SetUpdatedAt

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

SetUpdatedAt sets the "updated_at" field.

func (*ProjectMutation) Status

func (m *ProjectMutation) Status() (r string, exists bool)

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

func (ProjectMutation) Tx

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

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

func (*ProjectMutation) Type

func (m *ProjectMutation) Type() string

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

func (*ProjectMutation) UpdatedAt

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

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

func (*ProjectMutation) Where

func (m *ProjectMutation) Where(ps ...predicate.Project)

Where appends a list predicates to the ProjectMutation builder.

func (*ProjectMutation) WhereP

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

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

type ProjectQuery

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

ProjectQuery is the builder for querying Project entities.

func (*ProjectQuery) Aggregate

func (_q *ProjectQuery) Aggregate(fns ...AggregateFunc) *ProjectSelect

Aggregate returns a ProjectSelect configured with the given aggregations.

func (*ProjectQuery) All

func (_q *ProjectQuery) All(ctx context.Context) ([]*Project, error)

All executes the query and returns a list of Projects.

func (*ProjectQuery) AllX

func (_q *ProjectQuery) AllX(ctx context.Context) []*Project

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

func (*ProjectQuery) Clone

func (_q *ProjectQuery) Clone() *ProjectQuery

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

func (*ProjectQuery) Count

func (_q *ProjectQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*ProjectQuery) CountX

func (_q *ProjectQuery) CountX(ctx context.Context) int

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

func (*ProjectQuery) Exist

func (_q *ProjectQuery) Exist(ctx context.Context) (bool, error)

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

func (*ProjectQuery) ExistX

func (_q *ProjectQuery) ExistX(ctx context.Context) bool

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

func (*ProjectQuery) First

func (_q *ProjectQuery) First(ctx context.Context) (*Project, error)

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

func (*ProjectQuery) FirstID

func (_q *ProjectQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*ProjectQuery) FirstIDX

func (_q *ProjectQuery) FirstIDX(ctx context.Context) int

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

func (*ProjectQuery) FirstX

func (_q *ProjectQuery) FirstX(ctx context.Context) *Project

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

func (*ProjectQuery) GroupBy

func (_q *ProjectQuery) GroupBy(field string, fields ...string) *ProjectGroupBy

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.Project.Query().
	GroupBy(project.FieldName).
	Aggregate(data.Count()).
	Scan(ctx, &v)

func (*ProjectQuery) IDs

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

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

func (*ProjectQuery) IDsX

func (_q *ProjectQuery) IDsX(ctx context.Context) []int

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

func (*ProjectQuery) Limit

func (_q *ProjectQuery) Limit(limit int) *ProjectQuery

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

func (*ProjectQuery) Offset

func (_q *ProjectQuery) Offset(offset int) *ProjectQuery

Offset to start from.

func (*ProjectQuery) Only

func (_q *ProjectQuery) Only(ctx context.Context) (*Project, error)

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

func (*ProjectQuery) OnlyID

func (_q *ProjectQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*ProjectQuery) OnlyIDX

func (_q *ProjectQuery) OnlyIDX(ctx context.Context) int

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

func (*ProjectQuery) OnlyX

func (_q *ProjectQuery) OnlyX(ctx context.Context) *Project

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

func (*ProjectQuery) Order

func (_q *ProjectQuery) Order(o ...project.OrderOption) *ProjectQuery

Order specifies how the records should be ordered.

func (*ProjectQuery) QueryMembers

func (_q *ProjectQuery) QueryMembers() *ProjectMemberQuery

QueryMembers chains the current query on the "members" edge.

func (*ProjectQuery) QueryOwner

func (_q *ProjectQuery) QueryOwner() *UserQuery

QueryOwner chains the current query on the "owner" edge.

func (*ProjectQuery) QueryRetentionPolicies

func (_q *ProjectQuery) QueryRetentionPolicies() *RetentionPolicyQuery

QueryRetentionPolicies chains the current query on the "retention_policies" edge.

func (*ProjectQuery) Select

func (_q *ProjectQuery) Select(fields ...string) *ProjectSelect

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

func (*ProjectQuery) Unique

func (_q *ProjectQuery) Unique(unique bool) *ProjectQuery

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

func (_q *ProjectQuery) Where(ps ...predicate.Project) *ProjectQuery

Where adds a new predicate for the ProjectQuery builder.

func (*ProjectQuery) WithMembers

func (_q *ProjectQuery) WithMembers(opts ...func(*ProjectMemberQuery)) *ProjectQuery

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

func (*ProjectQuery) WithOwner

func (_q *ProjectQuery) WithOwner(opts ...func(*UserQuery)) *ProjectQuery

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

func (*ProjectQuery) WithRetentionPolicies

func (_q *ProjectQuery) WithRetentionPolicies(opts ...func(*RetentionPolicyQuery)) *ProjectQuery

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

type ProjectSelect

type ProjectSelect struct {
	*ProjectQuery
	// contains filtered or unexported fields
}

ProjectSelect is the builder for selecting fields of Project entities.

func (*ProjectSelect) Aggregate

func (_s *ProjectSelect) Aggregate(fns ...AggregateFunc) *ProjectSelect

Aggregate adds the given aggregation functions to the selector query.

func (*ProjectSelect) Bool

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

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

func (*ProjectSelect) BoolX

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

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

func (*ProjectSelect) Bools

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

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

func (*ProjectSelect) BoolsX

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

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

func (*ProjectSelect) Float64

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

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

func (*ProjectSelect) Float64X

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

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

func (*ProjectSelect) Float64s

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

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

func (*ProjectSelect) Float64sX

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

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

func (*ProjectSelect) Int

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

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

func (*ProjectSelect) IntX

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

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

func (*ProjectSelect) Ints

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

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

func (*ProjectSelect) IntsX

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

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

func (*ProjectSelect) Scan

func (_s *ProjectSelect) Scan(ctx context.Context, v any) error

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

func (*ProjectSelect) ScanX

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

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

func (*ProjectSelect) String

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

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

func (*ProjectSelect) StringX

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

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

func (*ProjectSelect) Strings

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

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

func (*ProjectSelect) StringsX

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

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

type ProjectUpdate

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

ProjectUpdate is the builder for updating Project entities.

func (*ProjectUpdate) AddMemberIDs

func (_u *ProjectUpdate) AddMemberIDs(ids ...int) *ProjectUpdate

AddMemberIDs adds the "members" edge to the ProjectMember entity by IDs.

func (*ProjectUpdate) AddMembers

func (_u *ProjectUpdate) AddMembers(v ...*ProjectMember) *ProjectUpdate

AddMembers adds the "members" edges to the ProjectMember entity.

func (*ProjectUpdate) AddRetentionPolicies

func (_u *ProjectUpdate) AddRetentionPolicies(v ...*RetentionPolicy) *ProjectUpdate

AddRetentionPolicies adds the "retention_policies" edges to the RetentionPolicy entity.

func (*ProjectUpdate) AddRetentionPolicyIDs

func (_u *ProjectUpdate) AddRetentionPolicyIDs(ids ...int) *ProjectUpdate

AddRetentionPolicyIDs adds the "retention_policies" edge to the RetentionPolicy entity by IDs.

func (*ProjectUpdate) ClearDescription

func (_u *ProjectUpdate) ClearDescription() *ProjectUpdate

ClearDescription clears the value of the "description" field.

func (*ProjectUpdate) ClearMembers

func (_u *ProjectUpdate) ClearMembers() *ProjectUpdate

ClearMembers clears all "members" edges to the ProjectMember entity.

func (*ProjectUpdate) ClearOwner

func (_u *ProjectUpdate) ClearOwner() *ProjectUpdate

ClearOwner clears the "owner" edge to the User entity.

func (*ProjectUpdate) ClearRetentionPolicies

func (_u *ProjectUpdate) ClearRetentionPolicies() *ProjectUpdate

ClearRetentionPolicies clears all "retention_policies" edges to the RetentionPolicy entity.

func (*ProjectUpdate) Exec

func (_u *ProjectUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*ProjectUpdate) ExecX

func (_u *ProjectUpdate) ExecX(ctx context.Context)

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

func (*ProjectUpdate) Mutation

func (_u *ProjectUpdate) Mutation() *ProjectMutation

Mutation returns the ProjectMutation object of the builder.

func (*ProjectUpdate) RemoveMemberIDs

func (_u *ProjectUpdate) RemoveMemberIDs(ids ...int) *ProjectUpdate

RemoveMemberIDs removes the "members" edge to ProjectMember entities by IDs.

func (*ProjectUpdate) RemoveMembers

func (_u *ProjectUpdate) RemoveMembers(v ...*ProjectMember) *ProjectUpdate

RemoveMembers removes "members" edges to ProjectMember entities.

func (*ProjectUpdate) RemoveRetentionPolicies

func (_u *ProjectUpdate) RemoveRetentionPolicies(v ...*RetentionPolicy) *ProjectUpdate

RemoveRetentionPolicies removes "retention_policies" edges to RetentionPolicy entities.

func (*ProjectUpdate) RemoveRetentionPolicyIDs

func (_u *ProjectUpdate) RemoveRetentionPolicyIDs(ids ...int) *ProjectUpdate

RemoveRetentionPolicyIDs removes the "retention_policies" edge to RetentionPolicy entities by IDs.

func (*ProjectUpdate) Save

func (_u *ProjectUpdate) Save(ctx context.Context) (int, error)

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

func (*ProjectUpdate) SaveX

func (_u *ProjectUpdate) SaveX(ctx context.Context) int

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

func (*ProjectUpdate) SetDescription

func (_u *ProjectUpdate) SetDescription(v string) *ProjectUpdate

SetDescription sets the "description" field.

func (*ProjectUpdate) SetDsn

func (_u *ProjectUpdate) SetDsn(v string) *ProjectUpdate

SetDsn sets the "dsn" field.

func (*ProjectUpdate) SetName

func (_u *ProjectUpdate) SetName(v string) *ProjectUpdate

SetName sets the "name" field.

func (*ProjectUpdate) SetNillableDescription

func (_u *ProjectUpdate) SetNillableDescription(v *string) *ProjectUpdate

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

func (*ProjectUpdate) SetNillableDsn

func (_u *ProjectUpdate) SetNillableDsn(v *string) *ProjectUpdate

SetNillableDsn sets the "dsn" field if the given value is not nil.

func (*ProjectUpdate) SetNillableName

func (_u *ProjectUpdate) SetNillableName(v *string) *ProjectUpdate

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

func (*ProjectUpdate) SetNillableStatus

func (_u *ProjectUpdate) SetNillableStatus(v *string) *ProjectUpdate

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

func (*ProjectUpdate) SetOwner

func (_u *ProjectUpdate) SetOwner(v *User) *ProjectUpdate

SetOwner sets the "owner" edge to the User entity.

func (*ProjectUpdate) SetOwnerID

func (_u *ProjectUpdate) SetOwnerID(id int) *ProjectUpdate

SetOwnerID sets the "owner" edge to the User entity by ID.

func (*ProjectUpdate) SetStatus

func (_u *ProjectUpdate) SetStatus(v string) *ProjectUpdate

SetStatus sets the "status" field.

func (*ProjectUpdate) SetUpdatedAt

func (_u *ProjectUpdate) SetUpdatedAt(v time.Time) *ProjectUpdate

SetUpdatedAt sets the "updated_at" field.

func (*ProjectUpdate) Where

func (_u *ProjectUpdate) Where(ps ...predicate.Project) *ProjectUpdate

Where appends a list predicates to the ProjectUpdate builder.

type ProjectUpdateOne

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

ProjectUpdateOne is the builder for updating a single Project entity.

func (*ProjectUpdateOne) AddMemberIDs

func (_u *ProjectUpdateOne) AddMemberIDs(ids ...int) *ProjectUpdateOne

AddMemberIDs adds the "members" edge to the ProjectMember entity by IDs.

func (*ProjectUpdateOne) AddMembers

func (_u *ProjectUpdateOne) AddMembers(v ...*ProjectMember) *ProjectUpdateOne

AddMembers adds the "members" edges to the ProjectMember entity.

func (*ProjectUpdateOne) AddRetentionPolicies

func (_u *ProjectUpdateOne) AddRetentionPolicies(v ...*RetentionPolicy) *ProjectUpdateOne

AddRetentionPolicies adds the "retention_policies" edges to the RetentionPolicy entity.

func (*ProjectUpdateOne) AddRetentionPolicyIDs

func (_u *ProjectUpdateOne) AddRetentionPolicyIDs(ids ...int) *ProjectUpdateOne

AddRetentionPolicyIDs adds the "retention_policies" edge to the RetentionPolicy entity by IDs.

func (*ProjectUpdateOne) ClearDescription

func (_u *ProjectUpdateOne) ClearDescription() *ProjectUpdateOne

ClearDescription clears the value of the "description" field.

func (*ProjectUpdateOne) ClearMembers

func (_u *ProjectUpdateOne) ClearMembers() *ProjectUpdateOne

ClearMembers clears all "members" edges to the ProjectMember entity.

func (*ProjectUpdateOne) ClearOwner

func (_u *ProjectUpdateOne) ClearOwner() *ProjectUpdateOne

ClearOwner clears the "owner" edge to the User entity.

func (*ProjectUpdateOne) ClearRetentionPolicies

func (_u *ProjectUpdateOne) ClearRetentionPolicies() *ProjectUpdateOne

ClearRetentionPolicies clears all "retention_policies" edges to the RetentionPolicy entity.

func (*ProjectUpdateOne) Exec

func (_u *ProjectUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*ProjectUpdateOne) ExecX

func (_u *ProjectUpdateOne) ExecX(ctx context.Context)

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

func (*ProjectUpdateOne) Mutation

func (_u *ProjectUpdateOne) Mutation() *ProjectMutation

Mutation returns the ProjectMutation object of the builder.

func (*ProjectUpdateOne) RemoveMemberIDs

func (_u *ProjectUpdateOne) RemoveMemberIDs(ids ...int) *ProjectUpdateOne

RemoveMemberIDs removes the "members" edge to ProjectMember entities by IDs.

func (*ProjectUpdateOne) RemoveMembers

func (_u *ProjectUpdateOne) RemoveMembers(v ...*ProjectMember) *ProjectUpdateOne

RemoveMembers removes "members" edges to ProjectMember entities.

func (*ProjectUpdateOne) RemoveRetentionPolicies

func (_u *ProjectUpdateOne) RemoveRetentionPolicies(v ...*RetentionPolicy) *ProjectUpdateOne

RemoveRetentionPolicies removes "retention_policies" edges to RetentionPolicy entities.

func (*ProjectUpdateOne) RemoveRetentionPolicyIDs

func (_u *ProjectUpdateOne) RemoveRetentionPolicyIDs(ids ...int) *ProjectUpdateOne

RemoveRetentionPolicyIDs removes the "retention_policies" edge to RetentionPolicy entities by IDs.

func (*ProjectUpdateOne) Save

func (_u *ProjectUpdateOne) Save(ctx context.Context) (*Project, error)

Save executes the query and returns the updated Project entity.

func (*ProjectUpdateOne) SaveX

func (_u *ProjectUpdateOne) SaveX(ctx context.Context) *Project

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

func (*ProjectUpdateOne) Select

func (_u *ProjectUpdateOne) Select(field string, fields ...string) *ProjectUpdateOne

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

func (*ProjectUpdateOne) SetDescription

func (_u *ProjectUpdateOne) SetDescription(v string) *ProjectUpdateOne

SetDescription sets the "description" field.

func (*ProjectUpdateOne) SetDsn

func (_u *ProjectUpdateOne) SetDsn(v string) *ProjectUpdateOne

SetDsn sets the "dsn" field.

func (*ProjectUpdateOne) SetName

func (_u *ProjectUpdateOne) SetName(v string) *ProjectUpdateOne

SetName sets the "name" field.

func (*ProjectUpdateOne) SetNillableDescription

func (_u *ProjectUpdateOne) SetNillableDescription(v *string) *ProjectUpdateOne

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

func (*ProjectUpdateOne) SetNillableDsn

func (_u *ProjectUpdateOne) SetNillableDsn(v *string) *ProjectUpdateOne

SetNillableDsn sets the "dsn" field if the given value is not nil.

func (*ProjectUpdateOne) SetNillableName

func (_u *ProjectUpdateOne) SetNillableName(v *string) *ProjectUpdateOne

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

func (*ProjectUpdateOne) SetNillableStatus

func (_u *ProjectUpdateOne) SetNillableStatus(v *string) *ProjectUpdateOne

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

func (*ProjectUpdateOne) SetOwner

func (_u *ProjectUpdateOne) SetOwner(v *User) *ProjectUpdateOne

SetOwner sets the "owner" edge to the User entity.

func (*ProjectUpdateOne) SetOwnerID

func (_u *ProjectUpdateOne) SetOwnerID(id int) *ProjectUpdateOne

SetOwnerID sets the "owner" edge to the User entity by ID.

func (*ProjectUpdateOne) SetStatus

func (_u *ProjectUpdateOne) SetStatus(v string) *ProjectUpdateOne

SetStatus sets the "status" field.

func (*ProjectUpdateOne) SetUpdatedAt

func (_u *ProjectUpdateOne) SetUpdatedAt(v time.Time) *ProjectUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*ProjectUpdateOne) Where

Where appends a list predicates to the ProjectUpdate builder.

type Projects

type Projects []*Project

Projects is a parsable slice of Project.

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 RetentionPolicies

type RetentionPolicies []*RetentionPolicy

RetentionPolicies is a parsable slice of RetentionPolicy.

type RetentionPolicy

type RetentionPolicy struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// Retention policy name
	Name string `json:"name,omitempty"`
	// Number of days to retain logs
	DurationDays int `json:"duration_days,omitempty"`
	// Description of the retention policy
	Description string `json:"description,omitempty"`
	// Whether the retention policy is active
	IsActive bool `json:"is_active,omitempty"`
	// When the retention policy was created
	CreatedAt time.Time `json:"created_at,omitempty"`
	// When the retention policy was last updated
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the RetentionPolicyQuery when eager-loading is set.
	Edges RetentionPolicyEdges `json:"edges"`
	// contains filtered or unexported fields
}

RetentionPolicy is the model entity for the RetentionPolicy schema.

func (*RetentionPolicy) QueryProject

func (_m *RetentionPolicy) QueryProject() *ProjectQuery

QueryProject queries the "project" edge of the RetentionPolicy entity.

func (*RetentionPolicy) String

func (_m *RetentionPolicy) String() string

String implements the fmt.Stringer.

func (*RetentionPolicy) Unwrap

func (_m *RetentionPolicy) Unwrap() *RetentionPolicy

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

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

func (*RetentionPolicy) Value

func (_m *RetentionPolicy) Value(name string) (ent.Value, error)

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

type RetentionPolicyClient

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

RetentionPolicyClient is a client for the RetentionPolicy schema.

func NewRetentionPolicyClient

func NewRetentionPolicyClient(c config) *RetentionPolicyClient

NewRetentionPolicyClient returns a client for the RetentionPolicy from the given config.

func (*RetentionPolicyClient) Create

Create returns a builder for creating a RetentionPolicy entity.

func (*RetentionPolicyClient) CreateBulk

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

func (*RetentionPolicyClient) Delete

Delete returns a delete builder for RetentionPolicy.

func (*RetentionPolicyClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*RetentionPolicyClient) DeleteOneID

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

func (*RetentionPolicyClient) Get

Get returns a RetentionPolicy entity by its id.

func (*RetentionPolicyClient) GetX

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

func (*RetentionPolicyClient) Hooks

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

Hooks returns the client hooks.

func (*RetentionPolicyClient) Intercept

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

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

func (*RetentionPolicyClient) Interceptors

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

Interceptors returns the client interceptors.

func (*RetentionPolicyClient) MapCreateBulk

func (c *RetentionPolicyClient) MapCreateBulk(slice any, setFunc func(*RetentionPolicyCreate, int)) *RetentionPolicyCreateBulk

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

Query returns a query builder for RetentionPolicy.

func (*RetentionPolicyClient) QueryProject

func (c *RetentionPolicyClient) QueryProject(_m *RetentionPolicy) *ProjectQuery

QueryProject queries the project edge of a RetentionPolicy.

func (*RetentionPolicyClient) Update

Update returns an update builder for RetentionPolicy.

func (*RetentionPolicyClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*RetentionPolicyClient) UpdateOneID

UpdateOneID returns an update builder for the given id.

func (*RetentionPolicyClient) Use

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

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

type RetentionPolicyCreate

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

RetentionPolicyCreate is the builder for creating a RetentionPolicy entity.

func (*RetentionPolicyCreate) Exec

Exec executes the query.

func (*RetentionPolicyCreate) ExecX

func (_c *RetentionPolicyCreate) ExecX(ctx context.Context)

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

func (*RetentionPolicyCreate) Mutation

Mutation returns the RetentionPolicyMutation object of the builder.

func (*RetentionPolicyCreate) Save

Save creates the RetentionPolicy in the database.

func (*RetentionPolicyCreate) SaveX

SaveX calls Save and panics if Save returns an error.

func (*RetentionPolicyCreate) SetCreatedAt

SetCreatedAt sets the "created_at" field.

func (*RetentionPolicyCreate) SetDescription

func (_c *RetentionPolicyCreate) SetDescription(v string) *RetentionPolicyCreate

SetDescription sets the "description" field.

func (*RetentionPolicyCreate) SetDurationDays

func (_c *RetentionPolicyCreate) SetDurationDays(v int) *RetentionPolicyCreate

SetDurationDays sets the "duration_days" field.

func (*RetentionPolicyCreate) SetIsActive

func (_c *RetentionPolicyCreate) SetIsActive(v bool) *RetentionPolicyCreate

SetIsActive sets the "is_active" field.

func (*RetentionPolicyCreate) SetName

SetName sets the "name" field.

func (*RetentionPolicyCreate) SetNillableCreatedAt

func (_c *RetentionPolicyCreate) SetNillableCreatedAt(v *time.Time) *RetentionPolicyCreate

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

func (*RetentionPolicyCreate) SetNillableDescription

func (_c *RetentionPolicyCreate) SetNillableDescription(v *string) *RetentionPolicyCreate

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

func (*RetentionPolicyCreate) SetNillableDurationDays

func (_c *RetentionPolicyCreate) SetNillableDurationDays(v *int) *RetentionPolicyCreate

SetNillableDurationDays sets the "duration_days" field if the given value is not nil.

func (*RetentionPolicyCreate) SetNillableIsActive

func (_c *RetentionPolicyCreate) SetNillableIsActive(v *bool) *RetentionPolicyCreate

SetNillableIsActive sets the "is_active" field if the given value is not nil.

func (*RetentionPolicyCreate) SetNillableUpdatedAt

func (_c *RetentionPolicyCreate) SetNillableUpdatedAt(v *time.Time) *RetentionPolicyCreate

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

func (*RetentionPolicyCreate) SetProject

SetProject sets the "project" edge to the Project entity.

func (*RetentionPolicyCreate) SetProjectID

func (_c *RetentionPolicyCreate) SetProjectID(id int) *RetentionPolicyCreate

SetProjectID sets the "project" edge to the Project entity by ID.

func (*RetentionPolicyCreate) SetUpdatedAt

SetUpdatedAt sets the "updated_at" field.

type RetentionPolicyCreateBulk

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

RetentionPolicyCreateBulk is the builder for creating many RetentionPolicy entities in bulk.

func (*RetentionPolicyCreateBulk) Exec

Exec executes the query.

func (*RetentionPolicyCreateBulk) ExecX

func (_c *RetentionPolicyCreateBulk) ExecX(ctx context.Context)

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

func (*RetentionPolicyCreateBulk) Save

Save creates the RetentionPolicy entities in the database.

func (*RetentionPolicyCreateBulk) SaveX

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

type RetentionPolicyDelete

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

RetentionPolicyDelete is the builder for deleting a RetentionPolicy entity.

func (*RetentionPolicyDelete) Exec

func (_d *RetentionPolicyDelete) Exec(ctx context.Context) (int, error)

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

func (*RetentionPolicyDelete) ExecX

func (_d *RetentionPolicyDelete) ExecX(ctx context.Context) int

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

func (*RetentionPolicyDelete) Where

Where appends a list predicates to the RetentionPolicyDelete builder.

type RetentionPolicyDeleteOne

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

RetentionPolicyDeleteOne is the builder for deleting a single RetentionPolicy entity.

func (*RetentionPolicyDeleteOne) Exec

Exec executes the deletion query.

func (*RetentionPolicyDeleteOne) ExecX

func (_d *RetentionPolicyDeleteOne) ExecX(ctx context.Context)

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

func (*RetentionPolicyDeleteOne) Where

Where appends a list predicates to the RetentionPolicyDelete builder.

type RetentionPolicyEdges

type RetentionPolicyEdges struct {
	// Project this retention policy belongs to
	Project *Project `json:"project,omitempty"`
	// contains filtered or unexported fields
}

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

func (RetentionPolicyEdges) ProjectOrErr

func (e RetentionPolicyEdges) ProjectOrErr() (*Project, error)

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

type RetentionPolicyGroupBy

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

RetentionPolicyGroupBy is the group-by builder for RetentionPolicy entities.

func (*RetentionPolicyGroupBy) Aggregate

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

func (*RetentionPolicyGroupBy) Bool

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

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

func (*RetentionPolicyGroupBy) BoolX

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

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

func (*RetentionPolicyGroupBy) Bools

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

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

func (*RetentionPolicyGroupBy) BoolsX

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

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

func (*RetentionPolicyGroupBy) Float64

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

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

func (*RetentionPolicyGroupBy) Float64X

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

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

func (*RetentionPolicyGroupBy) Float64s

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

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

func (*RetentionPolicyGroupBy) Float64sX

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

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

func (*RetentionPolicyGroupBy) Int

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

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

func (*RetentionPolicyGroupBy) IntX

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

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

func (*RetentionPolicyGroupBy) Ints

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

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

func (*RetentionPolicyGroupBy) IntsX

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

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

func (*RetentionPolicyGroupBy) Scan

func (_g *RetentionPolicyGroupBy) Scan(ctx context.Context, v any) error

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

func (*RetentionPolicyGroupBy) ScanX

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

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

func (*RetentionPolicyGroupBy) String

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

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

func (*RetentionPolicyGroupBy) StringX

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

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

func (*RetentionPolicyGroupBy) Strings

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

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

func (*RetentionPolicyGroupBy) StringsX

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

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

type RetentionPolicyMutation

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

RetentionPolicyMutation represents an operation that mutates the RetentionPolicy nodes in the graph.

func (*RetentionPolicyMutation) AddDurationDays

func (m *RetentionPolicyMutation) AddDurationDays(i int)

AddDurationDays adds i to the "duration_days" field.

func (*RetentionPolicyMutation) AddField

func (m *RetentionPolicyMutation) 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 (*RetentionPolicyMutation) AddedDurationDays

func (m *RetentionPolicyMutation) AddedDurationDays() (r int, exists bool)

AddedDurationDays returns the value that was added to the "duration_days" field in this mutation.

func (*RetentionPolicyMutation) AddedEdges

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

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

func (*RetentionPolicyMutation) AddedField

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

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

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

func (*RetentionPolicyMutation) AddedIDs

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

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

func (*RetentionPolicyMutation) ClearDescription

func (m *RetentionPolicyMutation) ClearDescription()

ClearDescription clears the value of the "description" field.

func (*RetentionPolicyMutation) ClearEdge

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

func (m *RetentionPolicyMutation) 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 (*RetentionPolicyMutation) ClearProject

func (m *RetentionPolicyMutation) ClearProject()

ClearProject clears the "project" edge to the Project entity.

func (*RetentionPolicyMutation) ClearedEdges

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

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

func (*RetentionPolicyMutation) ClearedFields

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

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

func (RetentionPolicyMutation) Client

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

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

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

func (*RetentionPolicyMutation) Description

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

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

func (*RetentionPolicyMutation) DescriptionCleared

func (m *RetentionPolicyMutation) DescriptionCleared() bool

DescriptionCleared returns if the "description" field was cleared in this mutation.

func (*RetentionPolicyMutation) DurationDays

func (m *RetentionPolicyMutation) DurationDays() (r int, exists bool)

DurationDays returns the value of the "duration_days" field in the mutation.

func (*RetentionPolicyMutation) EdgeCleared

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

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

func (*RetentionPolicyMutation) Field

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

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

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

func (*RetentionPolicyMutation) Fields

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

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

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

func (*RetentionPolicyMutation) IDs

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

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

func (*RetentionPolicyMutation) IsActive

func (m *RetentionPolicyMutation) IsActive() (r bool, exists bool)

IsActive returns the value of the "is_active" field in the mutation.

func (*RetentionPolicyMutation) Name

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

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

func (*RetentionPolicyMutation) OldCreatedAt

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

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

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

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

func (m *RetentionPolicyMutation) OldDurationDays(ctx context.Context) (v int, err error)

OldDurationDays returns the old "duration_days" field's value of the RetentionPolicy entity. If the RetentionPolicy 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 (*RetentionPolicyMutation) OldField

func (m *RetentionPolicyMutation) 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 (*RetentionPolicyMutation) OldIsActive

func (m *RetentionPolicyMutation) OldIsActive(ctx context.Context) (v bool, err error)

OldIsActive returns the old "is_active" field's value of the RetentionPolicy entity. If the RetentionPolicy 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 (*RetentionPolicyMutation) OldName

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

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

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

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

func (m *RetentionPolicyMutation) Op() Op

Op returns the operation name.

func (*RetentionPolicyMutation) ProjectCleared

func (m *RetentionPolicyMutation) ProjectCleared() bool

ProjectCleared reports if the "project" edge to the Project entity was cleared.

func (*RetentionPolicyMutation) ProjectID

func (m *RetentionPolicyMutation) ProjectID() (id int, exists bool)

ProjectID returns the "project" edge ID in the mutation.

func (*RetentionPolicyMutation) ProjectIDs

func (m *RetentionPolicyMutation) ProjectIDs() (ids []int)

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

func (*RetentionPolicyMutation) RemovedEdges

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

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

func (*RetentionPolicyMutation) RemovedIDs

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

func (m *RetentionPolicyMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*RetentionPolicyMutation) ResetDescription

func (m *RetentionPolicyMutation) ResetDescription()

ResetDescription resets all changes to the "description" field.

func (*RetentionPolicyMutation) ResetDurationDays

func (m *RetentionPolicyMutation) ResetDurationDays()

ResetDurationDays resets all changes to the "duration_days" field.

func (*RetentionPolicyMutation) ResetEdge

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

func (m *RetentionPolicyMutation) 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 (*RetentionPolicyMutation) ResetIsActive

func (m *RetentionPolicyMutation) ResetIsActive()

ResetIsActive resets all changes to the "is_active" field.

func (*RetentionPolicyMutation) ResetName

func (m *RetentionPolicyMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*RetentionPolicyMutation) ResetProject

func (m *RetentionPolicyMutation) ResetProject()

ResetProject resets all changes to the "project" edge.

func (*RetentionPolicyMutation) ResetUpdatedAt

func (m *RetentionPolicyMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*RetentionPolicyMutation) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*RetentionPolicyMutation) SetDescription

func (m *RetentionPolicyMutation) SetDescription(s string)

SetDescription sets the "description" field.

func (*RetentionPolicyMutation) SetDurationDays

func (m *RetentionPolicyMutation) SetDurationDays(i int)

SetDurationDays sets the "duration_days" field.

func (*RetentionPolicyMutation) SetField

func (m *RetentionPolicyMutation) 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 (*RetentionPolicyMutation) SetIsActive

func (m *RetentionPolicyMutation) SetIsActive(b bool)

SetIsActive sets the "is_active" field.

func (*RetentionPolicyMutation) SetName

func (m *RetentionPolicyMutation) SetName(s string)

SetName sets the "name" field.

func (*RetentionPolicyMutation) SetOp

func (m *RetentionPolicyMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*RetentionPolicyMutation) SetProjectID

func (m *RetentionPolicyMutation) SetProjectID(id int)

SetProjectID sets the "project" edge to the Project entity by id.

func (*RetentionPolicyMutation) SetUpdatedAt

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

SetUpdatedAt sets the "updated_at" field.

func (RetentionPolicyMutation) Tx

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

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

func (*RetentionPolicyMutation) Type

func (m *RetentionPolicyMutation) Type() string

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

func (*RetentionPolicyMutation) UpdatedAt

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

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

func (*RetentionPolicyMutation) Where

Where appends a list predicates to the RetentionPolicyMutation builder.

func (*RetentionPolicyMutation) WhereP

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

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

type RetentionPolicyQuery

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

RetentionPolicyQuery is the builder for querying RetentionPolicy entities.

func (*RetentionPolicyQuery) Aggregate

Aggregate returns a RetentionPolicySelect configured with the given aggregations.

func (*RetentionPolicyQuery) All

All executes the query and returns a list of RetentionPolicies.

func (*RetentionPolicyQuery) AllX

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

func (*RetentionPolicyQuery) Clone

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

func (*RetentionPolicyQuery) Count

func (_q *RetentionPolicyQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*RetentionPolicyQuery) CountX

func (_q *RetentionPolicyQuery) CountX(ctx context.Context) int

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

func (*RetentionPolicyQuery) Exist

func (_q *RetentionPolicyQuery) Exist(ctx context.Context) (bool, error)

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

func (*RetentionPolicyQuery) ExistX

func (_q *RetentionPolicyQuery) ExistX(ctx context.Context) bool

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

func (*RetentionPolicyQuery) First

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

func (*RetentionPolicyQuery) FirstID

func (_q *RetentionPolicyQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*RetentionPolicyQuery) FirstIDX

func (_q *RetentionPolicyQuery) FirstIDX(ctx context.Context) int

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

func (*RetentionPolicyQuery) FirstX

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

func (*RetentionPolicyQuery) GroupBy

func (_q *RetentionPolicyQuery) GroupBy(field string, fields ...string) *RetentionPolicyGroupBy

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.RetentionPolicy.Query().
	GroupBy(retentionpolicy.FieldName).
	Aggregate(data.Count()).
	Scan(ctx, &v)

func (*RetentionPolicyQuery) IDs

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

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

func (*RetentionPolicyQuery) IDsX

func (_q *RetentionPolicyQuery) IDsX(ctx context.Context) []int

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

func (*RetentionPolicyQuery) Limit

func (_q *RetentionPolicyQuery) Limit(limit int) *RetentionPolicyQuery

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

func (*RetentionPolicyQuery) Offset

func (_q *RetentionPolicyQuery) Offset(offset int) *RetentionPolicyQuery

Offset to start from.

func (*RetentionPolicyQuery) Only

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

func (*RetentionPolicyQuery) OnlyID

func (_q *RetentionPolicyQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*RetentionPolicyQuery) OnlyIDX

func (_q *RetentionPolicyQuery) OnlyIDX(ctx context.Context) int

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

func (*RetentionPolicyQuery) OnlyX

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

func (*RetentionPolicyQuery) Order

Order specifies how the records should be ordered.

func (*RetentionPolicyQuery) QueryProject

func (_q *RetentionPolicyQuery) QueryProject() *ProjectQuery

QueryProject chains the current query on the "project" edge.

func (*RetentionPolicyQuery) Select

func (_q *RetentionPolicyQuery) Select(fields ...string) *RetentionPolicySelect

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

func (*RetentionPolicyQuery) Unique

func (_q *RetentionPolicyQuery) Unique(unique bool) *RetentionPolicyQuery

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

Where adds a new predicate for the RetentionPolicyQuery builder.

func (*RetentionPolicyQuery) WithProject

func (_q *RetentionPolicyQuery) WithProject(opts ...func(*ProjectQuery)) *RetentionPolicyQuery

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

type RetentionPolicySelect

type RetentionPolicySelect struct {
	*RetentionPolicyQuery
	// contains filtered or unexported fields
}

RetentionPolicySelect is the builder for selecting fields of RetentionPolicy entities.

func (*RetentionPolicySelect) Aggregate

Aggregate adds the given aggregation functions to the selector query.

func (*RetentionPolicySelect) Bool

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

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

func (*RetentionPolicySelect) BoolX

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

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

func (*RetentionPolicySelect) Bools

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

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

func (*RetentionPolicySelect) BoolsX

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

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

func (*RetentionPolicySelect) Float64

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

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

func (*RetentionPolicySelect) Float64X

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

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

func (*RetentionPolicySelect) Float64s

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

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

func (*RetentionPolicySelect) Float64sX

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

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

func (*RetentionPolicySelect) Int

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

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

func (*RetentionPolicySelect) IntX

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

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

func (*RetentionPolicySelect) Ints

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

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

func (*RetentionPolicySelect) IntsX

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

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

func (*RetentionPolicySelect) Scan

func (_s *RetentionPolicySelect) Scan(ctx context.Context, v any) error

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

func (*RetentionPolicySelect) ScanX

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

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

func (*RetentionPolicySelect) String

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

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

func (*RetentionPolicySelect) StringX

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

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

func (*RetentionPolicySelect) Strings

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

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

func (*RetentionPolicySelect) StringsX

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

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

type RetentionPolicyUpdate

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

RetentionPolicyUpdate is the builder for updating RetentionPolicy entities.

func (*RetentionPolicyUpdate) AddDurationDays

func (_u *RetentionPolicyUpdate) AddDurationDays(v int) *RetentionPolicyUpdate

AddDurationDays adds value to the "duration_days" field.

func (*RetentionPolicyUpdate) ClearDescription

func (_u *RetentionPolicyUpdate) ClearDescription() *RetentionPolicyUpdate

ClearDescription clears the value of the "description" field.

func (*RetentionPolicyUpdate) ClearProject

func (_u *RetentionPolicyUpdate) ClearProject() *RetentionPolicyUpdate

ClearProject clears the "project" edge to the Project entity.

func (*RetentionPolicyUpdate) Exec

Exec executes the query.

func (*RetentionPolicyUpdate) ExecX

func (_u *RetentionPolicyUpdate) ExecX(ctx context.Context)

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

func (*RetentionPolicyUpdate) Mutation

Mutation returns the RetentionPolicyMutation object of the builder.

func (*RetentionPolicyUpdate) Save

func (_u *RetentionPolicyUpdate) Save(ctx context.Context) (int, error)

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

func (*RetentionPolicyUpdate) SaveX

func (_u *RetentionPolicyUpdate) SaveX(ctx context.Context) int

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

func (*RetentionPolicyUpdate) SetDescription

func (_u *RetentionPolicyUpdate) SetDescription(v string) *RetentionPolicyUpdate

SetDescription sets the "description" field.

func (*RetentionPolicyUpdate) SetDurationDays

func (_u *RetentionPolicyUpdate) SetDurationDays(v int) *RetentionPolicyUpdate

SetDurationDays sets the "duration_days" field.

func (*RetentionPolicyUpdate) SetIsActive

func (_u *RetentionPolicyUpdate) SetIsActive(v bool) *RetentionPolicyUpdate

SetIsActive sets the "is_active" field.

func (*RetentionPolicyUpdate) SetName

SetName sets the "name" field.

func (*RetentionPolicyUpdate) SetNillableDescription

func (_u *RetentionPolicyUpdate) SetNillableDescription(v *string) *RetentionPolicyUpdate

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

func (*RetentionPolicyUpdate) SetNillableDurationDays

func (_u *RetentionPolicyUpdate) SetNillableDurationDays(v *int) *RetentionPolicyUpdate

SetNillableDurationDays sets the "duration_days" field if the given value is not nil.

func (*RetentionPolicyUpdate) SetNillableIsActive

func (_u *RetentionPolicyUpdate) SetNillableIsActive(v *bool) *RetentionPolicyUpdate

SetNillableIsActive sets the "is_active" field if the given value is not nil.

func (*RetentionPolicyUpdate) SetNillableName

func (_u *RetentionPolicyUpdate) SetNillableName(v *string) *RetentionPolicyUpdate

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

func (*RetentionPolicyUpdate) SetProject

SetProject sets the "project" edge to the Project entity.

func (*RetentionPolicyUpdate) SetProjectID

func (_u *RetentionPolicyUpdate) SetProjectID(id int) *RetentionPolicyUpdate

SetProjectID sets the "project" edge to the Project entity by ID.

func (*RetentionPolicyUpdate) SetUpdatedAt

SetUpdatedAt sets the "updated_at" field.

func (*RetentionPolicyUpdate) Where

Where appends a list predicates to the RetentionPolicyUpdate builder.

type RetentionPolicyUpdateOne

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

RetentionPolicyUpdateOne is the builder for updating a single RetentionPolicy entity.

func (*RetentionPolicyUpdateOne) AddDurationDays

func (_u *RetentionPolicyUpdateOne) AddDurationDays(v int) *RetentionPolicyUpdateOne

AddDurationDays adds value to the "duration_days" field.

func (*RetentionPolicyUpdateOne) ClearDescription

func (_u *RetentionPolicyUpdateOne) ClearDescription() *RetentionPolicyUpdateOne

ClearDescription clears the value of the "description" field.

func (*RetentionPolicyUpdateOne) ClearProject

ClearProject clears the "project" edge to the Project entity.

func (*RetentionPolicyUpdateOne) Exec

Exec executes the query on the entity.

func (*RetentionPolicyUpdateOne) ExecX

func (_u *RetentionPolicyUpdateOne) ExecX(ctx context.Context)

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

func (*RetentionPolicyUpdateOne) Mutation

Mutation returns the RetentionPolicyMutation object of the builder.

func (*RetentionPolicyUpdateOne) Save

Save executes the query and returns the updated RetentionPolicy entity.

func (*RetentionPolicyUpdateOne) SaveX

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

func (*RetentionPolicyUpdateOne) Select

func (_u *RetentionPolicyUpdateOne) Select(field string, fields ...string) *RetentionPolicyUpdateOne

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

func (*RetentionPolicyUpdateOne) SetDescription

SetDescription sets the "description" field.

func (*RetentionPolicyUpdateOne) SetDurationDays

func (_u *RetentionPolicyUpdateOne) SetDurationDays(v int) *RetentionPolicyUpdateOne

SetDurationDays sets the "duration_days" field.

func (*RetentionPolicyUpdateOne) SetIsActive

SetIsActive sets the "is_active" field.

func (*RetentionPolicyUpdateOne) SetName

SetName sets the "name" field.

func (*RetentionPolicyUpdateOne) SetNillableDescription

func (_u *RetentionPolicyUpdateOne) SetNillableDescription(v *string) *RetentionPolicyUpdateOne

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

func (*RetentionPolicyUpdateOne) SetNillableDurationDays

func (_u *RetentionPolicyUpdateOne) SetNillableDurationDays(v *int) *RetentionPolicyUpdateOne

SetNillableDurationDays sets the "duration_days" field if the given value is not nil.

func (*RetentionPolicyUpdateOne) SetNillableIsActive

func (_u *RetentionPolicyUpdateOne) SetNillableIsActive(v *bool) *RetentionPolicyUpdateOne

SetNillableIsActive sets the "is_active" field if the given value is not nil.

func (*RetentionPolicyUpdateOne) SetNillableName

func (_u *RetentionPolicyUpdateOne) SetNillableName(v *string) *RetentionPolicyUpdateOne

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

func (*RetentionPolicyUpdateOne) SetProject

SetProject sets the "project" edge to the Project entity.

func (*RetentionPolicyUpdateOne) SetProjectID

SetProjectID sets the "project" edge to the Project entity by ID.

func (*RetentionPolicyUpdateOne) SetUpdatedAt

SetUpdatedAt sets the "updated_at" field.

func (*RetentionPolicyUpdateOne) Where

Where appends a list predicates to the RetentionPolicyUpdate builder.

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 {

	// Project is the client for interacting with the Project builders.
	Project *ProjectClient
	// ProjectMember is the client for interacting with the ProjectMember builders.
	ProjectMember *ProjectMemberClient
	// RetentionPolicy is the client for interacting with the RetentionPolicy builders.
	RetentionPolicy *RetentionPolicyClient
	// User is the client for interacting with the User builders.
	User *UserClient
	// contains filtered or unexported fields
}

Tx is a transactional client that is created by calling Client.Tx().

func TxFromContext

func TxFromContext(ctx context.Context) *Tx

TxFromContext returns a Tx stored inside a context, or nil if there isn't one.

func (*Tx) Client

func (tx *Tx) Client() *Client

Client returns a Client that binds to current transaction.

func (*Tx) Commit

func (tx *Tx) Commit() error

Commit commits the transaction.

func (*Tx) OnCommit

func (tx *Tx) OnCommit(f CommitHook)

OnCommit adds a hook to call on commit.

func (*Tx) OnRollback

func (tx *Tx) OnRollback(f RollbackHook)

OnRollback adds a hook to call on rollback.

func (*Tx) Rollback

func (tx *Tx) Rollback() error

Rollback rollbacks the transaction.

type User

type User struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// Unique username for the user
	Username string `json:"username,omitempty"`
	// Email address of the user
	Email string `json:"email,omitempty"`
	// Hashed password for authentication
	PasswordHash string `json:"-"`
	// User role: admin, user, etc.
	Role string `json:"role,omitempty"`
	// When the user was created
	CreatedAt time.Time `json:"created_at,omitempty"`
	// When the user was last updated
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the UserQuery when eager-loading is set.
	Edges UserEdges `json:"edges"`
	// contains filtered or unexported fields
}

User is the model entity for the User schema.

func (*User) QueryMemberships

func (_m *User) QueryMemberships() *ProjectMemberQuery

QueryMemberships queries the "memberships" edge of the User entity.

func (*User) QueryProjects

func (_m *User) QueryProjects() *ProjectQuery

QueryProjects queries the "projects" edge of the User entity.

func (*User) String

func (_m *User) String() string

String implements the fmt.Stringer.

func (*User) Unwrap

func (_m *User) Unwrap() *User

Unwrap unwraps the User entity that was returned from a transaction after it was closed, so that all future queries will be executed through the driver which created the transaction.

func (*User) Update

func (_m *User) Update() *UserUpdateOne

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

func (*User) Value

func (_m *User) Value(name string) (ent.Value, error)

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

type UserClient

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

UserClient is a client for the User schema.

func NewUserClient

func NewUserClient(c config) *UserClient

NewUserClient returns a client for the User from the given config.

func (*UserClient) Create

func (c *UserClient) Create() *UserCreate

Create returns a builder for creating a User entity.

func (*UserClient) CreateBulk

func (c *UserClient) CreateBulk(builders ...*UserCreate) *UserCreateBulk

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

func (*UserClient) Delete

func (c *UserClient) Delete() *UserDelete

Delete returns a delete builder for User.

func (*UserClient) DeleteOne

func (c *UserClient) DeleteOne(_m *User) *UserDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*UserClient) DeleteOneID

func (c *UserClient) DeleteOneID(id int) *UserDeleteOne

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

func (*UserClient) Get

func (c *UserClient) Get(ctx context.Context, id int) (*User, error)

Get returns a User entity by its id.

func (*UserClient) GetX

func (c *UserClient) GetX(ctx context.Context, id int) *User

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

func (*UserClient) Hooks

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

Hooks returns the client hooks.

func (*UserClient) Intercept

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

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

func (*UserClient) Interceptors

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

Interceptors returns the client interceptors.

func (*UserClient) MapCreateBulk

func (c *UserClient) MapCreateBulk(slice any, setFunc func(*UserCreate, int)) *UserCreateBulk

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

func (*UserClient) Query

func (c *UserClient) Query() *UserQuery

Query returns a query builder for User.

func (*UserClient) QueryMemberships

func (c *UserClient) QueryMemberships(_m *User) *ProjectMemberQuery

QueryMemberships queries the memberships edge of a User.

func (*UserClient) QueryProjects

func (c *UserClient) QueryProjects(_m *User) *ProjectQuery

QueryProjects queries the projects edge of a User.

func (*UserClient) Update

func (c *UserClient) Update() *UserUpdate

Update returns an update builder for User.

func (*UserClient) UpdateOne

func (c *UserClient) UpdateOne(_m *User) *UserUpdateOne

UpdateOne returns an update builder for the given entity.

func (*UserClient) UpdateOneID

func (c *UserClient) UpdateOneID(id int) *UserUpdateOne

UpdateOneID returns an update builder for the given id.

func (*UserClient) Use

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

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

type UserCreate

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

UserCreate is the builder for creating a User entity.

func (*UserCreate) AddMembershipIDs

func (_c *UserCreate) AddMembershipIDs(ids ...int) *UserCreate

AddMembershipIDs adds the "memberships" edge to the ProjectMember entity by IDs.

func (*UserCreate) AddMemberships

func (_c *UserCreate) AddMemberships(v ...*ProjectMember) *UserCreate

AddMemberships adds the "memberships" edges to the ProjectMember entity.

func (*UserCreate) AddProjectIDs

func (_c *UserCreate) AddProjectIDs(ids ...int) *UserCreate

AddProjectIDs adds the "projects" edge to the Project entity by IDs.

func (*UserCreate) AddProjects

func (_c *UserCreate) AddProjects(v ...*Project) *UserCreate

AddProjects adds the "projects" edges to the Project entity.

func (*UserCreate) Exec

func (_c *UserCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*UserCreate) ExecX

func (_c *UserCreate) ExecX(ctx context.Context)

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

func (*UserCreate) Mutation

func (_c *UserCreate) Mutation() *UserMutation

Mutation returns the UserMutation object of the builder.

func (*UserCreate) Save

func (_c *UserCreate) Save(ctx context.Context) (*User, error)

Save creates the User in the database.

func (*UserCreate) SaveX

func (_c *UserCreate) SaveX(ctx context.Context) *User

SaveX calls Save and panics if Save returns an error.

func (*UserCreate) SetCreatedAt

func (_c *UserCreate) SetCreatedAt(v time.Time) *UserCreate

SetCreatedAt sets the "created_at" field.

func (*UserCreate) SetEmail

func (_c *UserCreate) SetEmail(v string) *UserCreate

SetEmail sets the "email" field.

func (*UserCreate) SetNillableCreatedAt

func (_c *UserCreate) SetNillableCreatedAt(v *time.Time) *UserCreate

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

func (*UserCreate) SetNillableRole

func (_c *UserCreate) SetNillableRole(v *string) *UserCreate

SetNillableRole sets the "role" field if the given value is not nil.

func (*UserCreate) SetNillableUpdatedAt

func (_c *UserCreate) SetNillableUpdatedAt(v *time.Time) *UserCreate

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

func (*UserCreate) SetPasswordHash

func (_c *UserCreate) SetPasswordHash(v string) *UserCreate

SetPasswordHash sets the "password_hash" field.

func (*UserCreate) SetRole

func (_c *UserCreate) SetRole(v string) *UserCreate

SetRole sets the "role" field.

func (*UserCreate) SetUpdatedAt

func (_c *UserCreate) SetUpdatedAt(v time.Time) *UserCreate

SetUpdatedAt sets the "updated_at" field.

func (*UserCreate) SetUsername

func (_c *UserCreate) SetUsername(v string) *UserCreate

SetUsername sets the "username" field.

type UserCreateBulk

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

UserCreateBulk is the builder for creating many User entities in bulk.

func (*UserCreateBulk) Exec

func (_c *UserCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*UserCreateBulk) ExecX

func (_c *UserCreateBulk) ExecX(ctx context.Context)

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

func (*UserCreateBulk) Save

func (_c *UserCreateBulk) Save(ctx context.Context) ([]*User, error)

Save creates the User entities in the database.

func (*UserCreateBulk) SaveX

func (_c *UserCreateBulk) SaveX(ctx context.Context) []*User

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

type UserDelete

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

UserDelete is the builder for deleting a User entity.

func (*UserDelete) Exec

func (_d *UserDelete) Exec(ctx context.Context) (int, error)

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

func (*UserDelete) ExecX

func (_d *UserDelete) ExecX(ctx context.Context) int

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

func (*UserDelete) Where

func (_d *UserDelete) Where(ps ...predicate.User) *UserDelete

Where appends a list predicates to the UserDelete builder.

type UserDeleteOne

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

UserDeleteOne is the builder for deleting a single User entity.

func (*UserDeleteOne) Exec

func (_d *UserDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*UserDeleteOne) ExecX

func (_d *UserDeleteOne) ExecX(ctx context.Context)

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

func (*UserDeleteOne) Where

func (_d *UserDeleteOne) Where(ps ...predicate.User) *UserDeleteOne

Where appends a list predicates to the UserDelete builder.

type UserEdges

type UserEdges struct {
	// Projects owned by this user
	Projects []*Project `json:"projects,omitempty"`
	// Project memberships for this user
	Memberships []*ProjectMember `json:"memberships,omitempty"`
	// contains filtered or unexported fields
}

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

func (UserEdges) MembershipsOrErr

func (e UserEdges) MembershipsOrErr() ([]*ProjectMember, error)

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

func (UserEdges) ProjectsOrErr

func (e UserEdges) ProjectsOrErr() ([]*Project, error)

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

type UserGroupBy

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

UserGroupBy is the group-by builder for User entities.

func (*UserGroupBy) Aggregate

func (_g *UserGroupBy) Aggregate(fns ...AggregateFunc) *UserGroupBy

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

func (*UserGroupBy) Bool

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

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

func (*UserGroupBy) BoolX

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

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

func (*UserGroupBy) Bools

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

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

func (*UserGroupBy) BoolsX

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

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

func (*UserGroupBy) Float64

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

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

func (*UserGroupBy) Float64X

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

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

func (*UserGroupBy) Float64s

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

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

func (*UserGroupBy) Float64sX

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

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

func (*UserGroupBy) Int

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

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

func (*UserGroupBy) IntX

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

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

func (*UserGroupBy) Ints

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

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

func (*UserGroupBy) IntsX

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

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

func (*UserGroupBy) Scan

func (_g *UserGroupBy) Scan(ctx context.Context, v any) error

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

func (*UserGroupBy) ScanX

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

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

func (*UserGroupBy) String

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

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

func (*UserGroupBy) StringX

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

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

func (*UserGroupBy) Strings

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

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

func (*UserGroupBy) StringsX

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

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

type UserMutation

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

UserMutation represents an operation that mutates the User nodes in the graph.

func (*UserMutation) AddField

func (m *UserMutation) AddField(name string, value ent.Value) error

AddField adds the value to the field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*UserMutation) AddMembershipIDs

func (m *UserMutation) AddMembershipIDs(ids ...int)

AddMembershipIDs adds the "memberships" edge to the ProjectMember entity by ids.

func (*UserMutation) AddProjectIDs

func (m *UserMutation) AddProjectIDs(ids ...int)

AddProjectIDs adds the "projects" edge to the Project entity by ids.

func (*UserMutation) AddedEdges

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

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

func (*UserMutation) AddedField

func (m *UserMutation) AddedField(name string) (ent.Value, bool)

AddedField returns the numeric value that was incremented/decremented on a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*UserMutation) AddedFields

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

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

func (*UserMutation) AddedIDs

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

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

func (*UserMutation) ClearEdge

func (m *UserMutation) ClearEdge(name string) error

ClearEdge clears the value of the edge with the given name. It returns an error if that edge is not defined in the schema.

func (*UserMutation) ClearField

func (m *UserMutation) ClearField(name string) error

ClearField clears the value of the field with the given name. It returns an error if the field is not defined in the schema.

func (*UserMutation) ClearMemberships

func (m *UserMutation) ClearMemberships()

ClearMemberships clears the "memberships" edge to the ProjectMember entity.

func (*UserMutation) ClearProjects

func (m *UserMutation) ClearProjects()

ClearProjects clears the "projects" edge to the Project entity.

func (*UserMutation) ClearedEdges

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

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

func (*UserMutation) ClearedFields

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

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

func (UserMutation) Client

func (m UserMutation) Client() *Client

Client returns a new `ent.Client` from the mutation. If the mutation was executed in a transaction (ent.Tx), a transactional client is returned.

func (*UserMutation) CreatedAt

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

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

func (*UserMutation) EdgeCleared

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

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

func (*UserMutation) Email

func (m *UserMutation) Email() (r string, exists bool)

Email returns the value of the "email" field in the mutation.

func (*UserMutation) Field

func (m *UserMutation) Field(name string) (ent.Value, bool)

Field returns the value of a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*UserMutation) FieldCleared

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

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

func (*UserMutation) Fields

func (m *UserMutation) Fields() []string

Fields returns all fields that were changed during this mutation. Note that in order to get all numeric fields that were incremented/decremented, call AddedFields().

func (*UserMutation) ID

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

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

func (*UserMutation) IDs

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

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

func (*UserMutation) MembershipsCleared

func (m *UserMutation) MembershipsCleared() bool

MembershipsCleared reports if the "memberships" edge to the ProjectMember entity was cleared.

func (*UserMutation) MembershipsIDs

func (m *UserMutation) MembershipsIDs() (ids []int)

MembershipsIDs returns the "memberships" edge IDs in the mutation.

func (*UserMutation) OldCreatedAt

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

OldCreatedAt returns the old "created_at" field's value of the User entity. If the User object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*UserMutation) OldEmail

func (m *UserMutation) OldEmail(ctx context.Context) (v string, err error)

OldEmail returns the old "email" field's value of the User entity. If the User object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*UserMutation) OldField

func (m *UserMutation) OldField(ctx context.Context, name string) (ent.Value, error)

OldField returns the old value of the field from the database. An error is returned if the mutation operation is not UpdateOne, or the query to the database failed.

func (*UserMutation) OldPasswordHash

func (m *UserMutation) OldPasswordHash(ctx context.Context) (v string, err error)

OldPasswordHash returns the old "password_hash" field's value of the User entity. If the User object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*UserMutation) OldRole

func (m *UserMutation) OldRole(ctx context.Context) (v string, err error)

OldRole returns the old "role" field's value of the User entity. If the User object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*UserMutation) OldUpdatedAt

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

OldUpdatedAt returns the old "updated_at" field's value of the User entity. If the User object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*UserMutation) OldUsername

func (m *UserMutation) OldUsername(ctx context.Context) (v string, err error)

OldUsername returns the old "username" field's value of the User entity. If the User object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*UserMutation) Op

func (m *UserMutation) Op() Op

Op returns the operation name.

func (*UserMutation) PasswordHash

func (m *UserMutation) PasswordHash() (r string, exists bool)

PasswordHash returns the value of the "password_hash" field in the mutation.

func (*UserMutation) ProjectsCleared

func (m *UserMutation) ProjectsCleared() bool

ProjectsCleared reports if the "projects" edge to the Project entity was cleared.

func (*UserMutation) ProjectsIDs

func (m *UserMutation) ProjectsIDs() (ids []int)

ProjectsIDs returns the "projects" edge IDs in the mutation.

func (*UserMutation) RemoveMembershipIDs

func (m *UserMutation) RemoveMembershipIDs(ids ...int)

RemoveMembershipIDs removes the "memberships" edge to the ProjectMember entity by IDs.

func (*UserMutation) RemoveProjectIDs

func (m *UserMutation) RemoveProjectIDs(ids ...int)

RemoveProjectIDs removes the "projects" edge to the Project entity by IDs.

func (*UserMutation) RemovedEdges

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

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

func (*UserMutation) RemovedIDs

func (m *UserMutation) RemovedIDs(name string) []ent.Value

RemovedIDs returns all IDs (to other nodes) that were removed for the edge with the given name in this mutation.

func (*UserMutation) RemovedMembershipsIDs

func (m *UserMutation) RemovedMembershipsIDs() (ids []int)

RemovedMemberships returns the removed IDs of the "memberships" edge to the ProjectMember entity.

func (*UserMutation) RemovedProjectsIDs

func (m *UserMutation) RemovedProjectsIDs() (ids []int)

RemovedProjects returns the removed IDs of the "projects" edge to the Project entity.

func (*UserMutation) ResetCreatedAt

func (m *UserMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*UserMutation) ResetEdge

func (m *UserMutation) ResetEdge(name string) error

ResetEdge resets all changes to the edge with the given name in this mutation. It returns an error if the edge is not defined in the schema.

func (*UserMutation) ResetEmail

func (m *UserMutation) ResetEmail()

ResetEmail resets all changes to the "email" field.

func (*UserMutation) ResetField

func (m *UserMutation) ResetField(name string) error

ResetField resets all changes in the mutation for the field with the given name. It returns an error if the field is not defined in the schema.

func (*UserMutation) ResetMemberships

func (m *UserMutation) ResetMemberships()

ResetMemberships resets all changes to the "memberships" edge.

func (*UserMutation) ResetPasswordHash

func (m *UserMutation) ResetPasswordHash()

ResetPasswordHash resets all changes to the "password_hash" field.

func (*UserMutation) ResetProjects

func (m *UserMutation) ResetProjects()

ResetProjects resets all changes to the "projects" edge.

func (*UserMutation) ResetRole

func (m *UserMutation) ResetRole()

ResetRole resets all changes to the "role" field.

func (*UserMutation) ResetUpdatedAt

func (m *UserMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*UserMutation) ResetUsername

func (m *UserMutation) ResetUsername()

ResetUsername resets all changes to the "username" field.

func (*UserMutation) Role

func (m *UserMutation) Role() (r string, exists bool)

Role returns the value of the "role" field in the mutation.

func (*UserMutation) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*UserMutation) SetEmail

func (m *UserMutation) SetEmail(s string)

SetEmail sets the "email" field.

func (*UserMutation) SetField

func (m *UserMutation) SetField(name string, value ent.Value) error

SetField sets the value of a field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*UserMutation) SetOp

func (m *UserMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*UserMutation) SetPasswordHash

func (m *UserMutation) SetPasswordHash(s string)

SetPasswordHash sets the "password_hash" field.

func (*UserMutation) SetRole

func (m *UserMutation) SetRole(s string)

SetRole sets the "role" field.

func (*UserMutation) SetUpdatedAt

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

SetUpdatedAt sets the "updated_at" field.

func (*UserMutation) SetUsername

func (m *UserMutation) SetUsername(s string)

SetUsername sets the "username" field.

func (UserMutation) Tx

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

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

func (*UserMutation) Type

func (m *UserMutation) Type() string

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

func (*UserMutation) UpdatedAt

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

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

func (*UserMutation) Username

func (m *UserMutation) Username() (r string, exists bool)

Username returns the value of the "username" field in the mutation.

func (*UserMutation) Where

func (m *UserMutation) Where(ps ...predicate.User)

Where appends a list predicates to the UserMutation builder.

func (*UserMutation) WhereP

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

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

type UserQuery

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

UserQuery is the builder for querying User entities.

func (*UserQuery) Aggregate

func (_q *UserQuery) Aggregate(fns ...AggregateFunc) *UserSelect

Aggregate returns a UserSelect configured with the given aggregations.

func (*UserQuery) All

func (_q *UserQuery) All(ctx context.Context) ([]*User, error)

All executes the query and returns a list of Users.

func (*UserQuery) AllX

func (_q *UserQuery) AllX(ctx context.Context) []*User

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

func (*UserQuery) Clone

func (_q *UserQuery) Clone() *UserQuery

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

func (*UserQuery) Count

func (_q *UserQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*UserQuery) CountX

func (_q *UserQuery) CountX(ctx context.Context) int

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

func (*UserQuery) Exist

func (_q *UserQuery) Exist(ctx context.Context) (bool, error)

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

func (*UserQuery) ExistX

func (_q *UserQuery) ExistX(ctx context.Context) bool

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

func (*UserQuery) First

func (_q *UserQuery) First(ctx context.Context) (*User, error)

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

func (*UserQuery) FirstID

func (_q *UserQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*UserQuery) FirstIDX

func (_q *UserQuery) FirstIDX(ctx context.Context) int

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

func (*UserQuery) FirstX

func (_q *UserQuery) FirstX(ctx context.Context) *User

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

func (*UserQuery) GroupBy

func (_q *UserQuery) GroupBy(field string, fields ...string) *UserGroupBy

GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.

Example:

var v []struct {
	Username string `json:"username,omitempty"`
	Count int `json:"count,omitempty"`
}

client.User.Query().
	GroupBy(user.FieldUsername).
	Aggregate(data.Count()).
	Scan(ctx, &v)

func (*UserQuery) IDs

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

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

func (*UserQuery) IDsX

func (_q *UserQuery) IDsX(ctx context.Context) []int

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

func (*UserQuery) Limit

func (_q *UserQuery) Limit(limit int) *UserQuery

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

func (*UserQuery) Offset

func (_q *UserQuery) Offset(offset int) *UserQuery

Offset to start from.

func (*UserQuery) Only

func (_q *UserQuery) Only(ctx context.Context) (*User, error)

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

func (*UserQuery) OnlyID

func (_q *UserQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*UserQuery) OnlyIDX

func (_q *UserQuery) OnlyIDX(ctx context.Context) int

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

func (*UserQuery) OnlyX

func (_q *UserQuery) OnlyX(ctx context.Context) *User

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

func (*UserQuery) Order

func (_q *UserQuery) Order(o ...user.OrderOption) *UserQuery

Order specifies how the records should be ordered.

func (*UserQuery) QueryMemberships

func (_q *UserQuery) QueryMemberships() *ProjectMemberQuery

QueryMemberships chains the current query on the "memberships" edge.

func (*UserQuery) QueryProjects

func (_q *UserQuery) QueryProjects() *ProjectQuery

QueryProjects chains the current query on the "projects" edge.

func (*UserQuery) Select

func (_q *UserQuery) Select(fields ...string) *UserSelect

Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.

Example:

var v []struct {
	Username string `json:"username,omitempty"`
}

client.User.Query().
	Select(user.FieldUsername).
	Scan(ctx, &v)

func (*UserQuery) Unique

func (_q *UserQuery) Unique(unique bool) *UserQuery

Unique configures the query builder to filter duplicate records on query. By default, unique is set to true, and can be disabled using this method.

func (*UserQuery) Where

func (_q *UserQuery) Where(ps ...predicate.User) *UserQuery

Where adds a new predicate for the UserQuery builder.

func (*UserQuery) WithMemberships

func (_q *UserQuery) WithMemberships(opts ...func(*ProjectMemberQuery)) *UserQuery

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

func (*UserQuery) WithProjects

func (_q *UserQuery) WithProjects(opts ...func(*ProjectQuery)) *UserQuery

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

type UserSelect

type UserSelect struct {
	*UserQuery
	// contains filtered or unexported fields
}

UserSelect is the builder for selecting fields of User entities.

func (*UserSelect) Aggregate

func (_s *UserSelect) Aggregate(fns ...AggregateFunc) *UserSelect

Aggregate adds the given aggregation functions to the selector query.

func (*UserSelect) Bool

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

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

func (*UserSelect) BoolX

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

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

func (*UserSelect) Bools

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

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

func (*UserSelect) BoolsX

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

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

func (*UserSelect) Float64

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

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

func (*UserSelect) Float64X

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

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

func (*UserSelect) Float64s

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

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

func (*UserSelect) Float64sX

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

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

func (*UserSelect) Int

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

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

func (*UserSelect) IntX

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

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

func (*UserSelect) Ints

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

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

func (*UserSelect) IntsX

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

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

func (*UserSelect) Scan

func (_s *UserSelect) Scan(ctx context.Context, v any) error

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

func (*UserSelect) ScanX

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

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

func (*UserSelect) String

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

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

func (*UserSelect) StringX

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

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

func (*UserSelect) Strings

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

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

func (*UserSelect) StringsX

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

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

type UserUpdate

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

UserUpdate is the builder for updating User entities.

func (*UserUpdate) AddMembershipIDs

func (_u *UserUpdate) AddMembershipIDs(ids ...int) *UserUpdate

AddMembershipIDs adds the "memberships" edge to the ProjectMember entity by IDs.

func (*UserUpdate) AddMemberships

func (_u *UserUpdate) AddMemberships(v ...*ProjectMember) *UserUpdate

AddMemberships adds the "memberships" edges to the ProjectMember entity.

func (*UserUpdate) AddProjectIDs

func (_u *UserUpdate) AddProjectIDs(ids ...int) *UserUpdate

AddProjectIDs adds the "projects" edge to the Project entity by IDs.

func (*UserUpdate) AddProjects

func (_u *UserUpdate) AddProjects(v ...*Project) *UserUpdate

AddProjects adds the "projects" edges to the Project entity.

func (*UserUpdate) ClearMemberships

func (_u *UserUpdate) ClearMemberships() *UserUpdate

ClearMemberships clears all "memberships" edges to the ProjectMember entity.

func (*UserUpdate) ClearProjects

func (_u *UserUpdate) ClearProjects() *UserUpdate

ClearProjects clears all "projects" edges to the Project entity.

func (*UserUpdate) Exec

func (_u *UserUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*UserUpdate) ExecX

func (_u *UserUpdate) ExecX(ctx context.Context)

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

func (*UserUpdate) Mutation

func (_u *UserUpdate) Mutation() *UserMutation

Mutation returns the UserMutation object of the builder.

func (*UserUpdate) RemoveMembershipIDs

func (_u *UserUpdate) RemoveMembershipIDs(ids ...int) *UserUpdate

RemoveMembershipIDs removes the "memberships" edge to ProjectMember entities by IDs.

func (*UserUpdate) RemoveMemberships

func (_u *UserUpdate) RemoveMemberships(v ...*ProjectMember) *UserUpdate

RemoveMemberships removes "memberships" edges to ProjectMember entities.

func (*UserUpdate) RemoveProjectIDs

func (_u *UserUpdate) RemoveProjectIDs(ids ...int) *UserUpdate

RemoveProjectIDs removes the "projects" edge to Project entities by IDs.

func (*UserUpdate) RemoveProjects

func (_u *UserUpdate) RemoveProjects(v ...*Project) *UserUpdate

RemoveProjects removes "projects" edges to Project entities.

func (*UserUpdate) Save

func (_u *UserUpdate) Save(ctx context.Context) (int, error)

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

func (*UserUpdate) SaveX

func (_u *UserUpdate) SaveX(ctx context.Context) int

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

func (*UserUpdate) SetEmail

func (_u *UserUpdate) SetEmail(v string) *UserUpdate

SetEmail sets the "email" field.

func (*UserUpdate) SetNillableEmail

func (_u *UserUpdate) SetNillableEmail(v *string) *UserUpdate

SetNillableEmail sets the "email" field if the given value is not nil.

func (*UserUpdate) SetNillablePasswordHash

func (_u *UserUpdate) SetNillablePasswordHash(v *string) *UserUpdate

SetNillablePasswordHash sets the "password_hash" field if the given value is not nil.

func (*UserUpdate) SetNillableRole

func (_u *UserUpdate) SetNillableRole(v *string) *UserUpdate

SetNillableRole sets the "role" field if the given value is not nil.

func (*UserUpdate) SetNillableUsername

func (_u *UserUpdate) SetNillableUsername(v *string) *UserUpdate

SetNillableUsername sets the "username" field if the given value is not nil.

func (*UserUpdate) SetPasswordHash

func (_u *UserUpdate) SetPasswordHash(v string) *UserUpdate

SetPasswordHash sets the "password_hash" field.

func (*UserUpdate) SetRole

func (_u *UserUpdate) SetRole(v string) *UserUpdate

SetRole sets the "role" field.

func (*UserUpdate) SetUpdatedAt

func (_u *UserUpdate) SetUpdatedAt(v time.Time) *UserUpdate

SetUpdatedAt sets the "updated_at" field.

func (*UserUpdate) SetUsername

func (_u *UserUpdate) SetUsername(v string) *UserUpdate

SetUsername sets the "username" field.

func (*UserUpdate) Where

func (_u *UserUpdate) Where(ps ...predicate.User) *UserUpdate

Where appends a list predicates to the UserUpdate builder.

type UserUpdateOne

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

UserUpdateOne is the builder for updating a single User entity.

func (*UserUpdateOne) AddMembershipIDs

func (_u *UserUpdateOne) AddMembershipIDs(ids ...int) *UserUpdateOne

AddMembershipIDs adds the "memberships" edge to the ProjectMember entity by IDs.

func (*UserUpdateOne) AddMemberships

func (_u *UserUpdateOne) AddMemberships(v ...*ProjectMember) *UserUpdateOne

AddMemberships adds the "memberships" edges to the ProjectMember entity.

func (*UserUpdateOne) AddProjectIDs

func (_u *UserUpdateOne) AddProjectIDs(ids ...int) *UserUpdateOne

AddProjectIDs adds the "projects" edge to the Project entity by IDs.

func (*UserUpdateOne) AddProjects

func (_u *UserUpdateOne) AddProjects(v ...*Project) *UserUpdateOne

AddProjects adds the "projects" edges to the Project entity.

func (*UserUpdateOne) ClearMemberships

func (_u *UserUpdateOne) ClearMemberships() *UserUpdateOne

ClearMemberships clears all "memberships" edges to the ProjectMember entity.

func (*UserUpdateOne) ClearProjects

func (_u *UserUpdateOne) ClearProjects() *UserUpdateOne

ClearProjects clears all "projects" edges to the Project entity.

func (*UserUpdateOne) Exec

func (_u *UserUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*UserUpdateOne) ExecX

func (_u *UserUpdateOne) ExecX(ctx context.Context)

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

func (*UserUpdateOne) Mutation

func (_u *UserUpdateOne) Mutation() *UserMutation

Mutation returns the UserMutation object of the builder.

func (*UserUpdateOne) RemoveMembershipIDs

func (_u *UserUpdateOne) RemoveMembershipIDs(ids ...int) *UserUpdateOne

RemoveMembershipIDs removes the "memberships" edge to ProjectMember entities by IDs.

func (*UserUpdateOne) RemoveMemberships

func (_u *UserUpdateOne) RemoveMemberships(v ...*ProjectMember) *UserUpdateOne

RemoveMemberships removes "memberships" edges to ProjectMember entities.

func (*UserUpdateOne) RemoveProjectIDs

func (_u *UserUpdateOne) RemoveProjectIDs(ids ...int) *UserUpdateOne

RemoveProjectIDs removes the "projects" edge to Project entities by IDs.

func (*UserUpdateOne) RemoveProjects

func (_u *UserUpdateOne) RemoveProjects(v ...*Project) *UserUpdateOne

RemoveProjects removes "projects" edges to Project entities.

func (*UserUpdateOne) Save

func (_u *UserUpdateOne) Save(ctx context.Context) (*User, error)

Save executes the query and returns the updated User entity.

func (*UserUpdateOne) SaveX

func (_u *UserUpdateOne) SaveX(ctx context.Context) *User

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

func (*UserUpdateOne) Select

func (_u *UserUpdateOne) Select(field string, fields ...string) *UserUpdateOne

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

func (*UserUpdateOne) SetEmail

func (_u *UserUpdateOne) SetEmail(v string) *UserUpdateOne

SetEmail sets the "email" field.

func (*UserUpdateOne) SetNillableEmail

func (_u *UserUpdateOne) SetNillableEmail(v *string) *UserUpdateOne

SetNillableEmail sets the "email" field if the given value is not nil.

func (*UserUpdateOne) SetNillablePasswordHash

func (_u *UserUpdateOne) SetNillablePasswordHash(v *string) *UserUpdateOne

SetNillablePasswordHash sets the "password_hash" field if the given value is not nil.

func (*UserUpdateOne) SetNillableRole

func (_u *UserUpdateOne) SetNillableRole(v *string) *UserUpdateOne

SetNillableRole sets the "role" field if the given value is not nil.

func (*UserUpdateOne) SetNillableUsername

func (_u *UserUpdateOne) SetNillableUsername(v *string) *UserUpdateOne

SetNillableUsername sets the "username" field if the given value is not nil.

func (*UserUpdateOne) SetPasswordHash

func (_u *UserUpdateOne) SetPasswordHash(v string) *UserUpdateOne

SetPasswordHash sets the "password_hash" field.

func (*UserUpdateOne) SetRole

func (_u *UserUpdateOne) SetRole(v string) *UserUpdateOne

SetRole sets the "role" field.

func (*UserUpdateOne) SetUpdatedAt

func (_u *UserUpdateOne) SetUpdatedAt(v time.Time) *UserUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*UserUpdateOne) SetUsername

func (_u *UserUpdateOne) SetUsername(v string) *UserUpdateOne

SetUsername sets the "username" field.

func (*UserUpdateOne) Where

func (_u *UserUpdateOne) Where(ps ...predicate.User) *UserUpdateOne

Where appends a list predicates to the UserUpdate builder.

type Users

type Users []*User

Users is a parsable slice of User.

type ValidationError

type ValidationError struct {
	Name string // Field or edge name.
	// contains filtered or unexported fields
}

ValidationError returns when validating a field or edge fails.

func (*ValidationError) Error

func (e *ValidationError) Error() string

Error implements the error interface.

func (*ValidationError) Unwrap

func (e *ValidationError) Unwrap() error

Unwrap implements the errors.Wrapper interface.

type Value

type Value = ent.Value

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL