generated

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2024 License: Apache-2.0 Imports: 34 Imported by: 0

Documentation

Overview

Package generated is the ent generated package

Index

Constants

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

	// Node types.
	TypeDatabase = "Database"
	TypeGroup    = "Group"
)

Variables

View Source
var DefaultDatabaseOrder = &DatabaseOrder{
	Direction: entgql.OrderDirectionAsc,
	Field: &DatabaseOrderField{
		Value: func(d *Database) (ent.Value, error) {
			return d.ID, nil
		},
		column: database.FieldID,
		toTerm: database.ByID,
		toCursor: func(d *Database) Cursor {
			return Cursor{ID: d.ID}
		},
	},
}

DefaultDatabaseOrder is the default ordering of Database.

View Source
var DefaultGroupOrder = &GroupOrder{
	Direction: entgql.OrderDirectionAsc,
	Field: &GroupOrderField{
		Value: func(gr *Group) (ent.Value, error) {
			return gr.ID, nil
		},
		column: group.FieldID,
		toTerm: group.ByID,
		toCursor: func(gr *Group) Cursor {
			return Cursor{ID: gr.ID}
		},
	},
}

DefaultGroupOrder is the default ordering of Group.

View Source
var ErrEmptyDatabaseWhereInput = errors.New("generated: empty predicate DatabaseWhereInput")

ErrEmptyDatabaseWhereInput is returned in case the DatabaseWhereInput is empty.

View Source
var ErrEmptyGroupWhereInput = errors.New("generated: empty predicate GroupWhereInput")

ErrEmptyGroupWhereInput is returned in case the GroupWhereInput is empty.

View Source
var ErrTxStarted = errors.New("generated: 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 DatabaseEdgeCleanup

func DatabaseEdgeCleanup(ctx context.Context, id string) error

func Desc

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

Desc applies the given fields in DESC order.

func GroupEdgeCleanup

func GroupEdgeCleanup(ctx context.Context, id string) error

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.

func OpenTxFromContext

func OpenTxFromContext(ctx context.Context) (context.Context, driver.Tx, error)

OpenTxFromContext open transactions from client stored in context.

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(generated.As(generated.Sum(field1), "sum_field1"), (generated.As(generated.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
	// Database is the client for interacting with the Database builders.
	Database *DatabaseClient
	// Group is the client for interacting with the Group builders.
	Group *GroupClient
	// 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().
	Database.
	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) Noder

func (c *Client) Noder(ctx context.Context, id string, opts ...NodeOption) (_ Noder, err error)

Noder returns a Node by its id. If the NodeType was not provided, it will be derived from the id value according to the universal-id configuration.

c.Noder(ctx, id)
c.Noder(ctx, id, ent.WithNodeType(typeResolver))

func (*Client) Noders

func (c *Client) Noders(ctx context.Context, ids []string, opts ...NodeOption) ([]Noder, error)

func (*Client) OpenTx

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

OpenTx opens a transaction and returns a transactional context along with the created transaction.

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(...)`.

func (*Client) WithAuthz

func (c *Client) WithAuthz()

WithAuthz adds the authz hooks to the appropriate schemas - generated by entfga

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 CreateDatabaseInput

type CreateDatabaseInput struct {
	CreatedAt      *time.Time
	UpdatedAt      *time.Time
	CreatedBy      *string
	UpdatedBy      *string
	OrganizationID string
	Name           string
	Geo            *string
	Dsn            string
	Token          *string
	Status         *enums.DatabaseStatus
	Provider       *enums.DatabaseProvider
	GroupID        string
}

CreateDatabaseInput represents a mutation input for creating databases.

func (*CreateDatabaseInput) Mutate

func (i *CreateDatabaseInput) Mutate(m *DatabaseMutation)

Mutate applies the CreateDatabaseInput on the DatabaseMutation builder.

type CreateGroupInput

type CreateGroupInput struct {
	CreatedAt       *time.Time
	UpdatedAt       *time.Time
	CreatedBy       *string
	UpdatedBy       *string
	Name            string
	Description     *string
	PrimaryLocation string
	Locations       []string
	Token           *string
	Region          *enums.Region
	DatabaseIDs     []string
}

CreateGroupInput represents a mutation input for creating groups.

func (*CreateGroupInput) Mutate

func (i *CreateGroupInput) Mutate(m *GroupMutation)

Mutate applies the CreateGroupInput on the GroupMutation builder.

type Cursor

type Cursor = entgql.Cursor[string]

Common entgql types.

type Database

type Database struct {

	// ID of the ent.
	ID string `json:"id,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// UpdatedAt holds the value of the "updated_at" field.
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	// CreatedBy holds the value of the "created_by" field.
	CreatedBy string `json:"created_by,omitempty"`
	// UpdatedBy holds the value of the "updated_by" field.
	UpdatedBy string `json:"updated_by,omitempty"`
	// DeletedAt holds the value of the "deleted_at" field.
	DeletedAt time.Time `json:"deleted_at,omitempty"`
	// DeletedBy holds the value of the "deleted_by" field.
	DeletedBy string `json:"deleted_by,omitempty"`
	// the ID of the organization
	OrganizationID string `json:"organization_id,omitempty"`
	// the name to the database
	Name string `json:"name,omitempty"`
	// the geo location of the database
	Geo string `json:"geo,omitempty"`
	// the DSN to the database
	Dsn string `json:"dsn,omitempty"`
	// the ID of the group
	GroupID string `json:"group_id,omitempty"`
	// the auth token used to connect to the database
	Token string `json:"-"`
	// status of the database
	Status enums.DatabaseStatus `json:"status,omitempty"`
	// provider of the database
	Provider enums.DatabaseProvider `json:"provider,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the DatabaseQuery when eager-loading is set.
	Edges DatabaseEdges `json:"edges"`
	// contains filtered or unexported fields
}

Database is the model entity for the Database schema.

func (*Database) Group

func (d *Database) Group(ctx context.Context) (*Group, error)

func (*Database) IsNode

func (n *Database) IsNode()

IsNode implements the Node interface check for GQLGen.

func (*Database) QueryGroup

func (d *Database) QueryGroup() *GroupQuery

QueryGroup queries the "group" edge of the Database entity.

func (*Database) String

func (d *Database) String() string

String implements the fmt.Stringer.

func (*Database) ToEdge

func (d *Database) ToEdge(order *DatabaseOrder) *DatabaseEdge

ToEdge converts Database into DatabaseEdge.

func (*Database) Unwrap

func (d *Database) Unwrap() *Database

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

func (d *Database) Update() *DatabaseUpdateOne

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

func (*Database) Value

func (d *Database) Value(name string) (ent.Value, error)

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

type DatabaseClient

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

DatabaseClient is a client for the Database schema.

func NewDatabaseClient

func NewDatabaseClient(c config) *DatabaseClient

NewDatabaseClient returns a client for the Database from the given config.

func (*DatabaseClient) Create

func (c *DatabaseClient) Create() *DatabaseCreate

Create returns a builder for creating a Database entity.

func (*DatabaseClient) CreateBulk

func (c *DatabaseClient) CreateBulk(builders ...*DatabaseCreate) *DatabaseCreateBulk

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

func (*DatabaseClient) Delete

func (c *DatabaseClient) Delete() *DatabaseDelete

Delete returns a delete builder for Database.

func (*DatabaseClient) DeleteOne

func (c *DatabaseClient) DeleteOne(d *Database) *DatabaseDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*DatabaseClient) DeleteOneID

func (c *DatabaseClient) DeleteOneID(id string) *DatabaseDeleteOne

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

func (*DatabaseClient) Get

func (c *DatabaseClient) Get(ctx context.Context, id string) (*Database, error)

Get returns a Database entity by its id.

func (*DatabaseClient) GetX

func (c *DatabaseClient) GetX(ctx context.Context, id string) *Database

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

func (*DatabaseClient) Hooks

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

Hooks returns the client hooks.

func (*DatabaseClient) Intercept

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

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

func (*DatabaseClient) Interceptors

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

Interceptors returns the client interceptors.

func (*DatabaseClient) MapCreateBulk

func (c *DatabaseClient) MapCreateBulk(slice any, setFunc func(*DatabaseCreate, int)) *DatabaseCreateBulk

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

func (c *DatabaseClient) Query() *DatabaseQuery

Query returns a query builder for Database.

func (*DatabaseClient) QueryGroup

func (c *DatabaseClient) QueryGroup(d *Database) *GroupQuery

QueryGroup queries the group edge of a Database.

func (*DatabaseClient) Update

func (c *DatabaseClient) Update() *DatabaseUpdate

Update returns an update builder for Database.

func (*DatabaseClient) UpdateOne

func (c *DatabaseClient) UpdateOne(d *Database) *DatabaseUpdateOne

UpdateOne returns an update builder for the given entity.

func (*DatabaseClient) UpdateOneID

func (c *DatabaseClient) UpdateOneID(id string) *DatabaseUpdateOne

UpdateOneID returns an update builder for the given id.

func (*DatabaseClient) Use

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

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

type DatabaseConnection

type DatabaseConnection struct {
	Edges      []*DatabaseEdge `json:"edges"`
	PageInfo   PageInfo        `json:"pageInfo"`
	TotalCount int             `json:"totalCount"`
}

DatabaseConnection is the connection containing edges to Database.

type DatabaseCreate

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

DatabaseCreate is the builder for creating a Database entity.

func (*DatabaseCreate) Exec

func (dc *DatabaseCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*DatabaseCreate) ExecX

func (dc *DatabaseCreate) ExecX(ctx context.Context)

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

func (*DatabaseCreate) Mutation

func (dc *DatabaseCreate) Mutation() *DatabaseMutation

Mutation returns the DatabaseMutation object of the builder.

func (*DatabaseCreate) Save

func (dc *DatabaseCreate) Save(ctx context.Context) (*Database, error)

Save creates the Database in the database.

func (*DatabaseCreate) SaveX

func (dc *DatabaseCreate) SaveX(ctx context.Context) *Database

SaveX calls Save and panics if Save returns an error.

func (*DatabaseCreate) SetCreatedAt

func (dc *DatabaseCreate) SetCreatedAt(t time.Time) *DatabaseCreate

SetCreatedAt sets the "created_at" field.

func (*DatabaseCreate) SetCreatedBy

func (dc *DatabaseCreate) SetCreatedBy(s string) *DatabaseCreate

SetCreatedBy sets the "created_by" field.

func (*DatabaseCreate) SetDeletedAt

func (dc *DatabaseCreate) SetDeletedAt(t time.Time) *DatabaseCreate

SetDeletedAt sets the "deleted_at" field.

func (*DatabaseCreate) SetDeletedBy

func (dc *DatabaseCreate) SetDeletedBy(s string) *DatabaseCreate

SetDeletedBy sets the "deleted_by" field.

func (*DatabaseCreate) SetDsn

func (dc *DatabaseCreate) SetDsn(s string) *DatabaseCreate

SetDsn sets the "dsn" field.

func (*DatabaseCreate) SetGeo

func (dc *DatabaseCreate) SetGeo(s string) *DatabaseCreate

SetGeo sets the "geo" field.

func (*DatabaseCreate) SetGroup

func (dc *DatabaseCreate) SetGroup(g *Group) *DatabaseCreate

SetGroup sets the "group" edge to the Group entity.

func (*DatabaseCreate) SetGroupID

func (dc *DatabaseCreate) SetGroupID(s string) *DatabaseCreate

SetGroupID sets the "group_id" field.

func (*DatabaseCreate) SetID

func (dc *DatabaseCreate) SetID(s string) *DatabaseCreate

SetID sets the "id" field.

func (*DatabaseCreate) SetInput

SetInput applies the change-set in the CreateDatabaseInput on the DatabaseCreate builder.

func (*DatabaseCreate) SetName

func (dc *DatabaseCreate) SetName(s string) *DatabaseCreate

SetName sets the "name" field.

func (*DatabaseCreate) SetNillableCreatedAt

func (dc *DatabaseCreate) SetNillableCreatedAt(t *time.Time) *DatabaseCreate

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

func (*DatabaseCreate) SetNillableCreatedBy

func (dc *DatabaseCreate) SetNillableCreatedBy(s *string) *DatabaseCreate

SetNillableCreatedBy sets the "created_by" field if the given value is not nil.

func (*DatabaseCreate) SetNillableDeletedAt

func (dc *DatabaseCreate) SetNillableDeletedAt(t *time.Time) *DatabaseCreate

SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.

func (*DatabaseCreate) SetNillableDeletedBy

func (dc *DatabaseCreate) SetNillableDeletedBy(s *string) *DatabaseCreate

SetNillableDeletedBy sets the "deleted_by" field if the given value is not nil.

func (*DatabaseCreate) SetNillableGeo

func (dc *DatabaseCreate) SetNillableGeo(s *string) *DatabaseCreate

SetNillableGeo sets the "geo" field if the given value is not nil.

func (*DatabaseCreate) SetNillableID

func (dc *DatabaseCreate) SetNillableID(s *string) *DatabaseCreate

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

func (*DatabaseCreate) SetNillableProvider

func (dc *DatabaseCreate) SetNillableProvider(ep *enums.DatabaseProvider) *DatabaseCreate

SetNillableProvider sets the "provider" field if the given value is not nil.

func (*DatabaseCreate) SetNillableStatus

func (dc *DatabaseCreate) SetNillableStatus(es *enums.DatabaseStatus) *DatabaseCreate

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

func (*DatabaseCreate) SetNillableToken

func (dc *DatabaseCreate) SetNillableToken(s *string) *DatabaseCreate

SetNillableToken sets the "token" field if the given value is not nil.

func (*DatabaseCreate) SetNillableUpdatedAt

func (dc *DatabaseCreate) SetNillableUpdatedAt(t *time.Time) *DatabaseCreate

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

func (*DatabaseCreate) SetNillableUpdatedBy

func (dc *DatabaseCreate) SetNillableUpdatedBy(s *string) *DatabaseCreate

SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil.

func (*DatabaseCreate) SetOrganizationID

func (dc *DatabaseCreate) SetOrganizationID(s string) *DatabaseCreate

SetOrganizationID sets the "organization_id" field.

func (*DatabaseCreate) SetProvider

func (dc *DatabaseCreate) SetProvider(ep enums.DatabaseProvider) *DatabaseCreate

SetProvider sets the "provider" field.

func (*DatabaseCreate) SetStatus

SetStatus sets the "status" field.

func (*DatabaseCreate) SetToken

func (dc *DatabaseCreate) SetToken(s string) *DatabaseCreate

SetToken sets the "token" field.

func (*DatabaseCreate) SetUpdatedAt

func (dc *DatabaseCreate) SetUpdatedAt(t time.Time) *DatabaseCreate

SetUpdatedAt sets the "updated_at" field.

func (*DatabaseCreate) SetUpdatedBy

func (dc *DatabaseCreate) SetUpdatedBy(s string) *DatabaseCreate

SetUpdatedBy sets the "updated_by" field.

type DatabaseCreateBulk

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

DatabaseCreateBulk is the builder for creating many Database entities in bulk.

func (*DatabaseCreateBulk) Exec

func (dcb *DatabaseCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*DatabaseCreateBulk) ExecX

func (dcb *DatabaseCreateBulk) ExecX(ctx context.Context)

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

func (*DatabaseCreateBulk) Save

func (dcb *DatabaseCreateBulk) Save(ctx context.Context) ([]*Database, error)

Save creates the Database entities in the database.

func (*DatabaseCreateBulk) SaveX

func (dcb *DatabaseCreateBulk) SaveX(ctx context.Context) []*Database

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

type DatabaseDelete

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

DatabaseDelete is the builder for deleting a Database entity.

func (*DatabaseDelete) Exec

func (dd *DatabaseDelete) Exec(ctx context.Context) (int, error)

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

func (*DatabaseDelete) ExecX

func (dd *DatabaseDelete) ExecX(ctx context.Context) int

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

func (*DatabaseDelete) Where

func (dd *DatabaseDelete) Where(ps ...predicate.Database) *DatabaseDelete

Where appends a list predicates to the DatabaseDelete builder.

type DatabaseDeleteOne

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

DatabaseDeleteOne is the builder for deleting a single Database entity.

func (*DatabaseDeleteOne) Exec

func (ddo *DatabaseDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*DatabaseDeleteOne) ExecX

func (ddo *DatabaseDeleteOne) ExecX(ctx context.Context)

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

func (*DatabaseDeleteOne) Where

Where appends a list predicates to the DatabaseDelete builder.

type DatabaseEdge

type DatabaseEdge struct {
	Node   *Database `json:"node"`
	Cursor Cursor    `json:"cursor"`
}

DatabaseEdge is the edge representation of Database.

type DatabaseEdges

type DatabaseEdges struct {
	// Group holds the value of the group edge.
	Group *Group `json:"group,omitempty"`
	// contains filtered or unexported fields
}

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

func (DatabaseEdges) GroupOrErr

func (e DatabaseEdges) GroupOrErr() (*Group, error)

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

type DatabaseFilter

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

DatabaseFilter provides a generic filtering capability at runtime for DatabaseQuery.

func (*DatabaseFilter) Where

func (f *DatabaseFilter) Where(p entql.P)

Where applies the entql predicate on the query filter.

func (*DatabaseFilter) WhereCreatedAt

func (f *DatabaseFilter) WhereCreatedAt(p entql.TimeP)

WhereCreatedAt applies the entql time.Time predicate on the created_at field.

func (*DatabaseFilter) WhereCreatedBy

func (f *DatabaseFilter) WhereCreatedBy(p entql.StringP)

WhereCreatedBy applies the entql string predicate on the created_by field.

func (*DatabaseFilter) WhereDeletedAt

func (f *DatabaseFilter) WhereDeletedAt(p entql.TimeP)

WhereDeletedAt applies the entql time.Time predicate on the deleted_at field.

func (*DatabaseFilter) WhereDeletedBy

func (f *DatabaseFilter) WhereDeletedBy(p entql.StringP)

WhereDeletedBy applies the entql string predicate on the deleted_by field.

func (*DatabaseFilter) WhereDsn

func (f *DatabaseFilter) WhereDsn(p entql.StringP)

WhereDsn applies the entql string predicate on the dsn field.

func (*DatabaseFilter) WhereGeo

func (f *DatabaseFilter) WhereGeo(p entql.StringP)

WhereGeo applies the entql string predicate on the geo field.

func (*DatabaseFilter) WhereGroupID

func (f *DatabaseFilter) WhereGroupID(p entql.StringP)

WhereGroupID applies the entql string predicate on the group_id field.

func (*DatabaseFilter) WhereHasGroup

func (f *DatabaseFilter) WhereHasGroup()

WhereHasGroup applies a predicate to check if query has an edge group.

func (*DatabaseFilter) WhereHasGroupWith

func (f *DatabaseFilter) WhereHasGroupWith(preds ...predicate.Group)

WhereHasGroupWith applies a predicate to check if query has an edge group with a given conditions (other predicates).

func (*DatabaseFilter) WhereID

func (f *DatabaseFilter) WhereID(p entql.StringP)

WhereID applies the entql string predicate on the id field.

func (*DatabaseFilter) WhereName

func (f *DatabaseFilter) WhereName(p entql.StringP)

WhereName applies the entql string predicate on the name field.

func (*DatabaseFilter) WhereOrganizationID

func (f *DatabaseFilter) WhereOrganizationID(p entql.StringP)

WhereOrganizationID applies the entql string predicate on the organization_id field.

func (*DatabaseFilter) WhereProvider

func (f *DatabaseFilter) WhereProvider(p entql.StringP)

WhereProvider applies the entql string predicate on the provider field.

func (*DatabaseFilter) WhereStatus

func (f *DatabaseFilter) WhereStatus(p entql.StringP)

WhereStatus applies the entql string predicate on the status field.

func (*DatabaseFilter) WhereToken

func (f *DatabaseFilter) WhereToken(p entql.StringP)

WhereToken applies the entql string predicate on the token field.

func (*DatabaseFilter) WhereUpdatedAt

func (f *DatabaseFilter) WhereUpdatedAt(p entql.TimeP)

WhereUpdatedAt applies the entql time.Time predicate on the updated_at field.

func (*DatabaseFilter) WhereUpdatedBy

func (f *DatabaseFilter) WhereUpdatedBy(p entql.StringP)

WhereUpdatedBy applies the entql string predicate on the updated_by field.

type DatabaseGroupBy

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

DatabaseGroupBy is the group-by builder for Database entities.

func (*DatabaseGroupBy) Aggregate

func (dgb *DatabaseGroupBy) Aggregate(fns ...AggregateFunc) *DatabaseGroupBy

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

func (*DatabaseGroupBy) Bool

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

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

func (*DatabaseGroupBy) BoolX

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

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

func (*DatabaseGroupBy) Bools

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

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

func (*DatabaseGroupBy) BoolsX

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

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

func (*DatabaseGroupBy) Float64

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

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

func (*DatabaseGroupBy) Float64X

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

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

func (*DatabaseGroupBy) Float64s

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

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

func (*DatabaseGroupBy) Float64sX

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

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

func (*DatabaseGroupBy) Int

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

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

func (*DatabaseGroupBy) IntX

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

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

func (*DatabaseGroupBy) Ints

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

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

func (*DatabaseGroupBy) IntsX

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

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

func (*DatabaseGroupBy) Scan

func (dgb *DatabaseGroupBy) Scan(ctx context.Context, v any) error

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

func (*DatabaseGroupBy) ScanX

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

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

func (*DatabaseGroupBy) String

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

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

func (*DatabaseGroupBy) StringX

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

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

func (*DatabaseGroupBy) Strings

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

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

func (*DatabaseGroupBy) StringsX

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

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

type DatabaseMutation

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

DatabaseMutation represents an operation that mutates the Database nodes in the graph.

func (*DatabaseMutation) AddField

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

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

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

func (*DatabaseMutation) AddedField

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

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

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

func (*DatabaseMutation) AddedIDs

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

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

func (*DatabaseMutation) ClearCreatedAt

func (m *DatabaseMutation) ClearCreatedAt()

ClearCreatedAt clears the value of the "created_at" field.

func (*DatabaseMutation) ClearCreatedBy

func (m *DatabaseMutation) ClearCreatedBy()

ClearCreatedBy clears the value of the "created_by" field.

func (*DatabaseMutation) ClearDeletedAt

func (m *DatabaseMutation) ClearDeletedAt()

ClearDeletedAt clears the value of the "deleted_at" field.

func (*DatabaseMutation) ClearDeletedBy

func (m *DatabaseMutation) ClearDeletedBy()

ClearDeletedBy clears the value of the "deleted_by" field.

func (*DatabaseMutation) ClearEdge

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

func (m *DatabaseMutation) 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 (*DatabaseMutation) ClearGeo

func (m *DatabaseMutation) ClearGeo()

ClearGeo clears the value of the "geo" field.

func (*DatabaseMutation) ClearGroup

func (m *DatabaseMutation) ClearGroup()

ClearGroup clears the "group" edge to the Group entity.

func (*DatabaseMutation) ClearToken

func (m *DatabaseMutation) ClearToken()

ClearToken clears the value of the "token" field.

func (*DatabaseMutation) ClearUpdatedAt

func (m *DatabaseMutation) ClearUpdatedAt()

ClearUpdatedAt clears the value of the "updated_at" field.

func (*DatabaseMutation) ClearUpdatedBy

func (m *DatabaseMutation) ClearUpdatedBy()

ClearUpdatedBy clears the value of the "updated_by" field.

func (*DatabaseMutation) ClearedEdges

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

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

func (*DatabaseMutation) ClearedFields

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

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

func (DatabaseMutation) Client

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

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

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

func (*DatabaseMutation) CreatedAtCleared

func (m *DatabaseMutation) CreatedAtCleared() bool

CreatedAtCleared returns if the "created_at" field was cleared in this mutation.

func (*DatabaseMutation) CreatedBy

func (m *DatabaseMutation) CreatedBy() (r string, exists bool)

CreatedBy returns the value of the "created_by" field in the mutation.

func (*DatabaseMutation) CreatedByCleared

func (m *DatabaseMutation) CreatedByCleared() bool

CreatedByCleared returns if the "created_by" field was cleared in this mutation.

func (*DatabaseMutation) DeletedAt

func (m *DatabaseMutation) DeletedAt() (r time.Time, exists bool)

DeletedAt returns the value of the "deleted_at" field in the mutation.

func (*DatabaseMutation) DeletedAtCleared

func (m *DatabaseMutation) DeletedAtCleared() bool

DeletedAtCleared returns if the "deleted_at" field was cleared in this mutation.

func (*DatabaseMutation) DeletedBy

func (m *DatabaseMutation) DeletedBy() (r string, exists bool)

DeletedBy returns the value of the "deleted_by" field in the mutation.

func (*DatabaseMutation) DeletedByCleared

func (m *DatabaseMutation) DeletedByCleared() bool

DeletedByCleared returns if the "deleted_by" field was cleared in this mutation.

func (*DatabaseMutation) Dsn

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

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

func (*DatabaseMutation) EdgeCleared

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

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

func (*DatabaseMutation) Field

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

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

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

func (*DatabaseMutation) Fields

func (m *DatabaseMutation) 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 (*DatabaseMutation) Filter

func (m *DatabaseMutation) Filter() *DatabaseFilter

Filter returns an entql.Where implementation to apply filters on the DatabaseMutation builder.

func (*DatabaseMutation) Geo

func (m *DatabaseMutation) Geo() (r string, exists bool)

Geo returns the value of the "geo" field in the mutation.

func (*DatabaseMutation) GeoCleared

func (m *DatabaseMutation) GeoCleared() bool

GeoCleared returns if the "geo" field was cleared in this mutation.

func (*DatabaseMutation) GroupCleared

func (m *DatabaseMutation) GroupCleared() bool

GroupCleared reports if the "group" edge to the Group entity was cleared.

func (*DatabaseMutation) GroupID

func (m *DatabaseMutation) GroupID() (r string, exists bool)

GroupID returns the value of the "group_id" field in the mutation.

func (*DatabaseMutation) GroupIDs

func (m *DatabaseMutation) GroupIDs() (ids []string)

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

func (*DatabaseMutation) ID

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

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

func (*DatabaseMutation) IDs

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

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

func (*DatabaseMutation) Name

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

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

func (*DatabaseMutation) OldCreatedAt

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

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

func (m *DatabaseMutation) OldCreatedBy(ctx context.Context) (v string, err error)

OldCreatedBy returns the old "created_by" field's value of the Database entity. If the Database 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 (*DatabaseMutation) OldDeletedAt

func (m *DatabaseMutation) OldDeletedAt(ctx context.Context) (v time.Time, err error)

OldDeletedAt returns the old "deleted_at" field's value of the Database entity. If the Database 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 (*DatabaseMutation) OldDeletedBy

func (m *DatabaseMutation) OldDeletedBy(ctx context.Context) (v string, err error)

OldDeletedBy returns the old "deleted_by" field's value of the Database entity. If the Database 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 (*DatabaseMutation) OldDsn

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

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

func (m *DatabaseMutation) 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 (*DatabaseMutation) OldGeo

func (m *DatabaseMutation) OldGeo(ctx context.Context) (v string, err error)

OldGeo returns the old "geo" field's value of the Database entity. If the Database 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 (*DatabaseMutation) OldGroupID

func (m *DatabaseMutation) OldGroupID(ctx context.Context) (v string, err error)

OldGroupID returns the old "group_id" field's value of the Database entity. If the Database 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 (*DatabaseMutation) OldName

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

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

func (m *DatabaseMutation) OldOrganizationID(ctx context.Context) (v string, err error)

OldOrganizationID returns the old "organization_id" field's value of the Database entity. If the Database 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 (*DatabaseMutation) OldProvider

func (m *DatabaseMutation) OldProvider(ctx context.Context) (v enums.DatabaseProvider, err error)

OldProvider returns the old "provider" field's value of the Database entity. If the Database 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 (*DatabaseMutation) OldStatus

func (m *DatabaseMutation) OldStatus(ctx context.Context) (v enums.DatabaseStatus, err error)

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

func (m *DatabaseMutation) OldToken(ctx context.Context) (v string, err error)

OldToken returns the old "token" field's value of the Database entity. If the Database 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 (*DatabaseMutation) OldUpdatedAt

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

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

func (m *DatabaseMutation) OldUpdatedBy(ctx context.Context) (v string, err error)

OldUpdatedBy returns the old "updated_by" field's value of the Database entity. If the Database 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 (*DatabaseMutation) Op

func (m *DatabaseMutation) Op() Op

Op returns the operation name.

func (*DatabaseMutation) OrganizationID

func (m *DatabaseMutation) OrganizationID() (r string, exists bool)

OrganizationID returns the value of the "organization_id" field in the mutation.

func (*DatabaseMutation) Provider

func (m *DatabaseMutation) Provider() (r enums.DatabaseProvider, exists bool)

Provider returns the value of the "provider" field in the mutation.

func (*DatabaseMutation) RemovedEdges

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

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

func (*DatabaseMutation) RemovedIDs

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

func (m *DatabaseMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*DatabaseMutation) ResetCreatedBy

func (m *DatabaseMutation) ResetCreatedBy()

ResetCreatedBy resets all changes to the "created_by" field.

func (*DatabaseMutation) ResetDeletedAt

func (m *DatabaseMutation) ResetDeletedAt()

ResetDeletedAt resets all changes to the "deleted_at" field.

func (*DatabaseMutation) ResetDeletedBy

func (m *DatabaseMutation) ResetDeletedBy()

ResetDeletedBy resets all changes to the "deleted_by" field.

func (*DatabaseMutation) ResetDsn

func (m *DatabaseMutation) ResetDsn()

ResetDsn resets all changes to the "dsn" field.

func (*DatabaseMutation) ResetEdge

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

func (m *DatabaseMutation) 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 (*DatabaseMutation) ResetGeo

func (m *DatabaseMutation) ResetGeo()

ResetGeo resets all changes to the "geo" field.

func (*DatabaseMutation) ResetGroup

func (m *DatabaseMutation) ResetGroup()

ResetGroup resets all changes to the "group" edge.

func (*DatabaseMutation) ResetGroupID

func (m *DatabaseMutation) ResetGroupID()

ResetGroupID resets all changes to the "group_id" field.

func (*DatabaseMutation) ResetName

func (m *DatabaseMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*DatabaseMutation) ResetOrganizationID

func (m *DatabaseMutation) ResetOrganizationID()

ResetOrganizationID resets all changes to the "organization_id" field.

func (*DatabaseMutation) ResetProvider

func (m *DatabaseMutation) ResetProvider()

ResetProvider resets all changes to the "provider" field.

func (*DatabaseMutation) ResetStatus

func (m *DatabaseMutation) ResetStatus()

ResetStatus resets all changes to the "status" field.

func (*DatabaseMutation) ResetToken

func (m *DatabaseMutation) ResetToken()

ResetToken resets all changes to the "token" field.

func (*DatabaseMutation) ResetUpdatedAt

func (m *DatabaseMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*DatabaseMutation) ResetUpdatedBy

func (m *DatabaseMutation) ResetUpdatedBy()

ResetUpdatedBy resets all changes to the "updated_by" field.

func (*DatabaseMutation) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*DatabaseMutation) SetCreatedBy

func (m *DatabaseMutation) SetCreatedBy(s string)

SetCreatedBy sets the "created_by" field.

func (*DatabaseMutation) SetDeletedAt

func (m *DatabaseMutation) SetDeletedAt(t time.Time)

SetDeletedAt sets the "deleted_at" field.

func (*DatabaseMutation) SetDeletedBy

func (m *DatabaseMutation) SetDeletedBy(s string)

SetDeletedBy sets the "deleted_by" field.

func (*DatabaseMutation) SetDsn

func (m *DatabaseMutation) SetDsn(s string)

SetDsn sets the "dsn" field.

func (*DatabaseMutation) SetField

func (m *DatabaseMutation) 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 (*DatabaseMutation) SetGeo

func (m *DatabaseMutation) SetGeo(s string)

SetGeo sets the "geo" field.

func (*DatabaseMutation) SetGroupID

func (m *DatabaseMutation) SetGroupID(s string)

SetGroupID sets the "group_id" field.

func (*DatabaseMutation) SetID

func (m *DatabaseMutation) SetID(id string)

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

func (*DatabaseMutation) SetName

func (m *DatabaseMutation) SetName(s string)

SetName sets the "name" field.

func (*DatabaseMutation) SetOp

func (m *DatabaseMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*DatabaseMutation) SetOrganizationID

func (m *DatabaseMutation) SetOrganizationID(s string)

SetOrganizationID sets the "organization_id" field.

func (*DatabaseMutation) SetProvider

func (m *DatabaseMutation) SetProvider(ep enums.DatabaseProvider)

SetProvider sets the "provider" field.

func (*DatabaseMutation) SetStatus

func (m *DatabaseMutation) SetStatus(es enums.DatabaseStatus)

SetStatus sets the "status" field.

func (*DatabaseMutation) SetToken

func (m *DatabaseMutation) SetToken(s string)

SetToken sets the "token" field.

func (*DatabaseMutation) SetUpdatedAt

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

SetUpdatedAt sets the "updated_at" field.

func (*DatabaseMutation) SetUpdatedBy

func (m *DatabaseMutation) SetUpdatedBy(s string)

SetUpdatedBy sets the "updated_by" field.

func (*DatabaseMutation) Status

func (m *DatabaseMutation) Status() (r enums.DatabaseStatus, exists bool)

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

func (*DatabaseMutation) Token

func (m *DatabaseMutation) Token() (r string, exists bool)

Token returns the value of the "token" field in the mutation.

func (*DatabaseMutation) TokenCleared

func (m *DatabaseMutation) TokenCleared() bool

TokenCleared returns if the "token" field was cleared in this mutation.

func (DatabaseMutation) Tx

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

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

func (*DatabaseMutation) Type

func (m *DatabaseMutation) Type() string

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

func (*DatabaseMutation) UpdatedAt

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

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

func (*DatabaseMutation) UpdatedAtCleared

func (m *DatabaseMutation) UpdatedAtCleared() bool

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

func (*DatabaseMutation) UpdatedBy

func (m *DatabaseMutation) UpdatedBy() (r string, exists bool)

UpdatedBy returns the value of the "updated_by" field in the mutation.

func (*DatabaseMutation) UpdatedByCleared

func (m *DatabaseMutation) UpdatedByCleared() bool

UpdatedByCleared returns if the "updated_by" field was cleared in this mutation.

func (*DatabaseMutation) Where

func (m *DatabaseMutation) Where(ps ...predicate.Database)

Where appends a list predicates to the DatabaseMutation builder.

func (*DatabaseMutation) WhereP

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

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

type DatabaseOrder

type DatabaseOrder struct {
	Direction OrderDirection      `json:"direction"`
	Field     *DatabaseOrderField `json:"field"`
}

DatabaseOrder defines the ordering of Database.

type DatabaseOrderField

type DatabaseOrderField struct {
	// Value extracts the ordering value from the given Database.
	Value func(*Database) (ent.Value, error)
	// contains filtered or unexported fields
}

DatabaseOrderField defines the ordering field of Database.

type DatabasePaginateOption

type DatabasePaginateOption func(*databasePager) error

DatabasePaginateOption enables pagination customization.

func WithDatabaseFilter

func WithDatabaseFilter(filter func(*DatabaseQuery) (*DatabaseQuery, error)) DatabasePaginateOption

WithDatabaseFilter configures pagination filter.

func WithDatabaseOrder

func WithDatabaseOrder(order *DatabaseOrder) DatabasePaginateOption

WithDatabaseOrder configures pagination ordering.

type DatabaseQuery

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

DatabaseQuery is the builder for querying Database entities.

func (*DatabaseQuery) Aggregate

func (dq *DatabaseQuery) Aggregate(fns ...AggregateFunc) *DatabaseSelect

Aggregate returns a DatabaseSelect configured with the given aggregations.

func (*DatabaseQuery) All

func (dq *DatabaseQuery) All(ctx context.Context) ([]*Database, error)

All executes the query and returns a list of Databases.

func (*DatabaseQuery) AllX

func (dq *DatabaseQuery) AllX(ctx context.Context) []*Database

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

func (*DatabaseQuery) Clone

func (dq *DatabaseQuery) Clone() *DatabaseQuery

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

func (*DatabaseQuery) CollectFields

func (d *DatabaseQuery) CollectFields(ctx context.Context, satisfies ...string) (*DatabaseQuery, error)

CollectFields tells the query-builder to eagerly load connected nodes by resolver context.

func (*DatabaseQuery) Count

func (dq *DatabaseQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*DatabaseQuery) CountX

func (dq *DatabaseQuery) CountX(ctx context.Context) int

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

func (*DatabaseQuery) Exist

func (dq *DatabaseQuery) Exist(ctx context.Context) (bool, error)

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

func (*DatabaseQuery) ExistX

func (dq *DatabaseQuery) ExistX(ctx context.Context) bool

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

func (*DatabaseQuery) Filter

func (dq *DatabaseQuery) Filter() *DatabaseFilter

Filter returns a Filter implementation to apply filters on the DatabaseQuery builder.

func (*DatabaseQuery) First

func (dq *DatabaseQuery) First(ctx context.Context) (*Database, error)

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

func (*DatabaseQuery) FirstID

func (dq *DatabaseQuery) FirstID(ctx context.Context) (id string, err error)

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

func (*DatabaseQuery) FirstIDX

func (dq *DatabaseQuery) FirstIDX(ctx context.Context) string

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

func (*DatabaseQuery) FirstX

func (dq *DatabaseQuery) FirstX(ctx context.Context) *Database

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

func (*DatabaseQuery) GroupBy

func (dq *DatabaseQuery) GroupBy(field string, fields ...string) *DatabaseGroupBy

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 {
	CreatedAt time.Time `json:"created_at,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Database.Query().
	GroupBy(database.FieldCreatedAt).
	Aggregate(generated.Count()).
	Scan(ctx, &v)

func (*DatabaseQuery) IDs

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

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

func (*DatabaseQuery) IDsX

func (dq *DatabaseQuery) IDsX(ctx context.Context) []string

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

func (*DatabaseQuery) Limit

func (dq *DatabaseQuery) Limit(limit int) *DatabaseQuery

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

func (*DatabaseQuery) Offset

func (dq *DatabaseQuery) Offset(offset int) *DatabaseQuery

Offset to start from.

func (*DatabaseQuery) Only

func (dq *DatabaseQuery) Only(ctx context.Context) (*Database, error)

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

func (*DatabaseQuery) OnlyID

func (dq *DatabaseQuery) OnlyID(ctx context.Context) (id string, err error)

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

func (*DatabaseQuery) OnlyIDX

func (dq *DatabaseQuery) OnlyIDX(ctx context.Context) string

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

func (*DatabaseQuery) OnlyX

func (dq *DatabaseQuery) OnlyX(ctx context.Context) *Database

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

func (*DatabaseQuery) Order

Order specifies how the records should be ordered.

func (*DatabaseQuery) Paginate

func (d *DatabaseQuery) Paginate(
	ctx context.Context, after *Cursor, first *int,
	before *Cursor, last *int, opts ...DatabasePaginateOption,
) (*DatabaseConnection, error)

Paginate executes the query and returns a relay based cursor connection to Database.

func (*DatabaseQuery) QueryGroup

func (dq *DatabaseQuery) QueryGroup() *GroupQuery

QueryGroup chains the current query on the "group" edge.

func (*DatabaseQuery) Select

func (dq *DatabaseQuery) Select(fields ...string) *DatabaseSelect

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 {
	CreatedAt time.Time `json:"created_at,omitempty"`
}

client.Database.Query().
	Select(database.FieldCreatedAt).
	Scan(ctx, &v)

func (*DatabaseQuery) Unique

func (dq *DatabaseQuery) Unique(unique bool) *DatabaseQuery

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

func (dq *DatabaseQuery) Where(ps ...predicate.Database) *DatabaseQuery

Where adds a new predicate for the DatabaseQuery builder.

func (*DatabaseQuery) WithGroup

func (dq *DatabaseQuery) WithGroup(opts ...func(*GroupQuery)) *DatabaseQuery

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

type DatabaseSelect

type DatabaseSelect struct {
	*DatabaseQuery
	// contains filtered or unexported fields
}

DatabaseSelect is the builder for selecting fields of Database entities.

func (*DatabaseSelect) Aggregate

func (ds *DatabaseSelect) Aggregate(fns ...AggregateFunc) *DatabaseSelect

Aggregate adds the given aggregation functions to the selector query.

func (*DatabaseSelect) Bool

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

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

func (*DatabaseSelect) BoolX

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

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

func (*DatabaseSelect) Bools

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

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

func (*DatabaseSelect) BoolsX

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

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

func (*DatabaseSelect) Float64

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

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

func (*DatabaseSelect) Float64X

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

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

func (*DatabaseSelect) Float64s

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

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

func (*DatabaseSelect) Float64sX

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

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

func (*DatabaseSelect) Int

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

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

func (*DatabaseSelect) IntX

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

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

func (*DatabaseSelect) Ints

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

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

func (*DatabaseSelect) IntsX

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

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

func (*DatabaseSelect) Scan

func (ds *DatabaseSelect) Scan(ctx context.Context, v any) error

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

func (*DatabaseSelect) ScanX

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

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

func (*DatabaseSelect) String

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

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

func (*DatabaseSelect) StringX

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

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

func (*DatabaseSelect) Strings

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

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

func (*DatabaseSelect) StringsX

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

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

type DatabaseUpdate

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

DatabaseUpdate is the builder for updating Database entities.

func (*DatabaseUpdate) ClearDeletedAt

func (du *DatabaseUpdate) ClearDeletedAt() *DatabaseUpdate

ClearDeletedAt clears the value of the "deleted_at" field.

func (*DatabaseUpdate) ClearDeletedBy

func (du *DatabaseUpdate) ClearDeletedBy() *DatabaseUpdate

ClearDeletedBy clears the value of the "deleted_by" field.

func (*DatabaseUpdate) ClearGeo

func (du *DatabaseUpdate) ClearGeo() *DatabaseUpdate

ClearGeo clears the value of the "geo" field.

func (*DatabaseUpdate) ClearGroup

func (du *DatabaseUpdate) ClearGroup() *DatabaseUpdate

ClearGroup clears the "group" edge to the Group entity.

func (*DatabaseUpdate) ClearToken

func (du *DatabaseUpdate) ClearToken() *DatabaseUpdate

ClearToken clears the value of the "token" field.

func (*DatabaseUpdate) ClearUpdatedAt

func (du *DatabaseUpdate) ClearUpdatedAt() *DatabaseUpdate

ClearUpdatedAt clears the value of the "updated_at" field.

func (*DatabaseUpdate) ClearUpdatedBy

func (du *DatabaseUpdate) ClearUpdatedBy() *DatabaseUpdate

ClearUpdatedBy clears the value of the "updated_by" field.

func (*DatabaseUpdate) Exec

func (du *DatabaseUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*DatabaseUpdate) ExecX

func (du *DatabaseUpdate) ExecX(ctx context.Context)

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

func (*DatabaseUpdate) Mutation

func (du *DatabaseUpdate) Mutation() *DatabaseMutation

Mutation returns the DatabaseMutation object of the builder.

func (*DatabaseUpdate) Save

func (du *DatabaseUpdate) Save(ctx context.Context) (int, error)

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

func (*DatabaseUpdate) SaveX

func (du *DatabaseUpdate) SaveX(ctx context.Context) int

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

func (*DatabaseUpdate) SetDeletedAt

func (du *DatabaseUpdate) SetDeletedAt(t time.Time) *DatabaseUpdate

SetDeletedAt sets the "deleted_at" field.

func (*DatabaseUpdate) SetDeletedBy

func (du *DatabaseUpdate) SetDeletedBy(s string) *DatabaseUpdate

SetDeletedBy sets the "deleted_by" field.

func (*DatabaseUpdate) SetDsn

func (du *DatabaseUpdate) SetDsn(s string) *DatabaseUpdate

SetDsn sets the "dsn" field.

func (*DatabaseUpdate) SetGeo

func (du *DatabaseUpdate) SetGeo(s string) *DatabaseUpdate

SetGeo sets the "geo" field.

func (*DatabaseUpdate) SetGroup

func (du *DatabaseUpdate) SetGroup(g *Group) *DatabaseUpdate

SetGroup sets the "group" edge to the Group entity.

func (*DatabaseUpdate) SetGroupID

func (du *DatabaseUpdate) SetGroupID(s string) *DatabaseUpdate

SetGroupID sets the "group_id" field.

func (*DatabaseUpdate) SetInput

SetInput applies the change-set in the UpdateDatabaseInput on the DatabaseUpdate builder.

func (*DatabaseUpdate) SetName

func (du *DatabaseUpdate) SetName(s string) *DatabaseUpdate

SetName sets the "name" field.

func (*DatabaseUpdate) SetNillableDeletedAt

func (du *DatabaseUpdate) SetNillableDeletedAt(t *time.Time) *DatabaseUpdate

SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.

func (*DatabaseUpdate) SetNillableDeletedBy

func (du *DatabaseUpdate) SetNillableDeletedBy(s *string) *DatabaseUpdate

SetNillableDeletedBy sets the "deleted_by" field if the given value is not nil.

func (*DatabaseUpdate) SetNillableDsn

func (du *DatabaseUpdate) SetNillableDsn(s *string) *DatabaseUpdate

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

func (*DatabaseUpdate) SetNillableGeo

func (du *DatabaseUpdate) SetNillableGeo(s *string) *DatabaseUpdate

SetNillableGeo sets the "geo" field if the given value is not nil.

func (*DatabaseUpdate) SetNillableGroupID

func (du *DatabaseUpdate) SetNillableGroupID(s *string) *DatabaseUpdate

SetNillableGroupID sets the "group_id" field if the given value is not nil.

func (*DatabaseUpdate) SetNillableName

func (du *DatabaseUpdate) SetNillableName(s *string) *DatabaseUpdate

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

func (*DatabaseUpdate) SetNillableOrganizationID

func (du *DatabaseUpdate) SetNillableOrganizationID(s *string) *DatabaseUpdate

SetNillableOrganizationID sets the "organization_id" field if the given value is not nil.

func (*DatabaseUpdate) SetNillableProvider

func (du *DatabaseUpdate) SetNillableProvider(ep *enums.DatabaseProvider) *DatabaseUpdate

SetNillableProvider sets the "provider" field if the given value is not nil.

func (*DatabaseUpdate) SetNillableStatus

func (du *DatabaseUpdate) SetNillableStatus(es *enums.DatabaseStatus) *DatabaseUpdate

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

func (*DatabaseUpdate) SetNillableToken

func (du *DatabaseUpdate) SetNillableToken(s *string) *DatabaseUpdate

SetNillableToken sets the "token" field if the given value is not nil.

func (*DatabaseUpdate) SetNillableUpdatedBy

func (du *DatabaseUpdate) SetNillableUpdatedBy(s *string) *DatabaseUpdate

SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil.

func (*DatabaseUpdate) SetOrganizationID

func (du *DatabaseUpdate) SetOrganizationID(s string) *DatabaseUpdate

SetOrganizationID sets the "organization_id" field.

func (*DatabaseUpdate) SetProvider

func (du *DatabaseUpdate) SetProvider(ep enums.DatabaseProvider) *DatabaseUpdate

SetProvider sets the "provider" field.

func (*DatabaseUpdate) SetStatus

SetStatus sets the "status" field.

func (*DatabaseUpdate) SetToken

func (du *DatabaseUpdate) SetToken(s string) *DatabaseUpdate

SetToken sets the "token" field.

func (*DatabaseUpdate) SetUpdatedAt

func (du *DatabaseUpdate) SetUpdatedAt(t time.Time) *DatabaseUpdate

SetUpdatedAt sets the "updated_at" field.

func (*DatabaseUpdate) SetUpdatedBy

func (du *DatabaseUpdate) SetUpdatedBy(s string) *DatabaseUpdate

SetUpdatedBy sets the "updated_by" field.

func (*DatabaseUpdate) Where

func (du *DatabaseUpdate) Where(ps ...predicate.Database) *DatabaseUpdate

Where appends a list predicates to the DatabaseUpdate builder.

type DatabaseUpdateOne

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

DatabaseUpdateOne is the builder for updating a single Database entity.

func (*DatabaseUpdateOne) ClearDeletedAt

func (duo *DatabaseUpdateOne) ClearDeletedAt() *DatabaseUpdateOne

ClearDeletedAt clears the value of the "deleted_at" field.

func (*DatabaseUpdateOne) ClearDeletedBy

func (duo *DatabaseUpdateOne) ClearDeletedBy() *DatabaseUpdateOne

ClearDeletedBy clears the value of the "deleted_by" field.

func (*DatabaseUpdateOne) ClearGeo

func (duo *DatabaseUpdateOne) ClearGeo() *DatabaseUpdateOne

ClearGeo clears the value of the "geo" field.

func (*DatabaseUpdateOne) ClearGroup

func (duo *DatabaseUpdateOne) ClearGroup() *DatabaseUpdateOne

ClearGroup clears the "group" edge to the Group entity.

func (*DatabaseUpdateOne) ClearToken

func (duo *DatabaseUpdateOne) ClearToken() *DatabaseUpdateOne

ClearToken clears the value of the "token" field.

func (*DatabaseUpdateOne) ClearUpdatedAt

func (duo *DatabaseUpdateOne) ClearUpdatedAt() *DatabaseUpdateOne

ClearUpdatedAt clears the value of the "updated_at" field.

func (*DatabaseUpdateOne) ClearUpdatedBy

func (duo *DatabaseUpdateOne) ClearUpdatedBy() *DatabaseUpdateOne

ClearUpdatedBy clears the value of the "updated_by" field.

func (*DatabaseUpdateOne) Exec

func (duo *DatabaseUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*DatabaseUpdateOne) ExecX

func (duo *DatabaseUpdateOne) ExecX(ctx context.Context)

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

func (*DatabaseUpdateOne) Mutation

func (duo *DatabaseUpdateOne) Mutation() *DatabaseMutation

Mutation returns the DatabaseMutation object of the builder.

func (*DatabaseUpdateOne) Save

func (duo *DatabaseUpdateOne) Save(ctx context.Context) (*Database, error)

Save executes the query and returns the updated Database entity.

func (*DatabaseUpdateOne) SaveX

func (duo *DatabaseUpdateOne) SaveX(ctx context.Context) *Database

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

func (*DatabaseUpdateOne) Select

func (duo *DatabaseUpdateOne) Select(field string, fields ...string) *DatabaseUpdateOne

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

func (*DatabaseUpdateOne) SetDeletedAt

func (duo *DatabaseUpdateOne) SetDeletedAt(t time.Time) *DatabaseUpdateOne

SetDeletedAt sets the "deleted_at" field.

func (*DatabaseUpdateOne) SetDeletedBy

func (duo *DatabaseUpdateOne) SetDeletedBy(s string) *DatabaseUpdateOne

SetDeletedBy sets the "deleted_by" field.

func (*DatabaseUpdateOne) SetDsn

func (duo *DatabaseUpdateOne) SetDsn(s string) *DatabaseUpdateOne

SetDsn sets the "dsn" field.

func (*DatabaseUpdateOne) SetGeo

func (duo *DatabaseUpdateOne) SetGeo(s string) *DatabaseUpdateOne

SetGeo sets the "geo" field.

func (*DatabaseUpdateOne) SetGroup

func (duo *DatabaseUpdateOne) SetGroup(g *Group) *DatabaseUpdateOne

SetGroup sets the "group" edge to the Group entity.

func (*DatabaseUpdateOne) SetGroupID

func (duo *DatabaseUpdateOne) SetGroupID(s string) *DatabaseUpdateOne

SetGroupID sets the "group_id" field.

func (*DatabaseUpdateOne) SetInput

SetInput applies the change-set in the UpdateDatabaseInput on the DatabaseUpdateOne builder.

func (*DatabaseUpdateOne) SetName

func (duo *DatabaseUpdateOne) SetName(s string) *DatabaseUpdateOne

SetName sets the "name" field.

func (*DatabaseUpdateOne) SetNillableDeletedAt

func (duo *DatabaseUpdateOne) SetNillableDeletedAt(t *time.Time) *DatabaseUpdateOne

SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.

func (*DatabaseUpdateOne) SetNillableDeletedBy

func (duo *DatabaseUpdateOne) SetNillableDeletedBy(s *string) *DatabaseUpdateOne

SetNillableDeletedBy sets the "deleted_by" field if the given value is not nil.

func (*DatabaseUpdateOne) SetNillableDsn

func (duo *DatabaseUpdateOne) SetNillableDsn(s *string) *DatabaseUpdateOne

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

func (*DatabaseUpdateOne) SetNillableGeo

func (duo *DatabaseUpdateOne) SetNillableGeo(s *string) *DatabaseUpdateOne

SetNillableGeo sets the "geo" field if the given value is not nil.

func (*DatabaseUpdateOne) SetNillableGroupID

func (duo *DatabaseUpdateOne) SetNillableGroupID(s *string) *DatabaseUpdateOne

SetNillableGroupID sets the "group_id" field if the given value is not nil.

func (*DatabaseUpdateOne) SetNillableName

func (duo *DatabaseUpdateOne) SetNillableName(s *string) *DatabaseUpdateOne

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

func (*DatabaseUpdateOne) SetNillableOrganizationID

func (duo *DatabaseUpdateOne) SetNillableOrganizationID(s *string) *DatabaseUpdateOne

SetNillableOrganizationID sets the "organization_id" field if the given value is not nil.

func (*DatabaseUpdateOne) SetNillableProvider

func (duo *DatabaseUpdateOne) SetNillableProvider(ep *enums.DatabaseProvider) *DatabaseUpdateOne

SetNillableProvider sets the "provider" field if the given value is not nil.

func (*DatabaseUpdateOne) SetNillableStatus

func (duo *DatabaseUpdateOne) SetNillableStatus(es *enums.DatabaseStatus) *DatabaseUpdateOne

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

func (*DatabaseUpdateOne) SetNillableToken

func (duo *DatabaseUpdateOne) SetNillableToken(s *string) *DatabaseUpdateOne

SetNillableToken sets the "token" field if the given value is not nil.

func (*DatabaseUpdateOne) SetNillableUpdatedBy

func (duo *DatabaseUpdateOne) SetNillableUpdatedBy(s *string) *DatabaseUpdateOne

SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil.

func (*DatabaseUpdateOne) SetOrganizationID

func (duo *DatabaseUpdateOne) SetOrganizationID(s string) *DatabaseUpdateOne

SetOrganizationID sets the "organization_id" field.

func (*DatabaseUpdateOne) SetProvider

SetProvider sets the "provider" field.

func (*DatabaseUpdateOne) SetStatus

SetStatus sets the "status" field.

func (*DatabaseUpdateOne) SetToken

func (duo *DatabaseUpdateOne) SetToken(s string) *DatabaseUpdateOne

SetToken sets the "token" field.

func (*DatabaseUpdateOne) SetUpdatedAt

func (duo *DatabaseUpdateOne) SetUpdatedAt(t time.Time) *DatabaseUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*DatabaseUpdateOne) SetUpdatedBy

func (duo *DatabaseUpdateOne) SetUpdatedBy(s string) *DatabaseUpdateOne

SetUpdatedBy sets the "updated_by" field.

func (*DatabaseUpdateOne) Where

Where appends a list predicates to the DatabaseUpdate builder.

type DatabaseWhereInput

type DatabaseWhereInput struct {
	Predicates []predicate.Database  `json:"-"`
	Not        *DatabaseWhereInput   `json:"not,omitempty"`
	Or         []*DatabaseWhereInput `json:"or,omitempty"`
	And        []*DatabaseWhereInput `json:"and,omitempty"`

	// "id" field predicates.
	ID             *string  `json:"id,omitempty"`
	IDNEQ          *string  `json:"idNEQ,omitempty"`
	IDIn           []string `json:"idIn,omitempty"`
	IDNotIn        []string `json:"idNotIn,omitempty"`
	IDGT           *string  `json:"idGT,omitempty"`
	IDGTE          *string  `json:"idGTE,omitempty"`
	IDLT           *string  `json:"idLT,omitempty"`
	IDLTE          *string  `json:"idLTE,omitempty"`
	IDEqualFold    *string  `json:"idEqualFold,omitempty"`
	IDContainsFold *string  `json:"idContainsFold,omitempty"`

	// "created_at" field predicates.
	CreatedAt       *time.Time  `json:"createdAt,omitempty"`
	CreatedAtNEQ    *time.Time  `json:"createdAtNEQ,omitempty"`
	CreatedAtIn     []time.Time `json:"createdAtIn,omitempty"`
	CreatedAtNotIn  []time.Time `json:"createdAtNotIn,omitempty"`
	CreatedAtGT     *time.Time  `json:"createdAtGT,omitempty"`
	CreatedAtGTE    *time.Time  `json:"createdAtGTE,omitempty"`
	CreatedAtLT     *time.Time  `json:"createdAtLT,omitempty"`
	CreatedAtLTE    *time.Time  `json:"createdAtLTE,omitempty"`
	CreatedAtIsNil  bool        `json:"createdAtIsNil,omitempty"`
	CreatedAtNotNil bool        `json:"createdAtNotNil,omitempty"`

	// "updated_at" field predicates.
	UpdatedAt       *time.Time  `json:"updatedAt,omitempty"`
	UpdatedAtNEQ    *time.Time  `json:"updatedAtNEQ,omitempty"`
	UpdatedAtIn     []time.Time `json:"updatedAtIn,omitempty"`
	UpdatedAtNotIn  []time.Time `json:"updatedAtNotIn,omitempty"`
	UpdatedAtGT     *time.Time  `json:"updatedAtGT,omitempty"`
	UpdatedAtGTE    *time.Time  `json:"updatedAtGTE,omitempty"`
	UpdatedAtLT     *time.Time  `json:"updatedAtLT,omitempty"`
	UpdatedAtLTE    *time.Time  `json:"updatedAtLTE,omitempty"`
	UpdatedAtIsNil  bool        `json:"updatedAtIsNil,omitempty"`
	UpdatedAtNotNil bool        `json:"updatedAtNotNil,omitempty"`

	// "created_by" field predicates.
	CreatedBy             *string  `json:"createdBy,omitempty"`
	CreatedByNEQ          *string  `json:"createdByNEQ,omitempty"`
	CreatedByIn           []string `json:"createdByIn,omitempty"`
	CreatedByNotIn        []string `json:"createdByNotIn,omitempty"`
	CreatedByGT           *string  `json:"createdByGT,omitempty"`
	CreatedByGTE          *string  `json:"createdByGTE,omitempty"`
	CreatedByLT           *string  `json:"createdByLT,omitempty"`
	CreatedByLTE          *string  `json:"createdByLTE,omitempty"`
	CreatedByContains     *string  `json:"createdByContains,omitempty"`
	CreatedByHasPrefix    *string  `json:"createdByHasPrefix,omitempty"`
	CreatedByHasSuffix    *string  `json:"createdByHasSuffix,omitempty"`
	CreatedByIsNil        bool     `json:"createdByIsNil,omitempty"`
	CreatedByNotNil       bool     `json:"createdByNotNil,omitempty"`
	CreatedByEqualFold    *string  `json:"createdByEqualFold,omitempty"`
	CreatedByContainsFold *string  `json:"createdByContainsFold,omitempty"`

	// "updated_by" field predicates.
	UpdatedBy             *string  `json:"updatedBy,omitempty"`
	UpdatedByNEQ          *string  `json:"updatedByNEQ,omitempty"`
	UpdatedByIn           []string `json:"updatedByIn,omitempty"`
	UpdatedByNotIn        []string `json:"updatedByNotIn,omitempty"`
	UpdatedByGT           *string  `json:"updatedByGT,omitempty"`
	UpdatedByGTE          *string  `json:"updatedByGTE,omitempty"`
	UpdatedByLT           *string  `json:"updatedByLT,omitempty"`
	UpdatedByLTE          *string  `json:"updatedByLTE,omitempty"`
	UpdatedByContains     *string  `json:"updatedByContains,omitempty"`
	UpdatedByHasPrefix    *string  `json:"updatedByHasPrefix,omitempty"`
	UpdatedByHasSuffix    *string  `json:"updatedByHasSuffix,omitempty"`
	UpdatedByIsNil        bool     `json:"updatedByIsNil,omitempty"`
	UpdatedByNotNil       bool     `json:"updatedByNotNil,omitempty"`
	UpdatedByEqualFold    *string  `json:"updatedByEqualFold,omitempty"`
	UpdatedByContainsFold *string  `json:"updatedByContainsFold,omitempty"`

	// "deleted_at" field predicates.
	DeletedAt       *time.Time  `json:"deletedAt,omitempty"`
	DeletedAtNEQ    *time.Time  `json:"deletedAtNEQ,omitempty"`
	DeletedAtIn     []time.Time `json:"deletedAtIn,omitempty"`
	DeletedAtNotIn  []time.Time `json:"deletedAtNotIn,omitempty"`
	DeletedAtGT     *time.Time  `json:"deletedAtGT,omitempty"`
	DeletedAtGTE    *time.Time  `json:"deletedAtGTE,omitempty"`
	DeletedAtLT     *time.Time  `json:"deletedAtLT,omitempty"`
	DeletedAtLTE    *time.Time  `json:"deletedAtLTE,omitempty"`
	DeletedAtIsNil  bool        `json:"deletedAtIsNil,omitempty"`
	DeletedAtNotNil bool        `json:"deletedAtNotNil,omitempty"`

	// "deleted_by" field predicates.
	DeletedBy             *string  `json:"deletedBy,omitempty"`
	DeletedByNEQ          *string  `json:"deletedByNEQ,omitempty"`
	DeletedByIn           []string `json:"deletedByIn,omitempty"`
	DeletedByNotIn        []string `json:"deletedByNotIn,omitempty"`
	DeletedByGT           *string  `json:"deletedByGT,omitempty"`
	DeletedByGTE          *string  `json:"deletedByGTE,omitempty"`
	DeletedByLT           *string  `json:"deletedByLT,omitempty"`
	DeletedByLTE          *string  `json:"deletedByLTE,omitempty"`
	DeletedByContains     *string  `json:"deletedByContains,omitempty"`
	DeletedByHasPrefix    *string  `json:"deletedByHasPrefix,omitempty"`
	DeletedByHasSuffix    *string  `json:"deletedByHasSuffix,omitempty"`
	DeletedByIsNil        bool     `json:"deletedByIsNil,omitempty"`
	DeletedByNotNil       bool     `json:"deletedByNotNil,omitempty"`
	DeletedByEqualFold    *string  `json:"deletedByEqualFold,omitempty"`
	DeletedByContainsFold *string  `json:"deletedByContainsFold,omitempty"`

	// "organization_id" field predicates.
	OrganizationID             *string  `json:"organizationID,omitempty"`
	OrganizationIDNEQ          *string  `json:"organizationIDNEQ,omitempty"`
	OrganizationIDIn           []string `json:"organizationIDIn,omitempty"`
	OrganizationIDNotIn        []string `json:"organizationIDNotIn,omitempty"`
	OrganizationIDGT           *string  `json:"organizationIDGT,omitempty"`
	OrganizationIDGTE          *string  `json:"organizationIDGTE,omitempty"`
	OrganizationIDLT           *string  `json:"organizationIDLT,omitempty"`
	OrganizationIDLTE          *string  `json:"organizationIDLTE,omitempty"`
	OrganizationIDContains     *string  `json:"organizationIDContains,omitempty"`
	OrganizationIDHasPrefix    *string  `json:"organizationIDHasPrefix,omitempty"`
	OrganizationIDHasSuffix    *string  `json:"organizationIDHasSuffix,omitempty"`
	OrganizationIDEqualFold    *string  `json:"organizationIDEqualFold,omitempty"`
	OrganizationIDContainsFold *string  `json:"organizationIDContainsFold,omitempty"`

	// "name" field predicates.
	Name             *string  `json:"name,omitempty"`
	NameNEQ          *string  `json:"nameNEQ,omitempty"`
	NameIn           []string `json:"nameIn,omitempty"`
	NameNotIn        []string `json:"nameNotIn,omitempty"`
	NameGT           *string  `json:"nameGT,omitempty"`
	NameGTE          *string  `json:"nameGTE,omitempty"`
	NameLT           *string  `json:"nameLT,omitempty"`
	NameLTE          *string  `json:"nameLTE,omitempty"`
	NameContains     *string  `json:"nameContains,omitempty"`
	NameHasPrefix    *string  `json:"nameHasPrefix,omitempty"`
	NameHasSuffix    *string  `json:"nameHasSuffix,omitempty"`
	NameEqualFold    *string  `json:"nameEqualFold,omitempty"`
	NameContainsFold *string  `json:"nameContainsFold,omitempty"`

	// "geo" field predicates.
	Geo             *string  `json:"geo,omitempty"`
	GeoNEQ          *string  `json:"geoNEQ,omitempty"`
	GeoIn           []string `json:"geoIn,omitempty"`
	GeoNotIn        []string `json:"geoNotIn,omitempty"`
	GeoGT           *string  `json:"geoGT,omitempty"`
	GeoGTE          *string  `json:"geoGTE,omitempty"`
	GeoLT           *string  `json:"geoLT,omitempty"`
	GeoLTE          *string  `json:"geoLTE,omitempty"`
	GeoContains     *string  `json:"geoContains,omitempty"`
	GeoHasPrefix    *string  `json:"geoHasPrefix,omitempty"`
	GeoHasSuffix    *string  `json:"geoHasSuffix,omitempty"`
	GeoIsNil        bool     `json:"geoIsNil,omitempty"`
	GeoNotNil       bool     `json:"geoNotNil,omitempty"`
	GeoEqualFold    *string  `json:"geoEqualFold,omitempty"`
	GeoContainsFold *string  `json:"geoContainsFold,omitempty"`

	// "dsn" field predicates.
	Dsn             *string  `json:"dsn,omitempty"`
	DsnNEQ          *string  `json:"dsnNEQ,omitempty"`
	DsnIn           []string `json:"dsnIn,omitempty"`
	DsnNotIn        []string `json:"dsnNotIn,omitempty"`
	DsnGT           *string  `json:"dsnGT,omitempty"`
	DsnGTE          *string  `json:"dsnGTE,omitempty"`
	DsnLT           *string  `json:"dsnLT,omitempty"`
	DsnLTE          *string  `json:"dsnLTE,omitempty"`
	DsnContains     *string  `json:"dsnContains,omitempty"`
	DsnHasPrefix    *string  `json:"dsnHasPrefix,omitempty"`
	DsnHasSuffix    *string  `json:"dsnHasSuffix,omitempty"`
	DsnEqualFold    *string  `json:"dsnEqualFold,omitempty"`
	DsnContainsFold *string  `json:"dsnContainsFold,omitempty"`

	// "group_id" field predicates.
	GroupID             *string  `json:"groupID,omitempty"`
	GroupIDNEQ          *string  `json:"groupIDNEQ,omitempty"`
	GroupIDIn           []string `json:"groupIDIn,omitempty"`
	GroupIDNotIn        []string `json:"groupIDNotIn,omitempty"`
	GroupIDGT           *string  `json:"groupIDGT,omitempty"`
	GroupIDGTE          *string  `json:"groupIDGTE,omitempty"`
	GroupIDLT           *string  `json:"groupIDLT,omitempty"`
	GroupIDLTE          *string  `json:"groupIDLTE,omitempty"`
	GroupIDContains     *string  `json:"groupIDContains,omitempty"`
	GroupIDHasPrefix    *string  `json:"groupIDHasPrefix,omitempty"`
	GroupIDHasSuffix    *string  `json:"groupIDHasSuffix,omitempty"`
	GroupIDEqualFold    *string  `json:"groupIDEqualFold,omitempty"`
	GroupIDContainsFold *string  `json:"groupIDContainsFold,omitempty"`

	// "token" field predicates.
	Token             *string  `json:"token,omitempty"`
	TokenNEQ          *string  `json:"tokenNEQ,omitempty"`
	TokenIn           []string `json:"tokenIn,omitempty"`
	TokenNotIn        []string `json:"tokenNotIn,omitempty"`
	TokenGT           *string  `json:"tokenGT,omitempty"`
	TokenGTE          *string  `json:"tokenGTE,omitempty"`
	TokenLT           *string  `json:"tokenLT,omitempty"`
	TokenLTE          *string  `json:"tokenLTE,omitempty"`
	TokenContains     *string  `json:"tokenContains,omitempty"`
	TokenHasPrefix    *string  `json:"tokenHasPrefix,omitempty"`
	TokenHasSuffix    *string  `json:"tokenHasSuffix,omitempty"`
	TokenIsNil        bool     `json:"tokenIsNil,omitempty"`
	TokenNotNil       bool     `json:"tokenNotNil,omitempty"`
	TokenEqualFold    *string  `json:"tokenEqualFold,omitempty"`
	TokenContainsFold *string  `json:"tokenContainsFold,omitempty"`

	// "status" field predicates.
	Status      *enums.DatabaseStatus  `json:"status,omitempty"`
	StatusNEQ   *enums.DatabaseStatus  `json:"statusNEQ,omitempty"`
	StatusIn    []enums.DatabaseStatus `json:"statusIn,omitempty"`
	StatusNotIn []enums.DatabaseStatus `json:"statusNotIn,omitempty"`

	// "provider" field predicates.
	Provider      *enums.DatabaseProvider  `json:"provider,omitempty"`
	ProviderNEQ   *enums.DatabaseProvider  `json:"providerNEQ,omitempty"`
	ProviderIn    []enums.DatabaseProvider `json:"providerIn,omitempty"`
	ProviderNotIn []enums.DatabaseProvider `json:"providerNotIn,omitempty"`

	// "group" edge predicates.
	HasGroup     *bool              `json:"hasGroup,omitempty"`
	HasGroupWith []*GroupWhereInput `json:"hasGroupWith,omitempty"`
}

DatabaseWhereInput represents a where input for filtering Database queries.

func (*DatabaseWhereInput) AddPredicates

func (i *DatabaseWhereInput) AddPredicates(predicates ...predicate.Database)

AddPredicates adds custom predicates to the where input to be used during the filtering phase.

func (*DatabaseWhereInput) Filter

Filter applies the DatabaseWhereInput filter on the DatabaseQuery builder.

func (*DatabaseWhereInput) P

P returns a predicate for filtering databases. An error is returned if the input is empty or invalid.

type Databases

type Databases []*Database

Databases is a parsable slice of Database.

type Group

type Group struct {

	// ID of the ent.
	ID string `json:"id,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// UpdatedAt holds the value of the "updated_at" field.
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	// CreatedBy holds the value of the "created_by" field.
	CreatedBy string `json:"created_by,omitempty"`
	// UpdatedBy holds the value of the "updated_by" field.
	UpdatedBy string `json:"updated_by,omitempty"`
	// DeletedAt holds the value of the "deleted_at" field.
	DeletedAt time.Time `json:"deleted_at,omitempty"`
	// DeletedBy holds the value of the "deleted_by" field.
	DeletedBy string `json:"deleted_by,omitempty"`
	// the name of the group in turso
	Name string `json:"name,omitempty"`
	// the description of the group
	Description string `json:"description,omitempty"`
	// the primary of the group
	PrimaryLocation string `json:"primary_location,omitempty"`
	// the replica locations of the group
	Locations []string `json:"locations,omitempty"`
	// the auth token used to connect to the group
	Token string `json:"-"`
	// region the group
	Region enums.Region `json:"region,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the GroupQuery when eager-loading is set.
	Edges GroupEdges `json:"edges"`
	// contains filtered or unexported fields
}

Group is the model entity for the Group schema.

func (*Group) Databases

func (gr *Group) Databases(ctx context.Context) (result []*Database, err error)

func (*Group) IsNode

func (n *Group) IsNode()

IsNode implements the Node interface check for GQLGen.

func (*Group) NamedDatabases

func (gr *Group) NamedDatabases(name string) ([]*Database, error)

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

func (*Group) QueryDatabases

func (gr *Group) QueryDatabases() *DatabaseQuery

QueryDatabases queries the "databases" edge of the Group entity.

func (*Group) String

func (gr *Group) String() string

String implements the fmt.Stringer.

func (*Group) ToEdge

func (gr *Group) ToEdge(order *GroupOrder) *GroupEdge

ToEdge converts Group into GroupEdge.

func (*Group) Unwrap

func (gr *Group) Unwrap() *Group

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

func (gr *Group) Update() *GroupUpdateOne

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

func (*Group) Value

func (gr *Group) Value(name string) (ent.Value, error)

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

type GroupClient

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

GroupClient is a client for the Group schema.

func NewGroupClient

func NewGroupClient(c config) *GroupClient

NewGroupClient returns a client for the Group from the given config.

func (*GroupClient) Create

func (c *GroupClient) Create() *GroupCreate

Create returns a builder for creating a Group entity.

func (*GroupClient) CreateBulk

func (c *GroupClient) CreateBulk(builders ...*GroupCreate) *GroupCreateBulk

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

func (*GroupClient) Delete

func (c *GroupClient) Delete() *GroupDelete

Delete returns a delete builder for Group.

func (*GroupClient) DeleteOne

func (c *GroupClient) DeleteOne(gr *Group) *GroupDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*GroupClient) DeleteOneID

func (c *GroupClient) DeleteOneID(id string) *GroupDeleteOne

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

func (*GroupClient) Get

func (c *GroupClient) Get(ctx context.Context, id string) (*Group, error)

Get returns a Group entity by its id.

func (*GroupClient) GetX

func (c *GroupClient) GetX(ctx context.Context, id string) *Group

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

func (*GroupClient) Hooks

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

Hooks returns the client hooks.

func (*GroupClient) Intercept

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

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

func (*GroupClient) Interceptors

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

Interceptors returns the client interceptors.

func (*GroupClient) MapCreateBulk

func (c *GroupClient) MapCreateBulk(slice any, setFunc func(*GroupCreate, int)) *GroupCreateBulk

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

func (c *GroupClient) Query() *GroupQuery

Query returns a query builder for Group.

func (*GroupClient) QueryDatabases

func (c *GroupClient) QueryDatabases(gr *Group) *DatabaseQuery

QueryDatabases queries the databases edge of a Group.

func (*GroupClient) Update

func (c *GroupClient) Update() *GroupUpdate

Update returns an update builder for Group.

func (*GroupClient) UpdateOne

func (c *GroupClient) UpdateOne(gr *Group) *GroupUpdateOne

UpdateOne returns an update builder for the given entity.

func (*GroupClient) UpdateOneID

func (c *GroupClient) UpdateOneID(id string) *GroupUpdateOne

UpdateOneID returns an update builder for the given id.

func (*GroupClient) Use

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

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

type GroupConnection

type GroupConnection struct {
	Edges      []*GroupEdge `json:"edges"`
	PageInfo   PageInfo     `json:"pageInfo"`
	TotalCount int          `json:"totalCount"`
}

GroupConnection is the connection containing edges to Group.

type GroupCreate

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

GroupCreate is the builder for creating a Group entity.

func (*GroupCreate) AddDatabaseIDs

func (gc *GroupCreate) AddDatabaseIDs(ids ...string) *GroupCreate

AddDatabaseIDs adds the "databases" edge to the Database entity by IDs.

func (*GroupCreate) AddDatabases

func (gc *GroupCreate) AddDatabases(d ...*Database) *GroupCreate

AddDatabases adds the "databases" edges to the Database entity.

func (*GroupCreate) Exec

func (gc *GroupCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*GroupCreate) ExecX

func (gc *GroupCreate) ExecX(ctx context.Context)

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

func (*GroupCreate) Mutation

func (gc *GroupCreate) Mutation() *GroupMutation

Mutation returns the GroupMutation object of the builder.

func (*GroupCreate) Save

func (gc *GroupCreate) Save(ctx context.Context) (*Group, error)

Save creates the Group in the database.

func (*GroupCreate) SaveX

func (gc *GroupCreate) SaveX(ctx context.Context) *Group

SaveX calls Save and panics if Save returns an error.

func (*GroupCreate) SetCreatedAt

func (gc *GroupCreate) SetCreatedAt(t time.Time) *GroupCreate

SetCreatedAt sets the "created_at" field.

func (*GroupCreate) SetCreatedBy

func (gc *GroupCreate) SetCreatedBy(s string) *GroupCreate

SetCreatedBy sets the "created_by" field.

func (*GroupCreate) SetDeletedAt

func (gc *GroupCreate) SetDeletedAt(t time.Time) *GroupCreate

SetDeletedAt sets the "deleted_at" field.

func (*GroupCreate) SetDeletedBy

func (gc *GroupCreate) SetDeletedBy(s string) *GroupCreate

SetDeletedBy sets the "deleted_by" field.

func (*GroupCreate) SetDescription

func (gc *GroupCreate) SetDescription(s string) *GroupCreate

SetDescription sets the "description" field.

func (*GroupCreate) SetID

func (gc *GroupCreate) SetID(s string) *GroupCreate

SetID sets the "id" field.

func (*GroupCreate) SetInput

func (c *GroupCreate) SetInput(i CreateGroupInput) *GroupCreate

SetInput applies the change-set in the CreateGroupInput on the GroupCreate builder.

func (*GroupCreate) SetLocations

func (gc *GroupCreate) SetLocations(s []string) *GroupCreate

SetLocations sets the "locations" field.

func (*GroupCreate) SetName

func (gc *GroupCreate) SetName(s string) *GroupCreate

SetName sets the "name" field.

func (*GroupCreate) SetNillableCreatedAt

func (gc *GroupCreate) SetNillableCreatedAt(t *time.Time) *GroupCreate

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

func (*GroupCreate) SetNillableCreatedBy

func (gc *GroupCreate) SetNillableCreatedBy(s *string) *GroupCreate

SetNillableCreatedBy sets the "created_by" field if the given value is not nil.

func (*GroupCreate) SetNillableDeletedAt

func (gc *GroupCreate) SetNillableDeletedAt(t *time.Time) *GroupCreate

SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.

func (*GroupCreate) SetNillableDeletedBy

func (gc *GroupCreate) SetNillableDeletedBy(s *string) *GroupCreate

SetNillableDeletedBy sets the "deleted_by" field if the given value is not nil.

func (*GroupCreate) SetNillableDescription

func (gc *GroupCreate) SetNillableDescription(s *string) *GroupCreate

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

func (*GroupCreate) SetNillableID

func (gc *GroupCreate) SetNillableID(s *string) *GroupCreate

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

func (*GroupCreate) SetNillableRegion

func (gc *GroupCreate) SetNillableRegion(e *enums.Region) *GroupCreate

SetNillableRegion sets the "region" field if the given value is not nil.

func (*GroupCreate) SetNillableToken

func (gc *GroupCreate) SetNillableToken(s *string) *GroupCreate

SetNillableToken sets the "token" field if the given value is not nil.

func (*GroupCreate) SetNillableUpdatedAt

func (gc *GroupCreate) SetNillableUpdatedAt(t *time.Time) *GroupCreate

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

func (*GroupCreate) SetNillableUpdatedBy

func (gc *GroupCreate) SetNillableUpdatedBy(s *string) *GroupCreate

SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil.

func (*GroupCreate) SetPrimaryLocation

func (gc *GroupCreate) SetPrimaryLocation(s string) *GroupCreate

SetPrimaryLocation sets the "primary_location" field.

func (*GroupCreate) SetRegion

func (gc *GroupCreate) SetRegion(e enums.Region) *GroupCreate

SetRegion sets the "region" field.

func (*GroupCreate) SetToken

func (gc *GroupCreate) SetToken(s string) *GroupCreate

SetToken sets the "token" field.

func (*GroupCreate) SetUpdatedAt

func (gc *GroupCreate) SetUpdatedAt(t time.Time) *GroupCreate

SetUpdatedAt sets the "updated_at" field.

func (*GroupCreate) SetUpdatedBy

func (gc *GroupCreate) SetUpdatedBy(s string) *GroupCreate

SetUpdatedBy sets the "updated_by" field.

type GroupCreateBulk

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

GroupCreateBulk is the builder for creating many Group entities in bulk.

func (*GroupCreateBulk) Exec

func (gcb *GroupCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*GroupCreateBulk) ExecX

func (gcb *GroupCreateBulk) ExecX(ctx context.Context)

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

func (*GroupCreateBulk) Save

func (gcb *GroupCreateBulk) Save(ctx context.Context) ([]*Group, error)

Save creates the Group entities in the database.

func (*GroupCreateBulk) SaveX

func (gcb *GroupCreateBulk) SaveX(ctx context.Context) []*Group

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

type GroupDelete

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

GroupDelete is the builder for deleting a Group entity.

func (*GroupDelete) Exec

func (gd *GroupDelete) Exec(ctx context.Context) (int, error)

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

func (*GroupDelete) ExecX

func (gd *GroupDelete) ExecX(ctx context.Context) int

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

func (*GroupDelete) Where

func (gd *GroupDelete) Where(ps ...predicate.Group) *GroupDelete

Where appends a list predicates to the GroupDelete builder.

type GroupDeleteOne

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

GroupDeleteOne is the builder for deleting a single Group entity.

func (*GroupDeleteOne) Exec

func (gdo *GroupDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*GroupDeleteOne) ExecX

func (gdo *GroupDeleteOne) ExecX(ctx context.Context)

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

func (*GroupDeleteOne) Where

func (gdo *GroupDeleteOne) Where(ps ...predicate.Group) *GroupDeleteOne

Where appends a list predicates to the GroupDelete builder.

type GroupEdge

type GroupEdge struct {
	Node   *Group `json:"node"`
	Cursor Cursor `json:"cursor"`
}

GroupEdge is the edge representation of Group.

type GroupEdges

type GroupEdges struct {
	// Databases holds the value of the databases edge.
	Databases []*Database `json:"databases,omitempty"`
	// contains filtered or unexported fields
}

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

func (GroupEdges) DatabasesOrErr

func (e GroupEdges) DatabasesOrErr() ([]*Database, error)

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

type GroupFilter

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

GroupFilter provides a generic filtering capability at runtime for GroupQuery.

func (*GroupFilter) Where

func (f *GroupFilter) Where(p entql.P)

Where applies the entql predicate on the query filter.

func (*GroupFilter) WhereCreatedAt

func (f *GroupFilter) WhereCreatedAt(p entql.TimeP)

WhereCreatedAt applies the entql time.Time predicate on the created_at field.

func (*GroupFilter) WhereCreatedBy

func (f *GroupFilter) WhereCreatedBy(p entql.StringP)

WhereCreatedBy applies the entql string predicate on the created_by field.

func (*GroupFilter) WhereDeletedAt

func (f *GroupFilter) WhereDeletedAt(p entql.TimeP)

WhereDeletedAt applies the entql time.Time predicate on the deleted_at field.

func (*GroupFilter) WhereDeletedBy

func (f *GroupFilter) WhereDeletedBy(p entql.StringP)

WhereDeletedBy applies the entql string predicate on the deleted_by field.

func (*GroupFilter) WhereDescription

func (f *GroupFilter) WhereDescription(p entql.StringP)

WhereDescription applies the entql string predicate on the description field.

func (*GroupFilter) WhereHasDatabases

func (f *GroupFilter) WhereHasDatabases()

WhereHasDatabases applies a predicate to check if query has an edge databases.

func (*GroupFilter) WhereHasDatabasesWith

func (f *GroupFilter) WhereHasDatabasesWith(preds ...predicate.Database)

WhereHasDatabasesWith applies a predicate to check if query has an edge databases with a given conditions (other predicates).

func (*GroupFilter) WhereID

func (f *GroupFilter) WhereID(p entql.StringP)

WhereID applies the entql string predicate on the id field.

func (*GroupFilter) WhereLocations

func (f *GroupFilter) WhereLocations(p entql.BytesP)

WhereLocations applies the entql json.RawMessage predicate on the locations field.

func (*GroupFilter) WhereName

func (f *GroupFilter) WhereName(p entql.StringP)

WhereName applies the entql string predicate on the name field.

func (*GroupFilter) WherePrimaryLocation

func (f *GroupFilter) WherePrimaryLocation(p entql.StringP)

WherePrimaryLocation applies the entql string predicate on the primary_location field.

func (*GroupFilter) WhereRegion

func (f *GroupFilter) WhereRegion(p entql.StringP)

WhereRegion applies the entql string predicate on the region field.

func (*GroupFilter) WhereToken

func (f *GroupFilter) WhereToken(p entql.StringP)

WhereToken applies the entql string predicate on the token field.

func (*GroupFilter) WhereUpdatedAt

func (f *GroupFilter) WhereUpdatedAt(p entql.TimeP)

WhereUpdatedAt applies the entql time.Time predicate on the updated_at field.

func (*GroupFilter) WhereUpdatedBy

func (f *GroupFilter) WhereUpdatedBy(p entql.StringP)

WhereUpdatedBy applies the entql string predicate on the updated_by field.

type GroupGroupBy

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

GroupGroupBy is the group-by builder for Group entities.

func (*GroupGroupBy) Aggregate

func (ggb *GroupGroupBy) Aggregate(fns ...AggregateFunc) *GroupGroupBy

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

func (*GroupGroupBy) Bool

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

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

func (*GroupGroupBy) BoolX

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

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

func (*GroupGroupBy) Bools

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

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

func (*GroupGroupBy) BoolsX

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

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

func (*GroupGroupBy) Float64

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

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

func (*GroupGroupBy) Float64X

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

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

func (*GroupGroupBy) Float64s

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

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

func (*GroupGroupBy) Float64sX

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

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

func (*GroupGroupBy) Int

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

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

func (*GroupGroupBy) IntX

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

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

func (*GroupGroupBy) Ints

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

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

func (*GroupGroupBy) IntsX

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

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

func (*GroupGroupBy) Scan

func (ggb *GroupGroupBy) Scan(ctx context.Context, v any) error

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

func (*GroupGroupBy) ScanX

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

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

func (*GroupGroupBy) String

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

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

func (*GroupGroupBy) StringX

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

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

func (*GroupGroupBy) Strings

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

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

func (*GroupGroupBy) StringsX

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

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

type GroupMutation

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

GroupMutation represents an operation that mutates the Group nodes in the graph.

func (*GroupMutation) AddDatabaseIDs

func (m *GroupMutation) AddDatabaseIDs(ids ...string)

AddDatabaseIDs adds the "databases" edge to the Database entity by ids.

func (*GroupMutation) AddField

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

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

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

func (*GroupMutation) AddedField

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

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

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

func (*GroupMutation) AddedIDs

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

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

func (*GroupMutation) AppendLocations

func (m *GroupMutation) AppendLocations(s []string)

AppendLocations adds s to the "locations" field.

func (*GroupMutation) AppendedLocations

func (m *GroupMutation) AppendedLocations() ([]string, bool)

AppendedLocations returns the list of values that were appended to the "locations" field in this mutation.

func (*GroupMutation) ClearCreatedAt

func (m *GroupMutation) ClearCreatedAt()

ClearCreatedAt clears the value of the "created_at" field.

func (*GroupMutation) ClearCreatedBy

func (m *GroupMutation) ClearCreatedBy()

ClearCreatedBy clears the value of the "created_by" field.

func (*GroupMutation) ClearDatabases

func (m *GroupMutation) ClearDatabases()

ClearDatabases clears the "databases" edge to the Database entity.

func (*GroupMutation) ClearDeletedAt

func (m *GroupMutation) ClearDeletedAt()

ClearDeletedAt clears the value of the "deleted_at" field.

func (*GroupMutation) ClearDeletedBy

func (m *GroupMutation) ClearDeletedBy()

ClearDeletedBy clears the value of the "deleted_by" field.

func (*GroupMutation) ClearDescription

func (m *GroupMutation) ClearDescription()

ClearDescription clears the value of the "description" field.

func (*GroupMutation) ClearEdge

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

func (m *GroupMutation) 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 (*GroupMutation) ClearLocations

func (m *GroupMutation) ClearLocations()

ClearLocations clears the value of the "locations" field.

func (*GroupMutation) ClearToken

func (m *GroupMutation) ClearToken()

ClearToken clears the value of the "token" field.

func (*GroupMutation) ClearUpdatedAt

func (m *GroupMutation) ClearUpdatedAt()

ClearUpdatedAt clears the value of the "updated_at" field.

func (*GroupMutation) ClearUpdatedBy

func (m *GroupMutation) ClearUpdatedBy()

ClearUpdatedBy clears the value of the "updated_by" field.

func (*GroupMutation) ClearedEdges

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

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

func (*GroupMutation) ClearedFields

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

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

func (GroupMutation) Client

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

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

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

func (*GroupMutation) CreatedAtCleared

func (m *GroupMutation) CreatedAtCleared() bool

CreatedAtCleared returns if the "created_at" field was cleared in this mutation.

func (*GroupMutation) CreatedBy

func (m *GroupMutation) CreatedBy() (r string, exists bool)

CreatedBy returns the value of the "created_by" field in the mutation.

func (*GroupMutation) CreatedByCleared

func (m *GroupMutation) CreatedByCleared() bool

CreatedByCleared returns if the "created_by" field was cleared in this mutation.

func (*GroupMutation) DatabasesCleared

func (m *GroupMutation) DatabasesCleared() bool

DatabasesCleared reports if the "databases" edge to the Database entity was cleared.

func (*GroupMutation) DatabasesIDs

func (m *GroupMutation) DatabasesIDs() (ids []string)

DatabasesIDs returns the "databases" edge IDs in the mutation.

func (*GroupMutation) DeletedAt

func (m *GroupMutation) DeletedAt() (r time.Time, exists bool)

DeletedAt returns the value of the "deleted_at" field in the mutation.

func (*GroupMutation) DeletedAtCleared

func (m *GroupMutation) DeletedAtCleared() bool

DeletedAtCleared returns if the "deleted_at" field was cleared in this mutation.

func (*GroupMutation) DeletedBy

func (m *GroupMutation) DeletedBy() (r string, exists bool)

DeletedBy returns the value of the "deleted_by" field in the mutation.

func (*GroupMutation) DeletedByCleared

func (m *GroupMutation) DeletedByCleared() bool

DeletedByCleared returns if the "deleted_by" field was cleared in this mutation.

func (*GroupMutation) Description

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

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

func (*GroupMutation) DescriptionCleared

func (m *GroupMutation) DescriptionCleared() bool

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

func (*GroupMutation) EdgeCleared

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

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

func (*GroupMutation) Field

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

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

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

func (*GroupMutation) Fields

func (m *GroupMutation) 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 (*GroupMutation) Filter

func (m *GroupMutation) Filter() *GroupFilter

Filter returns an entql.Where implementation to apply filters on the GroupMutation builder.

func (*GroupMutation) ID

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

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

func (*GroupMutation) IDs

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

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

func (*GroupMutation) Locations

func (m *GroupMutation) Locations() (r []string, exists bool)

Locations returns the value of the "locations" field in the mutation.

func (*GroupMutation) LocationsCleared

func (m *GroupMutation) LocationsCleared() bool

LocationsCleared returns if the "locations" field was cleared in this mutation.

func (*GroupMutation) Name

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

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

func (*GroupMutation) OldCreatedAt

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

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

func (m *GroupMutation) OldCreatedBy(ctx context.Context) (v string, err error)

OldCreatedBy returns the old "created_by" field's value of the Group entity. If the Group 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 (*GroupMutation) OldDeletedAt

func (m *GroupMutation) OldDeletedAt(ctx context.Context) (v time.Time, err error)

OldDeletedAt returns the old "deleted_at" field's value of the Group entity. If the Group 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 (*GroupMutation) OldDeletedBy

func (m *GroupMutation) OldDeletedBy(ctx context.Context) (v string, err error)

OldDeletedBy returns the old "deleted_by" field's value of the Group entity. If the Group 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 (*GroupMutation) OldDescription

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

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

func (m *GroupMutation) 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 (*GroupMutation) OldLocations

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

OldLocations returns the old "locations" field's value of the Group entity. If the Group 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 (*GroupMutation) OldName

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

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

func (m *GroupMutation) OldPrimaryLocation(ctx context.Context) (v string, err error)

OldPrimaryLocation returns the old "primary_location" field's value of the Group entity. If the Group 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 (*GroupMutation) OldRegion

func (m *GroupMutation) OldRegion(ctx context.Context) (v enums.Region, err error)

OldRegion returns the old "region" field's value of the Group entity. If the Group 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 (*GroupMutation) OldToken

func (m *GroupMutation) OldToken(ctx context.Context) (v string, err error)

OldToken returns the old "token" field's value of the Group entity. If the Group 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 (*GroupMutation) OldUpdatedAt

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

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

func (m *GroupMutation) OldUpdatedBy(ctx context.Context) (v string, err error)

OldUpdatedBy returns the old "updated_by" field's value of the Group entity. If the Group 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 (*GroupMutation) Op

func (m *GroupMutation) Op() Op

Op returns the operation name.

func (*GroupMutation) PrimaryLocation

func (m *GroupMutation) PrimaryLocation() (r string, exists bool)

PrimaryLocation returns the value of the "primary_location" field in the mutation.

func (*GroupMutation) Region

func (m *GroupMutation) Region() (r enums.Region, exists bool)

Region returns the value of the "region" field in the mutation.

func (*GroupMutation) RemoveDatabaseIDs

func (m *GroupMutation) RemoveDatabaseIDs(ids ...string)

RemoveDatabaseIDs removes the "databases" edge to the Database entity by IDs.

func (*GroupMutation) RemovedDatabasesIDs

func (m *GroupMutation) RemovedDatabasesIDs() (ids []string)

RemovedDatabases returns the removed IDs of the "databases" edge to the Database entity.

func (*GroupMutation) RemovedEdges

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

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

func (*GroupMutation) RemovedIDs

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

func (m *GroupMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*GroupMutation) ResetCreatedBy

func (m *GroupMutation) ResetCreatedBy()

ResetCreatedBy resets all changes to the "created_by" field.

func (*GroupMutation) ResetDatabases

func (m *GroupMutation) ResetDatabases()

ResetDatabases resets all changes to the "databases" edge.

func (*GroupMutation) ResetDeletedAt

func (m *GroupMutation) ResetDeletedAt()

ResetDeletedAt resets all changes to the "deleted_at" field.

func (*GroupMutation) ResetDeletedBy

func (m *GroupMutation) ResetDeletedBy()

ResetDeletedBy resets all changes to the "deleted_by" field.

func (*GroupMutation) ResetDescription

func (m *GroupMutation) ResetDescription()

ResetDescription resets all changes to the "description" field.

func (*GroupMutation) ResetEdge

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

func (m *GroupMutation) 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 (*GroupMutation) ResetLocations

func (m *GroupMutation) ResetLocations()

ResetLocations resets all changes to the "locations" field.

func (*GroupMutation) ResetName

func (m *GroupMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*GroupMutation) ResetPrimaryLocation

func (m *GroupMutation) ResetPrimaryLocation()

ResetPrimaryLocation resets all changes to the "primary_location" field.

func (*GroupMutation) ResetRegion

func (m *GroupMutation) ResetRegion()

ResetRegion resets all changes to the "region" field.

func (*GroupMutation) ResetToken

func (m *GroupMutation) ResetToken()

ResetToken resets all changes to the "token" field.

func (*GroupMutation) ResetUpdatedAt

func (m *GroupMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*GroupMutation) ResetUpdatedBy

func (m *GroupMutation) ResetUpdatedBy()

ResetUpdatedBy resets all changes to the "updated_by" field.

func (*GroupMutation) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*GroupMutation) SetCreatedBy

func (m *GroupMutation) SetCreatedBy(s string)

SetCreatedBy sets the "created_by" field.

func (*GroupMutation) SetDeletedAt

func (m *GroupMutation) SetDeletedAt(t time.Time)

SetDeletedAt sets the "deleted_at" field.

func (*GroupMutation) SetDeletedBy

func (m *GroupMutation) SetDeletedBy(s string)

SetDeletedBy sets the "deleted_by" field.

func (*GroupMutation) SetDescription

func (m *GroupMutation) SetDescription(s string)

SetDescription sets the "description" field.

func (*GroupMutation) SetField

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

func (m *GroupMutation) SetID(id string)

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

func (*GroupMutation) SetLocations

func (m *GroupMutation) SetLocations(s []string)

SetLocations sets the "locations" field.

func (*GroupMutation) SetName

func (m *GroupMutation) SetName(s string)

SetName sets the "name" field.

func (*GroupMutation) SetOp

func (m *GroupMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*GroupMutation) SetPrimaryLocation

func (m *GroupMutation) SetPrimaryLocation(s string)

SetPrimaryLocation sets the "primary_location" field.

func (*GroupMutation) SetRegion

func (m *GroupMutation) SetRegion(e enums.Region)

SetRegion sets the "region" field.

func (*GroupMutation) SetToken

func (m *GroupMutation) SetToken(s string)

SetToken sets the "token" field.

func (*GroupMutation) SetUpdatedAt

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

SetUpdatedAt sets the "updated_at" field.

func (*GroupMutation) SetUpdatedBy

func (m *GroupMutation) SetUpdatedBy(s string)

SetUpdatedBy sets the "updated_by" field.

func (*GroupMutation) Token

func (m *GroupMutation) Token() (r string, exists bool)

Token returns the value of the "token" field in the mutation.

func (*GroupMutation) TokenCleared

func (m *GroupMutation) TokenCleared() bool

TokenCleared returns if the "token" field was cleared in this mutation.

func (GroupMutation) Tx

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

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

func (*GroupMutation) Type

func (m *GroupMutation) Type() string

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

func (*GroupMutation) UpdatedAt

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

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

func (*GroupMutation) UpdatedAtCleared

func (m *GroupMutation) UpdatedAtCleared() bool

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

func (*GroupMutation) UpdatedBy

func (m *GroupMutation) UpdatedBy() (r string, exists bool)

UpdatedBy returns the value of the "updated_by" field in the mutation.

func (*GroupMutation) UpdatedByCleared

func (m *GroupMutation) UpdatedByCleared() bool

UpdatedByCleared returns if the "updated_by" field was cleared in this mutation.

func (*GroupMutation) Where

func (m *GroupMutation) Where(ps ...predicate.Group)

Where appends a list predicates to the GroupMutation builder.

func (*GroupMutation) WhereP

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

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

type GroupOrder

type GroupOrder struct {
	Direction OrderDirection   `json:"direction"`
	Field     *GroupOrderField `json:"field"`
}

GroupOrder defines the ordering of Group.

type GroupOrderField

type GroupOrderField struct {
	// Value extracts the ordering value from the given Group.
	Value func(*Group) (ent.Value, error)
	// contains filtered or unexported fields
}

GroupOrderField defines the ordering field of Group.

type GroupPaginateOption

type GroupPaginateOption func(*groupPager) error

GroupPaginateOption enables pagination customization.

func WithGroupFilter

func WithGroupFilter(filter func(*GroupQuery) (*GroupQuery, error)) GroupPaginateOption

WithGroupFilter configures pagination filter.

func WithGroupOrder

func WithGroupOrder(order *GroupOrder) GroupPaginateOption

WithGroupOrder configures pagination ordering.

type GroupQuery

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

GroupQuery is the builder for querying Group entities.

func (*GroupQuery) Aggregate

func (gq *GroupQuery) Aggregate(fns ...AggregateFunc) *GroupSelect

Aggregate returns a GroupSelect configured with the given aggregations.

func (*GroupQuery) All

func (gq *GroupQuery) All(ctx context.Context) ([]*Group, error)

All executes the query and returns a list of Groups.

func (*GroupQuery) AllX

func (gq *GroupQuery) AllX(ctx context.Context) []*Group

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

func (*GroupQuery) Clone

func (gq *GroupQuery) Clone() *GroupQuery

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

func (*GroupQuery) CollectFields

func (gr *GroupQuery) CollectFields(ctx context.Context, satisfies ...string) (*GroupQuery, error)

CollectFields tells the query-builder to eagerly load connected nodes by resolver context.

func (*GroupQuery) Count

func (gq *GroupQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*GroupQuery) CountX

func (gq *GroupQuery) CountX(ctx context.Context) int

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

func (*GroupQuery) Exist

func (gq *GroupQuery) Exist(ctx context.Context) (bool, error)

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

func (*GroupQuery) ExistX

func (gq *GroupQuery) ExistX(ctx context.Context) bool

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

func (*GroupQuery) Filter

func (gq *GroupQuery) Filter() *GroupFilter

Filter returns a Filter implementation to apply filters on the GroupQuery builder.

func (*GroupQuery) First

func (gq *GroupQuery) First(ctx context.Context) (*Group, error)

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

func (*GroupQuery) FirstID

func (gq *GroupQuery) FirstID(ctx context.Context) (id string, err error)

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

func (*GroupQuery) FirstIDX

func (gq *GroupQuery) FirstIDX(ctx context.Context) string

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

func (*GroupQuery) FirstX

func (gq *GroupQuery) FirstX(ctx context.Context) *Group

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

func (*GroupQuery) GroupBy

func (gq *GroupQuery) GroupBy(field string, fields ...string) *GroupGroupBy

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 {
	CreatedAt time.Time `json:"created_at,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Group.Query().
	GroupBy(group.FieldCreatedAt).
	Aggregate(generated.Count()).
	Scan(ctx, &v)

func (*GroupQuery) IDs

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

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

func (*GroupQuery) IDsX

func (gq *GroupQuery) IDsX(ctx context.Context) []string

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

func (*GroupQuery) Limit

func (gq *GroupQuery) Limit(limit int) *GroupQuery

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

func (*GroupQuery) Offset

func (gq *GroupQuery) Offset(offset int) *GroupQuery

Offset to start from.

func (*GroupQuery) Only

func (gq *GroupQuery) Only(ctx context.Context) (*Group, error)

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

func (*GroupQuery) OnlyID

func (gq *GroupQuery) OnlyID(ctx context.Context) (id string, err error)

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

func (*GroupQuery) OnlyIDX

func (gq *GroupQuery) OnlyIDX(ctx context.Context) string

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

func (*GroupQuery) OnlyX

func (gq *GroupQuery) OnlyX(ctx context.Context) *Group

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

func (*GroupQuery) Order

func (gq *GroupQuery) Order(o ...group.OrderOption) *GroupQuery

Order specifies how the records should be ordered.

func (*GroupQuery) Paginate

func (gr *GroupQuery) Paginate(
	ctx context.Context, after *Cursor, first *int,
	before *Cursor, last *int, opts ...GroupPaginateOption,
) (*GroupConnection, error)

Paginate executes the query and returns a relay based cursor connection to Group.

func (*GroupQuery) QueryDatabases

func (gq *GroupQuery) QueryDatabases() *DatabaseQuery

QueryDatabases chains the current query on the "databases" edge.

func (*GroupQuery) Select

func (gq *GroupQuery) Select(fields ...string) *GroupSelect

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 {
	CreatedAt time.Time `json:"created_at,omitempty"`
}

client.Group.Query().
	Select(group.FieldCreatedAt).
	Scan(ctx, &v)

func (*GroupQuery) Unique

func (gq *GroupQuery) Unique(unique bool) *GroupQuery

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

func (gq *GroupQuery) Where(ps ...predicate.Group) *GroupQuery

Where adds a new predicate for the GroupQuery builder.

func (*GroupQuery) WithDatabases

func (gq *GroupQuery) WithDatabases(opts ...func(*DatabaseQuery)) *GroupQuery

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

func (*GroupQuery) WithNamedDatabases

func (gq *GroupQuery) WithNamedDatabases(name string, opts ...func(*DatabaseQuery)) *GroupQuery

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

type GroupSelect

type GroupSelect struct {
	*GroupQuery
	// contains filtered or unexported fields
}

GroupSelect is the builder for selecting fields of Group entities.

func (*GroupSelect) Aggregate

func (gs *GroupSelect) Aggregate(fns ...AggregateFunc) *GroupSelect

Aggregate adds the given aggregation functions to the selector query.

func (*GroupSelect) Bool

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

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

func (*GroupSelect) BoolX

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

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

func (*GroupSelect) Bools

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

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

func (*GroupSelect) BoolsX

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

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

func (*GroupSelect) Float64

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

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

func (*GroupSelect) Float64X

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

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

func (*GroupSelect) Float64s

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

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

func (*GroupSelect) Float64sX

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

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

func (*GroupSelect) Int

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

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

func (*GroupSelect) IntX

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

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

func (*GroupSelect) Ints

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

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

func (*GroupSelect) IntsX

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

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

func (*GroupSelect) Scan

func (gs *GroupSelect) Scan(ctx context.Context, v any) error

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

func (*GroupSelect) ScanX

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

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

func (*GroupSelect) String

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

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

func (*GroupSelect) StringX

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

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

func (*GroupSelect) Strings

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

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

func (*GroupSelect) StringsX

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

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

type GroupUpdate

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

GroupUpdate is the builder for updating Group entities.

func (*GroupUpdate) AddDatabaseIDs

func (gu *GroupUpdate) AddDatabaseIDs(ids ...string) *GroupUpdate

AddDatabaseIDs adds the "databases" edge to the Database entity by IDs.

func (*GroupUpdate) AddDatabases

func (gu *GroupUpdate) AddDatabases(d ...*Database) *GroupUpdate

AddDatabases adds the "databases" edges to the Database entity.

func (*GroupUpdate) AppendLocations

func (gu *GroupUpdate) AppendLocations(s []string) *GroupUpdate

AppendLocations appends s to the "locations" field.

func (*GroupUpdate) ClearDatabases

func (gu *GroupUpdate) ClearDatabases() *GroupUpdate

ClearDatabases clears all "databases" edges to the Database entity.

func (*GroupUpdate) ClearDeletedAt

func (gu *GroupUpdate) ClearDeletedAt() *GroupUpdate

ClearDeletedAt clears the value of the "deleted_at" field.

func (*GroupUpdate) ClearDeletedBy

func (gu *GroupUpdate) ClearDeletedBy() *GroupUpdate

ClearDeletedBy clears the value of the "deleted_by" field.

func (*GroupUpdate) ClearDescription

func (gu *GroupUpdate) ClearDescription() *GroupUpdate

ClearDescription clears the value of the "description" field.

func (*GroupUpdate) ClearLocations

func (gu *GroupUpdate) ClearLocations() *GroupUpdate

ClearLocations clears the value of the "locations" field.

func (*GroupUpdate) ClearToken

func (gu *GroupUpdate) ClearToken() *GroupUpdate

ClearToken clears the value of the "token" field.

func (*GroupUpdate) ClearUpdatedAt

func (gu *GroupUpdate) ClearUpdatedAt() *GroupUpdate

ClearUpdatedAt clears the value of the "updated_at" field.

func (*GroupUpdate) ClearUpdatedBy

func (gu *GroupUpdate) ClearUpdatedBy() *GroupUpdate

ClearUpdatedBy clears the value of the "updated_by" field.

func (*GroupUpdate) Exec

func (gu *GroupUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*GroupUpdate) ExecX

func (gu *GroupUpdate) ExecX(ctx context.Context)

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

func (*GroupUpdate) Mutation

func (gu *GroupUpdate) Mutation() *GroupMutation

Mutation returns the GroupMutation object of the builder.

func (*GroupUpdate) RemoveDatabaseIDs

func (gu *GroupUpdate) RemoveDatabaseIDs(ids ...string) *GroupUpdate

RemoveDatabaseIDs removes the "databases" edge to Database entities by IDs.

func (*GroupUpdate) RemoveDatabases

func (gu *GroupUpdate) RemoveDatabases(d ...*Database) *GroupUpdate

RemoveDatabases removes "databases" edges to Database entities.

func (*GroupUpdate) Save

func (gu *GroupUpdate) Save(ctx context.Context) (int, error)

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

func (*GroupUpdate) SaveX

func (gu *GroupUpdate) SaveX(ctx context.Context) int

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

func (*GroupUpdate) SetDeletedAt

func (gu *GroupUpdate) SetDeletedAt(t time.Time) *GroupUpdate

SetDeletedAt sets the "deleted_at" field.

func (*GroupUpdate) SetDeletedBy

func (gu *GroupUpdate) SetDeletedBy(s string) *GroupUpdate

SetDeletedBy sets the "deleted_by" field.

func (*GroupUpdate) SetDescription

func (gu *GroupUpdate) SetDescription(s string) *GroupUpdate

SetDescription sets the "description" field.

func (*GroupUpdate) SetInput

func (c *GroupUpdate) SetInput(i UpdateGroupInput) *GroupUpdate

SetInput applies the change-set in the UpdateGroupInput on the GroupUpdate builder.

func (*GroupUpdate) SetLocations

func (gu *GroupUpdate) SetLocations(s []string) *GroupUpdate

SetLocations sets the "locations" field.

func (*GroupUpdate) SetName

func (gu *GroupUpdate) SetName(s string) *GroupUpdate

SetName sets the "name" field.

func (*GroupUpdate) SetNillableDeletedAt

func (gu *GroupUpdate) SetNillableDeletedAt(t *time.Time) *GroupUpdate

SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.

func (*GroupUpdate) SetNillableDeletedBy

func (gu *GroupUpdate) SetNillableDeletedBy(s *string) *GroupUpdate

SetNillableDeletedBy sets the "deleted_by" field if the given value is not nil.

func (*GroupUpdate) SetNillableDescription

func (gu *GroupUpdate) SetNillableDescription(s *string) *GroupUpdate

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

func (*GroupUpdate) SetNillableName

func (gu *GroupUpdate) SetNillableName(s *string) *GroupUpdate

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

func (*GroupUpdate) SetNillablePrimaryLocation

func (gu *GroupUpdate) SetNillablePrimaryLocation(s *string) *GroupUpdate

SetNillablePrimaryLocation sets the "primary_location" field if the given value is not nil.

func (*GroupUpdate) SetNillableRegion

func (gu *GroupUpdate) SetNillableRegion(e *enums.Region) *GroupUpdate

SetNillableRegion sets the "region" field if the given value is not nil.

func (*GroupUpdate) SetNillableToken

func (gu *GroupUpdate) SetNillableToken(s *string) *GroupUpdate

SetNillableToken sets the "token" field if the given value is not nil.

func (*GroupUpdate) SetNillableUpdatedBy

func (gu *GroupUpdate) SetNillableUpdatedBy(s *string) *GroupUpdate

SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil.

func (*GroupUpdate) SetPrimaryLocation

func (gu *GroupUpdate) SetPrimaryLocation(s string) *GroupUpdate

SetPrimaryLocation sets the "primary_location" field.

func (*GroupUpdate) SetRegion

func (gu *GroupUpdate) SetRegion(e enums.Region) *GroupUpdate

SetRegion sets the "region" field.

func (*GroupUpdate) SetToken

func (gu *GroupUpdate) SetToken(s string) *GroupUpdate

SetToken sets the "token" field.

func (*GroupUpdate) SetUpdatedAt

func (gu *GroupUpdate) SetUpdatedAt(t time.Time) *GroupUpdate

SetUpdatedAt sets the "updated_at" field.

func (*GroupUpdate) SetUpdatedBy

func (gu *GroupUpdate) SetUpdatedBy(s string) *GroupUpdate

SetUpdatedBy sets the "updated_by" field.

func (*GroupUpdate) Where

func (gu *GroupUpdate) Where(ps ...predicate.Group) *GroupUpdate

Where appends a list predicates to the GroupUpdate builder.

type GroupUpdateOne

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

GroupUpdateOne is the builder for updating a single Group entity.

func (*GroupUpdateOne) AddDatabaseIDs

func (guo *GroupUpdateOne) AddDatabaseIDs(ids ...string) *GroupUpdateOne

AddDatabaseIDs adds the "databases" edge to the Database entity by IDs.

func (*GroupUpdateOne) AddDatabases

func (guo *GroupUpdateOne) AddDatabases(d ...*Database) *GroupUpdateOne

AddDatabases adds the "databases" edges to the Database entity.

func (*GroupUpdateOne) AppendLocations

func (guo *GroupUpdateOne) AppendLocations(s []string) *GroupUpdateOne

AppendLocations appends s to the "locations" field.

func (*GroupUpdateOne) ClearDatabases

func (guo *GroupUpdateOne) ClearDatabases() *GroupUpdateOne

ClearDatabases clears all "databases" edges to the Database entity.

func (*GroupUpdateOne) ClearDeletedAt

func (guo *GroupUpdateOne) ClearDeletedAt() *GroupUpdateOne

ClearDeletedAt clears the value of the "deleted_at" field.

func (*GroupUpdateOne) ClearDeletedBy

func (guo *GroupUpdateOne) ClearDeletedBy() *GroupUpdateOne

ClearDeletedBy clears the value of the "deleted_by" field.

func (*GroupUpdateOne) ClearDescription

func (guo *GroupUpdateOne) ClearDescription() *GroupUpdateOne

ClearDescription clears the value of the "description" field.

func (*GroupUpdateOne) ClearLocations

func (guo *GroupUpdateOne) ClearLocations() *GroupUpdateOne

ClearLocations clears the value of the "locations" field.

func (*GroupUpdateOne) ClearToken

func (guo *GroupUpdateOne) ClearToken() *GroupUpdateOne

ClearToken clears the value of the "token" field.

func (*GroupUpdateOne) ClearUpdatedAt

func (guo *GroupUpdateOne) ClearUpdatedAt() *GroupUpdateOne

ClearUpdatedAt clears the value of the "updated_at" field.

func (*GroupUpdateOne) ClearUpdatedBy

func (guo *GroupUpdateOne) ClearUpdatedBy() *GroupUpdateOne

ClearUpdatedBy clears the value of the "updated_by" field.

func (*GroupUpdateOne) Exec

func (guo *GroupUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*GroupUpdateOne) ExecX

func (guo *GroupUpdateOne) ExecX(ctx context.Context)

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

func (*GroupUpdateOne) Mutation

func (guo *GroupUpdateOne) Mutation() *GroupMutation

Mutation returns the GroupMutation object of the builder.

func (*GroupUpdateOne) RemoveDatabaseIDs

func (guo *GroupUpdateOne) RemoveDatabaseIDs(ids ...string) *GroupUpdateOne

RemoveDatabaseIDs removes the "databases" edge to Database entities by IDs.

func (*GroupUpdateOne) RemoveDatabases

func (guo *GroupUpdateOne) RemoveDatabases(d ...*Database) *GroupUpdateOne

RemoveDatabases removes "databases" edges to Database entities.

func (*GroupUpdateOne) Save

func (guo *GroupUpdateOne) Save(ctx context.Context) (*Group, error)

Save executes the query and returns the updated Group entity.

func (*GroupUpdateOne) SaveX

func (guo *GroupUpdateOne) SaveX(ctx context.Context) *Group

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

func (*GroupUpdateOne) Select

func (guo *GroupUpdateOne) Select(field string, fields ...string) *GroupUpdateOne

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

func (*GroupUpdateOne) SetDeletedAt

func (guo *GroupUpdateOne) SetDeletedAt(t time.Time) *GroupUpdateOne

SetDeletedAt sets the "deleted_at" field.

func (*GroupUpdateOne) SetDeletedBy

func (guo *GroupUpdateOne) SetDeletedBy(s string) *GroupUpdateOne

SetDeletedBy sets the "deleted_by" field.

func (*GroupUpdateOne) SetDescription

func (guo *GroupUpdateOne) SetDescription(s string) *GroupUpdateOne

SetDescription sets the "description" field.

func (*GroupUpdateOne) SetInput

SetInput applies the change-set in the UpdateGroupInput on the GroupUpdateOne builder.

func (*GroupUpdateOne) SetLocations

func (guo *GroupUpdateOne) SetLocations(s []string) *GroupUpdateOne

SetLocations sets the "locations" field.

func (*GroupUpdateOne) SetName

func (guo *GroupUpdateOne) SetName(s string) *GroupUpdateOne

SetName sets the "name" field.

func (*GroupUpdateOne) SetNillableDeletedAt

func (guo *GroupUpdateOne) SetNillableDeletedAt(t *time.Time) *GroupUpdateOne

SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.

func (*GroupUpdateOne) SetNillableDeletedBy

func (guo *GroupUpdateOne) SetNillableDeletedBy(s *string) *GroupUpdateOne

SetNillableDeletedBy sets the "deleted_by" field if the given value is not nil.

func (*GroupUpdateOne) SetNillableDescription

func (guo *GroupUpdateOne) SetNillableDescription(s *string) *GroupUpdateOne

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

func (*GroupUpdateOne) SetNillableName

func (guo *GroupUpdateOne) SetNillableName(s *string) *GroupUpdateOne

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

func (*GroupUpdateOne) SetNillablePrimaryLocation

func (guo *GroupUpdateOne) SetNillablePrimaryLocation(s *string) *GroupUpdateOne

SetNillablePrimaryLocation sets the "primary_location" field if the given value is not nil.

func (*GroupUpdateOne) SetNillableRegion

func (guo *GroupUpdateOne) SetNillableRegion(e *enums.Region) *GroupUpdateOne

SetNillableRegion sets the "region" field if the given value is not nil.

func (*GroupUpdateOne) SetNillableToken

func (guo *GroupUpdateOne) SetNillableToken(s *string) *GroupUpdateOne

SetNillableToken sets the "token" field if the given value is not nil.

func (*GroupUpdateOne) SetNillableUpdatedBy

func (guo *GroupUpdateOne) SetNillableUpdatedBy(s *string) *GroupUpdateOne

SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil.

func (*GroupUpdateOne) SetPrimaryLocation

func (guo *GroupUpdateOne) SetPrimaryLocation(s string) *GroupUpdateOne

SetPrimaryLocation sets the "primary_location" field.

func (*GroupUpdateOne) SetRegion

func (guo *GroupUpdateOne) SetRegion(e enums.Region) *GroupUpdateOne

SetRegion sets the "region" field.

func (*GroupUpdateOne) SetToken

func (guo *GroupUpdateOne) SetToken(s string) *GroupUpdateOne

SetToken sets the "token" field.

func (*GroupUpdateOne) SetUpdatedAt

func (guo *GroupUpdateOne) SetUpdatedAt(t time.Time) *GroupUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*GroupUpdateOne) SetUpdatedBy

func (guo *GroupUpdateOne) SetUpdatedBy(s string) *GroupUpdateOne

SetUpdatedBy sets the "updated_by" field.

func (*GroupUpdateOne) Where

func (guo *GroupUpdateOne) Where(ps ...predicate.Group) *GroupUpdateOne

Where appends a list predicates to the GroupUpdate builder.

type GroupWhereInput

type GroupWhereInput struct {
	Predicates []predicate.Group  `json:"-"`
	Not        *GroupWhereInput   `json:"not,omitempty"`
	Or         []*GroupWhereInput `json:"or,omitempty"`
	And        []*GroupWhereInput `json:"and,omitempty"`

	// "id" field predicates.
	ID             *string  `json:"id,omitempty"`
	IDNEQ          *string  `json:"idNEQ,omitempty"`
	IDIn           []string `json:"idIn,omitempty"`
	IDNotIn        []string `json:"idNotIn,omitempty"`
	IDGT           *string  `json:"idGT,omitempty"`
	IDGTE          *string  `json:"idGTE,omitempty"`
	IDLT           *string  `json:"idLT,omitempty"`
	IDLTE          *string  `json:"idLTE,omitempty"`
	IDEqualFold    *string  `json:"idEqualFold,omitempty"`
	IDContainsFold *string  `json:"idContainsFold,omitempty"`

	// "created_at" field predicates.
	CreatedAt       *time.Time  `json:"createdAt,omitempty"`
	CreatedAtNEQ    *time.Time  `json:"createdAtNEQ,omitempty"`
	CreatedAtIn     []time.Time `json:"createdAtIn,omitempty"`
	CreatedAtNotIn  []time.Time `json:"createdAtNotIn,omitempty"`
	CreatedAtGT     *time.Time  `json:"createdAtGT,omitempty"`
	CreatedAtGTE    *time.Time  `json:"createdAtGTE,omitempty"`
	CreatedAtLT     *time.Time  `json:"createdAtLT,omitempty"`
	CreatedAtLTE    *time.Time  `json:"createdAtLTE,omitempty"`
	CreatedAtIsNil  bool        `json:"createdAtIsNil,omitempty"`
	CreatedAtNotNil bool        `json:"createdAtNotNil,omitempty"`

	// "updated_at" field predicates.
	UpdatedAt       *time.Time  `json:"updatedAt,omitempty"`
	UpdatedAtNEQ    *time.Time  `json:"updatedAtNEQ,omitempty"`
	UpdatedAtIn     []time.Time `json:"updatedAtIn,omitempty"`
	UpdatedAtNotIn  []time.Time `json:"updatedAtNotIn,omitempty"`
	UpdatedAtGT     *time.Time  `json:"updatedAtGT,omitempty"`
	UpdatedAtGTE    *time.Time  `json:"updatedAtGTE,omitempty"`
	UpdatedAtLT     *time.Time  `json:"updatedAtLT,omitempty"`
	UpdatedAtLTE    *time.Time  `json:"updatedAtLTE,omitempty"`
	UpdatedAtIsNil  bool        `json:"updatedAtIsNil,omitempty"`
	UpdatedAtNotNil bool        `json:"updatedAtNotNil,omitempty"`

	// "created_by" field predicates.
	CreatedBy             *string  `json:"createdBy,omitempty"`
	CreatedByNEQ          *string  `json:"createdByNEQ,omitempty"`
	CreatedByIn           []string `json:"createdByIn,omitempty"`
	CreatedByNotIn        []string `json:"createdByNotIn,omitempty"`
	CreatedByGT           *string  `json:"createdByGT,omitempty"`
	CreatedByGTE          *string  `json:"createdByGTE,omitempty"`
	CreatedByLT           *string  `json:"createdByLT,omitempty"`
	CreatedByLTE          *string  `json:"createdByLTE,omitempty"`
	CreatedByContains     *string  `json:"createdByContains,omitempty"`
	CreatedByHasPrefix    *string  `json:"createdByHasPrefix,omitempty"`
	CreatedByHasSuffix    *string  `json:"createdByHasSuffix,omitempty"`
	CreatedByIsNil        bool     `json:"createdByIsNil,omitempty"`
	CreatedByNotNil       bool     `json:"createdByNotNil,omitempty"`
	CreatedByEqualFold    *string  `json:"createdByEqualFold,omitempty"`
	CreatedByContainsFold *string  `json:"createdByContainsFold,omitempty"`

	// "updated_by" field predicates.
	UpdatedBy             *string  `json:"updatedBy,omitempty"`
	UpdatedByNEQ          *string  `json:"updatedByNEQ,omitempty"`
	UpdatedByIn           []string `json:"updatedByIn,omitempty"`
	UpdatedByNotIn        []string `json:"updatedByNotIn,omitempty"`
	UpdatedByGT           *string  `json:"updatedByGT,omitempty"`
	UpdatedByGTE          *string  `json:"updatedByGTE,omitempty"`
	UpdatedByLT           *string  `json:"updatedByLT,omitempty"`
	UpdatedByLTE          *string  `json:"updatedByLTE,omitempty"`
	UpdatedByContains     *string  `json:"updatedByContains,omitempty"`
	UpdatedByHasPrefix    *string  `json:"updatedByHasPrefix,omitempty"`
	UpdatedByHasSuffix    *string  `json:"updatedByHasSuffix,omitempty"`
	UpdatedByIsNil        bool     `json:"updatedByIsNil,omitempty"`
	UpdatedByNotNil       bool     `json:"updatedByNotNil,omitempty"`
	UpdatedByEqualFold    *string  `json:"updatedByEqualFold,omitempty"`
	UpdatedByContainsFold *string  `json:"updatedByContainsFold,omitempty"`

	// "deleted_at" field predicates.
	DeletedAt       *time.Time  `json:"deletedAt,omitempty"`
	DeletedAtNEQ    *time.Time  `json:"deletedAtNEQ,omitempty"`
	DeletedAtIn     []time.Time `json:"deletedAtIn,omitempty"`
	DeletedAtNotIn  []time.Time `json:"deletedAtNotIn,omitempty"`
	DeletedAtGT     *time.Time  `json:"deletedAtGT,omitempty"`
	DeletedAtGTE    *time.Time  `json:"deletedAtGTE,omitempty"`
	DeletedAtLT     *time.Time  `json:"deletedAtLT,omitempty"`
	DeletedAtLTE    *time.Time  `json:"deletedAtLTE,omitempty"`
	DeletedAtIsNil  bool        `json:"deletedAtIsNil,omitempty"`
	DeletedAtNotNil bool        `json:"deletedAtNotNil,omitempty"`

	// "deleted_by" field predicates.
	DeletedBy             *string  `json:"deletedBy,omitempty"`
	DeletedByNEQ          *string  `json:"deletedByNEQ,omitempty"`
	DeletedByIn           []string `json:"deletedByIn,omitempty"`
	DeletedByNotIn        []string `json:"deletedByNotIn,omitempty"`
	DeletedByGT           *string  `json:"deletedByGT,omitempty"`
	DeletedByGTE          *string  `json:"deletedByGTE,omitempty"`
	DeletedByLT           *string  `json:"deletedByLT,omitempty"`
	DeletedByLTE          *string  `json:"deletedByLTE,omitempty"`
	DeletedByContains     *string  `json:"deletedByContains,omitempty"`
	DeletedByHasPrefix    *string  `json:"deletedByHasPrefix,omitempty"`
	DeletedByHasSuffix    *string  `json:"deletedByHasSuffix,omitempty"`
	DeletedByIsNil        bool     `json:"deletedByIsNil,omitempty"`
	DeletedByNotNil       bool     `json:"deletedByNotNil,omitempty"`
	DeletedByEqualFold    *string  `json:"deletedByEqualFold,omitempty"`
	DeletedByContainsFold *string  `json:"deletedByContainsFold,omitempty"`

	// "name" field predicates.
	Name             *string  `json:"name,omitempty"`
	NameNEQ          *string  `json:"nameNEQ,omitempty"`
	NameIn           []string `json:"nameIn,omitempty"`
	NameNotIn        []string `json:"nameNotIn,omitempty"`
	NameGT           *string  `json:"nameGT,omitempty"`
	NameGTE          *string  `json:"nameGTE,omitempty"`
	NameLT           *string  `json:"nameLT,omitempty"`
	NameLTE          *string  `json:"nameLTE,omitempty"`
	NameContains     *string  `json:"nameContains,omitempty"`
	NameHasPrefix    *string  `json:"nameHasPrefix,omitempty"`
	NameHasSuffix    *string  `json:"nameHasSuffix,omitempty"`
	NameEqualFold    *string  `json:"nameEqualFold,omitempty"`
	NameContainsFold *string  `json:"nameContainsFold,omitempty"`

	// "description" field predicates.
	Description             *string  `json:"description,omitempty"`
	DescriptionNEQ          *string  `json:"descriptionNEQ,omitempty"`
	DescriptionIn           []string `json:"descriptionIn,omitempty"`
	DescriptionNotIn        []string `json:"descriptionNotIn,omitempty"`
	DescriptionGT           *string  `json:"descriptionGT,omitempty"`
	DescriptionGTE          *string  `json:"descriptionGTE,omitempty"`
	DescriptionLT           *string  `json:"descriptionLT,omitempty"`
	DescriptionLTE          *string  `json:"descriptionLTE,omitempty"`
	DescriptionContains     *string  `json:"descriptionContains,omitempty"`
	DescriptionHasPrefix    *string  `json:"descriptionHasPrefix,omitempty"`
	DescriptionHasSuffix    *string  `json:"descriptionHasSuffix,omitempty"`
	DescriptionIsNil        bool     `json:"descriptionIsNil,omitempty"`
	DescriptionNotNil       bool     `json:"descriptionNotNil,omitempty"`
	DescriptionEqualFold    *string  `json:"descriptionEqualFold,omitempty"`
	DescriptionContainsFold *string  `json:"descriptionContainsFold,omitempty"`

	// "primary_location" field predicates.
	PrimaryLocation             *string  `json:"primaryLocation,omitempty"`
	PrimaryLocationNEQ          *string  `json:"primaryLocationNEQ,omitempty"`
	PrimaryLocationIn           []string `json:"primaryLocationIn,omitempty"`
	PrimaryLocationNotIn        []string `json:"primaryLocationNotIn,omitempty"`
	PrimaryLocationGT           *string  `json:"primaryLocationGT,omitempty"`
	PrimaryLocationGTE          *string  `json:"primaryLocationGTE,omitempty"`
	PrimaryLocationLT           *string  `json:"primaryLocationLT,omitempty"`
	PrimaryLocationLTE          *string  `json:"primaryLocationLTE,omitempty"`
	PrimaryLocationContains     *string  `json:"primaryLocationContains,omitempty"`
	PrimaryLocationHasPrefix    *string  `json:"primaryLocationHasPrefix,omitempty"`
	PrimaryLocationHasSuffix    *string  `json:"primaryLocationHasSuffix,omitempty"`
	PrimaryLocationEqualFold    *string  `json:"primaryLocationEqualFold,omitempty"`
	PrimaryLocationContainsFold *string  `json:"primaryLocationContainsFold,omitempty"`

	// "token" field predicates.
	Token             *string  `json:"token,omitempty"`
	TokenNEQ          *string  `json:"tokenNEQ,omitempty"`
	TokenIn           []string `json:"tokenIn,omitempty"`
	TokenNotIn        []string `json:"tokenNotIn,omitempty"`
	TokenGT           *string  `json:"tokenGT,omitempty"`
	TokenGTE          *string  `json:"tokenGTE,omitempty"`
	TokenLT           *string  `json:"tokenLT,omitempty"`
	TokenLTE          *string  `json:"tokenLTE,omitempty"`
	TokenContains     *string  `json:"tokenContains,omitempty"`
	TokenHasPrefix    *string  `json:"tokenHasPrefix,omitempty"`
	TokenHasSuffix    *string  `json:"tokenHasSuffix,omitempty"`
	TokenIsNil        bool     `json:"tokenIsNil,omitempty"`
	TokenNotNil       bool     `json:"tokenNotNil,omitempty"`
	TokenEqualFold    *string  `json:"tokenEqualFold,omitempty"`
	TokenContainsFold *string  `json:"tokenContainsFold,omitempty"`

	// "region" field predicates.
	Region      *enums.Region  `json:"region,omitempty"`
	RegionNEQ   *enums.Region  `json:"regionNEQ,omitempty"`
	RegionIn    []enums.Region `json:"regionIn,omitempty"`
	RegionNotIn []enums.Region `json:"regionNotIn,omitempty"`

	// "databases" edge predicates.
	HasDatabases     *bool                 `json:"hasDatabases,omitempty"`
	HasDatabasesWith []*DatabaseWhereInput `json:"hasDatabasesWith,omitempty"`
}

GroupWhereInput represents a where input for filtering Group queries.

func (*GroupWhereInput) AddPredicates

func (i *GroupWhereInput) AddPredicates(predicates ...predicate.Group)

AddPredicates adds custom predicates to the where input to be used during the filtering phase.

func (*GroupWhereInput) Filter

func (i *GroupWhereInput) Filter(q *GroupQuery) (*GroupQuery, error)

Filter applies the GroupWhereInput filter on the GroupQuery builder.

func (*GroupWhereInput) P

P returns a predicate for filtering groups. An error is returned if the input is empty or invalid.

type Groups

type Groups []*Group

Groups is a parsable slice of Group.

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 NodeOption

type NodeOption func(*nodeOptions)

NodeOption allows configuring the Noder execution using functional options.

func WithFixedNodeType

func WithFixedNodeType(t string) NodeOption

WithFixedNodeType sets the Type of the node to a fixed value.

func WithNodeType

func WithNodeType(f func(context.Context, string) (string, error)) NodeOption

WithNodeType sets the node Type resolver function (i.e. the table to query). If was not provided, the table will be derived from the universal-id configuration as described in: https://entgo.io/docs/migrate/#universal-ids.

type Noder

type Noder interface {
	IsNode()
}

Noder wraps the basic Node method.

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 AlternateSchema

func AlternateSchema(schemaConfig SchemaConfig) Option

AlternateSchemas allows alternate schema names to be passed into ent operations.

func Authz

func Authz(v fgax.Client) Option

Authz configures the Authz.

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 HTTPClient

func HTTPClient(v *http.Client) Option

HTTPClient configures the HTTPClient.

func Log

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

Log sets the logging function for debug mode.

func Logger

func Logger(v zap.SugaredLogger) Option

Logger configures the Logger.

func SecretsKeeper

func SecretsKeeper(v *secrets.Keeper) Option

SecretsKeeper configures the SecretsKeeper.

func Turso

func Turso(v *turso.Client) Option

Turso configures the Turso.

type OrderDirection

type OrderDirection = entgql.OrderDirection

Common entgql types.

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 PageInfo

type PageInfo = entgql.PageInfo[string]

Common entgql types.

type Policy

type Policy = ent.Policy

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

type Querier

type Querier = ent.Querier

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

type QuerierFunc

type QuerierFunc = ent.QuerierFunc

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

type Query

type Query = ent.Query

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

type QueryContext

type QueryContext = ent.QueryContext

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

type RollbackFunc

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

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

func (RollbackFunc) Rollback

func (f RollbackFunc) Rollback(ctx context.Context, tx *Tx) error

Rollback calls f(ctx, m).

type RollbackHook

type RollbackHook func(Rollbacker) Rollbacker

RollbackHook defines the "rollback middleware". A function that gets a Rollbacker and returns a Rollbacker. For example:

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

type Rollbacker

type Rollbacker interface {
	Rollback(context.Context, *Tx) error
}

Rollbacker is the interface that wraps the Rollback method.

type SchemaConfig

type SchemaConfig = internal.SchemaConfig

SchemaConfig represents alternative schema names for all tables that can be passed at runtime.

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 {

	// Database is the client for interacting with the Database builders.
	Database *DatabaseClient
	// Group is the client for interacting with the Group builders.
	Group *GroupClient
	// 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 UpdateDatabaseInput

type UpdateDatabaseInput struct {
	ClearUpdatedAt bool
	UpdatedAt      *time.Time
	ClearUpdatedBy bool
	UpdatedBy      *string
	OrganizationID *string
	Name           *string
	ClearGeo       bool
	Geo            *string
	Dsn            *string
	ClearToken     bool
	Token          *string
	Status         *enums.DatabaseStatus
	Provider       *enums.DatabaseProvider
	GroupID        *string
}

UpdateDatabaseInput represents a mutation input for updating databases.

func (*UpdateDatabaseInput) Mutate

func (i *UpdateDatabaseInput) Mutate(m *DatabaseMutation)

Mutate applies the UpdateDatabaseInput on the DatabaseMutation builder.

type UpdateGroupInput

type UpdateGroupInput struct {
	ClearUpdatedAt    bool
	UpdatedAt         *time.Time
	ClearUpdatedBy    bool
	UpdatedBy         *string
	Name              *string
	ClearDescription  bool
	Description       *string
	PrimaryLocation   *string
	ClearLocations    bool
	Locations         []string
	AppendLocations   []string
	ClearToken        bool
	Token             *string
	Region            *enums.Region
	ClearDatabases    bool
	AddDatabaseIDs    []string
	RemoveDatabaseIDs []string
}

UpdateGroupInput represents a mutation input for updating groups.

func (*UpdateGroupInput) Mutate

func (i *UpdateGroupInput) Mutate(m *GroupMutation)

Mutate applies the UpdateGroupInput on the GroupMutation builder.

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