ent

package
v0.0.0-...-7acab80 Latest Latest
Warning

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

Go to latest
Published: May 8, 2024 License: Apache-2.0 Imports: 32 Imported by: 0

Documentation

Overview

Code generated by ent, DO NOT EDIT. -------------------------------------------------------------- SPDX-FileCopyrightText: Copyright © 2024 The Protobom Authors SPDX-FileType: SOURCE SPDX-License-Identifier: Apache-2.0 --------------------------------------------------------------

Code generated by ent, DO NOT EDIT. -------------------------------------------------------------- SPDX-FileCopyrightText: Copyright © 2024 The Protobom Authors SPDX-FileType: SOURCE SPDX-License-Identifier: Apache-2.0 --------------------------------------------------------------

Code generated by ent, DO NOT EDIT. -------------------------------------------------------------- SPDX-FileCopyrightText: Copyright © 2024 The Protobom Authors SPDX-FileType: SOURCE SPDX-License-Identifier: Apache-2.0 --------------------------------------------------------------

Code generated by ent, DO NOT EDIT. -------------------------------------------------------------- SPDX-FileCopyrightText: Copyright © 2024 The Protobom Authors SPDX-FileType: SOURCE SPDX-License-Identifier: Apache-2.0 --------------------------------------------------------------

Code generated by ent, DO NOT EDIT. -------------------------------------------------------------- SPDX-FileCopyrightText: Copyright © 2024 The Protobom Authors SPDX-FileType: SOURCE SPDX-License-Identifier: Apache-2.0 --------------------------------------------------------------

Code generated by ent, DO NOT EDIT. -------------------------------------------------------------- SPDX-FileCopyrightText: Copyright © 2024 The Protobom Authors SPDX-FileType: SOURCE SPDX-License-Identifier: Apache-2.0 --------------------------------------------------------------

Code generated by ent, DO NOT EDIT. -------------------------------------------------------------- SPDX-FileCopyrightText: Copyright © 2024 The Protobom Authors SPDX-FileType: SOURCE SPDX-License-Identifier: Apache-2.0 --------------------------------------------------------------

Code generated by ent, DO NOT EDIT. -------------------------------------------------------------- SPDX-FileCopyrightText: Copyright © 2024 The Protobom Authors SPDX-FileType: SOURCE SPDX-License-Identifier: Apache-2.0 --------------------------------------------------------------

Code generated by ent, DO NOT EDIT. -------------------------------------------------------------- SPDX-FileCopyrightText: Copyright © 2024 The Protobom Authors SPDX-FileType: SOURCE SPDX-License-Identifier: Apache-2.0 --------------------------------------------------------------

Code generated by ent, DO NOT EDIT. -------------------------------------------------------------- SPDX-FileCopyrightText: Copyright © 2024 The Protobom Authors SPDX-FileType: SOURCE SPDX-License-Identifier: Apache-2.0 --------------------------------------------------------------

Code generated by ent, DO NOT EDIT. -------------------------------------------------------------- SPDX-FileCopyrightText: Copyright © 2024 The Protobom Authors SPDX-FileType: SOURCE SPDX-License-Identifier: Apache-2.0 --------------------------------------------------------------

Code generated by ent, DO NOT EDIT. -------------------------------------------------------------- SPDX-FileCopyrightText: Copyright © 2024 The Protobom Authors SPDX-FileType: SOURCE SPDX-License-Identifier: Apache-2.0 --------------------------------------------------------------

Code generated by ent, DO NOT EDIT. -------------------------------------------------------------- SPDX-FileCopyrightText: Copyright © 2024 The Protobom Authors SPDX-FileType: SOURCE SPDX-License-Identifier: Apache-2.0 --------------------------------------------------------------

Code generated by ent, DO NOT EDIT. -------------------------------------------------------------- SPDX-FileCopyrightText: Copyright © 2024 The Protobom Authors SPDX-FileType: SOURCE SPDX-License-Identifier: Apache-2.0 --------------------------------------------------------------

Code generated by ent, DO NOT EDIT. -------------------------------------------------------------- SPDX-FileCopyrightText: Copyright © 2024 The Protobom Authors SPDX-FileType: SOURCE SPDX-License-Identifier: Apache-2.0 --------------------------------------------------------------

Code generated by ent, DO NOT EDIT. -------------------------------------------------------------- SPDX-FileCopyrightText: Copyright © 2024 The Protobom Authors SPDX-FileType: SOURCE SPDX-License-Identifier: Apache-2.0 --------------------------------------------------------------

Code generated by ent, DO NOT EDIT. -------------------------------------------------------------- SPDX-FileCopyrightText: Copyright © 2024 The Protobom Authors SPDX-FileType: SOURCE SPDX-License-Identifier: Apache-2.0 --------------------------------------------------------------

Code generated by ent, DO NOT EDIT. -------------------------------------------------------------- SPDX-FileCopyrightText: Copyright © 2024 The Protobom Authors SPDX-FileType: SOURCE SPDX-License-Identifier: Apache-2.0 --------------------------------------------------------------

Code generated by ent, DO NOT EDIT. -------------------------------------------------------------- SPDX-FileCopyrightText: Copyright © 2024 The Protobom Authors SPDX-FileType: SOURCE SPDX-License-Identifier: Apache-2.0 --------------------------------------------------------------

Code generated by ent, DO NOT EDIT. -------------------------------------------------------------- SPDX-FileCopyrightText: Copyright © 2024 The Protobom Authors SPDX-FileType: SOURCE SPDX-License-Identifier: Apache-2.0 --------------------------------------------------------------

Code generated by ent, DO NOT EDIT. -------------------------------------------------------------- SPDX-FileCopyrightText: Copyright © 2024 The Protobom Authors SPDX-FileType: SOURCE SPDX-License-Identifier: Apache-2.0 --------------------------------------------------------------

Code generated by ent, DO NOT EDIT. -------------------------------------------------------------- SPDX-FileCopyrightText: Copyright © 2024 The Protobom Authors SPDX-FileType: SOURCE SPDX-License-Identifier: Apache-2.0 --------------------------------------------------------------

-------------------------------------------------------------- SPDX-FileCopyrightText: Copyright © 2024 The Protobom Authors SPDX-FileType: SOURCE SPDX-License-Identifier: Apache-2.0 --------------------------------------------------------------

Code generated by ent, DO NOT EDIT. -------------------------------------------------------------- SPDX-FileCopyrightText: Copyright © 2024 The Protobom Authors SPDX-FileType: SOURCE SPDX-License-Identifier: Apache-2.0 --------------------------------------------------------------

Code generated by ent, DO NOT EDIT. -------------------------------------------------------------- SPDX-FileCopyrightText: Copyright © 2024 The Protobom Authors SPDX-FileType: SOURCE SPDX-License-Identifier: Apache-2.0 --------------------------------------------------------------

Code generated by ent, DO NOT EDIT. -------------------------------------------------------------- SPDX-FileCopyrightText: Copyright © 2024 The Protobom Authors SPDX-FileType: SOURCE SPDX-License-Identifier: Apache-2.0 --------------------------------------------------------------

Code generated by ent, DO NOT EDIT. -------------------------------------------------------------- SPDX-FileCopyrightText: Copyright © 2024 The Protobom Authors SPDX-FileType: SOURCE SPDX-License-Identifier: Apache-2.0 --------------------------------------------------------------

Code generated by ent, DO NOT EDIT. -------------------------------------------------------------- SPDX-FileCopyrightText: Copyright © 2024 The Protobom Authors SPDX-FileType: SOURCE SPDX-License-Identifier: Apache-2.0 --------------------------------------------------------------

Code generated by ent, DO NOT EDIT. -------------------------------------------------------------- SPDX-FileCopyrightText: Copyright © 2024 The Protobom Authors SPDX-FileType: SOURCE SPDX-License-Identifier: Apache-2.0 --------------------------------------------------------------

Code generated by ent, DO NOT EDIT. -------------------------------------------------------------- SPDX-FileCopyrightText: Copyright © 2024 The Protobom Authors SPDX-FileType: SOURCE SPDX-License-Identifier: Apache-2.0 --------------------------------------------------------------

Code generated by ent, DO NOT EDIT. -------------------------------------------------------------- SPDX-FileCopyrightText: Copyright © 2024 The Protobom Authors SPDX-FileType: SOURCE SPDX-License-Identifier: Apache-2.0 --------------------------------------------------------------

Code generated by ent, DO NOT EDIT. -------------------------------------------------------------- SPDX-FileCopyrightText: Copyright © 2024 The Protobom Authors SPDX-FileType: SOURCE SPDX-License-Identifier: Apache-2.0 --------------------------------------------------------------

Code generated by ent, DO NOT EDIT. -------------------------------------------------------------- SPDX-FileCopyrightText: Copyright © 2024 The Protobom Authors SPDX-FileType: SOURCE SPDX-License-Identifier: Apache-2.0 --------------------------------------------------------------

Code generated by ent, DO NOT EDIT. -------------------------------------------------------------- SPDX-FileCopyrightText: Copyright © 2024 The Protobom Authors SPDX-FileType: SOURCE SPDX-License-Identifier: Apache-2.0 --------------------------------------------------------------

Code generated by ent, DO NOT EDIT. -------------------------------------------------------------- SPDX-FileCopyrightText: Copyright © 2024 The Protobom Authors SPDX-FileType: SOURCE SPDX-License-Identifier: Apache-2.0 --------------------------------------------------------------

Code generated by ent, DO NOT EDIT. -------------------------------------------------------------- SPDX-FileCopyrightText: Copyright © 2024 The Protobom Authors SPDX-FileType: SOURCE SPDX-License-Identifier: Apache-2.0 --------------------------------------------------------------

Code generated by ent, DO NOT EDIT. -------------------------------------------------------------- SPDX-FileCopyrightText: Copyright © 2024 The Protobom Authors SPDX-FileType: SOURCE SPDX-License-Identifier: Apache-2.0 --------------------------------------------------------------

Code generated by ent, DO NOT EDIT. -------------------------------------------------------------- SPDX-FileCopyrightText: Copyright © 2024 The Protobom Authors SPDX-FileType: SOURCE SPDX-License-Identifier: Apache-2.0 --------------------------------------------------------------

Code generated by ent, DO NOT EDIT. -------------------------------------------------------------- SPDX-FileCopyrightText: Copyright © 2024 The Protobom Authors SPDX-FileType: SOURCE SPDX-License-Identifier: Apache-2.0 --------------------------------------------------------------

Code generated by ent, DO NOT EDIT. -------------------------------------------------------------- SPDX-FileCopyrightText: Copyright © 2024 The Protobom Authors SPDX-FileType: SOURCE SPDX-License-Identifier: Apache-2.0 --------------------------------------------------------------

Code generated by ent, DO NOT EDIT. -------------------------------------------------------------- SPDX-FileCopyrightText: Copyright © 2024 The Protobom Authors SPDX-FileType: SOURCE SPDX-License-Identifier: Apache-2.0 --------------------------------------------------------------

Code generated by ent, DO NOT EDIT. -------------------------------------------------------------- SPDX-FileCopyrightText: Copyright © 2024 The Protobom Authors SPDX-FileType: SOURCE SPDX-License-Identifier: Apache-2.0 --------------------------------------------------------------

Code generated by ent, DO NOT EDIT. -------------------------------------------------------------- SPDX-FileCopyrightText: Copyright © 2024 The Protobom Authors SPDX-FileType: SOURCE SPDX-License-Identifier: Apache-2.0 --------------------------------------------------------------

Code generated by ent, DO NOT EDIT. -------------------------------------------------------------- SPDX-FileCopyrightText: Copyright © 2024 The Protobom Authors SPDX-FileType: SOURCE SPDX-License-Identifier: Apache-2.0 --------------------------------------------------------------

Code generated by ent, DO NOT EDIT. -------------------------------------------------------------- SPDX-FileCopyrightText: Copyright © 2024 The Protobom Authors SPDX-FileType: SOURCE SPDX-License-Identifier: Apache-2.0 --------------------------------------------------------------

Code generated by ent, DO NOT EDIT. -------------------------------------------------------------- SPDX-FileCopyrightText: Copyright © 2024 The Protobom Authors SPDX-FileType: SOURCE SPDX-License-Identifier: Apache-2.0 --------------------------------------------------------------

Code generated by ent, DO NOT EDIT. -------------------------------------------------------------- SPDX-FileCopyrightText: Copyright © 2024 The Protobom Authors SPDX-FileType: SOURCE SPDX-License-Identifier: Apache-2.0 --------------------------------------------------------------

Code generated by ent, DO NOT EDIT. -------------------------------------------------------------- SPDX-FileCopyrightText: Copyright © 2024 The Protobom Authors SPDX-FileType: SOURCE SPDX-License-Identifier: Apache-2.0 --------------------------------------------------------------

Code generated by ent, DO NOT EDIT. -------------------------------------------------------------- SPDX-FileCopyrightText: Copyright © 2024 The Protobom Authors SPDX-FileType: SOURCE SPDX-License-Identifier: Apache-2.0 --------------------------------------------------------------

Code generated by ent, DO NOT EDIT. -------------------------------------------------------------- SPDX-FileCopyrightText: Copyright © 2024 The Protobom Authors SPDX-FileType: SOURCE SPDX-License-Identifier: Apache-2.0 --------------------------------------------------------------

Code generated by ent, DO NOT EDIT. -------------------------------------------------------------- SPDX-FileCopyrightText: Copyright © 2024 The Protobom Authors SPDX-FileType: SOURCE SPDX-License-Identifier: Apache-2.0 --------------------------------------------------------------

Code generated by ent, DO NOT EDIT. -------------------------------------------------------------- SPDX-FileCopyrightText: Copyright © 2024 The Protobom Authors SPDX-FileType: SOURCE SPDX-License-Identifier: Apache-2.0 --------------------------------------------------------------

Code generated by ent, DO NOT EDIT. -------------------------------------------------------------- SPDX-FileCopyrightText: Copyright © 2024 The Protobom Authors SPDX-FileType: SOURCE SPDX-License-Identifier: Apache-2.0 --------------------------------------------------------------

Code generated by ent, DO NOT EDIT. -------------------------------------------------------------- SPDX-FileCopyrightText: Copyright © 2024 The Protobom Authors SPDX-FileType: SOURCE SPDX-License-Identifier: Apache-2.0 --------------------------------------------------------------

Code generated by ent, DO NOT EDIT. -------------------------------------------------------------- SPDX-FileCopyrightText: Copyright © 2024 The Protobom Authors SPDX-FileType: SOURCE SPDX-License-Identifier: Apache-2.0 --------------------------------------------------------------

Code generated by ent, DO NOT EDIT. -------------------------------------------------------------- SPDX-FileCopyrightText: Copyright © 2024 The Protobom Authors SPDX-FileType: SOURCE SPDX-License-Identifier: Apache-2.0 --------------------------------------------------------------

Code generated by ent, DO NOT EDIT. -------------------------------------------------------------- SPDX-FileCopyrightText: Copyright © 2024 The Protobom Authors SPDX-FileType: SOURCE SPDX-License-Identifier: Apache-2.0 --------------------------------------------------------------

Code generated by ent, DO NOT EDIT. -------------------------------------------------------------- SPDX-FileCopyrightText: Copyright © 2024 The Protobom Authors SPDX-FileType: SOURCE SPDX-License-Identifier: Apache-2.0 --------------------------------------------------------------

Code generated by ent, DO NOT EDIT. -------------------------------------------------------------- SPDX-FileCopyrightText: Copyright © 2024 The Protobom Authors SPDX-FileType: SOURCE SPDX-License-Identifier: Apache-2.0 --------------------------------------------------------------

Code generated by ent, DO NOT EDIT. -------------------------------------------------------------- SPDX-FileCopyrightText: Copyright © 2024 The Protobom Authors SPDX-FileType: SOURCE SPDX-License-Identifier: Apache-2.0 --------------------------------------------------------------

Code generated by ent, DO NOT EDIT. -------------------------------------------------------------- SPDX-FileCopyrightText: Copyright © 2024 The Protobom Authors SPDX-FileType: SOURCE SPDX-License-Identifier: Apache-2.0 --------------------------------------------------------------

Code generated by ent, DO NOT EDIT. -------------------------------------------------------------- SPDX-FileCopyrightText: Copyright © 2024 The Protobom Authors SPDX-FileType: SOURCE SPDX-License-Identifier: Apache-2.0 --------------------------------------------------------------

Code generated by ent, DO NOT EDIT. -------------------------------------------------------------- SPDX-FileCopyrightText: Copyright © 2024 The Protobom Authors SPDX-FileType: SOURCE SPDX-License-Identifier: Apache-2.0 --------------------------------------------------------------

Code generated by ent, DO NOT EDIT. -------------------------------------------------------------- SPDX-FileCopyrightText: Copyright © 2024 The Protobom Authors SPDX-FileType: SOURCE SPDX-License-Identifier: Apache-2.0 --------------------------------------------------------------

Code generated by ent, DO NOT EDIT. -------------------------------------------------------------- SPDX-FileCopyrightText: Copyright © 2024 The Protobom Authors SPDX-FileType: SOURCE SPDX-License-Identifier: Apache-2.0 --------------------------------------------------------------

Code generated by ent, DO NOT EDIT. -------------------------------------------------------------- SPDX-FileCopyrightText: Copyright © 2024 The Protobom Authors SPDX-FileType: SOURCE SPDX-License-Identifier: Apache-2.0 --------------------------------------------------------------

Index

Constants

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

	// Node types.
	TypeDocument          = "Document"
	TypeDocumentType      = "DocumentType"
	TypeEdgeType          = "EdgeType"
	TypeExternalReference = "ExternalReference"
	TypeHashesEntry       = "HashesEntry"
	TypeIdentifiersEntry  = "IdentifiersEntry"
	TypeMetadata          = "Metadata"
	TypeNode              = "Node"
	TypeNodeList          = "NodeList"
	TypePerson            = "Person"
	TypePurpose           = "Purpose"
	TypeTool              = "Tool"
)

Variables

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

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

Functions

func Asc

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

Asc applies the given fields in ASC order.

func Desc

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

Desc applies the given fields in DESC order.

func IsConstraintError

func IsConstraintError(err error) bool

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

func IsNotFound

func IsNotFound(err error) bool

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

func IsNotLoaded

func IsNotLoaded(err error) bool

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

func IsNotSingular

func IsNotSingular(err error) bool

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

func IsValidationError

func IsValidationError(err error) bool

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

func MaskNotFound

func MaskNotFound(err error) error

MaskNotFound masks not found error.

func NewContext

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

NewContext returns a new context with the given Client attached.

func NewTxContext

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

NewTxContext returns a new context with the given Tx attached.

Types

type AggregateFunc

type AggregateFunc func(*sql.Selector) string

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

func As

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

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

func Count

func Count() AggregateFunc

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

func Max

func Max(field string) AggregateFunc

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

func Mean

func Mean(field string) AggregateFunc

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

func Min

func Min(field string) AggregateFunc

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

func Sum

func Sum(field string) AggregateFunc

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

type Client

type Client struct {

	// Schema is the client for creating, migrating and dropping schema.
	Schema *migrate.Schema
	// Document is the client for interacting with the Document builders.
	Document *DocumentClient
	// DocumentType is the client for interacting with the DocumentType builders.
	DocumentType *DocumentTypeClient
	// EdgeType is the client for interacting with the EdgeType builders.
	EdgeType *EdgeTypeClient
	// ExternalReference is the client for interacting with the ExternalReference builders.
	ExternalReference *ExternalReferenceClient
	// HashesEntry is the client for interacting with the HashesEntry builders.
	HashesEntry *HashesEntryClient
	// IdentifiersEntry is the client for interacting with the IdentifiersEntry builders.
	IdentifiersEntry *IdentifiersEntryClient
	// Metadata is the client for interacting with the Metadata builders.
	Metadata *MetadataClient
	// Node is the client for interacting with the Node builders.
	Node *NodeClient
	// NodeList is the client for interacting with the NodeList builders.
	NodeList *NodeListClient
	// Person is the client for interacting with the Person builders.
	Person *PersonClient
	// Purpose is the client for interacting with the Purpose builders.
	Purpose *PurposeClient
	// Tool is the client for interacting with the Tool builders.
	Tool *ToolClient
	// 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().
	Document.
	Query().
	Count(ctx)

func (*Client) Intercept

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

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

func (*Client) Mutate

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

Mutate implements the ent.Mutator interface.

func (*Client) Tx

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

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

func (*Client) Use

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

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

type CommitFunc

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

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

func (CommitFunc) Commit

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

Commit calls f(ctx, m).

type CommitHook

type CommitHook func(Committer) Committer

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

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

type Committer

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

Committer is the interface that wraps the Commit method.

type ConstraintError

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

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

func (ConstraintError) Error

func (e ConstraintError) Error() string

Error implements the error interface.

func (*ConstraintError) Unwrap

func (e *ConstraintError) Unwrap() error

Unwrap implements the errors.Wrapper interface.

type Document

type Document struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the DocumentQuery when eager-loading is set.
	Edges DocumentEdges `json:"edges"`
	// contains filtered or unexported fields
}

Document is the model entity for the Document schema.

func (*Document) QueryMetadata

func (d *Document) QueryMetadata() *MetadataQuery

QueryMetadata queries the "metadata" edge of the Document entity.

func (*Document) QueryNodeList

func (d *Document) QueryNodeList() *NodeListQuery

QueryNodeList queries the "node_list" edge of the Document entity.

func (*Document) String

func (d *Document) String() string

String implements the fmt.Stringer.

func (*Document) Unwrap

func (d *Document) Unwrap() *Document

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

func (d *Document) Update() *DocumentUpdateOne

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

func (*Document) Value

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

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

type DocumentClient

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

DocumentClient is a client for the Document schema.

func NewDocumentClient

func NewDocumentClient(c config) *DocumentClient

NewDocumentClient returns a client for the Document from the given config.

func (*DocumentClient) Create

func (c *DocumentClient) Create() *DocumentCreate

Create returns a builder for creating a Document entity.

func (*DocumentClient) CreateBulk

func (c *DocumentClient) CreateBulk(builders ...*DocumentCreate) *DocumentCreateBulk

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

func (*DocumentClient) Delete

func (c *DocumentClient) Delete() *DocumentDelete

Delete returns a delete builder for Document.

func (*DocumentClient) DeleteOne

func (c *DocumentClient) DeleteOne(d *Document) *DocumentDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*DocumentClient) DeleteOneID

func (c *DocumentClient) DeleteOneID(id int) *DocumentDeleteOne

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

func (*DocumentClient) Get

func (c *DocumentClient) Get(ctx context.Context, id int) (*Document, error)

Get returns a Document entity by its id.

func (*DocumentClient) GetX

func (c *DocumentClient) GetX(ctx context.Context, id int) *Document

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

func (*DocumentClient) Hooks

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

Hooks returns the client hooks.

func (*DocumentClient) Intercept

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

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

func (*DocumentClient) Interceptors

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

Interceptors returns the client interceptors.

func (*DocumentClient) MapCreateBulk

func (c *DocumentClient) MapCreateBulk(slice any, setFunc func(*DocumentCreate, int)) *DocumentCreateBulk

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

func (c *DocumentClient) Query() *DocumentQuery

Query returns a query builder for Document.

func (*DocumentClient) QueryMetadata

func (c *DocumentClient) QueryMetadata(d *Document) *MetadataQuery

QueryMetadata queries the metadata edge of a Document.

func (*DocumentClient) QueryNodeList

func (c *DocumentClient) QueryNodeList(d *Document) *NodeListQuery

QueryNodeList queries the node_list edge of a Document.

func (*DocumentClient) Update

func (c *DocumentClient) Update() *DocumentUpdate

Update returns an update builder for Document.

func (*DocumentClient) UpdateOne

func (c *DocumentClient) UpdateOne(d *Document) *DocumentUpdateOne

UpdateOne returns an update builder for the given entity.

func (*DocumentClient) UpdateOneID

func (c *DocumentClient) UpdateOneID(id int) *DocumentUpdateOne

UpdateOneID returns an update builder for the given id.

func (*DocumentClient) Use

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

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

type DocumentCreate

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

DocumentCreate is the builder for creating a Document entity.

func (*DocumentCreate) Exec

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

Exec executes the query.

func (*DocumentCreate) ExecX

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

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

func (*DocumentCreate) Mutation

func (dc *DocumentCreate) Mutation() *DocumentMutation

Mutation returns the DocumentMutation object of the builder.

func (*DocumentCreate) OnConflict

func (dc *DocumentCreate) OnConflict(opts ...sql.ConflictOption) *DocumentUpsertOne

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

client.Document.Create().
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	Exec(ctx)

func (*DocumentCreate) OnConflictColumns

func (dc *DocumentCreate) OnConflictColumns(columns ...string) *DocumentUpsertOne

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

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

func (*DocumentCreate) Save

func (dc *DocumentCreate) Save(ctx context.Context) (*Document, error)

Save creates the Document in the database.

func (*DocumentCreate) SaveX

func (dc *DocumentCreate) SaveX(ctx context.Context) *Document

SaveX calls Save and panics if Save returns an error.

func (*DocumentCreate) SetMetadata

func (dc *DocumentCreate) SetMetadata(m *Metadata) *DocumentCreate

SetMetadata sets the "metadata" edge to the Metadata entity.

func (*DocumentCreate) SetMetadataID

func (dc *DocumentCreate) SetMetadataID(id string) *DocumentCreate

SetMetadataID sets the "metadata" edge to the Metadata entity by ID.

func (*DocumentCreate) SetNodeList

func (dc *DocumentCreate) SetNodeList(n *NodeList) *DocumentCreate

SetNodeList sets the "node_list" edge to the NodeList entity.

func (*DocumentCreate) SetNodeListID

func (dc *DocumentCreate) SetNodeListID(id int) *DocumentCreate

SetNodeListID sets the "node_list" edge to the NodeList entity by ID.

type DocumentCreateBulk

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

DocumentCreateBulk is the builder for creating many Document entities in bulk.

func (*DocumentCreateBulk) Exec

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

Exec executes the query.

func (*DocumentCreateBulk) ExecX

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

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

func (*DocumentCreateBulk) OnConflict

func (dcb *DocumentCreateBulk) OnConflict(opts ...sql.ConflictOption) *DocumentUpsertBulk

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

client.Document.CreateBulk(builders...).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	Exec(ctx)

func (*DocumentCreateBulk) OnConflictColumns

func (dcb *DocumentCreateBulk) OnConflictColumns(columns ...string) *DocumentUpsertBulk

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

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

func (*DocumentCreateBulk) Save

func (dcb *DocumentCreateBulk) Save(ctx context.Context) ([]*Document, error)

Save creates the Document entities in the database.

func (*DocumentCreateBulk) SaveX

func (dcb *DocumentCreateBulk) SaveX(ctx context.Context) []*Document

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

type DocumentDelete

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

DocumentDelete is the builder for deleting a Document entity.

func (*DocumentDelete) Exec

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

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

func (*DocumentDelete) ExecX

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

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

func (*DocumentDelete) Where

func (dd *DocumentDelete) Where(ps ...predicate.Document) *DocumentDelete

Where appends a list predicates to the DocumentDelete builder.

type DocumentDeleteOne

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

DocumentDeleteOne is the builder for deleting a single Document entity.

func (*DocumentDeleteOne) Exec

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

Exec executes the deletion query.

func (*DocumentDeleteOne) ExecX

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

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

func (*DocumentDeleteOne) Where

Where appends a list predicates to the DocumentDelete builder.

type DocumentEdges

type DocumentEdges struct {
	// Metadata holds the value of the metadata edge.
	Metadata *Metadata `json:"metadata,omitempty"`
	// NodeList holds the value of the node_list edge.
	NodeList *NodeList `json:"node_list,omitempty"`
	// contains filtered or unexported fields
}

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

func (DocumentEdges) MetadataOrErr

func (e DocumentEdges) MetadataOrErr() (*Metadata, error)

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

func (DocumentEdges) NodeListOrErr

func (e DocumentEdges) NodeListOrErr() (*NodeList, error)

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

type DocumentGroupBy

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

DocumentGroupBy is the group-by builder for Document entities.

func (*DocumentGroupBy) Aggregate

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

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

func (*DocumentGroupBy) Bool

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

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

func (*DocumentGroupBy) BoolX

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

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

func (*DocumentGroupBy) Bools

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

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

func (*DocumentGroupBy) BoolsX

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

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

func (*DocumentGroupBy) Float64

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

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

func (*DocumentGroupBy) Float64X

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

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

func (*DocumentGroupBy) Float64s

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

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

func (*DocumentGroupBy) Float64sX

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

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

func (*DocumentGroupBy) Int

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

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

func (*DocumentGroupBy) IntX

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

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

func (*DocumentGroupBy) Ints

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

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

func (*DocumentGroupBy) IntsX

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

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

func (*DocumentGroupBy) Scan

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

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

func (*DocumentGroupBy) ScanX

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

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

func (*DocumentGroupBy) String

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

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

func (*DocumentGroupBy) StringX

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

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

func (*DocumentGroupBy) Strings

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

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

func (*DocumentGroupBy) StringsX

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

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

type DocumentMutation

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

DocumentMutation represents an operation that mutates the Document nodes in the graph.

func (*DocumentMutation) AddField

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

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

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

func (*DocumentMutation) AddedField

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

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

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

func (*DocumentMutation) AddedIDs

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

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

func (*DocumentMutation) ClearEdge

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

func (m *DocumentMutation) 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 (*DocumentMutation) ClearMetadata

func (m *DocumentMutation) ClearMetadata()

ClearMetadata clears the "metadata" edge to the Metadata entity.

func (*DocumentMutation) ClearNodeList

func (m *DocumentMutation) ClearNodeList()

ClearNodeList clears the "node_list" edge to the NodeList entity.

func (*DocumentMutation) ClearedEdges

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

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

func (*DocumentMutation) ClearedFields

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

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

func (DocumentMutation) Client

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

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

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

func (*DocumentMutation) Field

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

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

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

func (*DocumentMutation) Fields

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

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

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

func (*DocumentMutation) IDs

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

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

func (*DocumentMutation) MetadataCleared

func (m *DocumentMutation) MetadataCleared() bool

MetadataCleared reports if the "metadata" edge to the Metadata entity was cleared.

func (*DocumentMutation) MetadataID

func (m *DocumentMutation) MetadataID() (id string, exists bool)

MetadataID returns the "metadata" edge ID in the mutation.

func (*DocumentMutation) MetadataIDs

func (m *DocumentMutation) MetadataIDs() (ids []string)

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

func (*DocumentMutation) NodeListCleared

func (m *DocumentMutation) NodeListCleared() bool

NodeListCleared reports if the "node_list" edge to the NodeList entity was cleared.

func (*DocumentMutation) NodeListID

func (m *DocumentMutation) NodeListID() (id int, exists bool)

NodeListID returns the "node_list" edge ID in the mutation.

func (*DocumentMutation) NodeListIDs

func (m *DocumentMutation) NodeListIDs() (ids []int)

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

func (*DocumentMutation) OldField

func (m *DocumentMutation) 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 (*DocumentMutation) Op

func (m *DocumentMutation) Op() Op

Op returns the operation name.

func (*DocumentMutation) RemovedEdges

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

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

func (*DocumentMutation) RemovedIDs

func (m *DocumentMutation) 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 (*DocumentMutation) ResetEdge

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

func (m *DocumentMutation) 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 (*DocumentMutation) ResetMetadata

func (m *DocumentMutation) ResetMetadata()

ResetMetadata resets all changes to the "metadata" edge.

func (*DocumentMutation) ResetNodeList

func (m *DocumentMutation) ResetNodeList()

ResetNodeList resets all changes to the "node_list" edge.

func (*DocumentMutation) SetField

func (m *DocumentMutation) 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 (*DocumentMutation) SetMetadataID

func (m *DocumentMutation) SetMetadataID(id string)

SetMetadataID sets the "metadata" edge to the Metadata entity by id.

func (*DocumentMutation) SetNodeListID

func (m *DocumentMutation) SetNodeListID(id int)

SetNodeListID sets the "node_list" edge to the NodeList entity by id.

func (*DocumentMutation) SetOp

func (m *DocumentMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (DocumentMutation) Tx

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

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

func (*DocumentMutation) Type

func (m *DocumentMutation) Type() string

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

func (*DocumentMutation) Where

func (m *DocumentMutation) Where(ps ...predicate.Document)

Where appends a list predicates to the DocumentMutation builder.

func (*DocumentMutation) WhereP

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

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

type DocumentQuery

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

DocumentQuery is the builder for querying Document entities.

func (*DocumentQuery) Aggregate

func (dq *DocumentQuery) Aggregate(fns ...AggregateFunc) *DocumentSelect

Aggregate returns a DocumentSelect configured with the given aggregations.

func (*DocumentQuery) All

func (dq *DocumentQuery) All(ctx context.Context) ([]*Document, error)

All executes the query and returns a list of Documents.

func (*DocumentQuery) AllX

func (dq *DocumentQuery) AllX(ctx context.Context) []*Document

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

func (*DocumentQuery) Clone

func (dq *DocumentQuery) Clone() *DocumentQuery

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

func (*DocumentQuery) Count

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

Count returns the count of the given query.

func (*DocumentQuery) CountX

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

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

func (*DocumentQuery) Exist

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

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

func (*DocumentQuery) ExistX

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

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

func (*DocumentQuery) First

func (dq *DocumentQuery) First(ctx context.Context) (*Document, error)

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

func (*DocumentQuery) FirstID

func (dq *DocumentQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*DocumentQuery) FirstIDX

func (dq *DocumentQuery) FirstIDX(ctx context.Context) int

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

func (*DocumentQuery) FirstX

func (dq *DocumentQuery) FirstX(ctx context.Context) *Document

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

func (*DocumentQuery) GroupBy

func (dq *DocumentQuery) GroupBy(field string, fields ...string) *DocumentGroupBy

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.

func (*DocumentQuery) IDs

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

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

func (*DocumentQuery) IDsX

func (dq *DocumentQuery) IDsX(ctx context.Context) []int

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

func (*DocumentQuery) Limit

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

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

func (*DocumentQuery) Offset

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

Offset to start from.

func (*DocumentQuery) Only

func (dq *DocumentQuery) Only(ctx context.Context) (*Document, error)

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

func (*DocumentQuery) OnlyID

func (dq *DocumentQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*DocumentQuery) OnlyIDX

func (dq *DocumentQuery) OnlyIDX(ctx context.Context) int

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

func (*DocumentQuery) OnlyX

func (dq *DocumentQuery) OnlyX(ctx context.Context) *Document

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

func (*DocumentQuery) Order

Order specifies how the records should be ordered.

func (*DocumentQuery) QueryMetadata

func (dq *DocumentQuery) QueryMetadata() *MetadataQuery

QueryMetadata chains the current query on the "metadata" edge.

func (*DocumentQuery) QueryNodeList

func (dq *DocumentQuery) QueryNodeList() *NodeListQuery

QueryNodeList chains the current query on the "node_list" edge.

func (*DocumentQuery) Select

func (dq *DocumentQuery) Select(fields ...string) *DocumentSelect

Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.

func (*DocumentQuery) Unique

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

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

func (dq *DocumentQuery) Where(ps ...predicate.Document) *DocumentQuery

Where adds a new predicate for the DocumentQuery builder.

func (*DocumentQuery) WithMetadata

func (dq *DocumentQuery) WithMetadata(opts ...func(*MetadataQuery)) *DocumentQuery

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

func (*DocumentQuery) WithNodeList

func (dq *DocumentQuery) WithNodeList(opts ...func(*NodeListQuery)) *DocumentQuery

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

type DocumentSelect

type DocumentSelect struct {
	*DocumentQuery
	// contains filtered or unexported fields
}

DocumentSelect is the builder for selecting fields of Document entities.

func (*DocumentSelect) Aggregate

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

Aggregate adds the given aggregation functions to the selector query.

func (*DocumentSelect) Bool

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

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

func (*DocumentSelect) BoolX

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

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

func (*DocumentSelect) Bools

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

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

func (*DocumentSelect) BoolsX

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

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

func (*DocumentSelect) Float64

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

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

func (*DocumentSelect) Float64X

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

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

func (*DocumentSelect) Float64s

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

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

func (*DocumentSelect) Float64sX

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

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

func (*DocumentSelect) Int

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

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

func (*DocumentSelect) IntX

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

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

func (*DocumentSelect) Ints

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

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

func (*DocumentSelect) IntsX

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

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

func (*DocumentSelect) Scan

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

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

func (*DocumentSelect) ScanX

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

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

func (*DocumentSelect) String

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

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

func (*DocumentSelect) StringX

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

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

func (*DocumentSelect) Strings

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

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

func (*DocumentSelect) StringsX

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

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

type DocumentType

type DocumentType struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// Type holds the value of the "type" field.
	Type *documenttype.Type `json:"type,omitempty"`
	// Name holds the value of the "name" field.
	Name *string `json:"name,omitempty"`
	// Description holds the value of the "description" field.
	Description *string `json:"description,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the DocumentTypeQuery when eager-loading is set.
	Edges DocumentTypeEdges `json:"edges"`
	// contains filtered or unexported fields
}

DocumentType is the model entity for the DocumentType schema.

func (*DocumentType) QueryMetadata

func (dt *DocumentType) QueryMetadata() *MetadataQuery

QueryMetadata queries the "metadata" edge of the DocumentType entity.

func (*DocumentType) String

func (dt *DocumentType) String() string

String implements the fmt.Stringer.

func (*DocumentType) Unwrap

func (dt *DocumentType) Unwrap() *DocumentType

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

func (dt *DocumentType) Update() *DocumentTypeUpdateOne

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

func (*DocumentType) Value

func (dt *DocumentType) Value(name string) (ent.Value, error)

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

type DocumentTypeClient

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

DocumentTypeClient is a client for the DocumentType schema.

func NewDocumentTypeClient

func NewDocumentTypeClient(c config) *DocumentTypeClient

NewDocumentTypeClient returns a client for the DocumentType from the given config.

func (*DocumentTypeClient) Create

Create returns a builder for creating a DocumentType entity.

func (*DocumentTypeClient) CreateBulk

func (c *DocumentTypeClient) CreateBulk(builders ...*DocumentTypeCreate) *DocumentTypeCreateBulk

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

func (*DocumentTypeClient) Delete

Delete returns a delete builder for DocumentType.

func (*DocumentTypeClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*DocumentTypeClient) DeleteOneID

func (c *DocumentTypeClient) DeleteOneID(id int) *DocumentTypeDeleteOne

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

func (*DocumentTypeClient) Get

Get returns a DocumentType entity by its id.

func (*DocumentTypeClient) GetX

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

func (*DocumentTypeClient) Hooks

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

Hooks returns the client hooks.

func (*DocumentTypeClient) Intercept

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

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

func (*DocumentTypeClient) Interceptors

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

Interceptors returns the client interceptors.

func (*DocumentTypeClient) MapCreateBulk

func (c *DocumentTypeClient) MapCreateBulk(slice any, setFunc func(*DocumentTypeCreate, int)) *DocumentTypeCreateBulk

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

Query returns a query builder for DocumentType.

func (*DocumentTypeClient) QueryMetadata

func (c *DocumentTypeClient) QueryMetadata(dt *DocumentType) *MetadataQuery

QueryMetadata queries the metadata edge of a DocumentType.

func (*DocumentTypeClient) Update

Update returns an update builder for DocumentType.

func (*DocumentTypeClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*DocumentTypeClient) UpdateOneID

func (c *DocumentTypeClient) UpdateOneID(id int) *DocumentTypeUpdateOne

UpdateOneID returns an update builder for the given id.

func (*DocumentTypeClient) Use

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

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

type DocumentTypeCreate

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

DocumentTypeCreate is the builder for creating a DocumentType entity.

func (*DocumentTypeCreate) Exec

func (dtc *DocumentTypeCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*DocumentTypeCreate) ExecX

func (dtc *DocumentTypeCreate) ExecX(ctx context.Context)

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

func (*DocumentTypeCreate) Mutation

func (dtc *DocumentTypeCreate) Mutation() *DocumentTypeMutation

Mutation returns the DocumentTypeMutation object of the builder.

func (*DocumentTypeCreate) OnConflict

func (dtc *DocumentTypeCreate) OnConflict(opts ...sql.ConflictOption) *DocumentTypeUpsertOne

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

client.DocumentType.Create().
	SetType(v).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.DocumentTypeUpsert) {
		SetType(v+v).
	}).
	Exec(ctx)

func (*DocumentTypeCreate) OnConflictColumns

func (dtc *DocumentTypeCreate) OnConflictColumns(columns ...string) *DocumentTypeUpsertOne

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

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

func (*DocumentTypeCreate) Save

Save creates the DocumentType in the database.

func (*DocumentTypeCreate) SaveX

SaveX calls Save and panics if Save returns an error.

func (*DocumentTypeCreate) SetDescription

func (dtc *DocumentTypeCreate) SetDescription(s string) *DocumentTypeCreate

SetDescription sets the "description" field.

func (*DocumentTypeCreate) SetMetadata

func (dtc *DocumentTypeCreate) SetMetadata(m *Metadata) *DocumentTypeCreate

SetMetadata sets the "metadata" edge to the Metadata entity.

func (*DocumentTypeCreate) SetMetadataID

func (dtc *DocumentTypeCreate) SetMetadataID(id string) *DocumentTypeCreate

SetMetadataID sets the "metadata" edge to the Metadata entity by ID.

func (*DocumentTypeCreate) SetName

func (dtc *DocumentTypeCreate) SetName(s string) *DocumentTypeCreate

SetName sets the "name" field.

func (*DocumentTypeCreate) SetNillableDescription

func (dtc *DocumentTypeCreate) SetNillableDescription(s *string) *DocumentTypeCreate

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

func (*DocumentTypeCreate) SetNillableMetadataID

func (dtc *DocumentTypeCreate) SetNillableMetadataID(id *string) *DocumentTypeCreate

SetNillableMetadataID sets the "metadata" edge to the Metadata entity by ID if the given value is not nil.

func (*DocumentTypeCreate) SetNillableName

func (dtc *DocumentTypeCreate) SetNillableName(s *string) *DocumentTypeCreate

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

func (*DocumentTypeCreate) SetNillableType

func (dtc *DocumentTypeCreate) SetNillableType(d *documenttype.Type) *DocumentTypeCreate

SetNillableType sets the "type" field if the given value is not nil.

func (*DocumentTypeCreate) SetType

SetType sets the "type" field.

type DocumentTypeCreateBulk

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

DocumentTypeCreateBulk is the builder for creating many DocumentType entities in bulk.

func (*DocumentTypeCreateBulk) Exec

func (dtcb *DocumentTypeCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*DocumentTypeCreateBulk) ExecX

func (dtcb *DocumentTypeCreateBulk) ExecX(ctx context.Context)

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

func (*DocumentTypeCreateBulk) OnConflict

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

client.DocumentType.CreateBulk(builders...).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.DocumentTypeUpsert) {
		SetType(v+v).
	}).
	Exec(ctx)

func (*DocumentTypeCreateBulk) OnConflictColumns

func (dtcb *DocumentTypeCreateBulk) OnConflictColumns(columns ...string) *DocumentTypeUpsertBulk

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

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

func (*DocumentTypeCreateBulk) Save

Save creates the DocumentType entities in the database.

func (*DocumentTypeCreateBulk) SaveX

func (dtcb *DocumentTypeCreateBulk) SaveX(ctx context.Context) []*DocumentType

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

type DocumentTypeDelete

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

DocumentTypeDelete is the builder for deleting a DocumentType entity.

func (*DocumentTypeDelete) Exec

func (dtd *DocumentTypeDelete) Exec(ctx context.Context) (int, error)

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

func (*DocumentTypeDelete) ExecX

func (dtd *DocumentTypeDelete) ExecX(ctx context.Context) int

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

func (*DocumentTypeDelete) Where

Where appends a list predicates to the DocumentTypeDelete builder.

type DocumentTypeDeleteOne

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

DocumentTypeDeleteOne is the builder for deleting a single DocumentType entity.

func (*DocumentTypeDeleteOne) Exec

func (dtdo *DocumentTypeDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*DocumentTypeDeleteOne) ExecX

func (dtdo *DocumentTypeDeleteOne) ExecX(ctx context.Context)

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

func (*DocumentTypeDeleteOne) Where

Where appends a list predicates to the DocumentTypeDelete builder.

type DocumentTypeEdges

type DocumentTypeEdges struct {
	// Metadata holds the value of the metadata edge.
	Metadata *Metadata `json:"metadata,omitempty"`
	// contains filtered or unexported fields
}

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

func (DocumentTypeEdges) MetadataOrErr

func (e DocumentTypeEdges) MetadataOrErr() (*Metadata, error)

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

type DocumentTypeGroupBy

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

DocumentTypeGroupBy is the group-by builder for DocumentType entities.

func (*DocumentTypeGroupBy) Aggregate

func (dtgb *DocumentTypeGroupBy) Aggregate(fns ...AggregateFunc) *DocumentTypeGroupBy

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

func (*DocumentTypeGroupBy) Bool

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

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

func (*DocumentTypeGroupBy) BoolX

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

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

func (*DocumentTypeGroupBy) Bools

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

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

func (*DocumentTypeGroupBy) BoolsX

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

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

func (*DocumentTypeGroupBy) Float64

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

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

func (*DocumentTypeGroupBy) Float64X

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

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

func (*DocumentTypeGroupBy) Float64s

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

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

func (*DocumentTypeGroupBy) Float64sX

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

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

func (*DocumentTypeGroupBy) Int

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

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

func (*DocumentTypeGroupBy) IntX

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

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

func (*DocumentTypeGroupBy) Ints

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

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

func (*DocumentTypeGroupBy) IntsX

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

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

func (*DocumentTypeGroupBy) Scan

func (dtgb *DocumentTypeGroupBy) Scan(ctx context.Context, v any) error

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

func (*DocumentTypeGroupBy) ScanX

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

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

func (*DocumentTypeGroupBy) String

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

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

func (*DocumentTypeGroupBy) StringX

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

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

func (*DocumentTypeGroupBy) Strings

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

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

func (*DocumentTypeGroupBy) StringsX

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

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

type DocumentTypeMutation

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

DocumentTypeMutation represents an operation that mutates the DocumentType nodes in the graph.

func (*DocumentTypeMutation) AddField

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

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

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

func (*DocumentTypeMutation) AddedField

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

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

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

func (*DocumentTypeMutation) AddedIDs

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

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

func (*DocumentTypeMutation) ClearDescription

func (m *DocumentTypeMutation) ClearDescription()

ClearDescription clears the value of the "description" field.

func (*DocumentTypeMutation) ClearEdge

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

func (m *DocumentTypeMutation) 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 (*DocumentTypeMutation) ClearMetadata

func (m *DocumentTypeMutation) ClearMetadata()

ClearMetadata clears the "metadata" edge to the Metadata entity.

func (*DocumentTypeMutation) ClearName

func (m *DocumentTypeMutation) ClearName()

ClearName clears the value of the "name" field.

func (*DocumentTypeMutation) ClearType

func (m *DocumentTypeMutation) ClearType()

ClearType clears the value of the "type" field.

func (*DocumentTypeMutation) ClearedEdges

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

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

func (*DocumentTypeMutation) ClearedFields

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

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

func (DocumentTypeMutation) Client

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

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

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

func (*DocumentTypeMutation) DescriptionCleared

func (m *DocumentTypeMutation) DescriptionCleared() bool

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

func (*DocumentTypeMutation) EdgeCleared

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

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

func (*DocumentTypeMutation) Field

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

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

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

func (*DocumentTypeMutation) Fields

func (m *DocumentTypeMutation) 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 (*DocumentTypeMutation) GetType

func (m *DocumentTypeMutation) GetType() (r documenttype.Type, exists bool)

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

func (*DocumentTypeMutation) ID

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

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

func (*DocumentTypeMutation) IDs

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

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

func (*DocumentTypeMutation) MetadataCleared

func (m *DocumentTypeMutation) MetadataCleared() bool

MetadataCleared reports if the "metadata" edge to the Metadata entity was cleared.

func (*DocumentTypeMutation) MetadataID

func (m *DocumentTypeMutation) MetadataID() (id string, exists bool)

MetadataID returns the "metadata" edge ID in the mutation.

func (*DocumentTypeMutation) MetadataIDs

func (m *DocumentTypeMutation) MetadataIDs() (ids []string)

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

func (*DocumentTypeMutation) Name

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

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

func (*DocumentTypeMutation) NameCleared

func (m *DocumentTypeMutation) NameCleared() bool

NameCleared returns if the "name" field was cleared in this mutation.

func (*DocumentTypeMutation) OldDescription

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

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

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

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

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

func (m *DocumentTypeMutation) OldType(ctx context.Context) (v *documenttype.Type, err error)

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

func (m *DocumentTypeMutation) Op() Op

Op returns the operation name.

func (*DocumentTypeMutation) RemovedEdges

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

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

func (*DocumentTypeMutation) RemovedIDs

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

func (m *DocumentTypeMutation) ResetDescription()

ResetDescription resets all changes to the "description" field.

func (*DocumentTypeMutation) ResetEdge

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

func (m *DocumentTypeMutation) 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 (*DocumentTypeMutation) ResetMetadata

func (m *DocumentTypeMutation) ResetMetadata()

ResetMetadata resets all changes to the "metadata" edge.

func (*DocumentTypeMutation) ResetName

func (m *DocumentTypeMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*DocumentTypeMutation) ResetType

func (m *DocumentTypeMutation) ResetType()

ResetType resets all changes to the "type" field.

func (*DocumentTypeMutation) SetDescription

func (m *DocumentTypeMutation) SetDescription(s string)

SetDescription sets the "description" field.

func (*DocumentTypeMutation) SetField

func (m *DocumentTypeMutation) 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 (*DocumentTypeMutation) SetMetadataID

func (m *DocumentTypeMutation) SetMetadataID(id string)

SetMetadataID sets the "metadata" edge to the Metadata entity by id.

func (*DocumentTypeMutation) SetName

func (m *DocumentTypeMutation) SetName(s string)

SetName sets the "name" field.

func (*DocumentTypeMutation) SetOp

func (m *DocumentTypeMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*DocumentTypeMutation) SetType

func (m *DocumentTypeMutation) SetType(d documenttype.Type)

SetType sets the "type" field.

func (DocumentTypeMutation) Tx

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

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

func (*DocumentTypeMutation) Type

func (m *DocumentTypeMutation) Type() string

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

func (*DocumentTypeMutation) TypeCleared

func (m *DocumentTypeMutation) TypeCleared() bool

TypeCleared returns if the "type" field was cleared in this mutation.

func (*DocumentTypeMutation) Where

Where appends a list predicates to the DocumentTypeMutation builder.

func (*DocumentTypeMutation) WhereP

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

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

type DocumentTypeQuery

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

DocumentTypeQuery is the builder for querying DocumentType entities.

func (*DocumentTypeQuery) Aggregate

func (dtq *DocumentTypeQuery) Aggregate(fns ...AggregateFunc) *DocumentTypeSelect

Aggregate returns a DocumentTypeSelect configured with the given aggregations.

func (*DocumentTypeQuery) All

func (dtq *DocumentTypeQuery) All(ctx context.Context) ([]*DocumentType, error)

All executes the query and returns a list of DocumentTypes.

func (*DocumentTypeQuery) AllX

func (dtq *DocumentTypeQuery) AllX(ctx context.Context) []*DocumentType

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

func (*DocumentTypeQuery) Clone

func (dtq *DocumentTypeQuery) Clone() *DocumentTypeQuery

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

func (*DocumentTypeQuery) Count

func (dtq *DocumentTypeQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*DocumentTypeQuery) CountX

func (dtq *DocumentTypeQuery) CountX(ctx context.Context) int

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

func (*DocumentTypeQuery) Exist

func (dtq *DocumentTypeQuery) Exist(ctx context.Context) (bool, error)

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

func (*DocumentTypeQuery) ExistX

func (dtq *DocumentTypeQuery) ExistX(ctx context.Context) bool

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

func (*DocumentTypeQuery) First

func (dtq *DocumentTypeQuery) First(ctx context.Context) (*DocumentType, error)

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

func (*DocumentTypeQuery) FirstID

func (dtq *DocumentTypeQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*DocumentTypeQuery) FirstIDX

func (dtq *DocumentTypeQuery) FirstIDX(ctx context.Context) int

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

func (*DocumentTypeQuery) FirstX

func (dtq *DocumentTypeQuery) FirstX(ctx context.Context) *DocumentType

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

func (*DocumentTypeQuery) GroupBy

func (dtq *DocumentTypeQuery) GroupBy(field string, fields ...string) *DocumentTypeGroupBy

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 {
	Type documenttype.Type `json:"type,omitempty"`
	Count int `json:"count,omitempty"`
}

client.DocumentType.Query().
	GroupBy(documenttype.FieldType).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*DocumentTypeQuery) IDs

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

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

func (*DocumentTypeQuery) IDsX

func (dtq *DocumentTypeQuery) IDsX(ctx context.Context) []int

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

func (*DocumentTypeQuery) Limit

func (dtq *DocumentTypeQuery) Limit(limit int) *DocumentTypeQuery

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

func (*DocumentTypeQuery) Offset

func (dtq *DocumentTypeQuery) Offset(offset int) *DocumentTypeQuery

Offset to start from.

func (*DocumentTypeQuery) Only

func (dtq *DocumentTypeQuery) Only(ctx context.Context) (*DocumentType, error)

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

func (*DocumentTypeQuery) OnlyID

func (dtq *DocumentTypeQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*DocumentTypeQuery) OnlyIDX

func (dtq *DocumentTypeQuery) OnlyIDX(ctx context.Context) int

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

func (*DocumentTypeQuery) OnlyX

func (dtq *DocumentTypeQuery) OnlyX(ctx context.Context) *DocumentType

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

func (*DocumentTypeQuery) Order

Order specifies how the records should be ordered.

func (*DocumentTypeQuery) QueryMetadata

func (dtq *DocumentTypeQuery) QueryMetadata() *MetadataQuery

QueryMetadata chains the current query on the "metadata" edge.

func (*DocumentTypeQuery) Select

func (dtq *DocumentTypeQuery) Select(fields ...string) *DocumentTypeSelect

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 {
	Type documenttype.Type `json:"type,omitempty"`
}

client.DocumentType.Query().
	Select(documenttype.FieldType).
	Scan(ctx, &v)

func (*DocumentTypeQuery) Unique

func (dtq *DocumentTypeQuery) Unique(unique bool) *DocumentTypeQuery

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

Where adds a new predicate for the DocumentTypeQuery builder.

func (*DocumentTypeQuery) WithMetadata

func (dtq *DocumentTypeQuery) WithMetadata(opts ...func(*MetadataQuery)) *DocumentTypeQuery

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

type DocumentTypeSelect

type DocumentTypeSelect struct {
	*DocumentTypeQuery
	// contains filtered or unexported fields
}

DocumentTypeSelect is the builder for selecting fields of DocumentType entities.

func (*DocumentTypeSelect) Aggregate

func (dts *DocumentTypeSelect) Aggregate(fns ...AggregateFunc) *DocumentTypeSelect

Aggregate adds the given aggregation functions to the selector query.

func (*DocumentTypeSelect) Bool

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

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

func (*DocumentTypeSelect) BoolX

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

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

func (*DocumentTypeSelect) Bools

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

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

func (*DocumentTypeSelect) BoolsX

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

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

func (*DocumentTypeSelect) Float64

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

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

func (*DocumentTypeSelect) Float64X

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

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

func (*DocumentTypeSelect) Float64s

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

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

func (*DocumentTypeSelect) Float64sX

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

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

func (*DocumentTypeSelect) Int

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

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

func (*DocumentTypeSelect) IntX

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

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

func (*DocumentTypeSelect) Ints

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

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

func (*DocumentTypeSelect) IntsX

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

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

func (*DocumentTypeSelect) Scan

func (dts *DocumentTypeSelect) Scan(ctx context.Context, v any) error

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

func (*DocumentTypeSelect) ScanX

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

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

func (*DocumentTypeSelect) String

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

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

func (*DocumentTypeSelect) StringX

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

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

func (*DocumentTypeSelect) Strings

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

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

func (*DocumentTypeSelect) StringsX

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

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

type DocumentTypeUpdate

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

DocumentTypeUpdate is the builder for updating DocumentType entities.

func (*DocumentTypeUpdate) ClearDescription

func (dtu *DocumentTypeUpdate) ClearDescription() *DocumentTypeUpdate

ClearDescription clears the value of the "description" field.

func (*DocumentTypeUpdate) ClearMetadata

func (dtu *DocumentTypeUpdate) ClearMetadata() *DocumentTypeUpdate

ClearMetadata clears the "metadata" edge to the Metadata entity.

func (*DocumentTypeUpdate) ClearName

func (dtu *DocumentTypeUpdate) ClearName() *DocumentTypeUpdate

ClearName clears the value of the "name" field.

func (*DocumentTypeUpdate) ClearType

func (dtu *DocumentTypeUpdate) ClearType() *DocumentTypeUpdate

ClearType clears the value of the "type" field.

func (*DocumentTypeUpdate) Exec

func (dtu *DocumentTypeUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*DocumentTypeUpdate) ExecX

func (dtu *DocumentTypeUpdate) ExecX(ctx context.Context)

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

func (*DocumentTypeUpdate) Mutation

func (dtu *DocumentTypeUpdate) Mutation() *DocumentTypeMutation

Mutation returns the DocumentTypeMutation object of the builder.

func (*DocumentTypeUpdate) Save

func (dtu *DocumentTypeUpdate) Save(ctx context.Context) (int, error)

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

func (*DocumentTypeUpdate) SaveX

func (dtu *DocumentTypeUpdate) SaveX(ctx context.Context) int

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

func (*DocumentTypeUpdate) SetDescription

func (dtu *DocumentTypeUpdate) SetDescription(s string) *DocumentTypeUpdate

SetDescription sets the "description" field.

func (*DocumentTypeUpdate) SetMetadata

func (dtu *DocumentTypeUpdate) SetMetadata(m *Metadata) *DocumentTypeUpdate

SetMetadata sets the "metadata" edge to the Metadata entity.

func (*DocumentTypeUpdate) SetMetadataID

func (dtu *DocumentTypeUpdate) SetMetadataID(id string) *DocumentTypeUpdate

SetMetadataID sets the "metadata" edge to the Metadata entity by ID.

func (*DocumentTypeUpdate) SetName

func (dtu *DocumentTypeUpdate) SetName(s string) *DocumentTypeUpdate

SetName sets the "name" field.

func (*DocumentTypeUpdate) SetNillableDescription

func (dtu *DocumentTypeUpdate) SetNillableDescription(s *string) *DocumentTypeUpdate

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

func (*DocumentTypeUpdate) SetNillableMetadataID

func (dtu *DocumentTypeUpdate) SetNillableMetadataID(id *string) *DocumentTypeUpdate

SetNillableMetadataID sets the "metadata" edge to the Metadata entity by ID if the given value is not nil.

func (*DocumentTypeUpdate) SetNillableName

func (dtu *DocumentTypeUpdate) SetNillableName(s *string) *DocumentTypeUpdate

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

func (*DocumentTypeUpdate) SetNillableType

func (dtu *DocumentTypeUpdate) SetNillableType(d *documenttype.Type) *DocumentTypeUpdate

SetNillableType sets the "type" field if the given value is not nil.

func (*DocumentTypeUpdate) SetType

SetType sets the "type" field.

func (*DocumentTypeUpdate) Where

Where appends a list predicates to the DocumentTypeUpdate builder.

type DocumentTypeUpdateOne

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

DocumentTypeUpdateOne is the builder for updating a single DocumentType entity.

func (*DocumentTypeUpdateOne) ClearDescription

func (dtuo *DocumentTypeUpdateOne) ClearDescription() *DocumentTypeUpdateOne

ClearDescription clears the value of the "description" field.

func (*DocumentTypeUpdateOne) ClearMetadata

func (dtuo *DocumentTypeUpdateOne) ClearMetadata() *DocumentTypeUpdateOne

ClearMetadata clears the "metadata" edge to the Metadata entity.

func (*DocumentTypeUpdateOne) ClearName

func (dtuo *DocumentTypeUpdateOne) ClearName() *DocumentTypeUpdateOne

ClearName clears the value of the "name" field.

func (*DocumentTypeUpdateOne) ClearType

func (dtuo *DocumentTypeUpdateOne) ClearType() *DocumentTypeUpdateOne

ClearType clears the value of the "type" field.

func (*DocumentTypeUpdateOne) Exec

func (dtuo *DocumentTypeUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*DocumentTypeUpdateOne) ExecX

func (dtuo *DocumentTypeUpdateOne) ExecX(ctx context.Context)

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

func (*DocumentTypeUpdateOne) Mutation

func (dtuo *DocumentTypeUpdateOne) Mutation() *DocumentTypeMutation

Mutation returns the DocumentTypeMutation object of the builder.

func (*DocumentTypeUpdateOne) Save

Save executes the query and returns the updated DocumentType entity.

func (*DocumentTypeUpdateOne) SaveX

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

func (*DocumentTypeUpdateOne) Select

func (dtuo *DocumentTypeUpdateOne) Select(field string, fields ...string) *DocumentTypeUpdateOne

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

func (*DocumentTypeUpdateOne) SetDescription

func (dtuo *DocumentTypeUpdateOne) SetDescription(s string) *DocumentTypeUpdateOne

SetDescription sets the "description" field.

func (*DocumentTypeUpdateOne) SetMetadata

func (dtuo *DocumentTypeUpdateOne) SetMetadata(m *Metadata) *DocumentTypeUpdateOne

SetMetadata sets the "metadata" edge to the Metadata entity.

func (*DocumentTypeUpdateOne) SetMetadataID

func (dtuo *DocumentTypeUpdateOne) SetMetadataID(id string) *DocumentTypeUpdateOne

SetMetadataID sets the "metadata" edge to the Metadata entity by ID.

func (*DocumentTypeUpdateOne) SetName

SetName sets the "name" field.

func (*DocumentTypeUpdateOne) SetNillableDescription

func (dtuo *DocumentTypeUpdateOne) SetNillableDescription(s *string) *DocumentTypeUpdateOne

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

func (*DocumentTypeUpdateOne) SetNillableMetadataID

func (dtuo *DocumentTypeUpdateOne) SetNillableMetadataID(id *string) *DocumentTypeUpdateOne

SetNillableMetadataID sets the "metadata" edge to the Metadata entity by ID if the given value is not nil.

func (*DocumentTypeUpdateOne) SetNillableName

func (dtuo *DocumentTypeUpdateOne) SetNillableName(s *string) *DocumentTypeUpdateOne

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

func (*DocumentTypeUpdateOne) SetNillableType

func (dtuo *DocumentTypeUpdateOne) SetNillableType(d *documenttype.Type) *DocumentTypeUpdateOne

SetNillableType sets the "type" field if the given value is not nil.

func (*DocumentTypeUpdateOne) SetType

SetType sets the "type" field.

func (*DocumentTypeUpdateOne) Where

Where appends a list predicates to the DocumentTypeUpdate builder.

type DocumentTypeUpsert

type DocumentTypeUpsert struct {
	*sql.UpdateSet
}

DocumentTypeUpsert is the "OnConflict" setter.

func (*DocumentTypeUpsert) ClearDescription

func (u *DocumentTypeUpsert) ClearDescription() *DocumentTypeUpsert

ClearDescription clears the value of the "description" field.

func (*DocumentTypeUpsert) ClearName

func (u *DocumentTypeUpsert) ClearName() *DocumentTypeUpsert

ClearName clears the value of the "name" field.

func (*DocumentTypeUpsert) ClearType

func (u *DocumentTypeUpsert) ClearType() *DocumentTypeUpsert

ClearType clears the value of the "type" field.

func (*DocumentTypeUpsert) SetDescription

func (u *DocumentTypeUpsert) SetDescription(v string) *DocumentTypeUpsert

SetDescription sets the "description" field.

func (*DocumentTypeUpsert) SetName

SetName sets the "name" field.

func (*DocumentTypeUpsert) SetType

SetType sets the "type" field.

func (*DocumentTypeUpsert) UpdateDescription

func (u *DocumentTypeUpsert) UpdateDescription() *DocumentTypeUpsert

UpdateDescription sets the "description" field to the value that was provided on create.

func (*DocumentTypeUpsert) UpdateName

func (u *DocumentTypeUpsert) UpdateName() *DocumentTypeUpsert

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

func (*DocumentTypeUpsert) UpdateType

func (u *DocumentTypeUpsert) UpdateType() *DocumentTypeUpsert

UpdateType sets the "type" field to the value that was provided on create.

type DocumentTypeUpsertBulk

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

DocumentTypeUpsertBulk is the builder for "upsert"-ing a bulk of DocumentType nodes.

func (*DocumentTypeUpsertBulk) ClearDescription

func (u *DocumentTypeUpsertBulk) ClearDescription() *DocumentTypeUpsertBulk

ClearDescription clears the value of the "description" field.

func (*DocumentTypeUpsertBulk) ClearName

ClearName clears the value of the "name" field.

func (*DocumentTypeUpsertBulk) ClearType

ClearType clears the value of the "type" field.

func (*DocumentTypeUpsertBulk) DoNothing

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

func (*DocumentTypeUpsertBulk) Exec

Exec executes the query.

func (*DocumentTypeUpsertBulk) ExecX

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

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

func (*DocumentTypeUpsertBulk) Ignore

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

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

func (*DocumentTypeUpsertBulk) SetDescription

SetDescription sets the "description" field.

func (*DocumentTypeUpsertBulk) SetName

SetName sets the "name" field.

func (*DocumentTypeUpsertBulk) SetType

SetType sets the "type" field.

func (*DocumentTypeUpsertBulk) Update

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

func (*DocumentTypeUpsertBulk) UpdateDescription

func (u *DocumentTypeUpsertBulk) UpdateDescription() *DocumentTypeUpsertBulk

UpdateDescription sets the "description" field to the value that was provided on create.

func (*DocumentTypeUpsertBulk) UpdateName

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

func (*DocumentTypeUpsertBulk) UpdateNewValues

func (u *DocumentTypeUpsertBulk) UpdateNewValues() *DocumentTypeUpsertBulk

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

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

func (*DocumentTypeUpsertBulk) UpdateType

UpdateType sets the "type" field to the value that was provided on create.

type DocumentTypeUpsertOne

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

DocumentTypeUpsertOne is the builder for "upsert"-ing

one DocumentType node.

func (*DocumentTypeUpsertOne) ClearDescription

func (u *DocumentTypeUpsertOne) ClearDescription() *DocumentTypeUpsertOne

ClearDescription clears the value of the "description" field.

func (*DocumentTypeUpsertOne) ClearName

ClearName clears the value of the "name" field.

func (*DocumentTypeUpsertOne) ClearType

ClearType clears the value of the "type" field.

func (*DocumentTypeUpsertOne) DoNothing

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

func (*DocumentTypeUpsertOne) Exec

Exec executes the query.

func (*DocumentTypeUpsertOne) ExecX

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

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

func (*DocumentTypeUpsertOne) ID

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

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

func (*DocumentTypeUpsertOne) IDX

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

func (*DocumentTypeUpsertOne) Ignore

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

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

func (*DocumentTypeUpsertOne) SetDescription

func (u *DocumentTypeUpsertOne) SetDescription(v string) *DocumentTypeUpsertOne

SetDescription sets the "description" field.

func (*DocumentTypeUpsertOne) SetName

SetName sets the "name" field.

func (*DocumentTypeUpsertOne) SetType

SetType sets the "type" field.

func (*DocumentTypeUpsertOne) Update

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

func (*DocumentTypeUpsertOne) UpdateDescription

func (u *DocumentTypeUpsertOne) UpdateDescription() *DocumentTypeUpsertOne

UpdateDescription sets the "description" field to the value that was provided on create.

func (*DocumentTypeUpsertOne) UpdateName

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

func (*DocumentTypeUpsertOne) UpdateNewValues

func (u *DocumentTypeUpsertOne) UpdateNewValues() *DocumentTypeUpsertOne

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

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

func (*DocumentTypeUpsertOne) UpdateType

UpdateType sets the "type" field to the value that was provided on create.

type DocumentTypes

type DocumentTypes []*DocumentType

DocumentTypes is a parsable slice of DocumentType.

type DocumentUpdate

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

DocumentUpdate is the builder for updating Document entities.

func (*DocumentUpdate) ClearMetadata

func (du *DocumentUpdate) ClearMetadata() *DocumentUpdate

ClearMetadata clears the "metadata" edge to the Metadata entity.

func (*DocumentUpdate) ClearNodeList

func (du *DocumentUpdate) ClearNodeList() *DocumentUpdate

ClearNodeList clears the "node_list" edge to the NodeList entity.

func (*DocumentUpdate) Exec

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

Exec executes the query.

func (*DocumentUpdate) ExecX

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

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

func (*DocumentUpdate) Mutation

func (du *DocumentUpdate) Mutation() *DocumentMutation

Mutation returns the DocumentMutation object of the builder.

func (*DocumentUpdate) Save

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

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

func (*DocumentUpdate) SaveX

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

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

func (*DocumentUpdate) SetMetadata

func (du *DocumentUpdate) SetMetadata(m *Metadata) *DocumentUpdate

SetMetadata sets the "metadata" edge to the Metadata entity.

func (*DocumentUpdate) SetMetadataID

func (du *DocumentUpdate) SetMetadataID(id string) *DocumentUpdate

SetMetadataID sets the "metadata" edge to the Metadata entity by ID.

func (*DocumentUpdate) SetNodeList

func (du *DocumentUpdate) SetNodeList(n *NodeList) *DocumentUpdate

SetNodeList sets the "node_list" edge to the NodeList entity.

func (*DocumentUpdate) SetNodeListID

func (du *DocumentUpdate) SetNodeListID(id int) *DocumentUpdate

SetNodeListID sets the "node_list" edge to the NodeList entity by ID.

func (*DocumentUpdate) Where

func (du *DocumentUpdate) Where(ps ...predicate.Document) *DocumentUpdate

Where appends a list predicates to the DocumentUpdate builder.

type DocumentUpdateOne

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

DocumentUpdateOne is the builder for updating a single Document entity.

func (*DocumentUpdateOne) ClearMetadata

func (duo *DocumentUpdateOne) ClearMetadata() *DocumentUpdateOne

ClearMetadata clears the "metadata" edge to the Metadata entity.

func (*DocumentUpdateOne) ClearNodeList

func (duo *DocumentUpdateOne) ClearNodeList() *DocumentUpdateOne

ClearNodeList clears the "node_list" edge to the NodeList entity.

func (*DocumentUpdateOne) Exec

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

Exec executes the query on the entity.

func (*DocumentUpdateOne) ExecX

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

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

func (*DocumentUpdateOne) Mutation

func (duo *DocumentUpdateOne) Mutation() *DocumentMutation

Mutation returns the DocumentMutation object of the builder.

func (*DocumentUpdateOne) Save

func (duo *DocumentUpdateOne) Save(ctx context.Context) (*Document, error)

Save executes the query and returns the updated Document entity.

func (*DocumentUpdateOne) SaveX

func (duo *DocumentUpdateOne) SaveX(ctx context.Context) *Document

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

func (*DocumentUpdateOne) Select

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

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

func (*DocumentUpdateOne) SetMetadata

func (duo *DocumentUpdateOne) SetMetadata(m *Metadata) *DocumentUpdateOne

SetMetadata sets the "metadata" edge to the Metadata entity.

func (*DocumentUpdateOne) SetMetadataID

func (duo *DocumentUpdateOne) SetMetadataID(id string) *DocumentUpdateOne

SetMetadataID sets the "metadata" edge to the Metadata entity by ID.

func (*DocumentUpdateOne) SetNodeList

func (duo *DocumentUpdateOne) SetNodeList(n *NodeList) *DocumentUpdateOne

SetNodeList sets the "node_list" edge to the NodeList entity.

func (*DocumentUpdateOne) SetNodeListID

func (duo *DocumentUpdateOne) SetNodeListID(id int) *DocumentUpdateOne

SetNodeListID sets the "node_list" edge to the NodeList entity by ID.

func (*DocumentUpdateOne) Where

Where appends a list predicates to the DocumentUpdate builder.

type DocumentUpsert

type DocumentUpsert struct {
	*sql.UpdateSet
}

DocumentUpsert is the "OnConflict" setter.

type DocumentUpsertBulk

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

DocumentUpsertBulk is the builder for "upsert"-ing a bulk of Document nodes.

func (*DocumentUpsertBulk) DoNothing

func (u *DocumentUpsertBulk) DoNothing() *DocumentUpsertBulk

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

func (*DocumentUpsertBulk) Exec

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

Exec executes the query.

func (*DocumentUpsertBulk) ExecX

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

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

func (*DocumentUpsertBulk) Ignore

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

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

func (*DocumentUpsertBulk) Update

func (u *DocumentUpsertBulk) Update(set func(*DocumentUpsert)) *DocumentUpsertBulk

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

func (*DocumentUpsertBulk) UpdateNewValues

func (u *DocumentUpsertBulk) UpdateNewValues() *DocumentUpsertBulk

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

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

type DocumentUpsertOne

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

DocumentUpsertOne is the builder for "upsert"-ing

one Document node.

func (*DocumentUpsertOne) DoNothing

func (u *DocumentUpsertOne) DoNothing() *DocumentUpsertOne

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

func (*DocumentUpsertOne) Exec

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

Exec executes the query.

func (*DocumentUpsertOne) ExecX

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

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

func (*DocumentUpsertOne) ID

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

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

func (*DocumentUpsertOne) IDX

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

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

func (*DocumentUpsertOne) Ignore

func (u *DocumentUpsertOne) Ignore() *DocumentUpsertOne

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

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

func (*DocumentUpsertOne) Update

func (u *DocumentUpsertOne) Update(set func(*DocumentUpsert)) *DocumentUpsertOne

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

func (*DocumentUpsertOne) UpdateNewValues

func (u *DocumentUpsertOne) UpdateNewValues() *DocumentUpsertOne

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

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

type Documents

type Documents []*Document

Documents is a parsable slice of Document.

type EdgeType

type EdgeType struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// Type holds the value of the "type" field.
	Type edgetype.Type `json:"type,omitempty"`
	// NodeID holds the value of the "node_id" field.
	NodeID string `json:"node_id,omitempty"`
	// ToID holds the value of the "to_id" field.
	ToID string `json:"to_id,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the EdgeTypeQuery when eager-loading is set.
	Edges EdgeTypeEdges `json:"edges"`
	// contains filtered or unexported fields
}

EdgeType is the model entity for the EdgeType schema.

func (*EdgeType) QueryFrom

func (et *EdgeType) QueryFrom() *NodeQuery

QueryFrom queries the "from" edge of the EdgeType entity.

func (*EdgeType) QueryTo

func (et *EdgeType) QueryTo() *NodeQuery

QueryTo queries the "to" edge of the EdgeType entity.

func (*EdgeType) String

func (et *EdgeType) String() string

String implements the fmt.Stringer.

func (*EdgeType) Unwrap

func (et *EdgeType) Unwrap() *EdgeType

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

func (et *EdgeType) Update() *EdgeTypeUpdateOne

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

func (*EdgeType) Value

func (et *EdgeType) Value(name string) (ent.Value, error)

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

type EdgeTypeClient

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

EdgeTypeClient is a client for the EdgeType schema.

func NewEdgeTypeClient

func NewEdgeTypeClient(c config) *EdgeTypeClient

NewEdgeTypeClient returns a client for the EdgeType from the given config.

func (*EdgeTypeClient) Create

func (c *EdgeTypeClient) Create() *EdgeTypeCreate

Create returns a builder for creating a EdgeType entity.

func (*EdgeTypeClient) CreateBulk

func (c *EdgeTypeClient) CreateBulk(builders ...*EdgeTypeCreate) *EdgeTypeCreateBulk

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

func (*EdgeTypeClient) Delete

func (c *EdgeTypeClient) Delete() *EdgeTypeDelete

Delete returns a delete builder for EdgeType.

func (*EdgeTypeClient) DeleteOne

func (c *EdgeTypeClient) DeleteOne(et *EdgeType) *EdgeTypeDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*EdgeTypeClient) DeleteOneID

func (c *EdgeTypeClient) DeleteOneID(id int) *EdgeTypeDeleteOne

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

func (*EdgeTypeClient) Get

func (c *EdgeTypeClient) Get(ctx context.Context, id int) (*EdgeType, error)

Get returns a EdgeType entity by its id.

func (*EdgeTypeClient) GetX

func (c *EdgeTypeClient) GetX(ctx context.Context, id int) *EdgeType

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

func (*EdgeTypeClient) Hooks

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

Hooks returns the client hooks.

func (*EdgeTypeClient) Intercept

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

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

func (*EdgeTypeClient) Interceptors

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

Interceptors returns the client interceptors.

func (*EdgeTypeClient) MapCreateBulk

func (c *EdgeTypeClient) MapCreateBulk(slice any, setFunc func(*EdgeTypeCreate, int)) *EdgeTypeCreateBulk

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

func (c *EdgeTypeClient) Query() *EdgeTypeQuery

Query returns a query builder for EdgeType.

func (*EdgeTypeClient) QueryFrom

func (c *EdgeTypeClient) QueryFrom(et *EdgeType) *NodeQuery

QueryFrom queries the from edge of a EdgeType.

func (*EdgeTypeClient) QueryTo

func (c *EdgeTypeClient) QueryTo(et *EdgeType) *NodeQuery

QueryTo queries the to edge of a EdgeType.

func (*EdgeTypeClient) Update

func (c *EdgeTypeClient) Update() *EdgeTypeUpdate

Update returns an update builder for EdgeType.

func (*EdgeTypeClient) UpdateOne

func (c *EdgeTypeClient) UpdateOne(et *EdgeType) *EdgeTypeUpdateOne

UpdateOne returns an update builder for the given entity.

func (*EdgeTypeClient) UpdateOneID

func (c *EdgeTypeClient) UpdateOneID(id int) *EdgeTypeUpdateOne

UpdateOneID returns an update builder for the given id.

func (*EdgeTypeClient) Use

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

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

type EdgeTypeCreate

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

EdgeTypeCreate is the builder for creating a EdgeType entity.

func (*EdgeTypeCreate) Exec

func (etc *EdgeTypeCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*EdgeTypeCreate) ExecX

func (etc *EdgeTypeCreate) ExecX(ctx context.Context)

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

func (*EdgeTypeCreate) Mutation

func (etc *EdgeTypeCreate) Mutation() *EdgeTypeMutation

Mutation returns the EdgeTypeMutation object of the builder.

func (*EdgeTypeCreate) OnConflict

func (etc *EdgeTypeCreate) OnConflict(opts ...sql.ConflictOption) *EdgeTypeUpsertOne

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

client.EdgeType.Create().
	SetType(v).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.EdgeTypeUpsert) {
		SetType(v+v).
	}).
	Exec(ctx)

func (*EdgeTypeCreate) OnConflictColumns

func (etc *EdgeTypeCreate) OnConflictColumns(columns ...string) *EdgeTypeUpsertOne

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

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

func (*EdgeTypeCreate) Save

func (etc *EdgeTypeCreate) Save(ctx context.Context) (*EdgeType, error)

Save creates the EdgeType in the database.

func (*EdgeTypeCreate) SaveX

func (etc *EdgeTypeCreate) SaveX(ctx context.Context) *EdgeType

SaveX calls Save and panics if Save returns an error.

func (*EdgeTypeCreate) SetFrom

func (etc *EdgeTypeCreate) SetFrom(n *Node) *EdgeTypeCreate

SetFrom sets the "from" edge to the Node entity.

func (*EdgeTypeCreate) SetFromID

func (etc *EdgeTypeCreate) SetFromID(id string) *EdgeTypeCreate

SetFromID sets the "from" edge to the Node entity by ID.

func (*EdgeTypeCreate) SetNodeID

func (etc *EdgeTypeCreate) SetNodeID(s string) *EdgeTypeCreate

SetNodeID sets the "node_id" field.

func (*EdgeTypeCreate) SetTo

func (etc *EdgeTypeCreate) SetTo(n *Node) *EdgeTypeCreate

SetTo sets the "to" edge to the Node entity.

func (*EdgeTypeCreate) SetToID

func (etc *EdgeTypeCreate) SetToID(s string) *EdgeTypeCreate

SetToID sets the "to_id" field.

func (*EdgeTypeCreate) SetType

func (etc *EdgeTypeCreate) SetType(e edgetype.Type) *EdgeTypeCreate

SetType sets the "type" field.

type EdgeTypeCreateBulk

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

EdgeTypeCreateBulk is the builder for creating many EdgeType entities in bulk.

func (*EdgeTypeCreateBulk) Exec

func (etcb *EdgeTypeCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*EdgeTypeCreateBulk) ExecX

func (etcb *EdgeTypeCreateBulk) ExecX(ctx context.Context)

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

func (*EdgeTypeCreateBulk) OnConflict

func (etcb *EdgeTypeCreateBulk) OnConflict(opts ...sql.ConflictOption) *EdgeTypeUpsertBulk

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

client.EdgeType.CreateBulk(builders...).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.EdgeTypeUpsert) {
		SetType(v+v).
	}).
	Exec(ctx)

func (*EdgeTypeCreateBulk) OnConflictColumns

func (etcb *EdgeTypeCreateBulk) OnConflictColumns(columns ...string) *EdgeTypeUpsertBulk

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

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

func (*EdgeTypeCreateBulk) Save

func (etcb *EdgeTypeCreateBulk) Save(ctx context.Context) ([]*EdgeType, error)

Save creates the EdgeType entities in the database.

func (*EdgeTypeCreateBulk) SaveX

func (etcb *EdgeTypeCreateBulk) SaveX(ctx context.Context) []*EdgeType

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

type EdgeTypeDelete

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

EdgeTypeDelete is the builder for deleting a EdgeType entity.

func (*EdgeTypeDelete) Exec

func (etd *EdgeTypeDelete) Exec(ctx context.Context) (int, error)

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

func (*EdgeTypeDelete) ExecX

func (etd *EdgeTypeDelete) ExecX(ctx context.Context) int

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

func (*EdgeTypeDelete) Where

func (etd *EdgeTypeDelete) Where(ps ...predicate.EdgeType) *EdgeTypeDelete

Where appends a list predicates to the EdgeTypeDelete builder.

type EdgeTypeDeleteOne

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

EdgeTypeDeleteOne is the builder for deleting a single EdgeType entity.

func (*EdgeTypeDeleteOne) Exec

func (etdo *EdgeTypeDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*EdgeTypeDeleteOne) ExecX

func (etdo *EdgeTypeDeleteOne) ExecX(ctx context.Context)

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

func (*EdgeTypeDeleteOne) Where

Where appends a list predicates to the EdgeTypeDelete builder.

type EdgeTypeEdges

type EdgeTypeEdges struct {
	// From holds the value of the from edge.
	From *Node `json:"from,omitempty"`
	// To holds the value of the to edge.
	To *Node `json:"to,omitempty"`
	// contains filtered or unexported fields
}

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

func (EdgeTypeEdges) FromOrErr

func (e EdgeTypeEdges) FromOrErr() (*Node, error)

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

func (EdgeTypeEdges) ToOrErr

func (e EdgeTypeEdges) ToOrErr() (*Node, error)

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

type EdgeTypeGroupBy

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

EdgeTypeGroupBy is the group-by builder for EdgeType entities.

func (*EdgeTypeGroupBy) Aggregate

func (etgb *EdgeTypeGroupBy) Aggregate(fns ...AggregateFunc) *EdgeTypeGroupBy

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

func (*EdgeTypeGroupBy) Bool

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

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

func (*EdgeTypeGroupBy) BoolX

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

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

func (*EdgeTypeGroupBy) Bools

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

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

func (*EdgeTypeGroupBy) BoolsX

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

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

func (*EdgeTypeGroupBy) Float64

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

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

func (*EdgeTypeGroupBy) Float64X

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

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

func (*EdgeTypeGroupBy) Float64s

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

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

func (*EdgeTypeGroupBy) Float64sX

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

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

func (*EdgeTypeGroupBy) Int

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

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

func (*EdgeTypeGroupBy) IntX

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

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

func (*EdgeTypeGroupBy) Ints

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

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

func (*EdgeTypeGroupBy) IntsX

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

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

func (*EdgeTypeGroupBy) Scan

func (etgb *EdgeTypeGroupBy) Scan(ctx context.Context, v any) error

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

func (*EdgeTypeGroupBy) ScanX

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

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

func (*EdgeTypeGroupBy) String

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

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

func (*EdgeTypeGroupBy) StringX

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

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

func (*EdgeTypeGroupBy) Strings

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

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

func (*EdgeTypeGroupBy) StringsX

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

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

type EdgeTypeMutation

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

EdgeTypeMutation represents an operation that mutates the EdgeType nodes in the graph.

func (*EdgeTypeMutation) AddField

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

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

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

func (*EdgeTypeMutation) AddedField

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

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

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

func (*EdgeTypeMutation) AddedIDs

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

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

func (*EdgeTypeMutation) ClearEdge

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

func (m *EdgeTypeMutation) 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 (*EdgeTypeMutation) ClearFrom

func (m *EdgeTypeMutation) ClearFrom()

ClearFrom clears the "from" edge to the Node entity.

func (*EdgeTypeMutation) ClearTo

func (m *EdgeTypeMutation) ClearTo()

ClearTo clears the "to" edge to the Node entity.

func (*EdgeTypeMutation) ClearedEdges

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

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

func (*EdgeTypeMutation) ClearedFields

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

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

func (EdgeTypeMutation) Client

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

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

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

func (*EdgeTypeMutation) Field

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

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

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

func (*EdgeTypeMutation) Fields

func (m *EdgeTypeMutation) 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 (*EdgeTypeMutation) FromCleared

func (m *EdgeTypeMutation) FromCleared() bool

FromCleared reports if the "from" edge to the Node entity was cleared.

func (*EdgeTypeMutation) FromID

func (m *EdgeTypeMutation) FromID() (id string, exists bool)

FromID returns the "from" edge ID in the mutation.

func (*EdgeTypeMutation) FromIDs

func (m *EdgeTypeMutation) FromIDs() (ids []string)

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

func (*EdgeTypeMutation) GetType

func (m *EdgeTypeMutation) GetType() (r edgetype.Type, exists bool)

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

func (*EdgeTypeMutation) ID

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

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

func (*EdgeTypeMutation) IDs

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

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

func (*EdgeTypeMutation) NodeID

func (m *EdgeTypeMutation) NodeID() (r string, exists bool)

NodeID returns the value of the "node_id" field in the mutation.

func (*EdgeTypeMutation) OldField

func (m *EdgeTypeMutation) 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 (*EdgeTypeMutation) OldNodeID

func (m *EdgeTypeMutation) OldNodeID(ctx context.Context) (v string, err error)

OldNodeID returns the old "node_id" field's value of the EdgeType entity. If the EdgeType 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 (*EdgeTypeMutation) OldToID

func (m *EdgeTypeMutation) OldToID(ctx context.Context) (v string, err error)

OldToID returns the old "to_id" field's value of the EdgeType entity. If the EdgeType 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 (*EdgeTypeMutation) OldType

func (m *EdgeTypeMutation) OldType(ctx context.Context) (v edgetype.Type, err error)

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

func (m *EdgeTypeMutation) Op() Op

Op returns the operation name.

func (*EdgeTypeMutation) RemovedEdges

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

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

func (*EdgeTypeMutation) RemovedIDs

func (m *EdgeTypeMutation) 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 (*EdgeTypeMutation) ResetEdge

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

func (m *EdgeTypeMutation) 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 (*EdgeTypeMutation) ResetFrom

func (m *EdgeTypeMutation) ResetFrom()

ResetFrom resets all changes to the "from" edge.

func (*EdgeTypeMutation) ResetNodeID

func (m *EdgeTypeMutation) ResetNodeID()

ResetNodeID resets all changes to the "node_id" field.

func (*EdgeTypeMutation) ResetTo

func (m *EdgeTypeMutation) ResetTo()

ResetTo resets all changes to the "to" edge.

func (*EdgeTypeMutation) ResetToID

func (m *EdgeTypeMutation) ResetToID()

ResetToID resets all changes to the "to_id" field.

func (*EdgeTypeMutation) ResetType

func (m *EdgeTypeMutation) ResetType()

ResetType resets all changes to the "type" field.

func (*EdgeTypeMutation) SetField

func (m *EdgeTypeMutation) 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 (*EdgeTypeMutation) SetFromID

func (m *EdgeTypeMutation) SetFromID(id string)

SetFromID sets the "from" edge to the Node entity by id.

func (*EdgeTypeMutation) SetNodeID

func (m *EdgeTypeMutation) SetNodeID(s string)

SetNodeID sets the "node_id" field.

func (*EdgeTypeMutation) SetOp

func (m *EdgeTypeMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*EdgeTypeMutation) SetToID

func (m *EdgeTypeMutation) SetToID(s string)

SetToID sets the "to_id" field.

func (*EdgeTypeMutation) SetType

func (m *EdgeTypeMutation) SetType(e edgetype.Type)

SetType sets the "type" field.

func (*EdgeTypeMutation) ToCleared

func (m *EdgeTypeMutation) ToCleared() bool

ToCleared reports if the "to" edge to the Node entity was cleared.

func (*EdgeTypeMutation) ToID

func (m *EdgeTypeMutation) ToID() (r string, exists bool)

ToID returns the value of the "to_id" field in the mutation.

func (*EdgeTypeMutation) ToIDs

func (m *EdgeTypeMutation) ToIDs() (ids []string)

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

func (EdgeTypeMutation) Tx

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

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

func (*EdgeTypeMutation) Type

func (m *EdgeTypeMutation) Type() string

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

func (*EdgeTypeMutation) Where

func (m *EdgeTypeMutation) Where(ps ...predicate.EdgeType)

Where appends a list predicates to the EdgeTypeMutation builder.

func (*EdgeTypeMutation) WhereP

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

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

type EdgeTypeQuery

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

EdgeTypeQuery is the builder for querying EdgeType entities.

func (*EdgeTypeQuery) Aggregate

func (etq *EdgeTypeQuery) Aggregate(fns ...AggregateFunc) *EdgeTypeSelect

Aggregate returns a EdgeTypeSelect configured with the given aggregations.

func (*EdgeTypeQuery) All

func (etq *EdgeTypeQuery) All(ctx context.Context) ([]*EdgeType, error)

All executes the query and returns a list of EdgeTypes.

func (*EdgeTypeQuery) AllX

func (etq *EdgeTypeQuery) AllX(ctx context.Context) []*EdgeType

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

func (*EdgeTypeQuery) Clone

func (etq *EdgeTypeQuery) Clone() *EdgeTypeQuery

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

func (*EdgeTypeQuery) Count

func (etq *EdgeTypeQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*EdgeTypeQuery) CountX

func (etq *EdgeTypeQuery) CountX(ctx context.Context) int

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

func (*EdgeTypeQuery) Exist

func (etq *EdgeTypeQuery) Exist(ctx context.Context) (bool, error)

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

func (*EdgeTypeQuery) ExistX

func (etq *EdgeTypeQuery) ExistX(ctx context.Context) bool

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

func (*EdgeTypeQuery) First

func (etq *EdgeTypeQuery) First(ctx context.Context) (*EdgeType, error)

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

func (*EdgeTypeQuery) FirstID

func (etq *EdgeTypeQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*EdgeTypeQuery) FirstIDX

func (etq *EdgeTypeQuery) FirstIDX(ctx context.Context) int

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

func (*EdgeTypeQuery) FirstX

func (etq *EdgeTypeQuery) FirstX(ctx context.Context) *EdgeType

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

func (*EdgeTypeQuery) GroupBy

func (etq *EdgeTypeQuery) GroupBy(field string, fields ...string) *EdgeTypeGroupBy

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 {
	Type edgetype.Type `json:"type,omitempty"`
	Count int `json:"count,omitempty"`
}

client.EdgeType.Query().
	GroupBy(edgetype.FieldType).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*EdgeTypeQuery) IDs

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

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

func (*EdgeTypeQuery) IDsX

func (etq *EdgeTypeQuery) IDsX(ctx context.Context) []int

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

func (*EdgeTypeQuery) Limit

func (etq *EdgeTypeQuery) Limit(limit int) *EdgeTypeQuery

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

func (*EdgeTypeQuery) Offset

func (etq *EdgeTypeQuery) Offset(offset int) *EdgeTypeQuery

Offset to start from.

func (*EdgeTypeQuery) Only

func (etq *EdgeTypeQuery) Only(ctx context.Context) (*EdgeType, error)

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

func (*EdgeTypeQuery) OnlyID

func (etq *EdgeTypeQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*EdgeTypeQuery) OnlyIDX

func (etq *EdgeTypeQuery) OnlyIDX(ctx context.Context) int

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

func (*EdgeTypeQuery) OnlyX

func (etq *EdgeTypeQuery) OnlyX(ctx context.Context) *EdgeType

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

func (*EdgeTypeQuery) Order

func (etq *EdgeTypeQuery) Order(o ...edgetype.OrderOption) *EdgeTypeQuery

Order specifies how the records should be ordered.

func (*EdgeTypeQuery) QueryFrom

func (etq *EdgeTypeQuery) QueryFrom() *NodeQuery

QueryFrom chains the current query on the "from" edge.

func (*EdgeTypeQuery) QueryTo

func (etq *EdgeTypeQuery) QueryTo() *NodeQuery

QueryTo chains the current query on the "to" edge.

func (*EdgeTypeQuery) Select

func (etq *EdgeTypeQuery) Select(fields ...string) *EdgeTypeSelect

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 {
	Type edgetype.Type `json:"type,omitempty"`
}

client.EdgeType.Query().
	Select(edgetype.FieldType).
	Scan(ctx, &v)

func (*EdgeTypeQuery) Unique

func (etq *EdgeTypeQuery) Unique(unique bool) *EdgeTypeQuery

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

func (etq *EdgeTypeQuery) Where(ps ...predicate.EdgeType) *EdgeTypeQuery

Where adds a new predicate for the EdgeTypeQuery builder.

func (*EdgeTypeQuery) WithFrom

func (etq *EdgeTypeQuery) WithFrom(opts ...func(*NodeQuery)) *EdgeTypeQuery

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

func (*EdgeTypeQuery) WithTo

func (etq *EdgeTypeQuery) WithTo(opts ...func(*NodeQuery)) *EdgeTypeQuery

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

type EdgeTypeSelect

type EdgeTypeSelect struct {
	*EdgeTypeQuery
	// contains filtered or unexported fields
}

EdgeTypeSelect is the builder for selecting fields of EdgeType entities.

func (*EdgeTypeSelect) Aggregate

func (ets *EdgeTypeSelect) Aggregate(fns ...AggregateFunc) *EdgeTypeSelect

Aggregate adds the given aggregation functions to the selector query.

func (*EdgeTypeSelect) Bool

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

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

func (*EdgeTypeSelect) BoolX

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

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

func (*EdgeTypeSelect) Bools

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

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

func (*EdgeTypeSelect) BoolsX

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

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

func (*EdgeTypeSelect) Float64

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

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

func (*EdgeTypeSelect) Float64X

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

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

func (*EdgeTypeSelect) Float64s

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

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

func (*EdgeTypeSelect) Float64sX

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

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

func (*EdgeTypeSelect) Int

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

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

func (*EdgeTypeSelect) IntX

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

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

func (*EdgeTypeSelect) Ints

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

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

func (*EdgeTypeSelect) IntsX

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

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

func (*EdgeTypeSelect) Scan

func (ets *EdgeTypeSelect) Scan(ctx context.Context, v any) error

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

func (*EdgeTypeSelect) ScanX

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

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

func (*EdgeTypeSelect) String

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

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

func (*EdgeTypeSelect) StringX

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

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

func (*EdgeTypeSelect) Strings

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

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

func (*EdgeTypeSelect) StringsX

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

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

type EdgeTypeUpdate

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

EdgeTypeUpdate is the builder for updating EdgeType entities.

func (*EdgeTypeUpdate) ClearFrom

func (etu *EdgeTypeUpdate) ClearFrom() *EdgeTypeUpdate

ClearFrom clears the "from" edge to the Node entity.

func (*EdgeTypeUpdate) ClearTo

func (etu *EdgeTypeUpdate) ClearTo() *EdgeTypeUpdate

ClearTo clears the "to" edge to the Node entity.

func (*EdgeTypeUpdate) Exec

func (etu *EdgeTypeUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*EdgeTypeUpdate) ExecX

func (etu *EdgeTypeUpdate) ExecX(ctx context.Context)

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

func (*EdgeTypeUpdate) Mutation

func (etu *EdgeTypeUpdate) Mutation() *EdgeTypeMutation

Mutation returns the EdgeTypeMutation object of the builder.

func (*EdgeTypeUpdate) Save

func (etu *EdgeTypeUpdate) Save(ctx context.Context) (int, error)

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

func (*EdgeTypeUpdate) SaveX

func (etu *EdgeTypeUpdate) SaveX(ctx context.Context) int

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

func (*EdgeTypeUpdate) SetFrom

func (etu *EdgeTypeUpdate) SetFrom(n *Node) *EdgeTypeUpdate

SetFrom sets the "from" edge to the Node entity.

func (*EdgeTypeUpdate) SetFromID

func (etu *EdgeTypeUpdate) SetFromID(id string) *EdgeTypeUpdate

SetFromID sets the "from" edge to the Node entity by ID.

func (*EdgeTypeUpdate) SetNillableNodeID

func (etu *EdgeTypeUpdate) SetNillableNodeID(s *string) *EdgeTypeUpdate

SetNillableNodeID sets the "node_id" field if the given value is not nil.

func (*EdgeTypeUpdate) SetNillableToID

func (etu *EdgeTypeUpdate) SetNillableToID(s *string) *EdgeTypeUpdate

SetNillableToID sets the "to_id" field if the given value is not nil.

func (*EdgeTypeUpdate) SetNillableType

func (etu *EdgeTypeUpdate) SetNillableType(e *edgetype.Type) *EdgeTypeUpdate

SetNillableType sets the "type" field if the given value is not nil.

func (*EdgeTypeUpdate) SetNodeID

func (etu *EdgeTypeUpdate) SetNodeID(s string) *EdgeTypeUpdate

SetNodeID sets the "node_id" field.

func (*EdgeTypeUpdate) SetTo

func (etu *EdgeTypeUpdate) SetTo(n *Node) *EdgeTypeUpdate

SetTo sets the "to" edge to the Node entity.

func (*EdgeTypeUpdate) SetToID

func (etu *EdgeTypeUpdate) SetToID(s string) *EdgeTypeUpdate

SetToID sets the "to_id" field.

func (*EdgeTypeUpdate) SetType

func (etu *EdgeTypeUpdate) SetType(e edgetype.Type) *EdgeTypeUpdate

SetType sets the "type" field.

func (*EdgeTypeUpdate) Where

func (etu *EdgeTypeUpdate) Where(ps ...predicate.EdgeType) *EdgeTypeUpdate

Where appends a list predicates to the EdgeTypeUpdate builder.

type EdgeTypeUpdateOne

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

EdgeTypeUpdateOne is the builder for updating a single EdgeType entity.

func (*EdgeTypeUpdateOne) ClearFrom

func (etuo *EdgeTypeUpdateOne) ClearFrom() *EdgeTypeUpdateOne

ClearFrom clears the "from" edge to the Node entity.

func (*EdgeTypeUpdateOne) ClearTo

func (etuo *EdgeTypeUpdateOne) ClearTo() *EdgeTypeUpdateOne

ClearTo clears the "to" edge to the Node entity.

func (*EdgeTypeUpdateOne) Exec

func (etuo *EdgeTypeUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*EdgeTypeUpdateOne) ExecX

func (etuo *EdgeTypeUpdateOne) ExecX(ctx context.Context)

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

func (*EdgeTypeUpdateOne) Mutation

func (etuo *EdgeTypeUpdateOne) Mutation() *EdgeTypeMutation

Mutation returns the EdgeTypeMutation object of the builder.

func (*EdgeTypeUpdateOne) Save

func (etuo *EdgeTypeUpdateOne) Save(ctx context.Context) (*EdgeType, error)

Save executes the query and returns the updated EdgeType entity.

func (*EdgeTypeUpdateOne) SaveX

func (etuo *EdgeTypeUpdateOne) SaveX(ctx context.Context) *EdgeType

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

func (*EdgeTypeUpdateOne) Select

func (etuo *EdgeTypeUpdateOne) Select(field string, fields ...string) *EdgeTypeUpdateOne

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

func (*EdgeTypeUpdateOne) SetFrom

func (etuo *EdgeTypeUpdateOne) SetFrom(n *Node) *EdgeTypeUpdateOne

SetFrom sets the "from" edge to the Node entity.

func (*EdgeTypeUpdateOne) SetFromID

func (etuo *EdgeTypeUpdateOne) SetFromID(id string) *EdgeTypeUpdateOne

SetFromID sets the "from" edge to the Node entity by ID.

func (*EdgeTypeUpdateOne) SetNillableNodeID

func (etuo *EdgeTypeUpdateOne) SetNillableNodeID(s *string) *EdgeTypeUpdateOne

SetNillableNodeID sets the "node_id" field if the given value is not nil.

func (*EdgeTypeUpdateOne) SetNillableToID

func (etuo *EdgeTypeUpdateOne) SetNillableToID(s *string) *EdgeTypeUpdateOne

SetNillableToID sets the "to_id" field if the given value is not nil.

func (*EdgeTypeUpdateOne) SetNillableType

func (etuo *EdgeTypeUpdateOne) SetNillableType(e *edgetype.Type) *EdgeTypeUpdateOne

SetNillableType sets the "type" field if the given value is not nil.

func (*EdgeTypeUpdateOne) SetNodeID

func (etuo *EdgeTypeUpdateOne) SetNodeID(s string) *EdgeTypeUpdateOne

SetNodeID sets the "node_id" field.

func (*EdgeTypeUpdateOne) SetTo

func (etuo *EdgeTypeUpdateOne) SetTo(n *Node) *EdgeTypeUpdateOne

SetTo sets the "to" edge to the Node entity.

func (*EdgeTypeUpdateOne) SetToID

func (etuo *EdgeTypeUpdateOne) SetToID(s string) *EdgeTypeUpdateOne

SetToID sets the "to_id" field.

func (*EdgeTypeUpdateOne) SetType

SetType sets the "type" field.

func (*EdgeTypeUpdateOne) Where

Where appends a list predicates to the EdgeTypeUpdate builder.

type EdgeTypeUpsert

type EdgeTypeUpsert struct {
	*sql.UpdateSet
}

EdgeTypeUpsert is the "OnConflict" setter.

func (*EdgeTypeUpsert) SetNodeID

func (u *EdgeTypeUpsert) SetNodeID(v string) *EdgeTypeUpsert

SetNodeID sets the "node_id" field.

func (*EdgeTypeUpsert) SetToID

func (u *EdgeTypeUpsert) SetToID(v string) *EdgeTypeUpsert

SetToID sets the "to_id" field.

func (*EdgeTypeUpsert) SetType

func (u *EdgeTypeUpsert) SetType(v edgetype.Type) *EdgeTypeUpsert

SetType sets the "type" field.

func (*EdgeTypeUpsert) UpdateNodeID

func (u *EdgeTypeUpsert) UpdateNodeID() *EdgeTypeUpsert

UpdateNodeID sets the "node_id" field to the value that was provided on create.

func (*EdgeTypeUpsert) UpdateToID

func (u *EdgeTypeUpsert) UpdateToID() *EdgeTypeUpsert

UpdateToID sets the "to_id" field to the value that was provided on create.

func (*EdgeTypeUpsert) UpdateType

func (u *EdgeTypeUpsert) UpdateType() *EdgeTypeUpsert

UpdateType sets the "type" field to the value that was provided on create.

type EdgeTypeUpsertBulk

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

EdgeTypeUpsertBulk is the builder for "upsert"-ing a bulk of EdgeType nodes.

func (*EdgeTypeUpsertBulk) DoNothing

func (u *EdgeTypeUpsertBulk) DoNothing() *EdgeTypeUpsertBulk

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

func (*EdgeTypeUpsertBulk) Exec

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

Exec executes the query.

func (*EdgeTypeUpsertBulk) ExecX

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

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

func (*EdgeTypeUpsertBulk) Ignore

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

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

func (*EdgeTypeUpsertBulk) SetNodeID

func (u *EdgeTypeUpsertBulk) SetNodeID(v string) *EdgeTypeUpsertBulk

SetNodeID sets the "node_id" field.

func (*EdgeTypeUpsertBulk) SetToID

SetToID sets the "to_id" field.

func (*EdgeTypeUpsertBulk) SetType

SetType sets the "type" field.

func (*EdgeTypeUpsertBulk) Update

func (u *EdgeTypeUpsertBulk) Update(set func(*EdgeTypeUpsert)) *EdgeTypeUpsertBulk

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

func (*EdgeTypeUpsertBulk) UpdateNewValues

func (u *EdgeTypeUpsertBulk) UpdateNewValues() *EdgeTypeUpsertBulk

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

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

func (*EdgeTypeUpsertBulk) UpdateNodeID

func (u *EdgeTypeUpsertBulk) UpdateNodeID() *EdgeTypeUpsertBulk

UpdateNodeID sets the "node_id" field to the value that was provided on create.

func (*EdgeTypeUpsertBulk) UpdateToID

func (u *EdgeTypeUpsertBulk) UpdateToID() *EdgeTypeUpsertBulk

UpdateToID sets the "to_id" field to the value that was provided on create.

func (*EdgeTypeUpsertBulk) UpdateType

func (u *EdgeTypeUpsertBulk) UpdateType() *EdgeTypeUpsertBulk

UpdateType sets the "type" field to the value that was provided on create.

type EdgeTypeUpsertOne

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

EdgeTypeUpsertOne is the builder for "upsert"-ing

one EdgeType node.

func (*EdgeTypeUpsertOne) DoNothing

func (u *EdgeTypeUpsertOne) DoNothing() *EdgeTypeUpsertOne

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

func (*EdgeTypeUpsertOne) Exec

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

Exec executes the query.

func (*EdgeTypeUpsertOne) ExecX

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

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

func (*EdgeTypeUpsertOne) ID

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

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

func (*EdgeTypeUpsertOne) IDX

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

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

func (*EdgeTypeUpsertOne) Ignore

func (u *EdgeTypeUpsertOne) Ignore() *EdgeTypeUpsertOne

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

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

func (*EdgeTypeUpsertOne) SetNodeID

func (u *EdgeTypeUpsertOne) SetNodeID(v string) *EdgeTypeUpsertOne

SetNodeID sets the "node_id" field.

func (*EdgeTypeUpsertOne) SetToID

SetToID sets the "to_id" field.

func (*EdgeTypeUpsertOne) SetType

SetType sets the "type" field.

func (*EdgeTypeUpsertOne) Update

func (u *EdgeTypeUpsertOne) Update(set func(*EdgeTypeUpsert)) *EdgeTypeUpsertOne

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

func (*EdgeTypeUpsertOne) UpdateNewValues

func (u *EdgeTypeUpsertOne) UpdateNewValues() *EdgeTypeUpsertOne

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

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

func (*EdgeTypeUpsertOne) UpdateNodeID

func (u *EdgeTypeUpsertOne) UpdateNodeID() *EdgeTypeUpsertOne

UpdateNodeID sets the "node_id" field to the value that was provided on create.

func (*EdgeTypeUpsertOne) UpdateToID

func (u *EdgeTypeUpsertOne) UpdateToID() *EdgeTypeUpsertOne

UpdateToID sets the "to_id" field to the value that was provided on create.

func (*EdgeTypeUpsertOne) UpdateType

func (u *EdgeTypeUpsertOne) UpdateType() *EdgeTypeUpsertOne

UpdateType sets the "type" field to the value that was provided on create.

type EdgeTypes

type EdgeTypes []*EdgeType

EdgeTypes is a parsable slice of EdgeType.

type ExternalReference

type ExternalReference struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// URL holds the value of the "url" field.
	URL string `json:"url,omitempty"`
	// Comment holds the value of the "comment" field.
	Comment string `json:"comment,omitempty"`
	// Authority holds the value of the "authority" field.
	Authority string `json:"authority,omitempty"`
	// Type holds the value of the "type" field.
	Type externalreference.Type `json:"type,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the ExternalReferenceQuery when eager-loading is set.
	Edges ExternalReferenceEdges `json:"edges"`
	// contains filtered or unexported fields
}

ExternalReference is the model entity for the ExternalReference schema.

func (*ExternalReference) QueryHashes

func (er *ExternalReference) QueryHashes() *HashesEntryQuery

QueryHashes queries the "hashes" edge of the ExternalReference entity.

func (*ExternalReference) QueryNode

func (er *ExternalReference) QueryNode() *NodeQuery

QueryNode queries the "node" edge of the ExternalReference entity.

func (*ExternalReference) String

func (er *ExternalReference) String() string

String implements the fmt.Stringer.

func (*ExternalReference) Unwrap

func (er *ExternalReference) Unwrap() *ExternalReference

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

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

func (*ExternalReference) Value

func (er *ExternalReference) Value(name string) (ent.Value, error)

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

type ExternalReferenceClient

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

ExternalReferenceClient is a client for the ExternalReference schema.

func NewExternalReferenceClient

func NewExternalReferenceClient(c config) *ExternalReferenceClient

NewExternalReferenceClient returns a client for the ExternalReference from the given config.

func (*ExternalReferenceClient) Create

Create returns a builder for creating a ExternalReference entity.

func (*ExternalReferenceClient) CreateBulk

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

func (*ExternalReferenceClient) Delete

Delete returns a delete builder for ExternalReference.

func (*ExternalReferenceClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*ExternalReferenceClient) DeleteOneID

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

func (*ExternalReferenceClient) Get

Get returns a ExternalReference entity by its id.

func (*ExternalReferenceClient) GetX

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

func (*ExternalReferenceClient) Hooks

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

Hooks returns the client hooks.

func (*ExternalReferenceClient) Intercept

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

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

func (*ExternalReferenceClient) Interceptors

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

Interceptors returns the client interceptors.

func (*ExternalReferenceClient) MapCreateBulk

func (c *ExternalReferenceClient) MapCreateBulk(slice any, setFunc func(*ExternalReferenceCreate, int)) *ExternalReferenceCreateBulk

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

Query returns a query builder for ExternalReference.

func (*ExternalReferenceClient) QueryHashes

QueryHashes queries the hashes edge of a ExternalReference.

func (*ExternalReferenceClient) QueryNode

QueryNode queries the node edge of a ExternalReference.

func (*ExternalReferenceClient) Update

Update returns an update builder for ExternalReference.

func (*ExternalReferenceClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*ExternalReferenceClient) UpdateOneID

UpdateOneID returns an update builder for the given id.

func (*ExternalReferenceClient) Use

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

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

type ExternalReferenceCreate

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

ExternalReferenceCreate is the builder for creating a ExternalReference entity.

func (*ExternalReferenceCreate) AddHashIDs

func (erc *ExternalReferenceCreate) AddHashIDs(ids ...int) *ExternalReferenceCreate

AddHashIDs adds the "hashes" edge to the HashesEntry entity by IDs.

func (*ExternalReferenceCreate) AddHashes

AddHashes adds the "hashes" edges to the HashesEntry entity.

func (*ExternalReferenceCreate) Exec

Exec executes the query.

func (*ExternalReferenceCreate) ExecX

func (erc *ExternalReferenceCreate) ExecX(ctx context.Context)

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

func (*ExternalReferenceCreate) Mutation

Mutation returns the ExternalReferenceMutation object of the builder.

func (*ExternalReferenceCreate) OnConflict

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

client.ExternalReference.Create().
	SetURL(v).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.ExternalReferenceUpsert) {
		SetURL(v+v).
	}).
	Exec(ctx)

func (*ExternalReferenceCreate) OnConflictColumns

func (erc *ExternalReferenceCreate) OnConflictColumns(columns ...string) *ExternalReferenceUpsertOne

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

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

func (*ExternalReferenceCreate) Save

Save creates the ExternalReference in the database.

func (*ExternalReferenceCreate) SaveX

SaveX calls Save and panics if Save returns an error.

func (*ExternalReferenceCreate) SetAuthority

SetAuthority sets the "authority" field.

func (*ExternalReferenceCreate) SetComment

SetComment sets the "comment" field.

func (*ExternalReferenceCreate) SetNillableAuthority

func (erc *ExternalReferenceCreate) SetNillableAuthority(s *string) *ExternalReferenceCreate

SetNillableAuthority sets the "authority" field if the given value is not nil.

func (*ExternalReferenceCreate) SetNode

SetNode sets the "node" edge to the Node entity.

func (*ExternalReferenceCreate) SetNodeID

SetNodeID sets the "node" edge to the Node entity by ID.

func (*ExternalReferenceCreate) SetType

SetType sets the "type" field.

func (*ExternalReferenceCreate) SetURL

SetURL sets the "url" field.

type ExternalReferenceCreateBulk

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

ExternalReferenceCreateBulk is the builder for creating many ExternalReference entities in bulk.

func (*ExternalReferenceCreateBulk) Exec

Exec executes the query.

func (*ExternalReferenceCreateBulk) ExecX

func (ercb *ExternalReferenceCreateBulk) ExecX(ctx context.Context)

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

func (*ExternalReferenceCreateBulk) OnConflict

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

client.ExternalReference.CreateBulk(builders...).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.ExternalReferenceUpsert) {
		SetURL(v+v).
	}).
	Exec(ctx)

func (*ExternalReferenceCreateBulk) OnConflictColumns

func (ercb *ExternalReferenceCreateBulk) OnConflictColumns(columns ...string) *ExternalReferenceUpsertBulk

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

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

func (*ExternalReferenceCreateBulk) Save

Save creates the ExternalReference entities in the database.

func (*ExternalReferenceCreateBulk) SaveX

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

type ExternalReferenceDelete

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

ExternalReferenceDelete is the builder for deleting a ExternalReference entity.

func (*ExternalReferenceDelete) Exec

func (erd *ExternalReferenceDelete) Exec(ctx context.Context) (int, error)

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

func (*ExternalReferenceDelete) ExecX

func (erd *ExternalReferenceDelete) ExecX(ctx context.Context) int

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

func (*ExternalReferenceDelete) Where

Where appends a list predicates to the ExternalReferenceDelete builder.

type ExternalReferenceDeleteOne

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

ExternalReferenceDeleteOne is the builder for deleting a single ExternalReference entity.

func (*ExternalReferenceDeleteOne) Exec

Exec executes the deletion query.

func (*ExternalReferenceDeleteOne) ExecX

func (erdo *ExternalReferenceDeleteOne) ExecX(ctx context.Context)

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

func (*ExternalReferenceDeleteOne) Where

Where appends a list predicates to the ExternalReferenceDelete builder.

type ExternalReferenceEdges

type ExternalReferenceEdges struct {
	// Hashes holds the value of the hashes edge.
	Hashes []*HashesEntry `json:"hashes,omitempty"`
	// Node holds the value of the node edge.
	Node *Node `json:"node,omitempty"`
	// contains filtered or unexported fields
}

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

func (ExternalReferenceEdges) HashesOrErr

func (e ExternalReferenceEdges) HashesOrErr() ([]*HashesEntry, error)

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

func (ExternalReferenceEdges) NodeOrErr

func (e ExternalReferenceEdges) NodeOrErr() (*Node, error)

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

type ExternalReferenceGroupBy

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

ExternalReferenceGroupBy is the group-by builder for ExternalReference entities.

func (*ExternalReferenceGroupBy) Aggregate

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

func (*ExternalReferenceGroupBy) Bool

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

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

func (*ExternalReferenceGroupBy) BoolX

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

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

func (*ExternalReferenceGroupBy) Bools

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

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

func (*ExternalReferenceGroupBy) BoolsX

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

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

func (*ExternalReferenceGroupBy) Float64

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

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

func (*ExternalReferenceGroupBy) Float64X

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

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

func (*ExternalReferenceGroupBy) Float64s

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

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

func (*ExternalReferenceGroupBy) Float64sX

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

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

func (*ExternalReferenceGroupBy) Int

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

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

func (*ExternalReferenceGroupBy) IntX

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

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

func (*ExternalReferenceGroupBy) Ints

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

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

func (*ExternalReferenceGroupBy) IntsX

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

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

func (*ExternalReferenceGroupBy) Scan

func (ergb *ExternalReferenceGroupBy) Scan(ctx context.Context, v any) error

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

func (*ExternalReferenceGroupBy) ScanX

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

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

func (*ExternalReferenceGroupBy) String

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

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

func (*ExternalReferenceGroupBy) StringX

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

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

func (*ExternalReferenceGroupBy) Strings

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

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

func (*ExternalReferenceGroupBy) StringsX

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

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

type ExternalReferenceMutation

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

ExternalReferenceMutation represents an operation that mutates the ExternalReference nodes in the graph.

func (*ExternalReferenceMutation) AddField

func (m *ExternalReferenceMutation) 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 (*ExternalReferenceMutation) AddHashIDs

func (m *ExternalReferenceMutation) AddHashIDs(ids ...int)

AddHashIDs adds the "hashes" edge to the HashesEntry entity by ids.

func (*ExternalReferenceMutation) AddedEdges

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

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

func (*ExternalReferenceMutation) AddedField

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

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

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

func (*ExternalReferenceMutation) AddedIDs

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

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

func (*ExternalReferenceMutation) Authority

func (m *ExternalReferenceMutation) Authority() (r string, exists bool)

Authority returns the value of the "authority" field in the mutation.

func (*ExternalReferenceMutation) AuthorityCleared

func (m *ExternalReferenceMutation) AuthorityCleared() bool

AuthorityCleared returns if the "authority" field was cleared in this mutation.

func (*ExternalReferenceMutation) ClearAuthority

func (m *ExternalReferenceMutation) ClearAuthority()

ClearAuthority clears the value of the "authority" field.

func (*ExternalReferenceMutation) ClearEdge

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

func (m *ExternalReferenceMutation) 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 (*ExternalReferenceMutation) ClearHashes

func (m *ExternalReferenceMutation) ClearHashes()

ClearHashes clears the "hashes" edge to the HashesEntry entity.

func (*ExternalReferenceMutation) ClearNode

func (m *ExternalReferenceMutation) ClearNode()

ClearNode clears the "node" edge to the Node entity.

func (*ExternalReferenceMutation) ClearedEdges

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

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

func (*ExternalReferenceMutation) ClearedFields

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

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

func (ExternalReferenceMutation) Client

func (m ExternalReferenceMutation) 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 (*ExternalReferenceMutation) Comment

func (m *ExternalReferenceMutation) Comment() (r string, exists bool)

Comment returns the value of the "comment" field in the mutation.

func (*ExternalReferenceMutation) EdgeCleared

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

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

func (*ExternalReferenceMutation) Field

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

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

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

func (*ExternalReferenceMutation) Fields

func (m *ExternalReferenceMutation) 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 (*ExternalReferenceMutation) GetType

func (m *ExternalReferenceMutation) GetType() (r externalreference.Type, exists bool)

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

func (*ExternalReferenceMutation) HashesCleared

func (m *ExternalReferenceMutation) HashesCleared() bool

HashesCleared reports if the "hashes" edge to the HashesEntry entity was cleared.

func (*ExternalReferenceMutation) HashesIDs

func (m *ExternalReferenceMutation) HashesIDs() (ids []int)

HashesIDs returns the "hashes" edge IDs in the mutation.

func (*ExternalReferenceMutation) ID

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

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

func (*ExternalReferenceMutation) IDs

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 (*ExternalReferenceMutation) NodeCleared

func (m *ExternalReferenceMutation) NodeCleared() bool

NodeCleared reports if the "node" edge to the Node entity was cleared.

func (*ExternalReferenceMutation) NodeID

func (m *ExternalReferenceMutation) NodeID() (id string, exists bool)

NodeID returns the "node" edge ID in the mutation.

func (*ExternalReferenceMutation) NodeIDs

func (m *ExternalReferenceMutation) NodeIDs() (ids []string)

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

func (*ExternalReferenceMutation) OldAuthority

func (m *ExternalReferenceMutation) OldAuthority(ctx context.Context) (v string, err error)

OldAuthority returns the old "authority" field's value of the ExternalReference entity. If the ExternalReference 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 (*ExternalReferenceMutation) OldComment

func (m *ExternalReferenceMutation) OldComment(ctx context.Context) (v string, err error)

OldComment returns the old "comment" field's value of the ExternalReference entity. If the ExternalReference 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 (*ExternalReferenceMutation) OldField

func (m *ExternalReferenceMutation) 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 (*ExternalReferenceMutation) OldType

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

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

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

func (m *ExternalReferenceMutation) Op() Op

Op returns the operation name.

func (*ExternalReferenceMutation) RemoveHashIDs

func (m *ExternalReferenceMutation) RemoveHashIDs(ids ...int)

RemoveHashIDs removes the "hashes" edge to the HashesEntry entity by IDs.

func (*ExternalReferenceMutation) RemovedEdges

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

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

func (*ExternalReferenceMutation) RemovedHashesIDs

func (m *ExternalReferenceMutation) RemovedHashesIDs() (ids []int)

RemovedHashes returns the removed IDs of the "hashes" edge to the HashesEntry entity.

func (*ExternalReferenceMutation) RemovedIDs

func (m *ExternalReferenceMutation) 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 (*ExternalReferenceMutation) ResetAuthority

func (m *ExternalReferenceMutation) ResetAuthority()

ResetAuthority resets all changes to the "authority" field.

func (*ExternalReferenceMutation) ResetComment

func (m *ExternalReferenceMutation) ResetComment()

ResetComment resets all changes to the "comment" field.

func (*ExternalReferenceMutation) ResetEdge

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

func (m *ExternalReferenceMutation) 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 (*ExternalReferenceMutation) ResetHashes

func (m *ExternalReferenceMutation) ResetHashes()

ResetHashes resets all changes to the "hashes" edge.

func (*ExternalReferenceMutation) ResetNode

func (m *ExternalReferenceMutation) ResetNode()

ResetNode resets all changes to the "node" edge.

func (*ExternalReferenceMutation) ResetType

func (m *ExternalReferenceMutation) ResetType()

ResetType resets all changes to the "type" field.

func (*ExternalReferenceMutation) ResetURL

func (m *ExternalReferenceMutation) ResetURL()

ResetURL resets all changes to the "url" field.

func (*ExternalReferenceMutation) SetAuthority

func (m *ExternalReferenceMutation) SetAuthority(s string)

SetAuthority sets the "authority" field.

func (*ExternalReferenceMutation) SetComment

func (m *ExternalReferenceMutation) SetComment(s string)

SetComment sets the "comment" field.

func (*ExternalReferenceMutation) SetField

func (m *ExternalReferenceMutation) 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 (*ExternalReferenceMutation) SetNodeID

func (m *ExternalReferenceMutation) SetNodeID(id string)

SetNodeID sets the "node" edge to the Node entity by id.

func (*ExternalReferenceMutation) SetOp

func (m *ExternalReferenceMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*ExternalReferenceMutation) SetType

SetType sets the "type" field.

func (*ExternalReferenceMutation) SetURL

func (m *ExternalReferenceMutation) SetURL(s string)

SetURL sets the "url" field.

func (ExternalReferenceMutation) Tx

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

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

func (*ExternalReferenceMutation) Type

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

func (*ExternalReferenceMutation) URL

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

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

func (*ExternalReferenceMutation) Where

Where appends a list predicates to the ExternalReferenceMutation builder.

func (*ExternalReferenceMutation) WhereP

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

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

type ExternalReferenceQuery

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

ExternalReferenceQuery is the builder for querying ExternalReference entities.

func (*ExternalReferenceQuery) Aggregate

Aggregate returns a ExternalReferenceSelect configured with the given aggregations.

func (*ExternalReferenceQuery) All

All executes the query and returns a list of ExternalReferences.

func (*ExternalReferenceQuery) AllX

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

func (*ExternalReferenceQuery) Clone

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

func (*ExternalReferenceQuery) Count

func (erq *ExternalReferenceQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*ExternalReferenceQuery) CountX

func (erq *ExternalReferenceQuery) CountX(ctx context.Context) int

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

func (*ExternalReferenceQuery) Exist

func (erq *ExternalReferenceQuery) Exist(ctx context.Context) (bool, error)

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

func (*ExternalReferenceQuery) ExistX

func (erq *ExternalReferenceQuery) ExistX(ctx context.Context) bool

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

func (*ExternalReferenceQuery) First

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

func (*ExternalReferenceQuery) FirstID

func (erq *ExternalReferenceQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*ExternalReferenceQuery) FirstIDX

func (erq *ExternalReferenceQuery) FirstIDX(ctx context.Context) int

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

func (*ExternalReferenceQuery) FirstX

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

func (*ExternalReferenceQuery) GroupBy

func (erq *ExternalReferenceQuery) GroupBy(field string, fields ...string) *ExternalReferenceGroupBy

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

client.ExternalReference.Query().
	GroupBy(externalreference.FieldURL).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*ExternalReferenceQuery) IDs

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

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

func (*ExternalReferenceQuery) IDsX

func (erq *ExternalReferenceQuery) IDsX(ctx context.Context) []int

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

func (*ExternalReferenceQuery) Limit

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

func (*ExternalReferenceQuery) Offset

func (erq *ExternalReferenceQuery) Offset(offset int) *ExternalReferenceQuery

Offset to start from.

func (*ExternalReferenceQuery) Only

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

func (*ExternalReferenceQuery) OnlyID

func (erq *ExternalReferenceQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*ExternalReferenceQuery) OnlyIDX

func (erq *ExternalReferenceQuery) OnlyIDX(ctx context.Context) int

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

func (*ExternalReferenceQuery) OnlyX

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

func (*ExternalReferenceQuery) Order

Order specifies how the records should be ordered.

func (*ExternalReferenceQuery) QueryHashes

func (erq *ExternalReferenceQuery) QueryHashes() *HashesEntryQuery

QueryHashes chains the current query on the "hashes" edge.

func (*ExternalReferenceQuery) QueryNode

func (erq *ExternalReferenceQuery) QueryNode() *NodeQuery

QueryNode chains the current query on the "node" edge.

func (*ExternalReferenceQuery) Select

func (erq *ExternalReferenceQuery) Select(fields ...string) *ExternalReferenceSelect

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

client.ExternalReference.Query().
	Select(externalreference.FieldURL).
	Scan(ctx, &v)

func (*ExternalReferenceQuery) Unique

func (erq *ExternalReferenceQuery) Unique(unique bool) *ExternalReferenceQuery

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

Where adds a new predicate for the ExternalReferenceQuery builder.

func (*ExternalReferenceQuery) WithHashes

func (erq *ExternalReferenceQuery) WithHashes(opts ...func(*HashesEntryQuery)) *ExternalReferenceQuery

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

func (*ExternalReferenceQuery) WithNode

func (erq *ExternalReferenceQuery) WithNode(opts ...func(*NodeQuery)) *ExternalReferenceQuery

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

type ExternalReferenceSelect

type ExternalReferenceSelect struct {
	*ExternalReferenceQuery
	// contains filtered or unexported fields
}

ExternalReferenceSelect is the builder for selecting fields of ExternalReference entities.

func (*ExternalReferenceSelect) Aggregate

Aggregate adds the given aggregation functions to the selector query.

func (*ExternalReferenceSelect) Bool

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

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

func (*ExternalReferenceSelect) BoolX

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

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

func (*ExternalReferenceSelect) Bools

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

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

func (*ExternalReferenceSelect) BoolsX

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

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

func (*ExternalReferenceSelect) Float64

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

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

func (*ExternalReferenceSelect) Float64X

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

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

func (*ExternalReferenceSelect) Float64s

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

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

func (*ExternalReferenceSelect) Float64sX

func (s *ExternalReferenceSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*ExternalReferenceSelect) Int

func (s *ExternalReferenceSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*ExternalReferenceSelect) IntX

func (s *ExternalReferenceSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*ExternalReferenceSelect) Ints

func (s *ExternalReferenceSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*ExternalReferenceSelect) IntsX

func (s *ExternalReferenceSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*ExternalReferenceSelect) Scan

func (ers *ExternalReferenceSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*ExternalReferenceSelect) ScanX

func (s *ExternalReferenceSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*ExternalReferenceSelect) String

func (s *ExternalReferenceSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*ExternalReferenceSelect) StringX

func (s *ExternalReferenceSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*ExternalReferenceSelect) Strings

func (s *ExternalReferenceSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*ExternalReferenceSelect) StringsX

func (s *ExternalReferenceSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type ExternalReferenceUpdate

type ExternalReferenceUpdate struct {
	// contains filtered or unexported fields
}

ExternalReferenceUpdate is the builder for updating ExternalReference entities.

func (*ExternalReferenceUpdate) AddHashIDs

func (eru *ExternalReferenceUpdate) AddHashIDs(ids ...int) *ExternalReferenceUpdate

AddHashIDs adds the "hashes" edge to the HashesEntry entity by IDs.

func (*ExternalReferenceUpdate) AddHashes

AddHashes adds the "hashes" edges to the HashesEntry entity.

func (*ExternalReferenceUpdate) ClearAuthority

func (eru *ExternalReferenceUpdate) ClearAuthority() *ExternalReferenceUpdate

ClearAuthority clears the value of the "authority" field.

func (*ExternalReferenceUpdate) ClearHashes

ClearHashes clears all "hashes" edges to the HashesEntry entity.

func (*ExternalReferenceUpdate) ClearNode

ClearNode clears the "node" edge to the Node entity.

func (*ExternalReferenceUpdate) Exec

Exec executes the query.

func (*ExternalReferenceUpdate) ExecX

func (eru *ExternalReferenceUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ExternalReferenceUpdate) Mutation

Mutation returns the ExternalReferenceMutation object of the builder.

func (*ExternalReferenceUpdate) RemoveHashIDs

func (eru *ExternalReferenceUpdate) RemoveHashIDs(ids ...int) *ExternalReferenceUpdate

RemoveHashIDs removes the "hashes" edge to HashesEntry entities by IDs.

func (*ExternalReferenceUpdate) RemoveHashes

RemoveHashes removes "hashes" edges to HashesEntry entities.

func (*ExternalReferenceUpdate) Save

func (eru *ExternalReferenceUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*ExternalReferenceUpdate) SaveX

func (eru *ExternalReferenceUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*ExternalReferenceUpdate) SetAuthority

SetAuthority sets the "authority" field.

func (*ExternalReferenceUpdate) SetComment

SetComment sets the "comment" field.

func (*ExternalReferenceUpdate) SetNillableAuthority

func (eru *ExternalReferenceUpdate) SetNillableAuthority(s *string) *ExternalReferenceUpdate

SetNillableAuthority sets the "authority" field if the given value is not nil.

func (*ExternalReferenceUpdate) SetNillableComment

func (eru *ExternalReferenceUpdate) SetNillableComment(s *string) *ExternalReferenceUpdate

SetNillableComment sets the "comment" field if the given value is not nil.

func (*ExternalReferenceUpdate) SetNillableType

SetNillableType sets the "type" field if the given value is not nil.

func (*ExternalReferenceUpdate) SetNillableURL

func (eru *ExternalReferenceUpdate) SetNillableURL(s *string) *ExternalReferenceUpdate

SetNillableURL sets the "url" field if the given value is not nil.

func (*ExternalReferenceUpdate) SetNode

SetNode sets the "node" edge to the Node entity.

func (*ExternalReferenceUpdate) SetNodeID

SetNodeID sets the "node" edge to the Node entity by ID.

func (*ExternalReferenceUpdate) SetType

SetType sets the "type" field.

func (*ExternalReferenceUpdate) SetURL

SetURL sets the "url" field.

func (*ExternalReferenceUpdate) Where

Where appends a list predicates to the ExternalReferenceUpdate builder.

type ExternalReferenceUpdateOne

type ExternalReferenceUpdateOne struct {
	// contains filtered or unexported fields
}

ExternalReferenceUpdateOne is the builder for updating a single ExternalReference entity.

func (*ExternalReferenceUpdateOne) AddHashIDs

func (eruo *ExternalReferenceUpdateOne) AddHashIDs(ids ...int) *ExternalReferenceUpdateOne

AddHashIDs adds the "hashes" edge to the HashesEntry entity by IDs.

func (*ExternalReferenceUpdateOne) AddHashes

AddHashes adds the "hashes" edges to the HashesEntry entity.

func (*ExternalReferenceUpdateOne) ClearAuthority

ClearAuthority clears the value of the "authority" field.

func (*ExternalReferenceUpdateOne) ClearHashes

ClearHashes clears all "hashes" edges to the HashesEntry entity.

func (*ExternalReferenceUpdateOne) ClearNode

ClearNode clears the "node" edge to the Node entity.

func (*ExternalReferenceUpdateOne) Exec

Exec executes the query on the entity.

func (*ExternalReferenceUpdateOne) ExecX

func (eruo *ExternalReferenceUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ExternalReferenceUpdateOne) Mutation

Mutation returns the ExternalReferenceMutation object of the builder.

func (*ExternalReferenceUpdateOne) RemoveHashIDs

func (eruo *ExternalReferenceUpdateOne) RemoveHashIDs(ids ...int) *ExternalReferenceUpdateOne

RemoveHashIDs removes the "hashes" edge to HashesEntry entities by IDs.

func (*ExternalReferenceUpdateOne) RemoveHashes

RemoveHashes removes "hashes" edges to HashesEntry entities.

func (*ExternalReferenceUpdateOne) Save

Save executes the query and returns the updated ExternalReference entity.

func (*ExternalReferenceUpdateOne) SaveX

SaveX is like Save, but panics if an error occurs.

func (*ExternalReferenceUpdateOne) Select

func (eruo *ExternalReferenceUpdateOne) Select(field string, fields ...string) *ExternalReferenceUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*ExternalReferenceUpdateOne) SetAuthority

SetAuthority sets the "authority" field.

func (*ExternalReferenceUpdateOne) SetComment

SetComment sets the "comment" field.

func (*ExternalReferenceUpdateOne) SetNillableAuthority

func (eruo *ExternalReferenceUpdateOne) SetNillableAuthority(s *string) *ExternalReferenceUpdateOne

SetNillableAuthority sets the "authority" field if the given value is not nil.

func (*ExternalReferenceUpdateOne) SetNillableComment

func (eruo *ExternalReferenceUpdateOne) SetNillableComment(s *string) *ExternalReferenceUpdateOne

SetNillableComment sets the "comment" field if the given value is not nil.

func (*ExternalReferenceUpdateOne) SetNillableType

SetNillableType sets the "type" field if the given value is not nil.

func (*ExternalReferenceUpdateOne) SetNillableURL

SetNillableURL sets the "url" field if the given value is not nil.

func (*ExternalReferenceUpdateOne) SetNode

SetNode sets the "node" edge to the Node entity.

func (*ExternalReferenceUpdateOne) SetNodeID

SetNodeID sets the "node" edge to the Node entity by ID.

func (*ExternalReferenceUpdateOne) SetType

SetType sets the "type" field.

func (*ExternalReferenceUpdateOne) SetURL

SetURL sets the "url" field.

func (*ExternalReferenceUpdateOne) Where

Where appends a list predicates to the ExternalReferenceUpdate builder.

type ExternalReferenceUpsert

type ExternalReferenceUpsert struct {
	*sql.UpdateSet
}

ExternalReferenceUpsert is the "OnConflict" setter.

func (*ExternalReferenceUpsert) ClearAuthority

func (u *ExternalReferenceUpsert) ClearAuthority() *ExternalReferenceUpsert

ClearAuthority clears the value of the "authority" field.

func (*ExternalReferenceUpsert) SetAuthority

SetAuthority sets the "authority" field.

func (*ExternalReferenceUpsert) SetComment

SetComment sets the "comment" field.

func (*ExternalReferenceUpsert) SetType

SetType sets the "type" field.

func (*ExternalReferenceUpsert) SetURL

SetURL sets the "url" field.

func (*ExternalReferenceUpsert) UpdateAuthority

func (u *ExternalReferenceUpsert) UpdateAuthority() *ExternalReferenceUpsert

UpdateAuthority sets the "authority" field to the value that was provided on create.

func (*ExternalReferenceUpsert) UpdateComment

UpdateComment sets the "comment" field to the value that was provided on create.

func (*ExternalReferenceUpsert) UpdateType

UpdateType sets the "type" field to the value that was provided on create.

func (*ExternalReferenceUpsert) UpdateURL

UpdateURL sets the "url" field to the value that was provided on create.

type ExternalReferenceUpsertBulk

type ExternalReferenceUpsertBulk struct {
	// contains filtered or unexported fields
}

ExternalReferenceUpsertBulk is the builder for "upsert"-ing a bulk of ExternalReference nodes.

func (*ExternalReferenceUpsertBulk) ClearAuthority

ClearAuthority clears the value of the "authority" field.

func (*ExternalReferenceUpsertBulk) DoNothing

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*ExternalReferenceUpsertBulk) Exec

Exec executes the query.

func (*ExternalReferenceUpsertBulk) ExecX

ExecX is like Exec, but panics if an error occurs.

func (*ExternalReferenceUpsertBulk) Ignore

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.ExternalReference.Create().
	OnConflict(sql.ResolveWithIgnore()).
	Exec(ctx)

func (*ExternalReferenceUpsertBulk) SetAuthority

SetAuthority sets the "authority" field.

func (*ExternalReferenceUpsertBulk) SetComment

SetComment sets the "comment" field.

func (*ExternalReferenceUpsertBulk) SetType

SetType sets the "type" field.

func (*ExternalReferenceUpsertBulk) SetURL

SetURL sets the "url" field.

func (*ExternalReferenceUpsertBulk) Update

Update allows overriding fields `UPDATE` values. See the ExternalReferenceCreateBulk.OnConflict documentation for more info.

func (*ExternalReferenceUpsertBulk) UpdateAuthority

UpdateAuthority sets the "authority" field to the value that was provided on create.

func (*ExternalReferenceUpsertBulk) UpdateComment

UpdateComment sets the "comment" field to the value that was provided on create.

func (*ExternalReferenceUpsertBulk) UpdateNewValues

UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:

client.ExternalReference.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
	).
	Exec(ctx)

func (*ExternalReferenceUpsertBulk) UpdateType

UpdateType sets the "type" field to the value that was provided on create.

func (*ExternalReferenceUpsertBulk) UpdateURL

UpdateURL sets the "url" field to the value that was provided on create.

type ExternalReferenceUpsertOne

type ExternalReferenceUpsertOne struct {
	// contains filtered or unexported fields
}

ExternalReferenceUpsertOne is the builder for "upsert"-ing

one ExternalReference node.

func (*ExternalReferenceUpsertOne) ClearAuthority

ClearAuthority clears the value of the "authority" field.

func (*ExternalReferenceUpsertOne) DoNothing

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*ExternalReferenceUpsertOne) Exec

Exec executes the query.

func (*ExternalReferenceUpsertOne) ExecX

ExecX is like Exec, but panics if an error occurs.

func (*ExternalReferenceUpsertOne) ID

func (u *ExternalReferenceUpsertOne) ID(ctx context.Context) (id int, err error)

Exec executes the UPSERT query and returns the inserted/updated ID.

func (*ExternalReferenceUpsertOne) IDX

IDX is like ID, but panics if an error occurs.

func (*ExternalReferenceUpsertOne) Ignore

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.ExternalReference.Create().
    OnConflict(sql.ResolveWithIgnore()).
    Exec(ctx)

func (*ExternalReferenceUpsertOne) SetAuthority

SetAuthority sets the "authority" field.

func (*ExternalReferenceUpsertOne) SetComment

SetComment sets the "comment" field.

func (*ExternalReferenceUpsertOne) SetType

SetType sets the "type" field.

func (*ExternalReferenceUpsertOne) SetURL

SetURL sets the "url" field.

func (*ExternalReferenceUpsertOne) Update

Update allows overriding fields `UPDATE` values. See the ExternalReferenceCreate.OnConflict documentation for more info.

func (*ExternalReferenceUpsertOne) UpdateAuthority

UpdateAuthority sets the "authority" field to the value that was provided on create.

func (*ExternalReferenceUpsertOne) UpdateComment

UpdateComment sets the "comment" field to the value that was provided on create.

func (*ExternalReferenceUpsertOne) UpdateNewValues

UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:

client.ExternalReference.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
	).
	Exec(ctx)

func (*ExternalReferenceUpsertOne) UpdateType

UpdateType sets the "type" field to the value that was provided on create.

func (*ExternalReferenceUpsertOne) UpdateURL

UpdateURL sets the "url" field to the value that was provided on create.

type ExternalReferences

type ExternalReferences []*ExternalReference

ExternalReferences is a parsable slice of ExternalReference.

type HashesEntries

type HashesEntries []*HashesEntry

HashesEntries is a parsable slice of HashesEntry.

type HashesEntry

type HashesEntry struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// HashAlgorithmType holds the value of the "hash_algorithm_type" field.
	HashAlgorithmType hashesentry.HashAlgorithmType `json:"hash_algorithm_type,omitempty"`
	// HashData holds the value of the "hash_data" field.
	HashData string `json:"hash_data,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the HashesEntryQuery when eager-loading is set.
	Edges HashesEntryEdges `json:"edges"`
	// contains filtered or unexported fields
}

HashesEntry is the model entity for the HashesEntry schema.

func (*HashesEntry) QueryExternalReferences

func (he *HashesEntry) QueryExternalReferences() *ExternalReferenceQuery

QueryExternalReferences queries the "external_references" edge of the HashesEntry entity.

func (*HashesEntry) QueryNodes

func (he *HashesEntry) QueryNodes() *NodeQuery

QueryNodes queries the "nodes" edge of the HashesEntry entity.

func (*HashesEntry) String

func (he *HashesEntry) String() string

String implements the fmt.Stringer.

func (*HashesEntry) Unwrap

func (he *HashesEntry) Unwrap() *HashesEntry

Unwrap unwraps the HashesEntry 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 (*HashesEntry) Update

func (he *HashesEntry) Update() *HashesEntryUpdateOne

Update returns a builder for updating this HashesEntry. Note that you need to call HashesEntry.Unwrap() before calling this method if this HashesEntry was returned from a transaction, and the transaction was committed or rolled back.

func (*HashesEntry) Value

func (he *HashesEntry) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the HashesEntry. This includes values selected through modifiers, order, etc.

type HashesEntryClient

type HashesEntryClient struct {
	// contains filtered or unexported fields
}

HashesEntryClient is a client for the HashesEntry schema.

func NewHashesEntryClient

func NewHashesEntryClient(c config) *HashesEntryClient

NewHashesEntryClient returns a client for the HashesEntry from the given config.

func (*HashesEntryClient) Create

func (c *HashesEntryClient) Create() *HashesEntryCreate

Create returns a builder for creating a HashesEntry entity.

func (*HashesEntryClient) CreateBulk

func (c *HashesEntryClient) CreateBulk(builders ...*HashesEntryCreate) *HashesEntryCreateBulk

CreateBulk returns a builder for creating a bulk of HashesEntry entities.

func (*HashesEntryClient) Delete

func (c *HashesEntryClient) Delete() *HashesEntryDelete

Delete returns a delete builder for HashesEntry.

func (*HashesEntryClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*HashesEntryClient) DeleteOneID

func (c *HashesEntryClient) DeleteOneID(id int) *HashesEntryDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*HashesEntryClient) Get

func (c *HashesEntryClient) Get(ctx context.Context, id int) (*HashesEntry, error)

Get returns a HashesEntry entity by its id.

func (*HashesEntryClient) GetX

func (c *HashesEntryClient) GetX(ctx context.Context, id int) *HashesEntry

GetX is like Get, but panics if an error occurs.

func (*HashesEntryClient) Hooks

func (c *HashesEntryClient) Hooks() []Hook

Hooks returns the client hooks.

func (*HashesEntryClient) Intercept

func (c *HashesEntryClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `hashesentry.Intercept(f(g(h())))`.

func (*HashesEntryClient) Interceptors

func (c *HashesEntryClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*HashesEntryClient) MapCreateBulk

func (c *HashesEntryClient) MapCreateBulk(slice any, setFunc func(*HashesEntryCreate, int)) *HashesEntryCreateBulk

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 (*HashesEntryClient) Query

func (c *HashesEntryClient) Query() *HashesEntryQuery

Query returns a query builder for HashesEntry.

func (*HashesEntryClient) QueryExternalReferences

func (c *HashesEntryClient) QueryExternalReferences(he *HashesEntry) *ExternalReferenceQuery

QueryExternalReferences queries the external_references edge of a HashesEntry.

func (*HashesEntryClient) QueryNodes

func (c *HashesEntryClient) QueryNodes(he *HashesEntry) *NodeQuery

QueryNodes queries the nodes edge of a HashesEntry.

func (*HashesEntryClient) Update

func (c *HashesEntryClient) Update() *HashesEntryUpdate

Update returns an update builder for HashesEntry.

func (*HashesEntryClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*HashesEntryClient) UpdateOneID

func (c *HashesEntryClient) UpdateOneID(id int) *HashesEntryUpdateOne

UpdateOneID returns an update builder for the given id.

func (*HashesEntryClient) Use

func (c *HashesEntryClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `hashesentry.Hooks(f(g(h())))`.

type HashesEntryCreate

type HashesEntryCreate struct {
	// contains filtered or unexported fields
}

HashesEntryCreate is the builder for creating a HashesEntry entity.

func (*HashesEntryCreate) Exec

func (hec *HashesEntryCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*HashesEntryCreate) ExecX

func (hec *HashesEntryCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*HashesEntryCreate) Mutation

func (hec *HashesEntryCreate) Mutation() *HashesEntryMutation

Mutation returns the HashesEntryMutation object of the builder.

func (*HashesEntryCreate) OnConflict

func (hec *HashesEntryCreate) OnConflict(opts ...sql.ConflictOption) *HashesEntryUpsertOne

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.HashesEntry.Create().
	SetHashAlgorithmType(v).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.HashesEntryUpsert) {
		SetHashAlgorithmType(v+v).
	}).
	Exec(ctx)

func (*HashesEntryCreate) OnConflictColumns

func (hec *HashesEntryCreate) OnConflictColumns(columns ...string) *HashesEntryUpsertOne

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.HashesEntry.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*HashesEntryCreate) Save

func (hec *HashesEntryCreate) Save(ctx context.Context) (*HashesEntry, error)

Save creates the HashesEntry in the database.

func (*HashesEntryCreate) SaveX

func (hec *HashesEntryCreate) SaveX(ctx context.Context) *HashesEntry

SaveX calls Save and panics if Save returns an error.

func (*HashesEntryCreate) SetExternalReferences

func (hec *HashesEntryCreate) SetExternalReferences(e *ExternalReference) *HashesEntryCreate

SetExternalReferences sets the "external_references" edge to the ExternalReference entity.

func (*HashesEntryCreate) SetExternalReferencesID

func (hec *HashesEntryCreate) SetExternalReferencesID(id int) *HashesEntryCreate

SetExternalReferencesID sets the "external_references" edge to the ExternalReference entity by ID.

func (*HashesEntryCreate) SetHashAlgorithmType

func (hec *HashesEntryCreate) SetHashAlgorithmType(hat hashesentry.HashAlgorithmType) *HashesEntryCreate

SetHashAlgorithmType sets the "hash_algorithm_type" field.

func (*HashesEntryCreate) SetHashData

func (hec *HashesEntryCreate) SetHashData(s string) *HashesEntryCreate

SetHashData sets the "hash_data" field.

func (*HashesEntryCreate) SetNillableExternalReferencesID

func (hec *HashesEntryCreate) SetNillableExternalReferencesID(id *int) *HashesEntryCreate

SetNillableExternalReferencesID sets the "external_references" edge to the ExternalReference entity by ID if the given value is not nil.

func (*HashesEntryCreate) SetNillableNodesID

func (hec *HashesEntryCreate) SetNillableNodesID(id *string) *HashesEntryCreate

SetNillableNodesID sets the "nodes" edge to the Node entity by ID if the given value is not nil.

func (*HashesEntryCreate) SetNodes

func (hec *HashesEntryCreate) SetNodes(n *Node) *HashesEntryCreate

SetNodes sets the "nodes" edge to the Node entity.

func (*HashesEntryCreate) SetNodesID

func (hec *HashesEntryCreate) SetNodesID(id string) *HashesEntryCreate

SetNodesID sets the "nodes" edge to the Node entity by ID.

type HashesEntryCreateBulk

type HashesEntryCreateBulk struct {
	// contains filtered or unexported fields
}

HashesEntryCreateBulk is the builder for creating many HashesEntry entities in bulk.

func (*HashesEntryCreateBulk) Exec

func (hecb *HashesEntryCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*HashesEntryCreateBulk) ExecX

func (hecb *HashesEntryCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*HashesEntryCreateBulk) OnConflict

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.HashesEntry.CreateBulk(builders...).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.HashesEntryUpsert) {
		SetHashAlgorithmType(v+v).
	}).
	Exec(ctx)

func (*HashesEntryCreateBulk) OnConflictColumns

func (hecb *HashesEntryCreateBulk) OnConflictColumns(columns ...string) *HashesEntryUpsertBulk

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.HashesEntry.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*HashesEntryCreateBulk) Save

func (hecb *HashesEntryCreateBulk) Save(ctx context.Context) ([]*HashesEntry, error)

Save creates the HashesEntry entities in the database.

func (*HashesEntryCreateBulk) SaveX

func (hecb *HashesEntryCreateBulk) SaveX(ctx context.Context) []*HashesEntry

SaveX is like Save, but panics if an error occurs.

type HashesEntryDelete

type HashesEntryDelete struct {
	// contains filtered or unexported fields
}

HashesEntryDelete is the builder for deleting a HashesEntry entity.

func (*HashesEntryDelete) Exec

func (hed *HashesEntryDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*HashesEntryDelete) ExecX

func (hed *HashesEntryDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*HashesEntryDelete) Where

Where appends a list predicates to the HashesEntryDelete builder.

type HashesEntryDeleteOne

type HashesEntryDeleteOne struct {
	// contains filtered or unexported fields
}

HashesEntryDeleteOne is the builder for deleting a single HashesEntry entity.

func (*HashesEntryDeleteOne) Exec

func (hedo *HashesEntryDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*HashesEntryDeleteOne) ExecX

func (hedo *HashesEntryDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*HashesEntryDeleteOne) Where

Where appends a list predicates to the HashesEntryDelete builder.

type HashesEntryEdges

type HashesEntryEdges struct {
	// ExternalReferences holds the value of the external_references edge.
	ExternalReferences *ExternalReference `json:"external_references,omitempty"`
	// Nodes holds the value of the nodes edge.
	Nodes *Node `json:"nodes,omitempty"`
	// contains filtered or unexported fields
}

HashesEntryEdges holds the relations/edges for other nodes in the graph.

func (HashesEntryEdges) ExternalReferencesOrErr

func (e HashesEntryEdges) ExternalReferencesOrErr() (*ExternalReference, error)

ExternalReferencesOrErr returns the ExternalReferences value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

func (HashesEntryEdges) NodesOrErr

func (e HashesEntryEdges) NodesOrErr() (*Node, error)

NodesOrErr returns the Nodes value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

type HashesEntryGroupBy

type HashesEntryGroupBy struct {
	// contains filtered or unexported fields
}

HashesEntryGroupBy is the group-by builder for HashesEntry entities.

func (*HashesEntryGroupBy) Aggregate

func (hegb *HashesEntryGroupBy) Aggregate(fns ...AggregateFunc) *HashesEntryGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*HashesEntryGroupBy) Bool

func (s *HashesEntryGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*HashesEntryGroupBy) BoolX

func (s *HashesEntryGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*HashesEntryGroupBy) Bools

func (s *HashesEntryGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*HashesEntryGroupBy) BoolsX

func (s *HashesEntryGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*HashesEntryGroupBy) Float64

func (s *HashesEntryGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*HashesEntryGroupBy) Float64X

func (s *HashesEntryGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*HashesEntryGroupBy) Float64s

func (s *HashesEntryGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*HashesEntryGroupBy) Float64sX

func (s *HashesEntryGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*HashesEntryGroupBy) Int

func (s *HashesEntryGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*HashesEntryGroupBy) IntX

func (s *HashesEntryGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*HashesEntryGroupBy) Ints

func (s *HashesEntryGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*HashesEntryGroupBy) IntsX

func (s *HashesEntryGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*HashesEntryGroupBy) Scan

func (hegb *HashesEntryGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*HashesEntryGroupBy) ScanX

func (s *HashesEntryGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*HashesEntryGroupBy) String

func (s *HashesEntryGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*HashesEntryGroupBy) StringX

func (s *HashesEntryGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*HashesEntryGroupBy) Strings

func (s *HashesEntryGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*HashesEntryGroupBy) StringsX

func (s *HashesEntryGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type HashesEntryMutation

type HashesEntryMutation struct {
	// contains filtered or unexported fields
}

HashesEntryMutation represents an operation that mutates the HashesEntry nodes in the graph.

func (*HashesEntryMutation) AddField

func (m *HashesEntryMutation) 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 (*HashesEntryMutation) AddedEdges

func (m *HashesEntryMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*HashesEntryMutation) AddedField

func (m *HashesEntryMutation) 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 (*HashesEntryMutation) AddedFields

func (m *HashesEntryMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*HashesEntryMutation) AddedIDs

func (m *HashesEntryMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*HashesEntryMutation) ClearEdge

func (m *HashesEntryMutation) 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 (*HashesEntryMutation) ClearExternalReferences

func (m *HashesEntryMutation) ClearExternalReferences()

ClearExternalReferences clears the "external_references" edge to the ExternalReference entity.

func (*HashesEntryMutation) ClearField

func (m *HashesEntryMutation) 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 (*HashesEntryMutation) ClearNodes

func (m *HashesEntryMutation) ClearNodes()

ClearNodes clears the "nodes" edge to the Node entity.

func (*HashesEntryMutation) ClearedEdges

func (m *HashesEntryMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*HashesEntryMutation) ClearedFields

func (m *HashesEntryMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (HashesEntryMutation) Client

func (m HashesEntryMutation) 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 (*HashesEntryMutation) EdgeCleared

func (m *HashesEntryMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*HashesEntryMutation) ExternalReferencesCleared

func (m *HashesEntryMutation) ExternalReferencesCleared() bool

ExternalReferencesCleared reports if the "external_references" edge to the ExternalReference entity was cleared.

func (*HashesEntryMutation) ExternalReferencesID

func (m *HashesEntryMutation) ExternalReferencesID() (id int, exists bool)

ExternalReferencesID returns the "external_references" edge ID in the mutation.

func (*HashesEntryMutation) ExternalReferencesIDs

func (m *HashesEntryMutation) ExternalReferencesIDs() (ids []int)

ExternalReferencesIDs returns the "external_references" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use ExternalReferencesID instead. It exists only for internal usage by the builders.

func (*HashesEntryMutation) Field

func (m *HashesEntryMutation) 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 (*HashesEntryMutation) FieldCleared

func (m *HashesEntryMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*HashesEntryMutation) Fields

func (m *HashesEntryMutation) 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 (*HashesEntryMutation) HashAlgorithmType

func (m *HashesEntryMutation) HashAlgorithmType() (r hashesentry.HashAlgorithmType, exists bool)

HashAlgorithmType returns the value of the "hash_algorithm_type" field in the mutation.

func (*HashesEntryMutation) HashData

func (m *HashesEntryMutation) HashData() (r string, exists bool)

HashData returns the value of the "hash_data" field in the mutation.

func (*HashesEntryMutation) ID

func (m *HashesEntryMutation) ID() (id int, exists bool)

ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.

func (*HashesEntryMutation) IDs

func (m *HashesEntryMutation) IDs(ctx context.Context) ([]int, error)

IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.

func (*HashesEntryMutation) NodesCleared

func (m *HashesEntryMutation) NodesCleared() bool

NodesCleared reports if the "nodes" edge to the Node entity was cleared.

func (*HashesEntryMutation) NodesID

func (m *HashesEntryMutation) NodesID() (id string, exists bool)

NodesID returns the "nodes" edge ID in the mutation.

func (*HashesEntryMutation) NodesIDs

func (m *HashesEntryMutation) NodesIDs() (ids []string)

NodesIDs returns the "nodes" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use NodesID instead. It exists only for internal usage by the builders.

func (*HashesEntryMutation) OldField

func (m *HashesEntryMutation) 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 (*HashesEntryMutation) OldHashAlgorithmType

func (m *HashesEntryMutation) OldHashAlgorithmType(ctx context.Context) (v hashesentry.HashAlgorithmType, err error)

OldHashAlgorithmType returns the old "hash_algorithm_type" field's value of the HashesEntry entity. If the HashesEntry 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 (*HashesEntryMutation) OldHashData

func (m *HashesEntryMutation) OldHashData(ctx context.Context) (v string, err error)

OldHashData returns the old "hash_data" field's value of the HashesEntry entity. If the HashesEntry 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 (*HashesEntryMutation) Op

func (m *HashesEntryMutation) Op() Op

Op returns the operation name.

func (*HashesEntryMutation) RemovedEdges

func (m *HashesEntryMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*HashesEntryMutation) RemovedIDs

func (m *HashesEntryMutation) 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 (*HashesEntryMutation) ResetEdge

func (m *HashesEntryMutation) 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 (*HashesEntryMutation) ResetExternalReferences

func (m *HashesEntryMutation) ResetExternalReferences()

ResetExternalReferences resets all changes to the "external_references" edge.

func (*HashesEntryMutation) ResetField

func (m *HashesEntryMutation) 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 (*HashesEntryMutation) ResetHashAlgorithmType

func (m *HashesEntryMutation) ResetHashAlgorithmType()

ResetHashAlgorithmType resets all changes to the "hash_algorithm_type" field.

func (*HashesEntryMutation) ResetHashData

func (m *HashesEntryMutation) ResetHashData()

ResetHashData resets all changes to the "hash_data" field.

func (*HashesEntryMutation) ResetNodes

func (m *HashesEntryMutation) ResetNodes()

ResetNodes resets all changes to the "nodes" edge.

func (*HashesEntryMutation) SetExternalReferencesID

func (m *HashesEntryMutation) SetExternalReferencesID(id int)

SetExternalReferencesID sets the "external_references" edge to the ExternalReference entity by id.

func (*HashesEntryMutation) SetField

func (m *HashesEntryMutation) 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 (*HashesEntryMutation) SetHashAlgorithmType

func (m *HashesEntryMutation) SetHashAlgorithmType(hat hashesentry.HashAlgorithmType)

SetHashAlgorithmType sets the "hash_algorithm_type" field.

func (*HashesEntryMutation) SetHashData

func (m *HashesEntryMutation) SetHashData(s string)

SetHashData sets the "hash_data" field.

func (*HashesEntryMutation) SetNodesID

func (m *HashesEntryMutation) SetNodesID(id string)

SetNodesID sets the "nodes" edge to the Node entity by id.

func (*HashesEntryMutation) SetOp

func (m *HashesEntryMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (HashesEntryMutation) Tx

func (m HashesEntryMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*HashesEntryMutation) Type

func (m *HashesEntryMutation) Type() string

Type returns the node type of this mutation (HashesEntry).

func (*HashesEntryMutation) Where

func (m *HashesEntryMutation) Where(ps ...predicate.HashesEntry)

Where appends a list predicates to the HashesEntryMutation builder.

func (*HashesEntryMutation) WhereP

func (m *HashesEntryMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the HashesEntryMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type HashesEntryQuery

type HashesEntryQuery struct {
	// contains filtered or unexported fields
}

HashesEntryQuery is the builder for querying HashesEntry entities.

func (*HashesEntryQuery) Aggregate

func (heq *HashesEntryQuery) Aggregate(fns ...AggregateFunc) *HashesEntrySelect

Aggregate returns a HashesEntrySelect configured with the given aggregations.

func (*HashesEntryQuery) All

func (heq *HashesEntryQuery) All(ctx context.Context) ([]*HashesEntry, error)

All executes the query and returns a list of HashesEntries.

func (*HashesEntryQuery) AllX

func (heq *HashesEntryQuery) AllX(ctx context.Context) []*HashesEntry

AllX is like All, but panics if an error occurs.

func (*HashesEntryQuery) Clone

func (heq *HashesEntryQuery) Clone() *HashesEntryQuery

Clone returns a duplicate of the HashesEntryQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*HashesEntryQuery) Count

func (heq *HashesEntryQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*HashesEntryQuery) CountX

func (heq *HashesEntryQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*HashesEntryQuery) Exist

func (heq *HashesEntryQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*HashesEntryQuery) ExistX

func (heq *HashesEntryQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*HashesEntryQuery) First

func (heq *HashesEntryQuery) First(ctx context.Context) (*HashesEntry, error)

First returns the first HashesEntry entity from the query. Returns a *NotFoundError when no HashesEntry was found.

func (*HashesEntryQuery) FirstID

func (heq *HashesEntryQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first HashesEntry ID from the query. Returns a *NotFoundError when no HashesEntry ID was found.

func (*HashesEntryQuery) FirstIDX

func (heq *HashesEntryQuery) FirstIDX(ctx context.Context) int

FirstIDX is like FirstID, but panics if an error occurs.

func (*HashesEntryQuery) FirstX

func (heq *HashesEntryQuery) FirstX(ctx context.Context) *HashesEntry

FirstX is like First, but panics if an error occurs.

func (*HashesEntryQuery) GroupBy

func (heq *HashesEntryQuery) GroupBy(field string, fields ...string) *HashesEntryGroupBy

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 {
	HashAlgorithmType hashesentry.HashAlgorithmType `json:"hash_algorithm_type,omitempty"`
	Count int `json:"count,omitempty"`
}

client.HashesEntry.Query().
	GroupBy(hashesentry.FieldHashAlgorithmType).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*HashesEntryQuery) IDs

func (heq *HashesEntryQuery) IDs(ctx context.Context) (ids []int, err error)

IDs executes the query and returns a list of HashesEntry IDs.

func (*HashesEntryQuery) IDsX

func (heq *HashesEntryQuery) IDsX(ctx context.Context) []int

IDsX is like IDs, but panics if an error occurs.

func (*HashesEntryQuery) Limit

func (heq *HashesEntryQuery) Limit(limit int) *HashesEntryQuery

Limit the number of records to be returned by this query.

func (*HashesEntryQuery) Offset

func (heq *HashesEntryQuery) Offset(offset int) *HashesEntryQuery

Offset to start from.

func (*HashesEntryQuery) Only

func (heq *HashesEntryQuery) Only(ctx context.Context) (*HashesEntry, error)

Only returns a single HashesEntry entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one HashesEntry entity is found. Returns a *NotFoundError when no HashesEntry entities are found.

func (*HashesEntryQuery) OnlyID

func (heq *HashesEntryQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID is like Only, but returns the only HashesEntry ID in the query. Returns a *NotSingularError when more than one HashesEntry ID is found. Returns a *NotFoundError when no entities are found.

func (*HashesEntryQuery) OnlyIDX

func (heq *HashesEntryQuery) OnlyIDX(ctx context.Context) int

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*HashesEntryQuery) OnlyX

func (heq *HashesEntryQuery) OnlyX(ctx context.Context) *HashesEntry

OnlyX is like Only, but panics if an error occurs.

func (*HashesEntryQuery) Order

Order specifies how the records should be ordered.

func (*HashesEntryQuery) QueryExternalReferences

func (heq *HashesEntryQuery) QueryExternalReferences() *ExternalReferenceQuery

QueryExternalReferences chains the current query on the "external_references" edge.

func (*HashesEntryQuery) QueryNodes

func (heq *HashesEntryQuery) QueryNodes() *NodeQuery

QueryNodes chains the current query on the "nodes" edge.

func (*HashesEntryQuery) Select

func (heq *HashesEntryQuery) Select(fields ...string) *HashesEntrySelect

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 {
	HashAlgorithmType hashesentry.HashAlgorithmType `json:"hash_algorithm_type,omitempty"`
}

client.HashesEntry.Query().
	Select(hashesentry.FieldHashAlgorithmType).
	Scan(ctx, &v)

func (*HashesEntryQuery) Unique

func (heq *HashesEntryQuery) Unique(unique bool) *HashesEntryQuery

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 (*HashesEntryQuery) Where

Where adds a new predicate for the HashesEntryQuery builder.

func (*HashesEntryQuery) WithExternalReferences

func (heq *HashesEntryQuery) WithExternalReferences(opts ...func(*ExternalReferenceQuery)) *HashesEntryQuery

WithExternalReferences tells the query-builder to eager-load the nodes that are connected to the "external_references" edge. The optional arguments are used to configure the query builder of the edge.

func (*HashesEntryQuery) WithNodes

func (heq *HashesEntryQuery) WithNodes(opts ...func(*NodeQuery)) *HashesEntryQuery

WithNodes tells the query-builder to eager-load the nodes that are connected to the "nodes" edge. The optional arguments are used to configure the query builder of the edge.

type HashesEntrySelect

type HashesEntrySelect struct {
	*HashesEntryQuery
	// contains filtered or unexported fields
}

HashesEntrySelect is the builder for selecting fields of HashesEntry entities.

func (*HashesEntrySelect) Aggregate

func (hes *HashesEntrySelect) Aggregate(fns ...AggregateFunc) *HashesEntrySelect

Aggregate adds the given aggregation functions to the selector query.

func (*HashesEntrySelect) Bool

func (s *HashesEntrySelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*HashesEntrySelect) BoolX

func (s *HashesEntrySelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*HashesEntrySelect) Bools

func (s *HashesEntrySelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*HashesEntrySelect) BoolsX

func (s *HashesEntrySelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*HashesEntrySelect) Float64

func (s *HashesEntrySelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*HashesEntrySelect) Float64X

func (s *HashesEntrySelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*HashesEntrySelect) Float64s

func (s *HashesEntrySelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*HashesEntrySelect) Float64sX

func (s *HashesEntrySelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*HashesEntrySelect) Int

func (s *HashesEntrySelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*HashesEntrySelect) IntX

func (s *HashesEntrySelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*HashesEntrySelect) Ints

func (s *HashesEntrySelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*HashesEntrySelect) IntsX

func (s *HashesEntrySelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*HashesEntrySelect) Scan

func (hes *HashesEntrySelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*HashesEntrySelect) ScanX

func (s *HashesEntrySelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*HashesEntrySelect) String

func (s *HashesEntrySelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*HashesEntrySelect) StringX

func (s *HashesEntrySelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*HashesEntrySelect) Strings

func (s *HashesEntrySelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*HashesEntrySelect) StringsX

func (s *HashesEntrySelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type HashesEntryUpdate

type HashesEntryUpdate struct {
	// contains filtered or unexported fields
}

HashesEntryUpdate is the builder for updating HashesEntry entities.

func (*HashesEntryUpdate) ClearExternalReferences

func (heu *HashesEntryUpdate) ClearExternalReferences() *HashesEntryUpdate

ClearExternalReferences clears the "external_references" edge to the ExternalReference entity.

func (*HashesEntryUpdate) ClearNodes

func (heu *HashesEntryUpdate) ClearNodes() *HashesEntryUpdate

ClearNodes clears the "nodes" edge to the Node entity.

func (*HashesEntryUpdate) Exec

func (heu *HashesEntryUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*HashesEntryUpdate) ExecX

func (heu *HashesEntryUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*HashesEntryUpdate) Mutation

func (heu *HashesEntryUpdate) Mutation() *HashesEntryMutation

Mutation returns the HashesEntryMutation object of the builder.

func (*HashesEntryUpdate) Save

func (heu *HashesEntryUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*HashesEntryUpdate) SaveX

func (heu *HashesEntryUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*HashesEntryUpdate) SetExternalReferences

func (heu *HashesEntryUpdate) SetExternalReferences(e *ExternalReference) *HashesEntryUpdate

SetExternalReferences sets the "external_references" edge to the ExternalReference entity.

func (*HashesEntryUpdate) SetExternalReferencesID

func (heu *HashesEntryUpdate) SetExternalReferencesID(id int) *HashesEntryUpdate

SetExternalReferencesID sets the "external_references" edge to the ExternalReference entity by ID.

func (*HashesEntryUpdate) SetHashAlgorithmType

func (heu *HashesEntryUpdate) SetHashAlgorithmType(hat hashesentry.HashAlgorithmType) *HashesEntryUpdate

SetHashAlgorithmType sets the "hash_algorithm_type" field.

func (*HashesEntryUpdate) SetHashData

func (heu *HashesEntryUpdate) SetHashData(s string) *HashesEntryUpdate

SetHashData sets the "hash_data" field.

func (*HashesEntryUpdate) SetNillableExternalReferencesID

func (heu *HashesEntryUpdate) SetNillableExternalReferencesID(id *int) *HashesEntryUpdate

SetNillableExternalReferencesID sets the "external_references" edge to the ExternalReference entity by ID if the given value is not nil.

func (*HashesEntryUpdate) SetNillableHashAlgorithmType

func (heu *HashesEntryUpdate) SetNillableHashAlgorithmType(hat *hashesentry.HashAlgorithmType) *HashesEntryUpdate

SetNillableHashAlgorithmType sets the "hash_algorithm_type" field if the given value is not nil.

func (*HashesEntryUpdate) SetNillableHashData

func (heu *HashesEntryUpdate) SetNillableHashData(s *string) *HashesEntryUpdate

SetNillableHashData sets the "hash_data" field if the given value is not nil.

func (*HashesEntryUpdate) SetNillableNodesID

func (heu *HashesEntryUpdate) SetNillableNodesID(id *string) *HashesEntryUpdate

SetNillableNodesID sets the "nodes" edge to the Node entity by ID if the given value is not nil.

func (*HashesEntryUpdate) SetNodes

func (heu *HashesEntryUpdate) SetNodes(n *Node) *HashesEntryUpdate

SetNodes sets the "nodes" edge to the Node entity.

func (*HashesEntryUpdate) SetNodesID

func (heu *HashesEntryUpdate) SetNodesID(id string) *HashesEntryUpdate

SetNodesID sets the "nodes" edge to the Node entity by ID.

func (*HashesEntryUpdate) Where

Where appends a list predicates to the HashesEntryUpdate builder.

type HashesEntryUpdateOne

type HashesEntryUpdateOne struct {
	// contains filtered or unexported fields
}

HashesEntryUpdateOne is the builder for updating a single HashesEntry entity.

func (*HashesEntryUpdateOne) ClearExternalReferences

func (heuo *HashesEntryUpdateOne) ClearExternalReferences() *HashesEntryUpdateOne

ClearExternalReferences clears the "external_references" edge to the ExternalReference entity.

func (*HashesEntryUpdateOne) ClearNodes

func (heuo *HashesEntryUpdateOne) ClearNodes() *HashesEntryUpdateOne

ClearNodes clears the "nodes" edge to the Node entity.

func (*HashesEntryUpdateOne) Exec

func (heuo *HashesEntryUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*HashesEntryUpdateOne) ExecX

func (heuo *HashesEntryUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*HashesEntryUpdateOne) Mutation

func (heuo *HashesEntryUpdateOne) Mutation() *HashesEntryMutation

Mutation returns the HashesEntryMutation object of the builder.

func (*HashesEntryUpdateOne) Save

Save executes the query and returns the updated HashesEntry entity.

func (*HashesEntryUpdateOne) SaveX

func (heuo *HashesEntryUpdateOne) SaveX(ctx context.Context) *HashesEntry

SaveX is like Save, but panics if an error occurs.

func (*HashesEntryUpdateOne) Select

func (heuo *HashesEntryUpdateOne) Select(field string, fields ...string) *HashesEntryUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*HashesEntryUpdateOne) SetExternalReferences

func (heuo *HashesEntryUpdateOne) SetExternalReferences(e *ExternalReference) *HashesEntryUpdateOne

SetExternalReferences sets the "external_references" edge to the ExternalReference entity.

func (*HashesEntryUpdateOne) SetExternalReferencesID

func (heuo *HashesEntryUpdateOne) SetExternalReferencesID(id int) *HashesEntryUpdateOne

SetExternalReferencesID sets the "external_references" edge to the ExternalReference entity by ID.

func (*HashesEntryUpdateOne) SetHashAlgorithmType

SetHashAlgorithmType sets the "hash_algorithm_type" field.

func (*HashesEntryUpdateOne) SetHashData

func (heuo *HashesEntryUpdateOne) SetHashData(s string) *HashesEntryUpdateOne

SetHashData sets the "hash_data" field.

func (*HashesEntryUpdateOne) SetNillableExternalReferencesID

func (heuo *HashesEntryUpdateOne) SetNillableExternalReferencesID(id *int) *HashesEntryUpdateOne

SetNillableExternalReferencesID sets the "external_references" edge to the ExternalReference entity by ID if the given value is not nil.

func (*HashesEntryUpdateOne) SetNillableHashAlgorithmType

func (heuo *HashesEntryUpdateOne) SetNillableHashAlgorithmType(hat *hashesentry.HashAlgorithmType) *HashesEntryUpdateOne

SetNillableHashAlgorithmType sets the "hash_algorithm_type" field if the given value is not nil.

func (*HashesEntryUpdateOne) SetNillableHashData

func (heuo *HashesEntryUpdateOne) SetNillableHashData(s *string) *HashesEntryUpdateOne

SetNillableHashData sets the "hash_data" field if the given value is not nil.

func (*HashesEntryUpdateOne) SetNillableNodesID

func (heuo *HashesEntryUpdateOne) SetNillableNodesID(id *string) *HashesEntryUpdateOne

SetNillableNodesID sets the "nodes" edge to the Node entity by ID if the given value is not nil.

func (*HashesEntryUpdateOne) SetNodes

func (heuo *HashesEntryUpdateOne) SetNodes(n *Node) *HashesEntryUpdateOne

SetNodes sets the "nodes" edge to the Node entity.

func (*HashesEntryUpdateOne) SetNodesID

func (heuo *HashesEntryUpdateOne) SetNodesID(id string) *HashesEntryUpdateOne

SetNodesID sets the "nodes" edge to the Node entity by ID.

func (*HashesEntryUpdateOne) Where

Where appends a list predicates to the HashesEntryUpdate builder.

type HashesEntryUpsert

type HashesEntryUpsert struct {
	*sql.UpdateSet
}

HashesEntryUpsert is the "OnConflict" setter.

func (*HashesEntryUpsert) SetHashAlgorithmType

SetHashAlgorithmType sets the "hash_algorithm_type" field.

func (*HashesEntryUpsert) SetHashData

func (u *HashesEntryUpsert) SetHashData(v string) *HashesEntryUpsert

SetHashData sets the "hash_data" field.

func (*HashesEntryUpsert) UpdateHashAlgorithmType

func (u *HashesEntryUpsert) UpdateHashAlgorithmType() *HashesEntryUpsert

UpdateHashAlgorithmType sets the "hash_algorithm_type" field to the value that was provided on create.

func (*HashesEntryUpsert) UpdateHashData

func (u *HashesEntryUpsert) UpdateHashData() *HashesEntryUpsert

UpdateHashData sets the "hash_data" field to the value that was provided on create.

type HashesEntryUpsertBulk

type HashesEntryUpsertBulk struct {
	// contains filtered or unexported fields
}

HashesEntryUpsertBulk is the builder for "upsert"-ing a bulk of HashesEntry nodes.

func (*HashesEntryUpsertBulk) DoNothing

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*HashesEntryUpsertBulk) Exec

Exec executes the query.

func (*HashesEntryUpsertBulk) ExecX

func (u *HashesEntryUpsertBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*HashesEntryUpsertBulk) Ignore

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.HashesEntry.Create().
	OnConflict(sql.ResolveWithIgnore()).
	Exec(ctx)

func (*HashesEntryUpsertBulk) SetHashAlgorithmType

SetHashAlgorithmType sets the "hash_algorithm_type" field.

func (*HashesEntryUpsertBulk) SetHashData

SetHashData sets the "hash_data" field.

func (*HashesEntryUpsertBulk) Update

Update allows overriding fields `UPDATE` values. See the HashesEntryCreateBulk.OnConflict documentation for more info.

func (*HashesEntryUpsertBulk) UpdateHashAlgorithmType

func (u *HashesEntryUpsertBulk) UpdateHashAlgorithmType() *HashesEntryUpsertBulk

UpdateHashAlgorithmType sets the "hash_algorithm_type" field to the value that was provided on create.

func (*HashesEntryUpsertBulk) UpdateHashData

func (u *HashesEntryUpsertBulk) UpdateHashData() *HashesEntryUpsertBulk

UpdateHashData sets the "hash_data" field to the value that was provided on create.

func (*HashesEntryUpsertBulk) UpdateNewValues

func (u *HashesEntryUpsertBulk) UpdateNewValues() *HashesEntryUpsertBulk

UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:

client.HashesEntry.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
	).
	Exec(ctx)

type HashesEntryUpsertOne

type HashesEntryUpsertOne struct {
	// contains filtered or unexported fields
}

HashesEntryUpsertOne is the builder for "upsert"-ing

one HashesEntry node.

func (*HashesEntryUpsertOne) DoNothing

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*HashesEntryUpsertOne) Exec

Exec executes the query.

func (*HashesEntryUpsertOne) ExecX

func (u *HashesEntryUpsertOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*HashesEntryUpsertOne) ID

func (u *HashesEntryUpsertOne) ID(ctx context.Context) (id int, err error)

Exec executes the UPSERT query and returns the inserted/updated ID.

func (*HashesEntryUpsertOne) IDX

IDX is like ID, but panics if an error occurs.

func (*HashesEntryUpsertOne) Ignore

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.HashesEntry.Create().
    OnConflict(sql.ResolveWithIgnore()).
    Exec(ctx)

func (*HashesEntryUpsertOne) SetHashAlgorithmType

SetHashAlgorithmType sets the "hash_algorithm_type" field.

func (*HashesEntryUpsertOne) SetHashData

SetHashData sets the "hash_data" field.

func (*HashesEntryUpsertOne) Update

Update allows overriding fields `UPDATE` values. See the HashesEntryCreate.OnConflict documentation for more info.

func (*HashesEntryUpsertOne) UpdateHashAlgorithmType

func (u *HashesEntryUpsertOne) UpdateHashAlgorithmType() *HashesEntryUpsertOne

UpdateHashAlgorithmType sets the "hash_algorithm_type" field to the value that was provided on create.

func (*HashesEntryUpsertOne) UpdateHashData

func (u *HashesEntryUpsertOne) UpdateHashData() *HashesEntryUpsertOne

UpdateHashData sets the "hash_data" field to the value that was provided on create.

func (*HashesEntryUpsertOne) UpdateNewValues

func (u *HashesEntryUpsertOne) UpdateNewValues() *HashesEntryUpsertOne

UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:

client.HashesEntry.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
	).
	Exec(ctx)

type Hook

type Hook = ent.Hook

ent aliases to avoid import conflicts in user's code.

type IdentifiersEntries

type IdentifiersEntries []*IdentifiersEntry

IdentifiersEntries is a parsable slice of IdentifiersEntry.

type IdentifiersEntry

type IdentifiersEntry struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// SoftwareIdentifierType holds the value of the "software_identifier_type" field.
	SoftwareIdentifierType identifiersentry.SoftwareIdentifierType `json:"software_identifier_type,omitempty"`
	// SoftwareIdentifierValue holds the value of the "software_identifier_value" field.
	SoftwareIdentifierValue string `json:"software_identifier_value,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the IdentifiersEntryQuery when eager-loading is set.
	Edges IdentifiersEntryEdges `json:"edges"`
	// contains filtered or unexported fields
}

IdentifiersEntry is the model entity for the IdentifiersEntry schema.

func (*IdentifiersEntry) QueryNodes

func (ie *IdentifiersEntry) QueryNodes() *NodeQuery

QueryNodes queries the "nodes" edge of the IdentifiersEntry entity.

func (*IdentifiersEntry) String

func (ie *IdentifiersEntry) String() string

String implements the fmt.Stringer.

func (*IdentifiersEntry) Unwrap

func (ie *IdentifiersEntry) Unwrap() *IdentifiersEntry

Unwrap unwraps the IdentifiersEntry 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 (*IdentifiersEntry) Update

Update returns a builder for updating this IdentifiersEntry. Note that you need to call IdentifiersEntry.Unwrap() before calling this method if this IdentifiersEntry was returned from a transaction, and the transaction was committed or rolled back.

func (*IdentifiersEntry) Value

func (ie *IdentifiersEntry) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the IdentifiersEntry. This includes values selected through modifiers, order, etc.

type IdentifiersEntryClient

type IdentifiersEntryClient struct {
	// contains filtered or unexported fields
}

IdentifiersEntryClient is a client for the IdentifiersEntry schema.

func NewIdentifiersEntryClient

func NewIdentifiersEntryClient(c config) *IdentifiersEntryClient

NewIdentifiersEntryClient returns a client for the IdentifiersEntry from the given config.

func (*IdentifiersEntryClient) Create

Create returns a builder for creating a IdentifiersEntry entity.

func (*IdentifiersEntryClient) CreateBulk

CreateBulk returns a builder for creating a bulk of IdentifiersEntry entities.

func (*IdentifiersEntryClient) Delete

Delete returns a delete builder for IdentifiersEntry.

func (*IdentifiersEntryClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*IdentifiersEntryClient) DeleteOneID

DeleteOneID returns a builder for deleting the given entity by its id.

func (*IdentifiersEntryClient) Get

Get returns a IdentifiersEntry entity by its id.

func (*IdentifiersEntryClient) GetX

GetX is like Get, but panics if an error occurs.

func (*IdentifiersEntryClient) Hooks

func (c *IdentifiersEntryClient) Hooks() []Hook

Hooks returns the client hooks.

func (*IdentifiersEntryClient) Intercept

func (c *IdentifiersEntryClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `identifiersentry.Intercept(f(g(h())))`.

func (*IdentifiersEntryClient) Interceptors

func (c *IdentifiersEntryClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*IdentifiersEntryClient) MapCreateBulk

func (c *IdentifiersEntryClient) MapCreateBulk(slice any, setFunc func(*IdentifiersEntryCreate, int)) *IdentifiersEntryCreateBulk

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 (*IdentifiersEntryClient) Query

Query returns a query builder for IdentifiersEntry.

func (*IdentifiersEntryClient) QueryNodes

QueryNodes queries the nodes edge of a IdentifiersEntry.

func (*IdentifiersEntryClient) Update

Update returns an update builder for IdentifiersEntry.

func (*IdentifiersEntryClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*IdentifiersEntryClient) UpdateOneID

UpdateOneID returns an update builder for the given id.

func (*IdentifiersEntryClient) Use

func (c *IdentifiersEntryClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `identifiersentry.Hooks(f(g(h())))`.

type IdentifiersEntryCreate

type IdentifiersEntryCreate struct {
	// contains filtered or unexported fields
}

IdentifiersEntryCreate is the builder for creating a IdentifiersEntry entity.

func (*IdentifiersEntryCreate) Exec

Exec executes the query.

func (*IdentifiersEntryCreate) ExecX

func (iec *IdentifiersEntryCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*IdentifiersEntryCreate) Mutation

Mutation returns the IdentifiersEntryMutation object of the builder.

func (*IdentifiersEntryCreate) OnConflict

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.IdentifiersEntry.Create().
	SetSoftwareIdentifierType(v).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.IdentifiersEntryUpsert) {
		SetSoftwareIdentifierType(v+v).
	}).
	Exec(ctx)

func (*IdentifiersEntryCreate) OnConflictColumns

func (iec *IdentifiersEntryCreate) OnConflictColumns(columns ...string) *IdentifiersEntryUpsertOne

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.IdentifiersEntry.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*IdentifiersEntryCreate) Save

Save creates the IdentifiersEntry in the database.

func (*IdentifiersEntryCreate) SaveX

SaveX calls Save and panics if Save returns an error.

func (*IdentifiersEntryCreate) SetNillableNodesID

func (iec *IdentifiersEntryCreate) SetNillableNodesID(id *string) *IdentifiersEntryCreate

SetNillableNodesID sets the "nodes" edge to the Node entity by ID if the given value is not nil.

func (*IdentifiersEntryCreate) SetNodes

SetNodes sets the "nodes" edge to the Node entity.

func (*IdentifiersEntryCreate) SetNodesID

SetNodesID sets the "nodes" edge to the Node entity by ID.

func (*IdentifiersEntryCreate) SetSoftwareIdentifierType

SetSoftwareIdentifierType sets the "software_identifier_type" field.

func (*IdentifiersEntryCreate) SetSoftwareIdentifierValue

func (iec *IdentifiersEntryCreate) SetSoftwareIdentifierValue(s string) *IdentifiersEntryCreate

SetSoftwareIdentifierValue sets the "software_identifier_value" field.

type IdentifiersEntryCreateBulk

type IdentifiersEntryCreateBulk struct {
	// contains filtered or unexported fields
}

IdentifiersEntryCreateBulk is the builder for creating many IdentifiersEntry entities in bulk.

func (*IdentifiersEntryCreateBulk) Exec

Exec executes the query.

func (*IdentifiersEntryCreateBulk) ExecX

func (iecb *IdentifiersEntryCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*IdentifiersEntryCreateBulk) OnConflict

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.IdentifiersEntry.CreateBulk(builders...).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.IdentifiersEntryUpsert) {
		SetSoftwareIdentifierType(v+v).
	}).
	Exec(ctx)

func (*IdentifiersEntryCreateBulk) OnConflictColumns

func (iecb *IdentifiersEntryCreateBulk) OnConflictColumns(columns ...string) *IdentifiersEntryUpsertBulk

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.IdentifiersEntry.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*IdentifiersEntryCreateBulk) Save

Save creates the IdentifiersEntry entities in the database.

func (*IdentifiersEntryCreateBulk) SaveX

SaveX is like Save, but panics if an error occurs.

type IdentifiersEntryDelete

type IdentifiersEntryDelete struct {
	// contains filtered or unexported fields
}

IdentifiersEntryDelete is the builder for deleting a IdentifiersEntry entity.

func (*IdentifiersEntryDelete) Exec

func (ied *IdentifiersEntryDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*IdentifiersEntryDelete) ExecX

func (ied *IdentifiersEntryDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*IdentifiersEntryDelete) Where

Where appends a list predicates to the IdentifiersEntryDelete builder.

type IdentifiersEntryDeleteOne

type IdentifiersEntryDeleteOne struct {
	// contains filtered or unexported fields
}

IdentifiersEntryDeleteOne is the builder for deleting a single IdentifiersEntry entity.

func (*IdentifiersEntryDeleteOne) Exec

Exec executes the deletion query.

func (*IdentifiersEntryDeleteOne) ExecX

func (iedo *IdentifiersEntryDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*IdentifiersEntryDeleteOne) Where

Where appends a list predicates to the IdentifiersEntryDelete builder.

type IdentifiersEntryEdges

type IdentifiersEntryEdges struct {
	// Nodes holds the value of the nodes edge.
	Nodes *Node `json:"nodes,omitempty"`
	// contains filtered or unexported fields
}

IdentifiersEntryEdges holds the relations/edges for other nodes in the graph.

func (IdentifiersEntryEdges) NodesOrErr

func (e IdentifiersEntryEdges) NodesOrErr() (*Node, error)

NodesOrErr returns the Nodes value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

type IdentifiersEntryGroupBy

type IdentifiersEntryGroupBy struct {
	// contains filtered or unexported fields
}

IdentifiersEntryGroupBy is the group-by builder for IdentifiersEntry entities.

func (*IdentifiersEntryGroupBy) Aggregate

Aggregate adds the given aggregation functions to the group-by query.

func (*IdentifiersEntryGroupBy) Bool

func (s *IdentifiersEntryGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*IdentifiersEntryGroupBy) BoolX

func (s *IdentifiersEntryGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*IdentifiersEntryGroupBy) Bools

func (s *IdentifiersEntryGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*IdentifiersEntryGroupBy) BoolsX

func (s *IdentifiersEntryGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*IdentifiersEntryGroupBy) Float64

func (s *IdentifiersEntryGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*IdentifiersEntryGroupBy) Float64X

func (s *IdentifiersEntryGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*IdentifiersEntryGroupBy) Float64s

func (s *IdentifiersEntryGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*IdentifiersEntryGroupBy) Float64sX

func (s *IdentifiersEntryGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*IdentifiersEntryGroupBy) Int

func (s *IdentifiersEntryGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*IdentifiersEntryGroupBy) IntX

func (s *IdentifiersEntryGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*IdentifiersEntryGroupBy) Ints

func (s *IdentifiersEntryGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*IdentifiersEntryGroupBy) IntsX

func (s *IdentifiersEntryGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*IdentifiersEntryGroupBy) Scan

func (iegb *IdentifiersEntryGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*IdentifiersEntryGroupBy) ScanX

func (s *IdentifiersEntryGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*IdentifiersEntryGroupBy) String

func (s *IdentifiersEntryGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*IdentifiersEntryGroupBy) StringX

func (s *IdentifiersEntryGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*IdentifiersEntryGroupBy) Strings

func (s *IdentifiersEntryGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*IdentifiersEntryGroupBy) StringsX

func (s *IdentifiersEntryGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type IdentifiersEntryMutation

type IdentifiersEntryMutation struct {
	// contains filtered or unexported fields
}

IdentifiersEntryMutation represents an operation that mutates the IdentifiersEntry nodes in the graph.

func (*IdentifiersEntryMutation) AddField

func (m *IdentifiersEntryMutation) 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 (*IdentifiersEntryMutation) AddedEdges

func (m *IdentifiersEntryMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*IdentifiersEntryMutation) AddedField

func (m *IdentifiersEntryMutation) 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 (*IdentifiersEntryMutation) AddedFields

func (m *IdentifiersEntryMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*IdentifiersEntryMutation) AddedIDs

func (m *IdentifiersEntryMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*IdentifiersEntryMutation) ClearEdge

func (m *IdentifiersEntryMutation) 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 (*IdentifiersEntryMutation) ClearField

func (m *IdentifiersEntryMutation) 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 (*IdentifiersEntryMutation) ClearNodes

func (m *IdentifiersEntryMutation) ClearNodes()

ClearNodes clears the "nodes" edge to the Node entity.

func (*IdentifiersEntryMutation) ClearedEdges

func (m *IdentifiersEntryMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*IdentifiersEntryMutation) ClearedFields

func (m *IdentifiersEntryMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (IdentifiersEntryMutation) Client

func (m IdentifiersEntryMutation) 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 (*IdentifiersEntryMutation) EdgeCleared

func (m *IdentifiersEntryMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*IdentifiersEntryMutation) Field

func (m *IdentifiersEntryMutation) 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 (*IdentifiersEntryMutation) FieldCleared

func (m *IdentifiersEntryMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*IdentifiersEntryMutation) Fields

func (m *IdentifiersEntryMutation) 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 (*IdentifiersEntryMutation) ID

func (m *IdentifiersEntryMutation) ID() (id int, exists bool)

ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.

func (*IdentifiersEntryMutation) IDs

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 (*IdentifiersEntryMutation) NodesCleared

func (m *IdentifiersEntryMutation) NodesCleared() bool

NodesCleared reports if the "nodes" edge to the Node entity was cleared.

func (*IdentifiersEntryMutation) NodesID

func (m *IdentifiersEntryMutation) NodesID() (id string, exists bool)

NodesID returns the "nodes" edge ID in the mutation.

func (*IdentifiersEntryMutation) NodesIDs

func (m *IdentifiersEntryMutation) NodesIDs() (ids []string)

NodesIDs returns the "nodes" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use NodesID instead. It exists only for internal usage by the builders.

func (*IdentifiersEntryMutation) OldField

func (m *IdentifiersEntryMutation) 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 (*IdentifiersEntryMutation) OldSoftwareIdentifierType

func (m *IdentifiersEntryMutation) OldSoftwareIdentifierType(ctx context.Context) (v identifiersentry.SoftwareIdentifierType, err error)

OldSoftwareIdentifierType returns the old "software_identifier_type" field's value of the IdentifiersEntry entity. If the IdentifiersEntry 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 (*IdentifiersEntryMutation) OldSoftwareIdentifierValue

func (m *IdentifiersEntryMutation) OldSoftwareIdentifierValue(ctx context.Context) (v string, err error)

OldSoftwareIdentifierValue returns the old "software_identifier_value" field's value of the IdentifiersEntry entity. If the IdentifiersEntry 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 (*IdentifiersEntryMutation) Op

func (m *IdentifiersEntryMutation) Op() Op

Op returns the operation name.

func (*IdentifiersEntryMutation) RemovedEdges

func (m *IdentifiersEntryMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*IdentifiersEntryMutation) RemovedIDs

func (m *IdentifiersEntryMutation) 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 (*IdentifiersEntryMutation) ResetEdge

func (m *IdentifiersEntryMutation) 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 (*IdentifiersEntryMutation) ResetField

func (m *IdentifiersEntryMutation) 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 (*IdentifiersEntryMutation) ResetNodes

func (m *IdentifiersEntryMutation) ResetNodes()

ResetNodes resets all changes to the "nodes" edge.

func (*IdentifiersEntryMutation) ResetSoftwareIdentifierType

func (m *IdentifiersEntryMutation) ResetSoftwareIdentifierType()

ResetSoftwareIdentifierType resets all changes to the "software_identifier_type" field.

func (*IdentifiersEntryMutation) ResetSoftwareIdentifierValue

func (m *IdentifiersEntryMutation) ResetSoftwareIdentifierValue()

ResetSoftwareIdentifierValue resets all changes to the "software_identifier_value" field.

func (*IdentifiersEntryMutation) SetField

func (m *IdentifiersEntryMutation) 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 (*IdentifiersEntryMutation) SetNodesID

func (m *IdentifiersEntryMutation) SetNodesID(id string)

SetNodesID sets the "nodes" edge to the Node entity by id.

func (*IdentifiersEntryMutation) SetOp

func (m *IdentifiersEntryMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*IdentifiersEntryMutation) SetSoftwareIdentifierType

func (m *IdentifiersEntryMutation) SetSoftwareIdentifierType(iit identifiersentry.SoftwareIdentifierType)

SetSoftwareIdentifierType sets the "software_identifier_type" field.

func (*IdentifiersEntryMutation) SetSoftwareIdentifierValue

func (m *IdentifiersEntryMutation) SetSoftwareIdentifierValue(s string)

SetSoftwareIdentifierValue sets the "software_identifier_value" field.

func (*IdentifiersEntryMutation) SoftwareIdentifierType

func (m *IdentifiersEntryMutation) SoftwareIdentifierType() (r identifiersentry.SoftwareIdentifierType, exists bool)

SoftwareIdentifierType returns the value of the "software_identifier_type" field in the mutation.

func (*IdentifiersEntryMutation) SoftwareIdentifierValue

func (m *IdentifiersEntryMutation) SoftwareIdentifierValue() (r string, exists bool)

SoftwareIdentifierValue returns the value of the "software_identifier_value" field in the mutation.

func (IdentifiersEntryMutation) Tx

func (m IdentifiersEntryMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*IdentifiersEntryMutation) Type

func (m *IdentifiersEntryMutation) Type() string

Type returns the node type of this mutation (IdentifiersEntry).

func (*IdentifiersEntryMutation) Where

Where appends a list predicates to the IdentifiersEntryMutation builder.

func (*IdentifiersEntryMutation) WhereP

func (m *IdentifiersEntryMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the IdentifiersEntryMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type IdentifiersEntryQuery

type IdentifiersEntryQuery struct {
	// contains filtered or unexported fields
}

IdentifiersEntryQuery is the builder for querying IdentifiersEntry entities.

func (*IdentifiersEntryQuery) Aggregate

Aggregate returns a IdentifiersEntrySelect configured with the given aggregations.

func (*IdentifiersEntryQuery) All

All executes the query and returns a list of IdentifiersEntries.

func (*IdentifiersEntryQuery) AllX

AllX is like All, but panics if an error occurs.

func (*IdentifiersEntryQuery) Clone

Clone returns a duplicate of the IdentifiersEntryQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*IdentifiersEntryQuery) Count

func (ieq *IdentifiersEntryQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*IdentifiersEntryQuery) CountX

func (ieq *IdentifiersEntryQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*IdentifiersEntryQuery) Exist

func (ieq *IdentifiersEntryQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*IdentifiersEntryQuery) ExistX

func (ieq *IdentifiersEntryQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*IdentifiersEntryQuery) First

First returns the first IdentifiersEntry entity from the query. Returns a *NotFoundError when no IdentifiersEntry was found.

func (*IdentifiersEntryQuery) FirstID

func (ieq *IdentifiersEntryQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first IdentifiersEntry ID from the query. Returns a *NotFoundError when no IdentifiersEntry ID was found.

func (*IdentifiersEntryQuery) FirstIDX

func (ieq *IdentifiersEntryQuery) FirstIDX(ctx context.Context) int

FirstIDX is like FirstID, but panics if an error occurs.

func (*IdentifiersEntryQuery) FirstX

FirstX is like First, but panics if an error occurs.

func (*IdentifiersEntryQuery) GroupBy

func (ieq *IdentifiersEntryQuery) GroupBy(field string, fields ...string) *IdentifiersEntryGroupBy

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 {
	SoftwareIdentifierType identifiersentry.SoftwareIdentifierType `json:"software_identifier_type,omitempty"`
	Count int `json:"count,omitempty"`
}

client.IdentifiersEntry.Query().
	GroupBy(identifiersentry.FieldSoftwareIdentifierType).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*IdentifiersEntryQuery) IDs

func (ieq *IdentifiersEntryQuery) IDs(ctx context.Context) (ids []int, err error)

IDs executes the query and returns a list of IdentifiersEntry IDs.

func (*IdentifiersEntryQuery) IDsX

func (ieq *IdentifiersEntryQuery) IDsX(ctx context.Context) []int

IDsX is like IDs, but panics if an error occurs.

func (*IdentifiersEntryQuery) Limit

func (ieq *IdentifiersEntryQuery) Limit(limit int) *IdentifiersEntryQuery

Limit the number of records to be returned by this query.

func (*IdentifiersEntryQuery) Offset

func (ieq *IdentifiersEntryQuery) Offset(offset int) *IdentifiersEntryQuery

Offset to start from.

func (*IdentifiersEntryQuery) Only

Only returns a single IdentifiersEntry entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one IdentifiersEntry entity is found. Returns a *NotFoundError when no IdentifiersEntry entities are found.

func (*IdentifiersEntryQuery) OnlyID

func (ieq *IdentifiersEntryQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID is like Only, but returns the only IdentifiersEntry ID in the query. Returns a *NotSingularError when more than one IdentifiersEntry ID is found. Returns a *NotFoundError when no entities are found.

func (*IdentifiersEntryQuery) OnlyIDX

func (ieq *IdentifiersEntryQuery) OnlyIDX(ctx context.Context) int

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*IdentifiersEntryQuery) OnlyX

OnlyX is like Only, but panics if an error occurs.

func (*IdentifiersEntryQuery) Order

Order specifies how the records should be ordered.

func (*IdentifiersEntryQuery) QueryNodes

func (ieq *IdentifiersEntryQuery) QueryNodes() *NodeQuery

QueryNodes chains the current query on the "nodes" edge.

func (*IdentifiersEntryQuery) Select

func (ieq *IdentifiersEntryQuery) Select(fields ...string) *IdentifiersEntrySelect

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 {
	SoftwareIdentifierType identifiersentry.SoftwareIdentifierType `json:"software_identifier_type,omitempty"`
}

client.IdentifiersEntry.Query().
	Select(identifiersentry.FieldSoftwareIdentifierType).
	Scan(ctx, &v)

func (*IdentifiersEntryQuery) Unique

func (ieq *IdentifiersEntryQuery) Unique(unique bool) *IdentifiersEntryQuery

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 (*IdentifiersEntryQuery) Where

Where adds a new predicate for the IdentifiersEntryQuery builder.

func (*IdentifiersEntryQuery) WithNodes

func (ieq *IdentifiersEntryQuery) WithNodes(opts ...func(*NodeQuery)) *IdentifiersEntryQuery

WithNodes tells the query-builder to eager-load the nodes that are connected to the "nodes" edge. The optional arguments are used to configure the query builder of the edge.

type IdentifiersEntrySelect

type IdentifiersEntrySelect struct {
	*IdentifiersEntryQuery
	// contains filtered or unexported fields
}

IdentifiersEntrySelect is the builder for selecting fields of IdentifiersEntry entities.

func (*IdentifiersEntrySelect) Aggregate

Aggregate adds the given aggregation functions to the selector query.

func (*IdentifiersEntrySelect) Bool

func (s *IdentifiersEntrySelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*IdentifiersEntrySelect) BoolX

func (s *IdentifiersEntrySelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*IdentifiersEntrySelect) Bools

func (s *IdentifiersEntrySelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*IdentifiersEntrySelect) BoolsX

func (s *IdentifiersEntrySelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*IdentifiersEntrySelect) Float64

func (s *IdentifiersEntrySelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*IdentifiersEntrySelect) Float64X

func (s *IdentifiersEntrySelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*IdentifiersEntrySelect) Float64s

func (s *IdentifiersEntrySelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*IdentifiersEntrySelect) Float64sX

func (s *IdentifiersEntrySelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*IdentifiersEntrySelect) Int

func (s *IdentifiersEntrySelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*IdentifiersEntrySelect) IntX

func (s *IdentifiersEntrySelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*IdentifiersEntrySelect) Ints

func (s *IdentifiersEntrySelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*IdentifiersEntrySelect) IntsX

func (s *IdentifiersEntrySelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*IdentifiersEntrySelect) Scan

func (ies *IdentifiersEntrySelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*IdentifiersEntrySelect) ScanX

func (s *IdentifiersEntrySelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*IdentifiersEntrySelect) String

func (s *IdentifiersEntrySelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*IdentifiersEntrySelect) StringX

func (s *IdentifiersEntrySelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*IdentifiersEntrySelect) Strings

func (s *IdentifiersEntrySelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*IdentifiersEntrySelect) StringsX

func (s *IdentifiersEntrySelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type IdentifiersEntryUpdate

type IdentifiersEntryUpdate struct {
	// contains filtered or unexported fields
}

IdentifiersEntryUpdate is the builder for updating IdentifiersEntry entities.

func (*IdentifiersEntryUpdate) ClearNodes

ClearNodes clears the "nodes" edge to the Node entity.

func (*IdentifiersEntryUpdate) Exec

Exec executes the query.

func (*IdentifiersEntryUpdate) ExecX

func (ieu *IdentifiersEntryUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*IdentifiersEntryUpdate) Mutation

Mutation returns the IdentifiersEntryMutation object of the builder.

func (*IdentifiersEntryUpdate) Save

func (ieu *IdentifiersEntryUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*IdentifiersEntryUpdate) SaveX

func (ieu *IdentifiersEntryUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*IdentifiersEntryUpdate) SetNillableNodesID

func (ieu *IdentifiersEntryUpdate) SetNillableNodesID(id *string) *IdentifiersEntryUpdate

SetNillableNodesID sets the "nodes" edge to the Node entity by ID if the given value is not nil.

func (*IdentifiersEntryUpdate) SetNillableSoftwareIdentifierType

func (ieu *IdentifiersEntryUpdate) SetNillableSoftwareIdentifierType(iit *identifiersentry.SoftwareIdentifierType) *IdentifiersEntryUpdate

SetNillableSoftwareIdentifierType sets the "software_identifier_type" field if the given value is not nil.

func (*IdentifiersEntryUpdate) SetNillableSoftwareIdentifierValue

func (ieu *IdentifiersEntryUpdate) SetNillableSoftwareIdentifierValue(s *string) *IdentifiersEntryUpdate

SetNillableSoftwareIdentifierValue sets the "software_identifier_value" field if the given value is not nil.

func (*IdentifiersEntryUpdate) SetNodes

SetNodes sets the "nodes" edge to the Node entity.

func (*IdentifiersEntryUpdate) SetNodesID

SetNodesID sets the "nodes" edge to the Node entity by ID.

func (*IdentifiersEntryUpdate) SetSoftwareIdentifierType

SetSoftwareIdentifierType sets the "software_identifier_type" field.

func (*IdentifiersEntryUpdate) SetSoftwareIdentifierValue

func (ieu *IdentifiersEntryUpdate) SetSoftwareIdentifierValue(s string) *IdentifiersEntryUpdate

SetSoftwareIdentifierValue sets the "software_identifier_value" field.

func (*IdentifiersEntryUpdate) Where

Where appends a list predicates to the IdentifiersEntryUpdate builder.

type IdentifiersEntryUpdateOne

type IdentifiersEntryUpdateOne struct {
	// contains filtered or unexported fields
}

IdentifiersEntryUpdateOne is the builder for updating a single IdentifiersEntry entity.

func (*IdentifiersEntryUpdateOne) ClearNodes

ClearNodes clears the "nodes" edge to the Node entity.

func (*IdentifiersEntryUpdateOne) Exec

Exec executes the query on the entity.

func (*IdentifiersEntryUpdateOne) ExecX

func (ieuo *IdentifiersEntryUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*IdentifiersEntryUpdateOne) Mutation

Mutation returns the IdentifiersEntryMutation object of the builder.

func (*IdentifiersEntryUpdateOne) Save

Save executes the query and returns the updated IdentifiersEntry entity.

func (*IdentifiersEntryUpdateOne) SaveX

SaveX is like Save, but panics if an error occurs.

func (*IdentifiersEntryUpdateOne) Select

func (ieuo *IdentifiersEntryUpdateOne) Select(field string, fields ...string) *IdentifiersEntryUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*IdentifiersEntryUpdateOne) SetNillableNodesID

func (ieuo *IdentifiersEntryUpdateOne) SetNillableNodesID(id *string) *IdentifiersEntryUpdateOne

SetNillableNodesID sets the "nodes" edge to the Node entity by ID if the given value is not nil.

func (*IdentifiersEntryUpdateOne) SetNillableSoftwareIdentifierType

func (ieuo *IdentifiersEntryUpdateOne) SetNillableSoftwareIdentifierType(iit *identifiersentry.SoftwareIdentifierType) *IdentifiersEntryUpdateOne

SetNillableSoftwareIdentifierType sets the "software_identifier_type" field if the given value is not nil.

func (*IdentifiersEntryUpdateOne) SetNillableSoftwareIdentifierValue

func (ieuo *IdentifiersEntryUpdateOne) SetNillableSoftwareIdentifierValue(s *string) *IdentifiersEntryUpdateOne

SetNillableSoftwareIdentifierValue sets the "software_identifier_value" field if the given value is not nil.

func (*IdentifiersEntryUpdateOne) SetNodes

SetNodes sets the "nodes" edge to the Node entity.

func (*IdentifiersEntryUpdateOne) SetNodesID

SetNodesID sets the "nodes" edge to the Node entity by ID.

func (*IdentifiersEntryUpdateOne) SetSoftwareIdentifierType

SetSoftwareIdentifierType sets the "software_identifier_type" field.

func (*IdentifiersEntryUpdateOne) SetSoftwareIdentifierValue

func (ieuo *IdentifiersEntryUpdateOne) SetSoftwareIdentifierValue(s string) *IdentifiersEntryUpdateOne

SetSoftwareIdentifierValue sets the "software_identifier_value" field.

func (*IdentifiersEntryUpdateOne) Where

Where appends a list predicates to the IdentifiersEntryUpdate builder.

type IdentifiersEntryUpsert

type IdentifiersEntryUpsert struct {
	*sql.UpdateSet
}

IdentifiersEntryUpsert is the "OnConflict" setter.

func (*IdentifiersEntryUpsert) SetSoftwareIdentifierType

SetSoftwareIdentifierType sets the "software_identifier_type" field.

func (*IdentifiersEntryUpsert) SetSoftwareIdentifierValue

func (u *IdentifiersEntryUpsert) SetSoftwareIdentifierValue(v string) *IdentifiersEntryUpsert

SetSoftwareIdentifierValue sets the "software_identifier_value" field.

func (*IdentifiersEntryUpsert) UpdateSoftwareIdentifierType

func (u *IdentifiersEntryUpsert) UpdateSoftwareIdentifierType() *IdentifiersEntryUpsert

UpdateSoftwareIdentifierType sets the "software_identifier_type" field to the value that was provided on create.

func (*IdentifiersEntryUpsert) UpdateSoftwareIdentifierValue

func (u *IdentifiersEntryUpsert) UpdateSoftwareIdentifierValue() *IdentifiersEntryUpsert

UpdateSoftwareIdentifierValue sets the "software_identifier_value" field to the value that was provided on create.

type IdentifiersEntryUpsertBulk

type IdentifiersEntryUpsertBulk struct {
	// contains filtered or unexported fields
}

IdentifiersEntryUpsertBulk is the builder for "upsert"-ing a bulk of IdentifiersEntry nodes.

func (*IdentifiersEntryUpsertBulk) DoNothing

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*IdentifiersEntryUpsertBulk) Exec

Exec executes the query.

func (*IdentifiersEntryUpsertBulk) ExecX

ExecX is like Exec, but panics if an error occurs.

func (*IdentifiersEntryUpsertBulk) Ignore

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.IdentifiersEntry.Create().
	OnConflict(sql.ResolveWithIgnore()).
	Exec(ctx)

func (*IdentifiersEntryUpsertBulk) SetSoftwareIdentifierType

SetSoftwareIdentifierType sets the "software_identifier_type" field.

func (*IdentifiersEntryUpsertBulk) SetSoftwareIdentifierValue

func (u *IdentifiersEntryUpsertBulk) SetSoftwareIdentifierValue(v string) *IdentifiersEntryUpsertBulk

SetSoftwareIdentifierValue sets the "software_identifier_value" field.

func (*IdentifiersEntryUpsertBulk) Update

Update allows overriding fields `UPDATE` values. See the IdentifiersEntryCreateBulk.OnConflict documentation for more info.

func (*IdentifiersEntryUpsertBulk) UpdateNewValues

UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:

client.IdentifiersEntry.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
	).
	Exec(ctx)

func (*IdentifiersEntryUpsertBulk) UpdateSoftwareIdentifierType

func (u *IdentifiersEntryUpsertBulk) UpdateSoftwareIdentifierType() *IdentifiersEntryUpsertBulk

UpdateSoftwareIdentifierType sets the "software_identifier_type" field to the value that was provided on create.

func (*IdentifiersEntryUpsertBulk) UpdateSoftwareIdentifierValue

func (u *IdentifiersEntryUpsertBulk) UpdateSoftwareIdentifierValue() *IdentifiersEntryUpsertBulk

UpdateSoftwareIdentifierValue sets the "software_identifier_value" field to the value that was provided on create.

type IdentifiersEntryUpsertOne

type IdentifiersEntryUpsertOne struct {
	// contains filtered or unexported fields
}

IdentifiersEntryUpsertOne is the builder for "upsert"-ing

one IdentifiersEntry node.

func (*IdentifiersEntryUpsertOne) DoNothing

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*IdentifiersEntryUpsertOne) Exec

Exec executes the query.

func (*IdentifiersEntryUpsertOne) ExecX

ExecX is like Exec, but panics if an error occurs.

func (*IdentifiersEntryUpsertOne) ID

func (u *IdentifiersEntryUpsertOne) ID(ctx context.Context) (id int, err error)

Exec executes the UPSERT query and returns the inserted/updated ID.

func (*IdentifiersEntryUpsertOne) IDX

IDX is like ID, but panics if an error occurs.

func (*IdentifiersEntryUpsertOne) Ignore

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.IdentifiersEntry.Create().
    OnConflict(sql.ResolveWithIgnore()).
    Exec(ctx)

func (*IdentifiersEntryUpsertOne) SetSoftwareIdentifierType

SetSoftwareIdentifierType sets the "software_identifier_type" field.

func (*IdentifiersEntryUpsertOne) SetSoftwareIdentifierValue

func (u *IdentifiersEntryUpsertOne) SetSoftwareIdentifierValue(v string) *IdentifiersEntryUpsertOne

SetSoftwareIdentifierValue sets the "software_identifier_value" field.

func (*IdentifiersEntryUpsertOne) Update

Update allows overriding fields `UPDATE` values. See the IdentifiersEntryCreate.OnConflict documentation for more info.

func (*IdentifiersEntryUpsertOne) UpdateNewValues

UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:

client.IdentifiersEntry.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
	).
	Exec(ctx)

func (*IdentifiersEntryUpsertOne) UpdateSoftwareIdentifierType

func (u *IdentifiersEntryUpsertOne) UpdateSoftwareIdentifierType() *IdentifiersEntryUpsertOne

UpdateSoftwareIdentifierType sets the "software_identifier_type" field to the value that was provided on create.

func (*IdentifiersEntryUpsertOne) UpdateSoftwareIdentifierValue

func (u *IdentifiersEntryUpsertOne) UpdateSoftwareIdentifierValue() *IdentifiersEntryUpsertOne

UpdateSoftwareIdentifierValue sets the "software_identifier_value" field to the value that was provided on create.

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 Metadata

type Metadata struct {

	// ID of the ent.
	ID string `json:"id,omitempty"`
	// Version holds the value of the "version" field.
	Version string `json:"version,omitempty"`
	// Name holds the value of the "name" field.
	Name string `json:"name,omitempty"`
	// Date holds the value of the "date" field.
	Date time.Time `json:"date,omitempty"`
	// Comment holds the value of the "comment" field.
	Comment string `json:"comment,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the MetadataQuery when eager-loading is set.
	Edges MetadataEdges `json:"edges"`
	// contains filtered or unexported fields
}

Metadata is the model entity for the Metadata schema.

func (*Metadata) QueryAuthors

func (m *Metadata) QueryAuthors() *PersonQuery

QueryAuthors queries the "authors" edge of the Metadata entity.

func (*Metadata) QueryDocument

func (m *Metadata) QueryDocument() *DocumentQuery

QueryDocument queries the "document" edge of the Metadata entity.

func (*Metadata) QueryDocumentTypes

func (m *Metadata) QueryDocumentTypes() *DocumentTypeQuery

QueryDocumentTypes queries the "document_types" edge of the Metadata entity.

func (*Metadata) QueryTools

func (m *Metadata) QueryTools() *ToolQuery

QueryTools queries the "tools" edge of the Metadata entity.

func (*Metadata) String

func (m *Metadata) String() string

String implements the fmt.Stringer.

func (*Metadata) Unwrap

func (m *Metadata) Unwrap() *Metadata

Unwrap unwraps the Metadata 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 (*Metadata) Update

func (m *Metadata) Update() *MetadataUpdateOne

Update returns a builder for updating this Metadata. Note that you need to call Metadata.Unwrap() before calling this method if this Metadata was returned from a transaction, and the transaction was committed or rolled back.

func (*Metadata) Value

func (m *Metadata) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the Metadata. This includes values selected through modifiers, order, etc.

type MetadataClient

type MetadataClient struct {
	// contains filtered or unexported fields
}

MetadataClient is a client for the Metadata schema.

func NewMetadataClient

func NewMetadataClient(c config) *MetadataClient

NewMetadataClient returns a client for the Metadata from the given config.

func (*MetadataClient) Create

func (c *MetadataClient) Create() *MetadataCreate

Create returns a builder for creating a Metadata entity.

func (*MetadataClient) CreateBulk

func (c *MetadataClient) CreateBulk(builders ...*MetadataCreate) *MetadataCreateBulk

CreateBulk returns a builder for creating a bulk of Metadata entities.

func (*MetadataClient) Delete

func (c *MetadataClient) Delete() *MetadataDelete

Delete returns a delete builder for Metadata.

func (*MetadataClient) DeleteOne

func (c *MetadataClient) DeleteOne(m *Metadata) *MetadataDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*MetadataClient) DeleteOneID

func (c *MetadataClient) DeleteOneID(id string) *MetadataDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*MetadataClient) Get

func (c *MetadataClient) Get(ctx context.Context, id string) (*Metadata, error)

Get returns a Metadata entity by its id.

func (*MetadataClient) GetX

func (c *MetadataClient) GetX(ctx context.Context, id string) *Metadata

GetX is like Get, but panics if an error occurs.

func (*MetadataClient) Hooks

func (c *MetadataClient) Hooks() []Hook

Hooks returns the client hooks.

func (*MetadataClient) Intercept

func (c *MetadataClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `metadata.Intercept(f(g(h())))`.

func (*MetadataClient) Interceptors

func (c *MetadataClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*MetadataClient) MapCreateBulk

func (c *MetadataClient) MapCreateBulk(slice any, setFunc func(*MetadataCreate, int)) *MetadataCreateBulk

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 (*MetadataClient) Query

func (c *MetadataClient) Query() *MetadataQuery

Query returns a query builder for Metadata.

func (*MetadataClient) QueryAuthors

func (c *MetadataClient) QueryAuthors(m *Metadata) *PersonQuery

QueryAuthors queries the authors edge of a Metadata.

func (*MetadataClient) QueryDocument

func (c *MetadataClient) QueryDocument(m *Metadata) *DocumentQuery

QueryDocument queries the document edge of a Metadata.

func (*MetadataClient) QueryDocumentTypes

func (c *MetadataClient) QueryDocumentTypes(m *Metadata) *DocumentTypeQuery

QueryDocumentTypes queries the document_types edge of a Metadata.

func (*MetadataClient) QueryTools

func (c *MetadataClient) QueryTools(m *Metadata) *ToolQuery

QueryTools queries the tools edge of a Metadata.

func (*MetadataClient) Update

func (c *MetadataClient) Update() *MetadataUpdate

Update returns an update builder for Metadata.

func (*MetadataClient) UpdateOne

func (c *MetadataClient) UpdateOne(m *Metadata) *MetadataUpdateOne

UpdateOne returns an update builder for the given entity.

func (*MetadataClient) UpdateOneID

func (c *MetadataClient) UpdateOneID(id string) *MetadataUpdateOne

UpdateOneID returns an update builder for the given id.

func (*MetadataClient) Use

func (c *MetadataClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `metadata.Hooks(f(g(h())))`.

type MetadataCreate

type MetadataCreate struct {
	// contains filtered or unexported fields
}

MetadataCreate is the builder for creating a Metadata entity.

func (*MetadataCreate) AddAuthorIDs

func (mc *MetadataCreate) AddAuthorIDs(ids ...int) *MetadataCreate

AddAuthorIDs adds the "authors" edge to the Person entity by IDs.

func (*MetadataCreate) AddAuthors

func (mc *MetadataCreate) AddAuthors(p ...*Person) *MetadataCreate

AddAuthors adds the "authors" edges to the Person entity.

func (*MetadataCreate) AddDocumentTypeIDs

func (mc *MetadataCreate) AddDocumentTypeIDs(ids ...int) *MetadataCreate

AddDocumentTypeIDs adds the "document_types" edge to the DocumentType entity by IDs.

func (*MetadataCreate) AddDocumentTypes

func (mc *MetadataCreate) AddDocumentTypes(d ...*DocumentType) *MetadataCreate

AddDocumentTypes adds the "document_types" edges to the DocumentType entity.

func (*MetadataCreate) AddToolIDs

func (mc *MetadataCreate) AddToolIDs(ids ...int) *MetadataCreate

AddToolIDs adds the "tools" edge to the Tool entity by IDs.

func (*MetadataCreate) AddTools

func (mc *MetadataCreate) AddTools(t ...*Tool) *MetadataCreate

AddTools adds the "tools" edges to the Tool entity.

func (*MetadataCreate) Exec

func (mc *MetadataCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*MetadataCreate) ExecX

func (mc *MetadataCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*MetadataCreate) Mutation

func (mc *MetadataCreate) Mutation() *MetadataMutation

Mutation returns the MetadataMutation object of the builder.

func (*MetadataCreate) OnConflict

func (mc *MetadataCreate) OnConflict(opts ...sql.ConflictOption) *MetadataUpsertOne

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.Metadata.Create().
	SetVersion(v).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.MetadataUpsert) {
		SetVersion(v+v).
	}).
	Exec(ctx)

func (*MetadataCreate) OnConflictColumns

func (mc *MetadataCreate) OnConflictColumns(columns ...string) *MetadataUpsertOne

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.Metadata.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*MetadataCreate) Save

func (mc *MetadataCreate) Save(ctx context.Context) (*Metadata, error)

Save creates the Metadata in the database.

func (*MetadataCreate) SaveX

func (mc *MetadataCreate) SaveX(ctx context.Context) *Metadata

SaveX calls Save and panics if Save returns an error.

func (*MetadataCreate) SetComment

func (mc *MetadataCreate) SetComment(s string) *MetadataCreate

SetComment sets the "comment" field.

func (*MetadataCreate) SetDate

func (mc *MetadataCreate) SetDate(t time.Time) *MetadataCreate

SetDate sets the "date" field.

func (*MetadataCreate) SetDocument

func (mc *MetadataCreate) SetDocument(d *Document) *MetadataCreate

SetDocument sets the "document" edge to the Document entity.

func (*MetadataCreate) SetDocumentID

func (mc *MetadataCreate) SetDocumentID(id int) *MetadataCreate

SetDocumentID sets the "document" edge to the Document entity by ID.

func (*MetadataCreate) SetID

func (mc *MetadataCreate) SetID(s string) *MetadataCreate

SetID sets the "id" field.

func (*MetadataCreate) SetName

func (mc *MetadataCreate) SetName(s string) *MetadataCreate

SetName sets the "name" field.

func (*MetadataCreate) SetNillableDocumentID

func (mc *MetadataCreate) SetNillableDocumentID(id *int) *MetadataCreate

SetNillableDocumentID sets the "document" edge to the Document entity by ID if the given value is not nil.

func (*MetadataCreate) SetVersion

func (mc *MetadataCreate) SetVersion(s string) *MetadataCreate

SetVersion sets the "version" field.

type MetadataCreateBulk

type MetadataCreateBulk struct {
	// contains filtered or unexported fields
}

MetadataCreateBulk is the builder for creating many Metadata entities in bulk.

func (*MetadataCreateBulk) Exec

func (mcb *MetadataCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*MetadataCreateBulk) ExecX

func (mcb *MetadataCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*MetadataCreateBulk) OnConflict

func (mcb *MetadataCreateBulk) OnConflict(opts ...sql.ConflictOption) *MetadataUpsertBulk

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.Metadata.CreateBulk(builders...).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.MetadataUpsert) {
		SetVersion(v+v).
	}).
	Exec(ctx)

func (*MetadataCreateBulk) OnConflictColumns

func (mcb *MetadataCreateBulk) OnConflictColumns(columns ...string) *MetadataUpsertBulk

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.Metadata.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*MetadataCreateBulk) Save

func (mcb *MetadataCreateBulk) Save(ctx context.Context) ([]*Metadata, error)

Save creates the Metadata entities in the database.

func (*MetadataCreateBulk) SaveX

func (mcb *MetadataCreateBulk) SaveX(ctx context.Context) []*Metadata

SaveX is like Save, but panics if an error occurs.

type MetadataDelete

type MetadataDelete struct {
	// contains filtered or unexported fields
}

MetadataDelete is the builder for deleting a Metadata entity.

func (*MetadataDelete) Exec

func (md *MetadataDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*MetadataDelete) ExecX

func (md *MetadataDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*MetadataDelete) Where

func (md *MetadataDelete) Where(ps ...predicate.Metadata) *MetadataDelete

Where appends a list predicates to the MetadataDelete builder.

type MetadataDeleteOne

type MetadataDeleteOne struct {
	// contains filtered or unexported fields
}

MetadataDeleteOne is the builder for deleting a single Metadata entity.

func (*MetadataDeleteOne) Exec

func (mdo *MetadataDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*MetadataDeleteOne) ExecX

func (mdo *MetadataDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*MetadataDeleteOne) Where

Where appends a list predicates to the MetadataDelete builder.

type MetadataEdges

type MetadataEdges struct {
	// Tools holds the value of the tools edge.
	Tools []*Tool `json:"tools,omitempty"`
	// Authors holds the value of the authors edge.
	Authors []*Person `json:"authors,omitempty"`
	// DocumentTypes holds the value of the document_types edge.
	DocumentTypes []*DocumentType `json:"document_types,omitempty"`
	// Document holds the value of the document edge.
	Document *Document `json:"document,omitempty"`
	// contains filtered or unexported fields
}

MetadataEdges holds the relations/edges for other nodes in the graph.

func (MetadataEdges) AuthorsOrErr

func (e MetadataEdges) AuthorsOrErr() ([]*Person, error)

AuthorsOrErr returns the Authors value or an error if the edge was not loaded in eager-loading.

func (MetadataEdges) DocumentOrErr

func (e MetadataEdges) DocumentOrErr() (*Document, error)

DocumentOrErr returns the Document value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

func (MetadataEdges) DocumentTypesOrErr

func (e MetadataEdges) DocumentTypesOrErr() ([]*DocumentType, error)

DocumentTypesOrErr returns the DocumentTypes value or an error if the edge was not loaded in eager-loading.

func (MetadataEdges) ToolsOrErr

func (e MetadataEdges) ToolsOrErr() ([]*Tool, error)

ToolsOrErr returns the Tools value or an error if the edge was not loaded in eager-loading.

type MetadataGroupBy

type MetadataGroupBy struct {
	// contains filtered or unexported fields
}

MetadataGroupBy is the group-by builder for Metadata entities.

func (*MetadataGroupBy) Aggregate

func (mgb *MetadataGroupBy) Aggregate(fns ...AggregateFunc) *MetadataGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*MetadataGroupBy) Bool

func (s *MetadataGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*MetadataGroupBy) BoolX

func (s *MetadataGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*MetadataGroupBy) Bools

func (s *MetadataGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*MetadataGroupBy) BoolsX

func (s *MetadataGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*MetadataGroupBy) Float64

func (s *MetadataGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*MetadataGroupBy) Float64X

func (s *MetadataGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*MetadataGroupBy) Float64s

func (s *MetadataGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*MetadataGroupBy) Float64sX

func (s *MetadataGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*MetadataGroupBy) Int

func (s *MetadataGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*MetadataGroupBy) IntX

func (s *MetadataGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*MetadataGroupBy) Ints

func (s *MetadataGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*MetadataGroupBy) IntsX

func (s *MetadataGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*MetadataGroupBy) Scan

func (mgb *MetadataGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*MetadataGroupBy) ScanX

func (s *MetadataGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*MetadataGroupBy) String

func (s *MetadataGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*MetadataGroupBy) StringX

func (s *MetadataGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*MetadataGroupBy) Strings

func (s *MetadataGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*MetadataGroupBy) StringsX

func (s *MetadataGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type MetadataMutation

type MetadataMutation struct {
	// contains filtered or unexported fields
}

MetadataMutation represents an operation that mutates the Metadata nodes in the graph.

func (*MetadataMutation) AddAuthorIDs

func (m *MetadataMutation) AddAuthorIDs(ids ...int)

AddAuthorIDs adds the "authors" edge to the Person entity by ids.

func (*MetadataMutation) AddDocumentTypeIDs

func (m *MetadataMutation) AddDocumentTypeIDs(ids ...int)

AddDocumentTypeIDs adds the "document_types" edge to the DocumentType entity by ids.

func (*MetadataMutation) AddField

func (m *MetadataMutation) 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 (*MetadataMutation) AddToolIDs

func (m *MetadataMutation) AddToolIDs(ids ...int)

AddToolIDs adds the "tools" edge to the Tool entity by ids.

func (*MetadataMutation) AddedEdges

func (m *MetadataMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*MetadataMutation) AddedField

func (m *MetadataMutation) 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 (*MetadataMutation) AddedFields

func (m *MetadataMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*MetadataMutation) AddedIDs

func (m *MetadataMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*MetadataMutation) AuthorsCleared

func (m *MetadataMutation) AuthorsCleared() bool

AuthorsCleared reports if the "authors" edge to the Person entity was cleared.

func (*MetadataMutation) AuthorsIDs

func (m *MetadataMutation) AuthorsIDs() (ids []int)

AuthorsIDs returns the "authors" edge IDs in the mutation.

func (*MetadataMutation) ClearAuthors

func (m *MetadataMutation) ClearAuthors()

ClearAuthors clears the "authors" edge to the Person entity.

func (*MetadataMutation) ClearDocument

func (m *MetadataMutation) ClearDocument()

ClearDocument clears the "document" edge to the Document entity.

func (*MetadataMutation) ClearDocumentTypes

func (m *MetadataMutation) ClearDocumentTypes()

ClearDocumentTypes clears the "document_types" edge to the DocumentType entity.

func (*MetadataMutation) ClearEdge

func (m *MetadataMutation) 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 (*MetadataMutation) ClearField

func (m *MetadataMutation) 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 (*MetadataMutation) ClearTools

func (m *MetadataMutation) ClearTools()

ClearTools clears the "tools" edge to the Tool entity.

func (*MetadataMutation) ClearedEdges

func (m *MetadataMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*MetadataMutation) ClearedFields

func (m *MetadataMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (MetadataMutation) Client

func (m MetadataMutation) 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 (*MetadataMutation) Comment

func (m *MetadataMutation) Comment() (r string, exists bool)

Comment returns the value of the "comment" field in the mutation.

func (*MetadataMutation) Date

func (m *MetadataMutation) Date() (r time.Time, exists bool)

Date returns the value of the "date" field in the mutation.

func (*MetadataMutation) DocumentCleared

func (m *MetadataMutation) DocumentCleared() bool

DocumentCleared reports if the "document" edge to the Document entity was cleared.

func (*MetadataMutation) DocumentID

func (m *MetadataMutation) DocumentID() (id int, exists bool)

DocumentID returns the "document" edge ID in the mutation.

func (*MetadataMutation) DocumentIDs

func (m *MetadataMutation) DocumentIDs() (ids []int)

DocumentIDs returns the "document" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use DocumentID instead. It exists only for internal usage by the builders.

func (*MetadataMutation) DocumentTypesCleared

func (m *MetadataMutation) DocumentTypesCleared() bool

DocumentTypesCleared reports if the "document_types" edge to the DocumentType entity was cleared.

func (*MetadataMutation) DocumentTypesIDs

func (m *MetadataMutation) DocumentTypesIDs() (ids []int)

DocumentTypesIDs returns the "document_types" edge IDs in the mutation.

func (*MetadataMutation) EdgeCleared

func (m *MetadataMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*MetadataMutation) Field

func (m *MetadataMutation) 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 (*MetadataMutation) FieldCleared

func (m *MetadataMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*MetadataMutation) Fields

func (m *MetadataMutation) 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 (*MetadataMutation) ID

func (m *MetadataMutation) 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 (*MetadataMutation) IDs

func (m *MetadataMutation) 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 (*MetadataMutation) Name

func (m *MetadataMutation) Name() (r string, exists bool)

Name returns the value of the "name" field in the mutation.

func (*MetadataMutation) OldComment

func (m *MetadataMutation) OldComment(ctx context.Context) (v string, err error)

OldComment returns the old "comment" field's value of the Metadata entity. If the Metadata 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 (*MetadataMutation) OldDate

func (m *MetadataMutation) OldDate(ctx context.Context) (v time.Time, err error)

OldDate returns the old "date" field's value of the Metadata entity. If the Metadata 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 (*MetadataMutation) OldField

func (m *MetadataMutation) 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 (*MetadataMutation) OldName

func (m *MetadataMutation) OldName(ctx context.Context) (v string, err error)

OldName returns the old "name" field's value of the Metadata entity. If the Metadata 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 (*MetadataMutation) OldVersion

func (m *MetadataMutation) OldVersion(ctx context.Context) (v string, err error)

OldVersion returns the old "version" field's value of the Metadata entity. If the Metadata 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 (*MetadataMutation) Op

func (m *MetadataMutation) Op() Op

Op returns the operation name.

func (*MetadataMutation) RemoveAuthorIDs

func (m *MetadataMutation) RemoveAuthorIDs(ids ...int)

RemoveAuthorIDs removes the "authors" edge to the Person entity by IDs.

func (*MetadataMutation) RemoveDocumentTypeIDs

func (m *MetadataMutation) RemoveDocumentTypeIDs(ids ...int)

RemoveDocumentTypeIDs removes the "document_types" edge to the DocumentType entity by IDs.

func (*MetadataMutation) RemoveToolIDs

func (m *MetadataMutation) RemoveToolIDs(ids ...int)

RemoveToolIDs removes the "tools" edge to the Tool entity by IDs.

func (*MetadataMutation) RemovedAuthorsIDs

func (m *MetadataMutation) RemovedAuthorsIDs() (ids []int)

RemovedAuthors returns the removed IDs of the "authors" edge to the Person entity.

func (*MetadataMutation) RemovedDocumentTypesIDs

func (m *MetadataMutation) RemovedDocumentTypesIDs() (ids []int)

RemovedDocumentTypes returns the removed IDs of the "document_types" edge to the DocumentType entity.

func (*MetadataMutation) RemovedEdges

func (m *MetadataMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*MetadataMutation) RemovedIDs

func (m *MetadataMutation) 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 (*MetadataMutation) RemovedToolsIDs

func (m *MetadataMutation) RemovedToolsIDs() (ids []int)

RemovedTools returns the removed IDs of the "tools" edge to the Tool entity.

func (*MetadataMutation) ResetAuthors

func (m *MetadataMutation) ResetAuthors()

ResetAuthors resets all changes to the "authors" edge.

func (*MetadataMutation) ResetComment

func (m *MetadataMutation) ResetComment()

ResetComment resets all changes to the "comment" field.

func (*MetadataMutation) ResetDate

func (m *MetadataMutation) ResetDate()

ResetDate resets all changes to the "date" field.

func (*MetadataMutation) ResetDocument

func (m *MetadataMutation) ResetDocument()

ResetDocument resets all changes to the "document" edge.

func (*MetadataMutation) ResetDocumentTypes

func (m *MetadataMutation) ResetDocumentTypes()

ResetDocumentTypes resets all changes to the "document_types" edge.

func (*MetadataMutation) ResetEdge

func (m *MetadataMutation) 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 (*MetadataMutation) ResetField

func (m *MetadataMutation) 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 (*MetadataMutation) ResetName

func (m *MetadataMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*MetadataMutation) ResetTools

func (m *MetadataMutation) ResetTools()

ResetTools resets all changes to the "tools" edge.

func (*MetadataMutation) ResetVersion

func (m *MetadataMutation) ResetVersion()

ResetVersion resets all changes to the "version" field.

func (*MetadataMutation) SetComment

func (m *MetadataMutation) SetComment(s string)

SetComment sets the "comment" field.

func (*MetadataMutation) SetDate

func (m *MetadataMutation) SetDate(t time.Time)

SetDate sets the "date" field.

func (*MetadataMutation) SetDocumentID

func (m *MetadataMutation) SetDocumentID(id int)

SetDocumentID sets the "document" edge to the Document entity by id.

func (*MetadataMutation) SetField

func (m *MetadataMutation) 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 (*MetadataMutation) SetID

func (m *MetadataMutation) SetID(id string)

SetID sets the value of the id field. Note that this operation is only accepted on creation of Metadata entities.

func (*MetadataMutation) SetName

func (m *MetadataMutation) SetName(s string)

SetName sets the "name" field.

func (*MetadataMutation) SetOp

func (m *MetadataMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*MetadataMutation) SetVersion

func (m *MetadataMutation) SetVersion(s string)

SetVersion sets the "version" field.

func (*MetadataMutation) ToolsCleared

func (m *MetadataMutation) ToolsCleared() bool

ToolsCleared reports if the "tools" edge to the Tool entity was cleared.

func (*MetadataMutation) ToolsIDs

func (m *MetadataMutation) ToolsIDs() (ids []int)

ToolsIDs returns the "tools" edge IDs in the mutation.

func (MetadataMutation) Tx

func (m MetadataMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*MetadataMutation) Type

func (m *MetadataMutation) Type() string

Type returns the node type of this mutation (Metadata).

func (*MetadataMutation) Version

func (m *MetadataMutation) Version() (r string, exists bool)

Version returns the value of the "version" field in the mutation.

func (*MetadataMutation) Where

func (m *MetadataMutation) Where(ps ...predicate.Metadata)

Where appends a list predicates to the MetadataMutation builder.

func (*MetadataMutation) WhereP

func (m *MetadataMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the MetadataMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type MetadataQuery

type MetadataQuery struct {
	// contains filtered or unexported fields
}

MetadataQuery is the builder for querying Metadata entities.

func (*MetadataQuery) Aggregate

func (mq *MetadataQuery) Aggregate(fns ...AggregateFunc) *MetadataSelect

Aggregate returns a MetadataSelect configured with the given aggregations.

func (*MetadataQuery) All

func (mq *MetadataQuery) All(ctx context.Context) ([]*Metadata, error)

All executes the query and returns a list of MetadataSlice.

func (*MetadataQuery) AllX

func (mq *MetadataQuery) AllX(ctx context.Context) []*Metadata

AllX is like All, but panics if an error occurs.

func (*MetadataQuery) Clone

func (mq *MetadataQuery) Clone() *MetadataQuery

Clone returns a duplicate of the MetadataQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*MetadataQuery) Count

func (mq *MetadataQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*MetadataQuery) CountX

func (mq *MetadataQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*MetadataQuery) Exist

func (mq *MetadataQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*MetadataQuery) ExistX

func (mq *MetadataQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*MetadataQuery) First

func (mq *MetadataQuery) First(ctx context.Context) (*Metadata, error)

First returns the first Metadata entity from the query. Returns a *NotFoundError when no Metadata was found.

func (*MetadataQuery) FirstID

func (mq *MetadataQuery) FirstID(ctx context.Context) (id string, err error)

FirstID returns the first Metadata ID from the query. Returns a *NotFoundError when no Metadata ID was found.

func (*MetadataQuery) FirstIDX

func (mq *MetadataQuery) FirstIDX(ctx context.Context) string

FirstIDX is like FirstID, but panics if an error occurs.

func (*MetadataQuery) FirstX

func (mq *MetadataQuery) FirstX(ctx context.Context) *Metadata

FirstX is like First, but panics if an error occurs.

func (*MetadataQuery) GroupBy

func (mq *MetadataQuery) GroupBy(field string, fields ...string) *MetadataGroupBy

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 {
	Version string `json:"version,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Metadata.Query().
	GroupBy(metadata.FieldVersion).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*MetadataQuery) IDs

func (mq *MetadataQuery) IDs(ctx context.Context) (ids []string, err error)

IDs executes the query and returns a list of Metadata IDs.

func (*MetadataQuery) IDsX

func (mq *MetadataQuery) IDsX(ctx context.Context) []string

IDsX is like IDs, but panics if an error occurs.

func (*MetadataQuery) Limit

func (mq *MetadataQuery) Limit(limit int) *MetadataQuery

Limit the number of records to be returned by this query.

func (*MetadataQuery) Offset

func (mq *MetadataQuery) Offset(offset int) *MetadataQuery

Offset to start from.

func (*MetadataQuery) Only

func (mq *MetadataQuery) Only(ctx context.Context) (*Metadata, error)

Only returns a single Metadata entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Metadata entity is found. Returns a *NotFoundError when no Metadata entities are found.

func (*MetadataQuery) OnlyID

func (mq *MetadataQuery) OnlyID(ctx context.Context) (id string, err error)

OnlyID is like Only, but returns the only Metadata ID in the query. Returns a *NotSingularError when more than one Metadata ID is found. Returns a *NotFoundError when no entities are found.

func (*MetadataQuery) OnlyIDX

func (mq *MetadataQuery) OnlyIDX(ctx context.Context) string

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*MetadataQuery) OnlyX

func (mq *MetadataQuery) OnlyX(ctx context.Context) *Metadata

OnlyX is like Only, but panics if an error occurs.

func (*MetadataQuery) Order

Order specifies how the records should be ordered.

func (*MetadataQuery) QueryAuthors

func (mq *MetadataQuery) QueryAuthors() *PersonQuery

QueryAuthors chains the current query on the "authors" edge.

func (*MetadataQuery) QueryDocument

func (mq *MetadataQuery) QueryDocument() *DocumentQuery

QueryDocument chains the current query on the "document" edge.

func (*MetadataQuery) QueryDocumentTypes

func (mq *MetadataQuery) QueryDocumentTypes() *DocumentTypeQuery

QueryDocumentTypes chains the current query on the "document_types" edge.

func (*MetadataQuery) QueryTools

func (mq *MetadataQuery) QueryTools() *ToolQuery

QueryTools chains the current query on the "tools" edge.

func (*MetadataQuery) Select

func (mq *MetadataQuery) Select(fields ...string) *MetadataSelect

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 {
	Version string `json:"version,omitempty"`
}

client.Metadata.Query().
	Select(metadata.FieldVersion).
	Scan(ctx, &v)

func (*MetadataQuery) Unique

func (mq *MetadataQuery) Unique(unique bool) *MetadataQuery

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 (*MetadataQuery) Where

func (mq *MetadataQuery) Where(ps ...predicate.Metadata) *MetadataQuery

Where adds a new predicate for the MetadataQuery builder.

func (*MetadataQuery) WithAuthors

func (mq *MetadataQuery) WithAuthors(opts ...func(*PersonQuery)) *MetadataQuery

WithAuthors tells the query-builder to eager-load the nodes that are connected to the "authors" edge. The optional arguments are used to configure the query builder of the edge.

func (*MetadataQuery) WithDocument

func (mq *MetadataQuery) WithDocument(opts ...func(*DocumentQuery)) *MetadataQuery

WithDocument tells the query-builder to eager-load the nodes that are connected to the "document" edge. The optional arguments are used to configure the query builder of the edge.

func (*MetadataQuery) WithDocumentTypes

func (mq *MetadataQuery) WithDocumentTypes(opts ...func(*DocumentTypeQuery)) *MetadataQuery

WithDocumentTypes tells the query-builder to eager-load the nodes that are connected to the "document_types" edge. The optional arguments are used to configure the query builder of the edge.

func (*MetadataQuery) WithTools

func (mq *MetadataQuery) WithTools(opts ...func(*ToolQuery)) *MetadataQuery

WithTools tells the query-builder to eager-load the nodes that are connected to the "tools" edge. The optional arguments are used to configure the query builder of the edge.

type MetadataSelect

type MetadataSelect struct {
	*MetadataQuery
	// contains filtered or unexported fields
}

MetadataSelect is the builder for selecting fields of Metadata entities.

func (*MetadataSelect) Aggregate

func (ms *MetadataSelect) Aggregate(fns ...AggregateFunc) *MetadataSelect

Aggregate adds the given aggregation functions to the selector query.

func (*MetadataSelect) Bool

func (s *MetadataSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*MetadataSelect) BoolX

func (s *MetadataSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*MetadataSelect) Bools

func (s *MetadataSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*MetadataSelect) BoolsX

func (s *MetadataSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*MetadataSelect) Float64

func (s *MetadataSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*MetadataSelect) Float64X

func (s *MetadataSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*MetadataSelect) Float64s

func (s *MetadataSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*MetadataSelect) Float64sX

func (s *MetadataSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*MetadataSelect) Int

func (s *MetadataSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*MetadataSelect) IntX

func (s *MetadataSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*MetadataSelect) Ints

func (s *MetadataSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*MetadataSelect) IntsX

func (s *MetadataSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*MetadataSelect) Scan

func (ms *MetadataSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*MetadataSelect) ScanX

func (s *MetadataSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*MetadataSelect) String

func (s *MetadataSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*MetadataSelect) StringX

func (s *MetadataSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*MetadataSelect) Strings

func (s *MetadataSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*MetadataSelect) StringsX

func (s *MetadataSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type MetadataSlice

type MetadataSlice []*Metadata

MetadataSlice is a parsable slice of Metadata.

type MetadataUpdate

type MetadataUpdate struct {
	// contains filtered or unexported fields
}

MetadataUpdate is the builder for updating Metadata entities.

func (*MetadataUpdate) AddAuthorIDs

func (mu *MetadataUpdate) AddAuthorIDs(ids ...int) *MetadataUpdate

AddAuthorIDs adds the "authors" edge to the Person entity by IDs.

func (*MetadataUpdate) AddAuthors

func (mu *MetadataUpdate) AddAuthors(p ...*Person) *MetadataUpdate

AddAuthors adds the "authors" edges to the Person entity.

func (*MetadataUpdate) AddDocumentTypeIDs

func (mu *MetadataUpdate) AddDocumentTypeIDs(ids ...int) *MetadataUpdate

AddDocumentTypeIDs adds the "document_types" edge to the DocumentType entity by IDs.

func (*MetadataUpdate) AddDocumentTypes

func (mu *MetadataUpdate) AddDocumentTypes(d ...*DocumentType) *MetadataUpdate

AddDocumentTypes adds the "document_types" edges to the DocumentType entity.

func (*MetadataUpdate) AddToolIDs

func (mu *MetadataUpdate) AddToolIDs(ids ...int) *MetadataUpdate

AddToolIDs adds the "tools" edge to the Tool entity by IDs.

func (*MetadataUpdate) AddTools

func (mu *MetadataUpdate) AddTools(t ...*Tool) *MetadataUpdate

AddTools adds the "tools" edges to the Tool entity.

func (*MetadataUpdate) ClearAuthors

func (mu *MetadataUpdate) ClearAuthors() *MetadataUpdate

ClearAuthors clears all "authors" edges to the Person entity.

func (*MetadataUpdate) ClearDocument

func (mu *MetadataUpdate) ClearDocument() *MetadataUpdate

ClearDocument clears the "document" edge to the Document entity.

func (*MetadataUpdate) ClearDocumentTypes

func (mu *MetadataUpdate) ClearDocumentTypes() *MetadataUpdate

ClearDocumentTypes clears all "document_types" edges to the DocumentType entity.

func (*MetadataUpdate) ClearTools

func (mu *MetadataUpdate) ClearTools() *MetadataUpdate

ClearTools clears all "tools" edges to the Tool entity.

func (*MetadataUpdate) Exec

func (mu *MetadataUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*MetadataUpdate) ExecX

func (mu *MetadataUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*MetadataUpdate) Mutation

func (mu *MetadataUpdate) Mutation() *MetadataMutation

Mutation returns the MetadataMutation object of the builder.

func (*MetadataUpdate) RemoveAuthorIDs

func (mu *MetadataUpdate) RemoveAuthorIDs(ids ...int) *MetadataUpdate

RemoveAuthorIDs removes the "authors" edge to Person entities by IDs.

func (*MetadataUpdate) RemoveAuthors

func (mu *MetadataUpdate) RemoveAuthors(p ...*Person) *MetadataUpdate

RemoveAuthors removes "authors" edges to Person entities.

func (*MetadataUpdate) RemoveDocumentTypeIDs

func (mu *MetadataUpdate) RemoveDocumentTypeIDs(ids ...int) *MetadataUpdate

RemoveDocumentTypeIDs removes the "document_types" edge to DocumentType entities by IDs.

func (*MetadataUpdate) RemoveDocumentTypes

func (mu *MetadataUpdate) RemoveDocumentTypes(d ...*DocumentType) *MetadataUpdate

RemoveDocumentTypes removes "document_types" edges to DocumentType entities.

func (*MetadataUpdate) RemoveToolIDs

func (mu *MetadataUpdate) RemoveToolIDs(ids ...int) *MetadataUpdate

RemoveToolIDs removes the "tools" edge to Tool entities by IDs.

func (*MetadataUpdate) RemoveTools

func (mu *MetadataUpdate) RemoveTools(t ...*Tool) *MetadataUpdate

RemoveTools removes "tools" edges to Tool entities.

func (*MetadataUpdate) Save

func (mu *MetadataUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*MetadataUpdate) SaveX

func (mu *MetadataUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*MetadataUpdate) SetComment

func (mu *MetadataUpdate) SetComment(s string) *MetadataUpdate

SetComment sets the "comment" field.

func (*MetadataUpdate) SetDate

func (mu *MetadataUpdate) SetDate(t time.Time) *MetadataUpdate

SetDate sets the "date" field.

func (*MetadataUpdate) SetDocument

func (mu *MetadataUpdate) SetDocument(d *Document) *MetadataUpdate

SetDocument sets the "document" edge to the Document entity.

func (*MetadataUpdate) SetDocumentID

func (mu *MetadataUpdate) SetDocumentID(id int) *MetadataUpdate

SetDocumentID sets the "document" edge to the Document entity by ID.

func (*MetadataUpdate) SetName

func (mu *MetadataUpdate) SetName(s string) *MetadataUpdate

SetName sets the "name" field.

func (*MetadataUpdate) SetNillableComment

func (mu *MetadataUpdate) SetNillableComment(s *string) *MetadataUpdate

SetNillableComment sets the "comment" field if the given value is not nil.

func (*MetadataUpdate) SetNillableDate

func (mu *MetadataUpdate) SetNillableDate(t *time.Time) *MetadataUpdate

SetNillableDate sets the "date" field if the given value is not nil.

func (*MetadataUpdate) SetNillableDocumentID

func (mu *MetadataUpdate) SetNillableDocumentID(id *int) *MetadataUpdate

SetNillableDocumentID sets the "document" edge to the Document entity by ID if the given value is not nil.

func (*MetadataUpdate) SetNillableName

func (mu *MetadataUpdate) SetNillableName(s *string) *MetadataUpdate

SetNillableName sets the "name" field if the given value is not nil.

func (*MetadataUpdate) SetNillableVersion

func (mu *MetadataUpdate) SetNillableVersion(s *string) *MetadataUpdate

SetNillableVersion sets the "version" field if the given value is not nil.

func (*MetadataUpdate) SetVersion

func (mu *MetadataUpdate) SetVersion(s string) *MetadataUpdate

SetVersion sets the "version" field.

func (*MetadataUpdate) Where

func (mu *MetadataUpdate) Where(ps ...predicate.Metadata) *MetadataUpdate

Where appends a list predicates to the MetadataUpdate builder.

type MetadataUpdateOne

type MetadataUpdateOne struct {
	// contains filtered or unexported fields
}

MetadataUpdateOne is the builder for updating a single Metadata entity.

func (*MetadataUpdateOne) AddAuthorIDs

func (muo *MetadataUpdateOne) AddAuthorIDs(ids ...int) *MetadataUpdateOne

AddAuthorIDs adds the "authors" edge to the Person entity by IDs.

func (*MetadataUpdateOne) AddAuthors

func (muo *MetadataUpdateOne) AddAuthors(p ...*Person) *MetadataUpdateOne

AddAuthors adds the "authors" edges to the Person entity.

func (*MetadataUpdateOne) AddDocumentTypeIDs

func (muo *MetadataUpdateOne) AddDocumentTypeIDs(ids ...int) *MetadataUpdateOne

AddDocumentTypeIDs adds the "document_types" edge to the DocumentType entity by IDs.

func (*MetadataUpdateOne) AddDocumentTypes

func (muo *MetadataUpdateOne) AddDocumentTypes(d ...*DocumentType) *MetadataUpdateOne

AddDocumentTypes adds the "document_types" edges to the DocumentType entity.

func (*MetadataUpdateOne) AddToolIDs

func (muo *MetadataUpdateOne) AddToolIDs(ids ...int) *MetadataUpdateOne

AddToolIDs adds the "tools" edge to the Tool entity by IDs.

func (*MetadataUpdateOne) AddTools

func (muo *MetadataUpdateOne) AddTools(t ...*Tool) *MetadataUpdateOne

AddTools adds the "tools" edges to the Tool entity.

func (*MetadataUpdateOne) ClearAuthors

func (muo *MetadataUpdateOne) ClearAuthors() *MetadataUpdateOne

ClearAuthors clears all "authors" edges to the Person entity.

func (*MetadataUpdateOne) ClearDocument

func (muo *MetadataUpdateOne) ClearDocument() *MetadataUpdateOne

ClearDocument clears the "document" edge to the Document entity.

func (*MetadataUpdateOne) ClearDocumentTypes

func (muo *MetadataUpdateOne) ClearDocumentTypes() *MetadataUpdateOne

ClearDocumentTypes clears all "document_types" edges to the DocumentType entity.

func (*MetadataUpdateOne) ClearTools

func (muo *MetadataUpdateOne) ClearTools() *MetadataUpdateOne

ClearTools clears all "tools" edges to the Tool entity.

func (*MetadataUpdateOne) Exec

func (muo *MetadataUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*MetadataUpdateOne) ExecX

func (muo *MetadataUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*MetadataUpdateOne) Mutation

func (muo *MetadataUpdateOne) Mutation() *MetadataMutation

Mutation returns the MetadataMutation object of the builder.

func (*MetadataUpdateOne) RemoveAuthorIDs

func (muo *MetadataUpdateOne) RemoveAuthorIDs(ids ...int) *MetadataUpdateOne

RemoveAuthorIDs removes the "authors" edge to Person entities by IDs.

func (*MetadataUpdateOne) RemoveAuthors

func (muo *MetadataUpdateOne) RemoveAuthors(p ...*Person) *MetadataUpdateOne

RemoveAuthors removes "authors" edges to Person entities.

func (*MetadataUpdateOne) RemoveDocumentTypeIDs

func (muo *MetadataUpdateOne) RemoveDocumentTypeIDs(ids ...int) *MetadataUpdateOne

RemoveDocumentTypeIDs removes the "document_types" edge to DocumentType entities by IDs.

func (*MetadataUpdateOne) RemoveDocumentTypes

func (muo *MetadataUpdateOne) RemoveDocumentTypes(d ...*DocumentType) *MetadataUpdateOne

RemoveDocumentTypes removes "document_types" edges to DocumentType entities.

func (*MetadataUpdateOne) RemoveToolIDs

func (muo *MetadataUpdateOne) RemoveToolIDs(ids ...int) *MetadataUpdateOne

RemoveToolIDs removes the "tools" edge to Tool entities by IDs.

func (*MetadataUpdateOne) RemoveTools

func (muo *MetadataUpdateOne) RemoveTools(t ...*Tool) *MetadataUpdateOne

RemoveTools removes "tools" edges to Tool entities.

func (*MetadataUpdateOne) Save

func (muo *MetadataUpdateOne) Save(ctx context.Context) (*Metadata, error)

Save executes the query and returns the updated Metadata entity.

func (*MetadataUpdateOne) SaveX

func (muo *MetadataUpdateOne) SaveX(ctx context.Context) *Metadata

SaveX is like Save, but panics if an error occurs.

func (*MetadataUpdateOne) Select

func (muo *MetadataUpdateOne) Select(field string, fields ...string) *MetadataUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*MetadataUpdateOne) SetComment

func (muo *MetadataUpdateOne) SetComment(s string) *MetadataUpdateOne

SetComment sets the "comment" field.

func (*MetadataUpdateOne) SetDate

func (muo *MetadataUpdateOne) SetDate(t time.Time) *MetadataUpdateOne

SetDate sets the "date" field.

func (*MetadataUpdateOne) SetDocument

func (muo *MetadataUpdateOne) SetDocument(d *Document) *MetadataUpdateOne

SetDocument sets the "document" edge to the Document entity.

func (*MetadataUpdateOne) SetDocumentID

func (muo *MetadataUpdateOne) SetDocumentID(id int) *MetadataUpdateOne

SetDocumentID sets the "document" edge to the Document entity by ID.

func (*MetadataUpdateOne) SetName

func (muo *MetadataUpdateOne) SetName(s string) *MetadataUpdateOne

SetName sets the "name" field.

func (*MetadataUpdateOne) SetNillableComment

func (muo *MetadataUpdateOne) SetNillableComment(s *string) *MetadataUpdateOne

SetNillableComment sets the "comment" field if the given value is not nil.

func (*MetadataUpdateOne) SetNillableDate

func (muo *MetadataUpdateOne) SetNillableDate(t *time.Time) *MetadataUpdateOne

SetNillableDate sets the "date" field if the given value is not nil.

func (*MetadataUpdateOne) SetNillableDocumentID

func (muo *MetadataUpdateOne) SetNillableDocumentID(id *int) *MetadataUpdateOne

SetNillableDocumentID sets the "document" edge to the Document entity by ID if the given value is not nil.

func (*MetadataUpdateOne) SetNillableName

func (muo *MetadataUpdateOne) SetNillableName(s *string) *MetadataUpdateOne

SetNillableName sets the "name" field if the given value is not nil.

func (*MetadataUpdateOne) SetNillableVersion

func (muo *MetadataUpdateOne) SetNillableVersion(s *string) *MetadataUpdateOne

SetNillableVersion sets the "version" field if the given value is not nil.

func (*MetadataUpdateOne) SetVersion

func (muo *MetadataUpdateOne) SetVersion(s string) *MetadataUpdateOne

SetVersion sets the "version" field.

func (*MetadataUpdateOne) Where

Where appends a list predicates to the MetadataUpdate builder.

type MetadataUpsert

type MetadataUpsert struct {
	*sql.UpdateSet
}

MetadataUpsert is the "OnConflict" setter.

func (*MetadataUpsert) SetComment

func (u *MetadataUpsert) SetComment(v string) *MetadataUpsert

SetComment sets the "comment" field.

func (*MetadataUpsert) SetDate

func (u *MetadataUpsert) SetDate(v time.Time) *MetadataUpsert

SetDate sets the "date" field.

func (*MetadataUpsert) SetName

func (u *MetadataUpsert) SetName(v string) *MetadataUpsert

SetName sets the "name" field.

func (*MetadataUpsert) SetVersion

func (u *MetadataUpsert) SetVersion(v string) *MetadataUpsert

SetVersion sets the "version" field.

func (*MetadataUpsert) UpdateComment

func (u *MetadataUpsert) UpdateComment() *MetadataUpsert

UpdateComment sets the "comment" field to the value that was provided on create.

func (*MetadataUpsert) UpdateDate

func (u *MetadataUpsert) UpdateDate() *MetadataUpsert

UpdateDate sets the "date" field to the value that was provided on create.

func (*MetadataUpsert) UpdateName

func (u *MetadataUpsert) UpdateName() *MetadataUpsert

UpdateName sets the "name" field to the value that was provided on create.

func (*MetadataUpsert) UpdateVersion

func (u *MetadataUpsert) UpdateVersion() *MetadataUpsert

UpdateVersion sets the "version" field to the value that was provided on create.

type MetadataUpsertBulk

type MetadataUpsertBulk struct {
	// contains filtered or unexported fields
}

MetadataUpsertBulk is the builder for "upsert"-ing a bulk of Metadata nodes.

func (*MetadataUpsertBulk) DoNothing

func (u *MetadataUpsertBulk) DoNothing() *MetadataUpsertBulk

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*MetadataUpsertBulk) Exec

func (u *MetadataUpsertBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*MetadataUpsertBulk) ExecX

func (u *MetadataUpsertBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*MetadataUpsertBulk) Ignore

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.Metadata.Create().
	OnConflict(sql.ResolveWithIgnore()).
	Exec(ctx)

func (*MetadataUpsertBulk) SetComment

func (u *MetadataUpsertBulk) SetComment(v string) *MetadataUpsertBulk

SetComment sets the "comment" field.

func (*MetadataUpsertBulk) SetDate

SetDate sets the "date" field.

func (*MetadataUpsertBulk) SetName

SetName sets the "name" field.

func (*MetadataUpsertBulk) SetVersion

func (u *MetadataUpsertBulk) SetVersion(v string) *MetadataUpsertBulk

SetVersion sets the "version" field.

func (*MetadataUpsertBulk) Update

func (u *MetadataUpsertBulk) Update(set func(*MetadataUpsert)) *MetadataUpsertBulk

Update allows overriding fields `UPDATE` values. See the MetadataCreateBulk.OnConflict documentation for more info.

func (*MetadataUpsertBulk) UpdateComment

func (u *MetadataUpsertBulk) UpdateComment() *MetadataUpsertBulk

UpdateComment sets the "comment" field to the value that was provided on create.

func (*MetadataUpsertBulk) UpdateDate

func (u *MetadataUpsertBulk) UpdateDate() *MetadataUpsertBulk

UpdateDate sets the "date" field to the value that was provided on create.

func (*MetadataUpsertBulk) UpdateName

func (u *MetadataUpsertBulk) UpdateName() *MetadataUpsertBulk

UpdateName sets the "name" field to the value that was provided on create.

func (*MetadataUpsertBulk) UpdateNewValues

func (u *MetadataUpsertBulk) UpdateNewValues() *MetadataUpsertBulk

UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:

client.Metadata.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
		sql.ResolveWith(func(u *sql.UpdateSet) {
			u.SetIgnore(metadata.FieldID)
		}),
	).
	Exec(ctx)

func (*MetadataUpsertBulk) UpdateVersion

func (u *MetadataUpsertBulk) UpdateVersion() *MetadataUpsertBulk

UpdateVersion sets the "version" field to the value that was provided on create.

type MetadataUpsertOne

type MetadataUpsertOne struct {
	// contains filtered or unexported fields
}

MetadataUpsertOne is the builder for "upsert"-ing

one Metadata node.

func (*MetadataUpsertOne) DoNothing

func (u *MetadataUpsertOne) DoNothing() *MetadataUpsertOne

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*MetadataUpsertOne) Exec

func (u *MetadataUpsertOne) Exec(ctx context.Context) error

Exec executes the query.

func (*MetadataUpsertOne) ExecX

func (u *MetadataUpsertOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*MetadataUpsertOne) ID

func (u *MetadataUpsertOne) ID(ctx context.Context) (id string, err error)

Exec executes the UPSERT query and returns the inserted/updated ID.

func (*MetadataUpsertOne) IDX

IDX is like ID, but panics if an error occurs.

func (*MetadataUpsertOne) Ignore

func (u *MetadataUpsertOne) Ignore() *MetadataUpsertOne

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.Metadata.Create().
    OnConflict(sql.ResolveWithIgnore()).
    Exec(ctx)

func (*MetadataUpsertOne) SetComment

func (u *MetadataUpsertOne) SetComment(v string) *MetadataUpsertOne

SetComment sets the "comment" field.

func (*MetadataUpsertOne) SetDate

SetDate sets the "date" field.

func (*MetadataUpsertOne) SetName

SetName sets the "name" field.

func (*MetadataUpsertOne) SetVersion

func (u *MetadataUpsertOne) SetVersion(v string) *MetadataUpsertOne

SetVersion sets the "version" field.

func (*MetadataUpsertOne) Update

func (u *MetadataUpsertOne) Update(set func(*MetadataUpsert)) *MetadataUpsertOne

Update allows overriding fields `UPDATE` values. See the MetadataCreate.OnConflict documentation for more info.

func (*MetadataUpsertOne) UpdateComment

func (u *MetadataUpsertOne) UpdateComment() *MetadataUpsertOne

UpdateComment sets the "comment" field to the value that was provided on create.

func (*MetadataUpsertOne) UpdateDate

func (u *MetadataUpsertOne) UpdateDate() *MetadataUpsertOne

UpdateDate sets the "date" field to the value that was provided on create.

func (*MetadataUpsertOne) UpdateName

func (u *MetadataUpsertOne) UpdateName() *MetadataUpsertOne

UpdateName sets the "name" field to the value that was provided on create.

func (*MetadataUpsertOne) UpdateNewValues

func (u *MetadataUpsertOne) UpdateNewValues() *MetadataUpsertOne

UpdateNewValues updates the mutable fields using the new values that were set on create except the ID field. Using this option is equivalent to using:

client.Metadata.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
		sql.ResolveWith(func(u *sql.UpdateSet) {
			u.SetIgnore(metadata.FieldID)
		}),
	).
	Exec(ctx)

func (*MetadataUpsertOne) UpdateVersion

func (u *MetadataUpsertOne) UpdateVersion() *MetadataUpsertOne

UpdateVersion sets the "version" field to the value that was provided on create.

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 Node

type Node struct {

	// ID of the ent.
	ID string `json:"id,omitempty"`
	// Type holds the value of the "type" field.
	Type node.Type `json:"type,omitempty"`
	// Name holds the value of the "name" field.
	Name string `json:"name,omitempty"`
	// Version holds the value of the "version" field.
	Version string `json:"version,omitempty"`
	// FileName holds the value of the "file_name" field.
	FileName string `json:"file_name,omitempty"`
	// URLHome holds the value of the "url_home" field.
	URLHome string `json:"url_home,omitempty"`
	// URLDownload holds the value of the "url_download" field.
	URLDownload string `json:"url_download,omitempty"`
	// Licenses holds the value of the "licenses" field.
	Licenses []string `json:"licenses,omitempty"`
	// LicenseConcluded holds the value of the "license_concluded" field.
	LicenseConcluded string `json:"license_concluded,omitempty"`
	// LicenseComments holds the value of the "license_comments" field.
	LicenseComments string `json:"license_comments,omitempty"`
	// Copyright holds the value of the "copyright" field.
	Copyright string `json:"copyright,omitempty"`
	// SourceInfo holds the value of the "source_info" field.
	SourceInfo string `json:"source_info,omitempty"`
	// Comment holds the value of the "comment" field.
	Comment string `json:"comment,omitempty"`
	// Summary holds the value of the "summary" field.
	Summary string `json:"summary,omitempty"`
	// Description holds the value of the "description" field.
	Description string `json:"description,omitempty"`
	// ReleaseDate holds the value of the "release_date" field.
	ReleaseDate time.Time `json:"release_date,omitempty"`
	// BuildDate holds the value of the "build_date" field.
	BuildDate time.Time `json:"build_date,omitempty"`
	// ValidUntilDate holds the value of the "valid_until_date" field.
	ValidUntilDate time.Time `json:"valid_until_date,omitempty"`
	// Attribution holds the value of the "attribution" field.
	Attribution []string `json:"attribution,omitempty"`
	// FileTypes holds the value of the "file_types" field.
	FileTypes []string `json:"file_types,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the NodeQuery when eager-loading is set.
	Edges NodeEdges `json:"edges"`
	// contains filtered or unexported fields
}

Node is the model entity for the Node schema.

func (*Node) QueryEdgeTypes

func (n *Node) QueryEdgeTypes() *EdgeTypeQuery

QueryEdgeTypes queries the "edge_types" edge of the Node entity.

func (*Node) QueryExternalReferences

func (n *Node) QueryExternalReferences() *ExternalReferenceQuery

QueryExternalReferences queries the "external_references" edge of the Node entity.

func (*Node) QueryHashes

func (n *Node) QueryHashes() *HashesEntryQuery

QueryHashes queries the "hashes" edge of the Node entity.

func (*Node) QueryIdentifiers

func (n *Node) QueryIdentifiers() *IdentifiersEntryQuery

QueryIdentifiers queries the "identifiers" edge of the Node entity.

func (*Node) QueryNodeList

func (n *Node) QueryNodeList() *NodeListQuery

QueryNodeList queries the "node_list" edge of the Node entity.

func (*Node) QueryNodes

func (n *Node) QueryNodes() *NodeQuery

QueryNodes queries the "nodes" edge of the Node entity.

func (*Node) QueryOriginators

func (n *Node) QueryOriginators() *PersonQuery

QueryOriginators queries the "originators" edge of the Node entity.

func (*Node) QueryPrimaryPurpose

func (n *Node) QueryPrimaryPurpose() *PurposeQuery

QueryPrimaryPurpose queries the "primary_purpose" edge of the Node entity.

func (*Node) QuerySuppliers

func (n *Node) QuerySuppliers() *PersonQuery

QuerySuppliers queries the "suppliers" edge of the Node entity.

func (*Node) String

func (n *Node) String() string

String implements the fmt.Stringer.

func (*Node) Unwrap

func (n *Node) Unwrap() *Node

Unwrap unwraps the Node 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 (*Node) Update

func (n *Node) Update() *NodeUpdateOne

Update returns a builder for updating this Node. Note that you need to call Node.Unwrap() before calling this method if this Node was returned from a transaction, and the transaction was committed or rolled back.

func (*Node) Value

func (n *Node) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the Node. This includes values selected through modifiers, order, etc.

type NodeClient

type NodeClient struct {
	// contains filtered or unexported fields
}

NodeClient is a client for the Node schema.

func NewNodeClient

func NewNodeClient(c config) *NodeClient

NewNodeClient returns a client for the Node from the given config.

func (*NodeClient) Create

func (c *NodeClient) Create() *NodeCreate

Create returns a builder for creating a Node entity.

func (*NodeClient) CreateBulk

func (c *NodeClient) CreateBulk(builders ...*NodeCreate) *NodeCreateBulk

CreateBulk returns a builder for creating a bulk of Node entities.

func (*NodeClient) Delete

func (c *NodeClient) Delete() *NodeDelete

Delete returns a delete builder for Node.

func (*NodeClient) DeleteOne

func (c *NodeClient) DeleteOne(n *Node) *NodeDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*NodeClient) DeleteOneID

func (c *NodeClient) DeleteOneID(id string) *NodeDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*NodeClient) Get

func (c *NodeClient) Get(ctx context.Context, id string) (*Node, error)

Get returns a Node entity by its id.

func (*NodeClient) GetX

func (c *NodeClient) GetX(ctx context.Context, id string) *Node

GetX is like Get, but panics if an error occurs.

func (*NodeClient) Hooks

func (c *NodeClient) Hooks() []Hook

Hooks returns the client hooks.

func (*NodeClient) Intercept

func (c *NodeClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `node.Intercept(f(g(h())))`.

func (*NodeClient) Interceptors

func (c *NodeClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*NodeClient) MapCreateBulk

func (c *NodeClient) MapCreateBulk(slice any, setFunc func(*NodeCreate, int)) *NodeCreateBulk

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 (*NodeClient) Query

func (c *NodeClient) Query() *NodeQuery

Query returns a query builder for Node.

func (*NodeClient) QueryEdgeTypes

func (c *NodeClient) QueryEdgeTypes(n *Node) *EdgeTypeQuery

QueryEdgeTypes queries the edge_types edge of a Node.

func (*NodeClient) QueryExternalReferences

func (c *NodeClient) QueryExternalReferences(n *Node) *ExternalReferenceQuery

QueryExternalReferences queries the external_references edge of a Node.

func (*NodeClient) QueryHashes

func (c *NodeClient) QueryHashes(n *Node) *HashesEntryQuery

QueryHashes queries the hashes edge of a Node.

func (*NodeClient) QueryIdentifiers

func (c *NodeClient) QueryIdentifiers(n *Node) *IdentifiersEntryQuery

QueryIdentifiers queries the identifiers edge of a Node.

func (*NodeClient) QueryNodeList

func (c *NodeClient) QueryNodeList(n *Node) *NodeListQuery

QueryNodeList queries the node_list edge of a Node.

func (*NodeClient) QueryNodes

func (c *NodeClient) QueryNodes(n *Node) *NodeQuery

QueryNodes queries the nodes edge of a Node.

func (*NodeClient) QueryOriginators

func (c *NodeClient) QueryOriginators(n *Node) *PersonQuery

QueryOriginators queries the originators edge of a Node.

func (*NodeClient) QueryPrimaryPurpose

func (c *NodeClient) QueryPrimaryPurpose(n *Node) *PurposeQuery

QueryPrimaryPurpose queries the primary_purpose edge of a Node.

func (*NodeClient) QuerySuppliers

func (c *NodeClient) QuerySuppliers(n *Node) *PersonQuery

QuerySuppliers queries the suppliers edge of a Node.

func (*NodeClient) Update

func (c *NodeClient) Update() *NodeUpdate

Update returns an update builder for Node.

func (*NodeClient) UpdateOne

func (c *NodeClient) UpdateOne(n *Node) *NodeUpdateOne

UpdateOne returns an update builder for the given entity.

func (*NodeClient) UpdateOneID

func (c *NodeClient) UpdateOneID(id string) *NodeUpdateOne

UpdateOneID returns an update builder for the given id.

func (*NodeClient) Use

func (c *NodeClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `node.Hooks(f(g(h())))`.

type NodeCreate

type NodeCreate struct {
	// contains filtered or unexported fields
}

NodeCreate is the builder for creating a Node entity.

func (*NodeCreate) AddEdgeTypeIDs

func (nc *NodeCreate) AddEdgeTypeIDs(ids ...int) *NodeCreate

AddEdgeTypeIDs adds the "edge_types" edge to the EdgeType entity by IDs.

func (*NodeCreate) AddEdgeTypes

func (nc *NodeCreate) AddEdgeTypes(e ...*EdgeType) *NodeCreate

AddEdgeTypes adds the "edge_types" edges to the EdgeType entity.

func (*NodeCreate) AddExternalReferenceIDs

func (nc *NodeCreate) AddExternalReferenceIDs(ids ...int) *NodeCreate

AddExternalReferenceIDs adds the "external_references" edge to the ExternalReference entity by IDs.

func (*NodeCreate) AddExternalReferences

func (nc *NodeCreate) AddExternalReferences(e ...*ExternalReference) *NodeCreate

AddExternalReferences adds the "external_references" edges to the ExternalReference entity.

func (*NodeCreate) AddHashIDs

func (nc *NodeCreate) AddHashIDs(ids ...int) *NodeCreate

AddHashIDs adds the "hashes" edge to the HashesEntry entity by IDs.

func (*NodeCreate) AddHashes

func (nc *NodeCreate) AddHashes(h ...*HashesEntry) *NodeCreate

AddHashes adds the "hashes" edges to the HashesEntry entity.

func (*NodeCreate) AddIdentifierIDs

func (nc *NodeCreate) AddIdentifierIDs(ids ...int) *NodeCreate

AddIdentifierIDs adds the "identifiers" edge to the IdentifiersEntry entity by IDs.

func (*NodeCreate) AddIdentifiers

func (nc *NodeCreate) AddIdentifiers(i ...*IdentifiersEntry) *NodeCreate

AddIdentifiers adds the "identifiers" edges to the IdentifiersEntry entity.

func (*NodeCreate) AddNodeIDs

func (nc *NodeCreate) AddNodeIDs(ids ...string) *NodeCreate

AddNodeIDs adds the "nodes" edge to the Node entity by IDs.

func (*NodeCreate) AddNodes

func (nc *NodeCreate) AddNodes(n ...*Node) *NodeCreate

AddNodes adds the "nodes" edges to the Node entity.

func (*NodeCreate) AddOriginatorIDs

func (nc *NodeCreate) AddOriginatorIDs(ids ...int) *NodeCreate

AddOriginatorIDs adds the "originators" edge to the Person entity by IDs.

func (*NodeCreate) AddOriginators

func (nc *NodeCreate) AddOriginators(p ...*Person) *NodeCreate

AddOriginators adds the "originators" edges to the Person entity.

func (*NodeCreate) AddPrimaryPurpose

func (nc *NodeCreate) AddPrimaryPurpose(p ...*Purpose) *NodeCreate

AddPrimaryPurpose adds the "primary_purpose" edges to the Purpose entity.

func (*NodeCreate) AddPrimaryPurposeIDs

func (nc *NodeCreate) AddPrimaryPurposeIDs(ids ...int) *NodeCreate

AddPrimaryPurposeIDs adds the "primary_purpose" edge to the Purpose entity by IDs.

func (*NodeCreate) AddSupplierIDs

func (nc *NodeCreate) AddSupplierIDs(ids ...int) *NodeCreate

AddSupplierIDs adds the "suppliers" edge to the Person entity by IDs.

func (*NodeCreate) AddSuppliers

func (nc *NodeCreate) AddSuppliers(p ...*Person) *NodeCreate

AddSuppliers adds the "suppliers" edges to the Person entity.

func (*NodeCreate) Exec

func (nc *NodeCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*NodeCreate) ExecX

func (nc *NodeCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*NodeCreate) Mutation

func (nc *NodeCreate) Mutation() *NodeMutation

Mutation returns the NodeMutation object of the builder.

func (*NodeCreate) OnConflict

func (nc *NodeCreate) OnConflict(opts ...sql.ConflictOption) *NodeUpsertOne

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.Node.Create().
	SetType(v).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.NodeUpsert) {
		SetType(v+v).
	}).
	Exec(ctx)

func (*NodeCreate) OnConflictColumns

func (nc *NodeCreate) OnConflictColumns(columns ...string) *NodeUpsertOne

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.Node.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*NodeCreate) Save

func (nc *NodeCreate) Save(ctx context.Context) (*Node, error)

Save creates the Node in the database.

func (*NodeCreate) SaveX

func (nc *NodeCreate) SaveX(ctx context.Context) *Node

SaveX calls Save and panics if Save returns an error.

func (*NodeCreate) SetAttribution

func (nc *NodeCreate) SetAttribution(s []string) *NodeCreate

SetAttribution sets the "attribution" field.

func (*NodeCreate) SetBuildDate

func (nc *NodeCreate) SetBuildDate(t time.Time) *NodeCreate

SetBuildDate sets the "build_date" field.

func (*NodeCreate) SetComment

func (nc *NodeCreate) SetComment(s string) *NodeCreate

SetComment sets the "comment" field.

func (*NodeCreate) SetCopyright

func (nc *NodeCreate) SetCopyright(s string) *NodeCreate

SetCopyright sets the "copyright" field.

func (*NodeCreate) SetDescription

func (nc *NodeCreate) SetDescription(s string) *NodeCreate

SetDescription sets the "description" field.

func (*NodeCreate) SetFileName

func (nc *NodeCreate) SetFileName(s string) *NodeCreate

SetFileName sets the "file_name" field.

func (*NodeCreate) SetFileTypes

func (nc *NodeCreate) SetFileTypes(s []string) *NodeCreate

SetFileTypes sets the "file_types" field.

func (*NodeCreate) SetID

func (nc *NodeCreate) SetID(s string) *NodeCreate

SetID sets the "id" field.

func (*NodeCreate) SetLicenseComments

func (nc *NodeCreate) SetLicenseComments(s string) *NodeCreate

SetLicenseComments sets the "license_comments" field.

func (*NodeCreate) SetLicenseConcluded

func (nc *NodeCreate) SetLicenseConcluded(s string) *NodeCreate

SetLicenseConcluded sets the "license_concluded" field.

func (*NodeCreate) SetLicenses

func (nc *NodeCreate) SetLicenses(s []string) *NodeCreate

SetLicenses sets the "licenses" field.

func (*NodeCreate) SetName

func (nc *NodeCreate) SetName(s string) *NodeCreate

SetName sets the "name" field.

func (*NodeCreate) SetNodeList

func (nc *NodeCreate) SetNodeList(n *NodeList) *NodeCreate

SetNodeList sets the "node_list" edge to the NodeList entity.

func (*NodeCreate) SetNodeListID

func (nc *NodeCreate) SetNodeListID(id int) *NodeCreate

SetNodeListID sets the "node_list" edge to the NodeList entity by ID.

func (*NodeCreate) SetReleaseDate

func (nc *NodeCreate) SetReleaseDate(t time.Time) *NodeCreate

SetReleaseDate sets the "release_date" field.

func (*NodeCreate) SetSourceInfo

func (nc *NodeCreate) SetSourceInfo(s string) *NodeCreate

SetSourceInfo sets the "source_info" field.

func (*NodeCreate) SetSummary

func (nc *NodeCreate) SetSummary(s string) *NodeCreate

SetSummary sets the "summary" field.

func (*NodeCreate) SetType

func (nc *NodeCreate) SetType(n node.Type) *NodeCreate

SetType sets the "type" field.

func (*NodeCreate) SetURLDownload

func (nc *NodeCreate) SetURLDownload(s string) *NodeCreate

SetURLDownload sets the "url_download" field.

func (*NodeCreate) SetURLHome

func (nc *NodeCreate) SetURLHome(s string) *NodeCreate

SetURLHome sets the "url_home" field.

func (*NodeCreate) SetValidUntilDate

func (nc *NodeCreate) SetValidUntilDate(t time.Time) *NodeCreate

SetValidUntilDate sets the "valid_until_date" field.

func (*NodeCreate) SetVersion

func (nc *NodeCreate) SetVersion(s string) *NodeCreate

SetVersion sets the "version" field.

type NodeCreateBulk

type NodeCreateBulk struct {
	// contains filtered or unexported fields
}

NodeCreateBulk is the builder for creating many Node entities in bulk.

func (*NodeCreateBulk) Exec

func (ncb *NodeCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*NodeCreateBulk) ExecX

func (ncb *NodeCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*NodeCreateBulk) OnConflict

func (ncb *NodeCreateBulk) OnConflict(opts ...sql.ConflictOption) *NodeUpsertBulk

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.Node.CreateBulk(builders...).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.NodeUpsert) {
		SetType(v+v).
	}).
	Exec(ctx)

func (*NodeCreateBulk) OnConflictColumns

func (ncb *NodeCreateBulk) OnConflictColumns(columns ...string) *NodeUpsertBulk

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.Node.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*NodeCreateBulk) Save

func (ncb *NodeCreateBulk) Save(ctx context.Context) ([]*Node, error)

Save creates the Node entities in the database.

func (*NodeCreateBulk) SaveX

func (ncb *NodeCreateBulk) SaveX(ctx context.Context) []*Node

SaveX is like Save, but panics if an error occurs.

type NodeDelete

type NodeDelete struct {
	// contains filtered or unexported fields
}

NodeDelete is the builder for deleting a Node entity.

func (*NodeDelete) Exec

func (nd *NodeDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*NodeDelete) ExecX

func (nd *NodeDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*NodeDelete) Where

func (nd *NodeDelete) Where(ps ...predicate.Node) *NodeDelete

Where appends a list predicates to the NodeDelete builder.

type NodeDeleteOne

type NodeDeleteOne struct {
	// contains filtered or unexported fields
}

NodeDeleteOne is the builder for deleting a single Node entity.

func (*NodeDeleteOne) Exec

func (ndo *NodeDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*NodeDeleteOne) ExecX

func (ndo *NodeDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*NodeDeleteOne) Where

func (ndo *NodeDeleteOne) Where(ps ...predicate.Node) *NodeDeleteOne

Where appends a list predicates to the NodeDelete builder.

type NodeEdges

type NodeEdges struct {
	// Suppliers holds the value of the suppliers edge.
	Suppliers []*Person `json:"suppliers,omitempty"`
	// Originators holds the value of the originators edge.
	Originators []*Person `json:"originators,omitempty"`
	// ExternalReferences holds the value of the external_references edge.
	ExternalReferences []*ExternalReference `json:"external_references,omitempty"`
	// Identifiers holds the value of the identifiers edge.
	Identifiers []*IdentifiersEntry `json:"identifiers,omitempty"`
	// Hashes holds the value of the hashes edge.
	Hashes []*HashesEntry `json:"hashes,omitempty"`
	// PrimaryPurpose holds the value of the primary_purpose edge.
	PrimaryPurpose []*Purpose `json:"primary_purpose,omitempty"`
	// Nodes holds the value of the nodes edge.
	Nodes []*Node `json:"nodes,omitempty"`
	// NodeList holds the value of the node_list edge.
	NodeList *NodeList `json:"node_list,omitempty"`
	// EdgeTypes holds the value of the edge_types edge.
	EdgeTypes []*EdgeType `json:"edge_types,omitempty"`
	// contains filtered or unexported fields
}

NodeEdges holds the relations/edges for other nodes in the graph.

func (NodeEdges) EdgeTypesOrErr

func (e NodeEdges) EdgeTypesOrErr() ([]*EdgeType, error)

EdgeTypesOrErr returns the EdgeTypes value or an error if the edge was not loaded in eager-loading.

func (NodeEdges) ExternalReferencesOrErr

func (e NodeEdges) ExternalReferencesOrErr() ([]*ExternalReference, error)

ExternalReferencesOrErr returns the ExternalReferences value or an error if the edge was not loaded in eager-loading.

func (NodeEdges) HashesOrErr

func (e NodeEdges) HashesOrErr() ([]*HashesEntry, error)

HashesOrErr returns the Hashes value or an error if the edge was not loaded in eager-loading.

func (NodeEdges) IdentifiersOrErr

func (e NodeEdges) IdentifiersOrErr() ([]*IdentifiersEntry, error)

IdentifiersOrErr returns the Identifiers value or an error if the edge was not loaded in eager-loading.

func (NodeEdges) NodeListOrErr

func (e NodeEdges) NodeListOrErr() (*NodeList, error)

NodeListOrErr returns the NodeList value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

func (NodeEdges) NodesOrErr

func (e NodeEdges) NodesOrErr() ([]*Node, error)

NodesOrErr returns the Nodes value or an error if the edge was not loaded in eager-loading.

func (NodeEdges) OriginatorsOrErr

func (e NodeEdges) OriginatorsOrErr() ([]*Person, error)

OriginatorsOrErr returns the Originators value or an error if the edge was not loaded in eager-loading.

func (NodeEdges) PrimaryPurposeOrErr

func (e NodeEdges) PrimaryPurposeOrErr() ([]*Purpose, error)

PrimaryPurposeOrErr returns the PrimaryPurpose value or an error if the edge was not loaded in eager-loading.

func (NodeEdges) SuppliersOrErr

func (e NodeEdges) SuppliersOrErr() ([]*Person, error)

SuppliersOrErr returns the Suppliers value or an error if the edge was not loaded in eager-loading.

type NodeGroupBy

type NodeGroupBy struct {
	// contains filtered or unexported fields
}

NodeGroupBy is the group-by builder for Node entities.

func (*NodeGroupBy) Aggregate

func (ngb *NodeGroupBy) Aggregate(fns ...AggregateFunc) *NodeGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*NodeGroupBy) Bool

func (s *NodeGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*NodeGroupBy) BoolX

func (s *NodeGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*NodeGroupBy) Bools

func (s *NodeGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*NodeGroupBy) BoolsX

func (s *NodeGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*NodeGroupBy) Float64

func (s *NodeGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*NodeGroupBy) Float64X

func (s *NodeGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*NodeGroupBy) Float64s

func (s *NodeGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*NodeGroupBy) Float64sX

func (s *NodeGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*NodeGroupBy) Int

func (s *NodeGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*NodeGroupBy) IntX

func (s *NodeGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*NodeGroupBy) Ints

func (s *NodeGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*NodeGroupBy) IntsX

func (s *NodeGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*NodeGroupBy) Scan

func (ngb *NodeGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*NodeGroupBy) ScanX

func (s *NodeGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*NodeGroupBy) String

func (s *NodeGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*NodeGroupBy) StringX

func (s *NodeGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*NodeGroupBy) Strings

func (s *NodeGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*NodeGroupBy) StringsX

func (s *NodeGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type NodeList

type NodeList struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// RootElements holds the value of the "root_elements" field.
	RootElements []string `json:"root_elements,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the NodeListQuery when eager-loading is set.
	Edges NodeListEdges `json:"edges"`
	// contains filtered or unexported fields
}

NodeList is the model entity for the NodeList schema.

func (*NodeList) QueryDocument

func (nl *NodeList) QueryDocument() *DocumentQuery

QueryDocument queries the "document" edge of the NodeList entity.

func (*NodeList) QueryNodes

func (nl *NodeList) QueryNodes() *NodeQuery

QueryNodes queries the "nodes" edge of the NodeList entity.

func (*NodeList) String

func (nl *NodeList) String() string

String implements the fmt.Stringer.

func (*NodeList) Unwrap

func (nl *NodeList) Unwrap() *NodeList

Unwrap unwraps the NodeList 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 (*NodeList) Update

func (nl *NodeList) Update() *NodeListUpdateOne

Update returns a builder for updating this NodeList. Note that you need to call NodeList.Unwrap() before calling this method if this NodeList was returned from a transaction, and the transaction was committed or rolled back.

func (*NodeList) Value

func (nl *NodeList) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the NodeList. This includes values selected through modifiers, order, etc.

type NodeListClient

type NodeListClient struct {
	// contains filtered or unexported fields
}

NodeListClient is a client for the NodeList schema.

func NewNodeListClient

func NewNodeListClient(c config) *NodeListClient

NewNodeListClient returns a client for the NodeList from the given config.

func (*NodeListClient) Create

func (c *NodeListClient) Create() *NodeListCreate

Create returns a builder for creating a NodeList entity.

func (*NodeListClient) CreateBulk

func (c *NodeListClient) CreateBulk(builders ...*NodeListCreate) *NodeListCreateBulk

CreateBulk returns a builder for creating a bulk of NodeList entities.

func (*NodeListClient) Delete

func (c *NodeListClient) Delete() *NodeListDelete

Delete returns a delete builder for NodeList.

func (*NodeListClient) DeleteOne

func (c *NodeListClient) DeleteOne(nl *NodeList) *NodeListDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*NodeListClient) DeleteOneID

func (c *NodeListClient) DeleteOneID(id int) *NodeListDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*NodeListClient) Get

func (c *NodeListClient) Get(ctx context.Context, id int) (*NodeList, error)

Get returns a NodeList entity by its id.

func (*NodeListClient) GetX

func (c *NodeListClient) GetX(ctx context.Context, id int) *NodeList

GetX is like Get, but panics if an error occurs.

func (*NodeListClient) Hooks

func (c *NodeListClient) Hooks() []Hook

Hooks returns the client hooks.

func (*NodeListClient) Intercept

func (c *NodeListClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `nodelist.Intercept(f(g(h())))`.

func (*NodeListClient) Interceptors

func (c *NodeListClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*NodeListClient) MapCreateBulk

func (c *NodeListClient) MapCreateBulk(slice any, setFunc func(*NodeListCreate, int)) *NodeListCreateBulk

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 (*NodeListClient) Query

func (c *NodeListClient) Query() *NodeListQuery

Query returns a query builder for NodeList.

func (*NodeListClient) QueryDocument

func (c *NodeListClient) QueryDocument(nl *NodeList) *DocumentQuery

QueryDocument queries the document edge of a NodeList.

func (*NodeListClient) QueryNodes

func (c *NodeListClient) QueryNodes(nl *NodeList) *NodeQuery

QueryNodes queries the nodes edge of a NodeList.

func (*NodeListClient) Update

func (c *NodeListClient) Update() *NodeListUpdate

Update returns an update builder for NodeList.

func (*NodeListClient) UpdateOne

func (c *NodeListClient) UpdateOne(nl *NodeList) *NodeListUpdateOne

UpdateOne returns an update builder for the given entity.

func (*NodeListClient) UpdateOneID

func (c *NodeListClient) UpdateOneID(id int) *NodeListUpdateOne

UpdateOneID returns an update builder for the given id.

func (*NodeListClient) Use

func (c *NodeListClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `nodelist.Hooks(f(g(h())))`.

type NodeListCreate

type NodeListCreate struct {
	// contains filtered or unexported fields
}

NodeListCreate is the builder for creating a NodeList entity.

func (*NodeListCreate) AddNodeIDs

func (nlc *NodeListCreate) AddNodeIDs(ids ...string) *NodeListCreate

AddNodeIDs adds the "nodes" edge to the Node entity by IDs.

func (*NodeListCreate) AddNodes

func (nlc *NodeListCreate) AddNodes(n ...*Node) *NodeListCreate

AddNodes adds the "nodes" edges to the Node entity.

func (*NodeListCreate) Exec

func (nlc *NodeListCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*NodeListCreate) ExecX

func (nlc *NodeListCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*NodeListCreate) Mutation

func (nlc *NodeListCreate) Mutation() *NodeListMutation

Mutation returns the NodeListMutation object of the builder.

func (*NodeListCreate) OnConflict

func (nlc *NodeListCreate) OnConflict(opts ...sql.ConflictOption) *NodeListUpsertOne

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.NodeList.Create().
	SetRootElements(v).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.NodeListUpsert) {
		SetRootElements(v+v).
	}).
	Exec(ctx)

func (*NodeListCreate) OnConflictColumns

func (nlc *NodeListCreate) OnConflictColumns(columns ...string) *NodeListUpsertOne

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.NodeList.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*NodeListCreate) Save

func (nlc *NodeListCreate) Save(ctx context.Context) (*NodeList, error)

Save creates the NodeList in the database.

func (*NodeListCreate) SaveX

func (nlc *NodeListCreate) SaveX(ctx context.Context) *NodeList

SaveX calls Save and panics if Save returns an error.

func (*NodeListCreate) SetDocument

func (nlc *NodeListCreate) SetDocument(d *Document) *NodeListCreate

SetDocument sets the "document" edge to the Document entity.

func (*NodeListCreate) SetDocumentID

func (nlc *NodeListCreate) SetDocumentID(id int) *NodeListCreate

SetDocumentID sets the "document" edge to the Document entity by ID.

func (*NodeListCreate) SetNillableDocumentID

func (nlc *NodeListCreate) SetNillableDocumentID(id *int) *NodeListCreate

SetNillableDocumentID sets the "document" edge to the Document entity by ID if the given value is not nil.

func (*NodeListCreate) SetRootElements

func (nlc *NodeListCreate) SetRootElements(s []string) *NodeListCreate

SetRootElements sets the "root_elements" field.

type NodeListCreateBulk

type NodeListCreateBulk struct {
	// contains filtered or unexported fields
}

NodeListCreateBulk is the builder for creating many NodeList entities in bulk.

func (*NodeListCreateBulk) Exec

func (nlcb *NodeListCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*NodeListCreateBulk) ExecX

func (nlcb *NodeListCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*NodeListCreateBulk) OnConflict

func (nlcb *NodeListCreateBulk) OnConflict(opts ...sql.ConflictOption) *NodeListUpsertBulk

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.NodeList.CreateBulk(builders...).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.NodeListUpsert) {
		SetRootElements(v+v).
	}).
	Exec(ctx)

func (*NodeListCreateBulk) OnConflictColumns

func (nlcb *NodeListCreateBulk) OnConflictColumns(columns ...string) *NodeListUpsertBulk

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.NodeList.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*NodeListCreateBulk) Save

func (nlcb *NodeListCreateBulk) Save(ctx context.Context) ([]*NodeList, error)

Save creates the NodeList entities in the database.

func (*NodeListCreateBulk) SaveX

func (nlcb *NodeListCreateBulk) SaveX(ctx context.Context) []*NodeList

SaveX is like Save, but panics if an error occurs.

type NodeListDelete

type NodeListDelete struct {
	// contains filtered or unexported fields
}

NodeListDelete is the builder for deleting a NodeList entity.

func (*NodeListDelete) Exec

func (nld *NodeListDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*NodeListDelete) ExecX

func (nld *NodeListDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*NodeListDelete) Where

func (nld *NodeListDelete) Where(ps ...predicate.NodeList) *NodeListDelete

Where appends a list predicates to the NodeListDelete builder.

type NodeListDeleteOne

type NodeListDeleteOne struct {
	// contains filtered or unexported fields
}

NodeListDeleteOne is the builder for deleting a single NodeList entity.

func (*NodeListDeleteOne) Exec

func (nldo *NodeListDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*NodeListDeleteOne) ExecX

func (nldo *NodeListDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*NodeListDeleteOne) Where

Where appends a list predicates to the NodeListDelete builder.

type NodeListEdges

type NodeListEdges struct {
	// Nodes holds the value of the nodes edge.
	Nodes []*Node `json:"nodes,omitempty"`
	// Document holds the value of the document edge.
	Document *Document `json:"document,omitempty"`
	// contains filtered or unexported fields
}

NodeListEdges holds the relations/edges for other nodes in the graph.

func (NodeListEdges) DocumentOrErr

func (e NodeListEdges) DocumentOrErr() (*Document, error)

DocumentOrErr returns the Document value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

func (NodeListEdges) NodesOrErr

func (e NodeListEdges) NodesOrErr() ([]*Node, error)

NodesOrErr returns the Nodes value or an error if the edge was not loaded in eager-loading.

type NodeListGroupBy

type NodeListGroupBy struct {
	// contains filtered or unexported fields
}

NodeListGroupBy is the group-by builder for NodeList entities.

func (*NodeListGroupBy) Aggregate

func (nlgb *NodeListGroupBy) Aggregate(fns ...AggregateFunc) *NodeListGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*NodeListGroupBy) Bool

func (s *NodeListGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*NodeListGroupBy) BoolX

func (s *NodeListGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*NodeListGroupBy) Bools

func (s *NodeListGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*NodeListGroupBy) BoolsX

func (s *NodeListGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*NodeListGroupBy) Float64

func (s *NodeListGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*NodeListGroupBy) Float64X

func (s *NodeListGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*NodeListGroupBy) Float64s

func (s *NodeListGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*NodeListGroupBy) Float64sX

func (s *NodeListGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*NodeListGroupBy) Int

func (s *NodeListGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*NodeListGroupBy) IntX

func (s *NodeListGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*NodeListGroupBy) Ints

func (s *NodeListGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*NodeListGroupBy) IntsX

func (s *NodeListGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*NodeListGroupBy) Scan

func (nlgb *NodeListGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*NodeListGroupBy) ScanX

func (s *NodeListGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*NodeListGroupBy) String

func (s *NodeListGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*NodeListGroupBy) StringX

func (s *NodeListGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*NodeListGroupBy) Strings

func (s *NodeListGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*NodeListGroupBy) StringsX

func (s *NodeListGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type NodeListMutation

type NodeListMutation struct {
	// contains filtered or unexported fields
}

NodeListMutation represents an operation that mutates the NodeList nodes in the graph.

func (*NodeListMutation) AddField

func (m *NodeListMutation) 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 (*NodeListMutation) AddNodeIDs

func (m *NodeListMutation) AddNodeIDs(ids ...string)

AddNodeIDs adds the "nodes" edge to the Node entity by ids.

func (*NodeListMutation) AddedEdges

func (m *NodeListMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*NodeListMutation) AddedField

func (m *NodeListMutation) 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 (*NodeListMutation) AddedFields

func (m *NodeListMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*NodeListMutation) AddedIDs

func (m *NodeListMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*NodeListMutation) AppendRootElements

func (m *NodeListMutation) AppendRootElements(s []string)

AppendRootElements adds s to the "root_elements" field.

func (*NodeListMutation) AppendedRootElements

func (m *NodeListMutation) AppendedRootElements() ([]string, bool)

AppendedRootElements returns the list of values that were appended to the "root_elements" field in this mutation.

func (*NodeListMutation) ClearDocument

func (m *NodeListMutation) ClearDocument()

ClearDocument clears the "document" edge to the Document entity.

func (*NodeListMutation) ClearEdge

func (m *NodeListMutation) 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 (*NodeListMutation) ClearField

func (m *NodeListMutation) 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 (*NodeListMutation) ClearNodes

func (m *NodeListMutation) ClearNodes()

ClearNodes clears the "nodes" edge to the Node entity.

func (*NodeListMutation) ClearedEdges

func (m *NodeListMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*NodeListMutation) ClearedFields

func (m *NodeListMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (NodeListMutation) Client

func (m NodeListMutation) 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 (*NodeListMutation) DocumentCleared

func (m *NodeListMutation) DocumentCleared() bool

DocumentCleared reports if the "document" edge to the Document entity was cleared.

func (*NodeListMutation) DocumentID

func (m *NodeListMutation) DocumentID() (id int, exists bool)

DocumentID returns the "document" edge ID in the mutation.

func (*NodeListMutation) DocumentIDs

func (m *NodeListMutation) DocumentIDs() (ids []int)

DocumentIDs returns the "document" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use DocumentID instead. It exists only for internal usage by the builders.

func (*NodeListMutation) EdgeCleared

func (m *NodeListMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*NodeListMutation) Field

func (m *NodeListMutation) 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 (*NodeListMutation) FieldCleared

func (m *NodeListMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*NodeListMutation) Fields

func (m *NodeListMutation) 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 (*NodeListMutation) ID

func (m *NodeListMutation) ID() (id int, exists bool)

ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.

func (*NodeListMutation) IDs

func (m *NodeListMutation) IDs(ctx context.Context) ([]int, error)

IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.

func (*NodeListMutation) NodesCleared

func (m *NodeListMutation) NodesCleared() bool

NodesCleared reports if the "nodes" edge to the Node entity was cleared.

func (*NodeListMutation) NodesIDs

func (m *NodeListMutation) NodesIDs() (ids []string)

NodesIDs returns the "nodes" edge IDs in the mutation.

func (*NodeListMutation) OldField

func (m *NodeListMutation) 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 (*NodeListMutation) OldRootElements

func (m *NodeListMutation) OldRootElements(ctx context.Context) (v []string, err error)

OldRootElements returns the old "root_elements" field's value of the NodeList entity. If the NodeList 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 (*NodeListMutation) Op

func (m *NodeListMutation) Op() Op

Op returns the operation name.

func (*NodeListMutation) RemoveNodeIDs

func (m *NodeListMutation) RemoveNodeIDs(ids ...string)

RemoveNodeIDs removes the "nodes" edge to the Node entity by IDs.

func (*NodeListMutation) RemovedEdges

func (m *NodeListMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*NodeListMutation) RemovedIDs

func (m *NodeListMutation) 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 (*NodeListMutation) RemovedNodesIDs

func (m *NodeListMutation) RemovedNodesIDs() (ids []string)

RemovedNodes returns the removed IDs of the "nodes" edge to the Node entity.

func (*NodeListMutation) ResetDocument

func (m *NodeListMutation) ResetDocument()

ResetDocument resets all changes to the "document" edge.

func (*NodeListMutation) ResetEdge

func (m *NodeListMutation) 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 (*NodeListMutation) ResetField

func (m *NodeListMutation) 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 (*NodeListMutation) ResetNodes

func (m *NodeListMutation) ResetNodes()

ResetNodes resets all changes to the "nodes" edge.

func (*NodeListMutation) ResetRootElements

func (m *NodeListMutation) ResetRootElements()

ResetRootElements resets all changes to the "root_elements" field.

func (*NodeListMutation) RootElements

func (m *NodeListMutation) RootElements() (r []string, exists bool)

RootElements returns the value of the "root_elements" field in the mutation.

func (*NodeListMutation) SetDocumentID

func (m *NodeListMutation) SetDocumentID(id int)

SetDocumentID sets the "document" edge to the Document entity by id.

func (*NodeListMutation) SetField

func (m *NodeListMutation) 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 (*NodeListMutation) SetOp

func (m *NodeListMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*NodeListMutation) SetRootElements

func (m *NodeListMutation) SetRootElements(s []string)

SetRootElements sets the "root_elements" field.

func (NodeListMutation) Tx

func (m NodeListMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*NodeListMutation) Type

func (m *NodeListMutation) Type() string

Type returns the node type of this mutation (NodeList).

func (*NodeListMutation) Where

func (m *NodeListMutation) Where(ps ...predicate.NodeList)

Where appends a list predicates to the NodeListMutation builder.

func (*NodeListMutation) WhereP

func (m *NodeListMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the NodeListMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type NodeListQuery

type NodeListQuery struct {
	// contains filtered or unexported fields
}

NodeListQuery is the builder for querying NodeList entities.

func (*NodeListQuery) Aggregate

func (nlq *NodeListQuery) Aggregate(fns ...AggregateFunc) *NodeListSelect

Aggregate returns a NodeListSelect configured with the given aggregations.

func (*NodeListQuery) All

func (nlq *NodeListQuery) All(ctx context.Context) ([]*NodeList, error)

All executes the query and returns a list of NodeLists.

func (*NodeListQuery) AllX

func (nlq *NodeListQuery) AllX(ctx context.Context) []*NodeList

AllX is like All, but panics if an error occurs.

func (*NodeListQuery) Clone

func (nlq *NodeListQuery) Clone() *NodeListQuery

Clone returns a duplicate of the NodeListQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*NodeListQuery) Count

func (nlq *NodeListQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*NodeListQuery) CountX

func (nlq *NodeListQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*NodeListQuery) Exist

func (nlq *NodeListQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*NodeListQuery) ExistX

func (nlq *NodeListQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*NodeListQuery) First

func (nlq *NodeListQuery) First(ctx context.Context) (*NodeList, error)

First returns the first NodeList entity from the query. Returns a *NotFoundError when no NodeList was found.

func (*NodeListQuery) FirstID

func (nlq *NodeListQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first NodeList ID from the query. Returns a *NotFoundError when no NodeList ID was found.

func (*NodeListQuery) FirstIDX

func (nlq *NodeListQuery) FirstIDX(ctx context.Context) int

FirstIDX is like FirstID, but panics if an error occurs.

func (*NodeListQuery) FirstX

func (nlq *NodeListQuery) FirstX(ctx context.Context) *NodeList

FirstX is like First, but panics if an error occurs.

func (*NodeListQuery) GroupBy

func (nlq *NodeListQuery) GroupBy(field string, fields ...string) *NodeListGroupBy

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 {
	RootElements []string `json:"root_elements,omitempty"`
	Count int `json:"count,omitempty"`
}

client.NodeList.Query().
	GroupBy(nodelist.FieldRootElements).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*NodeListQuery) IDs

func (nlq *NodeListQuery) IDs(ctx context.Context) (ids []int, err error)

IDs executes the query and returns a list of NodeList IDs.

func (*NodeListQuery) IDsX

func (nlq *NodeListQuery) IDsX(ctx context.Context) []int

IDsX is like IDs, but panics if an error occurs.

func (*NodeListQuery) Limit

func (nlq *NodeListQuery) Limit(limit int) *NodeListQuery

Limit the number of records to be returned by this query.

func (*NodeListQuery) Offset

func (nlq *NodeListQuery) Offset(offset int) *NodeListQuery

Offset to start from.

func (*NodeListQuery) Only

func (nlq *NodeListQuery) Only(ctx context.Context) (*NodeList, error)

Only returns a single NodeList entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one NodeList entity is found. Returns a *NotFoundError when no NodeList entities are found.

func (*NodeListQuery) OnlyID

func (nlq *NodeListQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID is like Only, but returns the only NodeList ID in the query. Returns a *NotSingularError when more than one NodeList ID is found. Returns a *NotFoundError when no entities are found.

func (*NodeListQuery) OnlyIDX

func (nlq *NodeListQuery) OnlyIDX(ctx context.Context) int

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*NodeListQuery) OnlyX

func (nlq *NodeListQuery) OnlyX(ctx context.Context) *NodeList

OnlyX is like Only, but panics if an error occurs.

func (*NodeListQuery) Order

func (nlq *NodeListQuery) Order(o ...nodelist.OrderOption) *NodeListQuery

Order specifies how the records should be ordered.

func (*NodeListQuery) QueryDocument

func (nlq *NodeListQuery) QueryDocument() *DocumentQuery

QueryDocument chains the current query on the "document" edge.

func (*NodeListQuery) QueryNodes

func (nlq *NodeListQuery) QueryNodes() *NodeQuery

QueryNodes chains the current query on the "nodes" edge.

func (*NodeListQuery) Select

func (nlq *NodeListQuery) Select(fields ...string) *NodeListSelect

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 {
	RootElements []string `json:"root_elements,omitempty"`
}

client.NodeList.Query().
	Select(nodelist.FieldRootElements).
	Scan(ctx, &v)

func (*NodeListQuery) Unique

func (nlq *NodeListQuery) Unique(unique bool) *NodeListQuery

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 (*NodeListQuery) Where

func (nlq *NodeListQuery) Where(ps ...predicate.NodeList) *NodeListQuery

Where adds a new predicate for the NodeListQuery builder.

func (*NodeListQuery) WithDocument

func (nlq *NodeListQuery) WithDocument(opts ...func(*DocumentQuery)) *NodeListQuery

WithDocument tells the query-builder to eager-load the nodes that are connected to the "document" edge. The optional arguments are used to configure the query builder of the edge.

func (*NodeListQuery) WithNodes

func (nlq *NodeListQuery) WithNodes(opts ...func(*NodeQuery)) *NodeListQuery

WithNodes tells the query-builder to eager-load the nodes that are connected to the "nodes" edge. The optional arguments are used to configure the query builder of the edge.

type NodeListSelect

type NodeListSelect struct {
	*NodeListQuery
	// contains filtered or unexported fields
}

NodeListSelect is the builder for selecting fields of NodeList entities.

func (*NodeListSelect) Aggregate

func (nls *NodeListSelect) Aggregate(fns ...AggregateFunc) *NodeListSelect

Aggregate adds the given aggregation functions to the selector query.

func (*NodeListSelect) Bool

func (s *NodeListSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*NodeListSelect) BoolX

func (s *NodeListSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*NodeListSelect) Bools

func (s *NodeListSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*NodeListSelect) BoolsX

func (s *NodeListSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*NodeListSelect) Float64

func (s *NodeListSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*NodeListSelect) Float64X

func (s *NodeListSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*NodeListSelect) Float64s

func (s *NodeListSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*NodeListSelect) Float64sX

func (s *NodeListSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*NodeListSelect) Int

func (s *NodeListSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*NodeListSelect) IntX

func (s *NodeListSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*NodeListSelect) Ints

func (s *NodeListSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*NodeListSelect) IntsX

func (s *NodeListSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*NodeListSelect) Scan

func (nls *NodeListSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*NodeListSelect) ScanX

func (s *NodeListSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*NodeListSelect) String

func (s *NodeListSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*NodeListSelect) StringX

func (s *NodeListSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*NodeListSelect) Strings

func (s *NodeListSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*NodeListSelect) StringsX

func (s *NodeListSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type NodeListUpdate

type NodeListUpdate struct {
	// contains filtered or unexported fields
}

NodeListUpdate is the builder for updating NodeList entities.

func (*NodeListUpdate) AddNodeIDs

func (nlu *NodeListUpdate) AddNodeIDs(ids ...string) *NodeListUpdate

AddNodeIDs adds the "nodes" edge to the Node entity by IDs.

func (*NodeListUpdate) AddNodes

func (nlu *NodeListUpdate) AddNodes(n ...*Node) *NodeListUpdate

AddNodes adds the "nodes" edges to the Node entity.

func (*NodeListUpdate) AppendRootElements

func (nlu *NodeListUpdate) AppendRootElements(s []string) *NodeListUpdate

AppendRootElements appends s to the "root_elements" field.

func (*NodeListUpdate) ClearDocument

func (nlu *NodeListUpdate) ClearDocument() *NodeListUpdate

ClearDocument clears the "document" edge to the Document entity.

func (*NodeListUpdate) ClearNodes

func (nlu *NodeListUpdate) ClearNodes() *NodeListUpdate

ClearNodes clears all "nodes" edges to the Node entity.

func (*NodeListUpdate) Exec

func (nlu *NodeListUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*NodeListUpdate) ExecX

func (nlu *NodeListUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*NodeListUpdate) Mutation

func (nlu *NodeListUpdate) Mutation() *NodeListMutation

Mutation returns the NodeListMutation object of the builder.

func (*NodeListUpdate) RemoveNodeIDs

func (nlu *NodeListUpdate) RemoveNodeIDs(ids ...string) *NodeListUpdate

RemoveNodeIDs removes the "nodes" edge to Node entities by IDs.

func (*NodeListUpdate) RemoveNodes

func (nlu *NodeListUpdate) RemoveNodes(n ...*Node) *NodeListUpdate

RemoveNodes removes "nodes" edges to Node entities.

func (*NodeListUpdate) Save

func (nlu *NodeListUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*NodeListUpdate) SaveX

func (nlu *NodeListUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*NodeListUpdate) SetDocument

func (nlu *NodeListUpdate) SetDocument(d *Document) *NodeListUpdate

SetDocument sets the "document" edge to the Document entity.

func (*NodeListUpdate) SetDocumentID

func (nlu *NodeListUpdate) SetDocumentID(id int) *NodeListUpdate

SetDocumentID sets the "document" edge to the Document entity by ID.

func (*NodeListUpdate) SetNillableDocumentID

func (nlu *NodeListUpdate) SetNillableDocumentID(id *int) *NodeListUpdate

SetNillableDocumentID sets the "document" edge to the Document entity by ID if the given value is not nil.

func (*NodeListUpdate) SetRootElements

func (nlu *NodeListUpdate) SetRootElements(s []string) *NodeListUpdate

SetRootElements sets the "root_elements" field.

func (*NodeListUpdate) Where

func (nlu *NodeListUpdate) Where(ps ...predicate.NodeList) *NodeListUpdate

Where appends a list predicates to the NodeListUpdate builder.

type NodeListUpdateOne

type NodeListUpdateOne struct {
	// contains filtered or unexported fields
}

NodeListUpdateOne is the builder for updating a single NodeList entity.

func (*NodeListUpdateOne) AddNodeIDs

func (nluo *NodeListUpdateOne) AddNodeIDs(ids ...string) *NodeListUpdateOne

AddNodeIDs adds the "nodes" edge to the Node entity by IDs.

func (*NodeListUpdateOne) AddNodes

func (nluo *NodeListUpdateOne) AddNodes(n ...*Node) *NodeListUpdateOne

AddNodes adds the "nodes" edges to the Node entity.

func (*NodeListUpdateOne) AppendRootElements

func (nluo *NodeListUpdateOne) AppendRootElements(s []string) *NodeListUpdateOne

AppendRootElements appends s to the "root_elements" field.

func (*NodeListUpdateOne) ClearDocument

func (nluo *NodeListUpdateOne) ClearDocument() *NodeListUpdateOne

ClearDocument clears the "document" edge to the Document entity.

func (*NodeListUpdateOne) ClearNodes

func (nluo *NodeListUpdateOne) ClearNodes() *NodeListUpdateOne

ClearNodes clears all "nodes" edges to the Node entity.

func (*NodeListUpdateOne) Exec

func (nluo *NodeListUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*NodeListUpdateOne) ExecX

func (nluo *NodeListUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*NodeListUpdateOne) Mutation

func (nluo *NodeListUpdateOne) Mutation() *NodeListMutation

Mutation returns the NodeListMutation object of the builder.

func (*NodeListUpdateOne) RemoveNodeIDs

func (nluo *NodeListUpdateOne) RemoveNodeIDs(ids ...string) *NodeListUpdateOne

RemoveNodeIDs removes the "nodes" edge to Node entities by IDs.

func (*NodeListUpdateOne) RemoveNodes

func (nluo *NodeListUpdateOne) RemoveNodes(n ...*Node) *NodeListUpdateOne

RemoveNodes removes "nodes" edges to Node entities.

func (*NodeListUpdateOne) Save

func (nluo *NodeListUpdateOne) Save(ctx context.Context) (*NodeList, error)

Save executes the query and returns the updated NodeList entity.

func (*NodeListUpdateOne) SaveX

func (nluo *NodeListUpdateOne) SaveX(ctx context.Context) *NodeList

SaveX is like Save, but panics if an error occurs.

func (*NodeListUpdateOne) Select

func (nluo *NodeListUpdateOne) Select(field string, fields ...string) *NodeListUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*NodeListUpdateOne) SetDocument

func (nluo *NodeListUpdateOne) SetDocument(d *Document) *NodeListUpdateOne

SetDocument sets the "document" edge to the Document entity.

func (*NodeListUpdateOne) SetDocumentID

func (nluo *NodeListUpdateOne) SetDocumentID(id int) *NodeListUpdateOne

SetDocumentID sets the "document" edge to the Document entity by ID.

func (*NodeListUpdateOne) SetNillableDocumentID

func (nluo *NodeListUpdateOne) SetNillableDocumentID(id *int) *NodeListUpdateOne

SetNillableDocumentID sets the "document" edge to the Document entity by ID if the given value is not nil.

func (*NodeListUpdateOne) SetRootElements

func (nluo *NodeListUpdateOne) SetRootElements(s []string) *NodeListUpdateOne

SetRootElements sets the "root_elements" field.

func (*NodeListUpdateOne) Where

Where appends a list predicates to the NodeListUpdate builder.

type NodeListUpsert

type NodeListUpsert struct {
	*sql.UpdateSet
}

NodeListUpsert is the "OnConflict" setter.

func (*NodeListUpsert) SetRootElements

func (u *NodeListUpsert) SetRootElements(v []string) *NodeListUpsert

SetRootElements sets the "root_elements" field.

func (*NodeListUpsert) UpdateRootElements

func (u *NodeListUpsert) UpdateRootElements() *NodeListUpsert

UpdateRootElements sets the "root_elements" field to the value that was provided on create.

type NodeListUpsertBulk

type NodeListUpsertBulk struct {
	// contains filtered or unexported fields
}

NodeListUpsertBulk is the builder for "upsert"-ing a bulk of NodeList nodes.

func (*NodeListUpsertBulk) DoNothing

func (u *NodeListUpsertBulk) DoNothing() *NodeListUpsertBulk

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*NodeListUpsertBulk) Exec

func (u *NodeListUpsertBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*NodeListUpsertBulk) ExecX

func (u *NodeListUpsertBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*NodeListUpsertBulk) Ignore

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.NodeList.Create().
	OnConflict(sql.ResolveWithIgnore()).
	Exec(ctx)

func (*NodeListUpsertBulk) SetRootElements

func (u *NodeListUpsertBulk) SetRootElements(v []string) *NodeListUpsertBulk

SetRootElements sets the "root_elements" field.

func (*NodeListUpsertBulk) Update

func (u *NodeListUpsertBulk) Update(set func(*NodeListUpsert)) *NodeListUpsertBulk

Update allows overriding fields `UPDATE` values. See the NodeListCreateBulk.OnConflict documentation for more info.

func (*NodeListUpsertBulk) UpdateNewValues

func (u *NodeListUpsertBulk) UpdateNewValues() *NodeListUpsertBulk

UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:

client.NodeList.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
	).
	Exec(ctx)

func (*NodeListUpsertBulk) UpdateRootElements

func (u *NodeListUpsertBulk) UpdateRootElements() *NodeListUpsertBulk

UpdateRootElements sets the "root_elements" field to the value that was provided on create.

type NodeListUpsertOne

type NodeListUpsertOne struct {
	// contains filtered or unexported fields
}

NodeListUpsertOne is the builder for "upsert"-ing

one NodeList node.

func (*NodeListUpsertOne) DoNothing

func (u *NodeListUpsertOne) DoNothing() *NodeListUpsertOne

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*NodeListUpsertOne) Exec

func (u *NodeListUpsertOne) Exec(ctx context.Context) error

Exec executes the query.

func (*NodeListUpsertOne) ExecX

func (u *NodeListUpsertOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*NodeListUpsertOne) ID

func (u *NodeListUpsertOne) ID(ctx context.Context) (id int, err error)

Exec executes the UPSERT query and returns the inserted/updated ID.

func (*NodeListUpsertOne) IDX

func (u *NodeListUpsertOne) IDX(ctx context.Context) int

IDX is like ID, but panics if an error occurs.

func (*NodeListUpsertOne) Ignore

func (u *NodeListUpsertOne) Ignore() *NodeListUpsertOne

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.NodeList.Create().
    OnConflict(sql.ResolveWithIgnore()).
    Exec(ctx)

func (*NodeListUpsertOne) SetRootElements

func (u *NodeListUpsertOne) SetRootElements(v []string) *NodeListUpsertOne

SetRootElements sets the "root_elements" field.

func (*NodeListUpsertOne) Update

func (u *NodeListUpsertOne) Update(set func(*NodeListUpsert)) *NodeListUpsertOne

Update allows overriding fields `UPDATE` values. See the NodeListCreate.OnConflict documentation for more info.

func (*NodeListUpsertOne) UpdateNewValues

func (u *NodeListUpsertOne) UpdateNewValues() *NodeListUpsertOne

UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:

client.NodeList.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
	).
	Exec(ctx)

func (*NodeListUpsertOne) UpdateRootElements

func (u *NodeListUpsertOne) UpdateRootElements() *NodeListUpsertOne

UpdateRootElements sets the "root_elements" field to the value that was provided on create.

type NodeLists

type NodeLists []*NodeList

NodeLists is a parsable slice of NodeList.

type NodeMutation

type NodeMutation struct {
	// contains filtered or unexported fields
}

NodeMutation represents an operation that mutates the Node nodes in the graph.

func (*NodeMutation) AddEdgeTypeIDs

func (m *NodeMutation) AddEdgeTypeIDs(ids ...int)

AddEdgeTypeIDs adds the "edge_types" edge to the EdgeType entity by ids.

func (*NodeMutation) AddExternalReferenceIDs

func (m *NodeMutation) AddExternalReferenceIDs(ids ...int)

AddExternalReferenceIDs adds the "external_references" edge to the ExternalReference entity by ids.

func (*NodeMutation) AddField

func (m *NodeMutation) 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 (*NodeMutation) AddHashIDs

func (m *NodeMutation) AddHashIDs(ids ...int)

AddHashIDs adds the "hashes" edge to the HashesEntry entity by ids.

func (*NodeMutation) AddIdentifierIDs

func (m *NodeMutation) AddIdentifierIDs(ids ...int)

AddIdentifierIDs adds the "identifiers" edge to the IdentifiersEntry entity by ids.

func (*NodeMutation) AddNodeIDs

func (m *NodeMutation) AddNodeIDs(ids ...string)

AddNodeIDs adds the "nodes" edge to the Node entity by ids.

func (*NodeMutation) AddOriginatorIDs

func (m *NodeMutation) AddOriginatorIDs(ids ...int)

AddOriginatorIDs adds the "originators" edge to the Person entity by ids.

func (*NodeMutation) AddPrimaryPurposeIDs

func (m *NodeMutation) AddPrimaryPurposeIDs(ids ...int)

AddPrimaryPurposeIDs adds the "primary_purpose" edge to the Purpose entity by ids.

func (*NodeMutation) AddSupplierIDs

func (m *NodeMutation) AddSupplierIDs(ids ...int)

AddSupplierIDs adds the "suppliers" edge to the Person entity by ids.

func (*NodeMutation) AddedEdges

func (m *NodeMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*NodeMutation) AddedField

func (m *NodeMutation) 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 (*NodeMutation) AddedFields

func (m *NodeMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*NodeMutation) AddedIDs

func (m *NodeMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*NodeMutation) AppendAttribution

func (m *NodeMutation) AppendAttribution(s []string)

AppendAttribution adds s to the "attribution" field.

func (*NodeMutation) AppendFileTypes

func (m *NodeMutation) AppendFileTypes(s []string)

AppendFileTypes adds s to the "file_types" field.

func (*NodeMutation) AppendLicenses

func (m *NodeMutation) AppendLicenses(s []string)

AppendLicenses adds s to the "licenses" field.

func (*NodeMutation) AppendedAttribution

func (m *NodeMutation) AppendedAttribution() ([]string, bool)

AppendedAttribution returns the list of values that were appended to the "attribution" field in this mutation.

func (*NodeMutation) AppendedFileTypes

func (m *NodeMutation) AppendedFileTypes() ([]string, bool)

AppendedFileTypes returns the list of values that were appended to the "file_types" field in this mutation.

func (*NodeMutation) AppendedLicenses

func (m *NodeMutation) AppendedLicenses() ([]string, bool)

AppendedLicenses returns the list of values that were appended to the "licenses" field in this mutation.

func (*NodeMutation) Attribution

func (m *NodeMutation) Attribution() (r []string, exists bool)

Attribution returns the value of the "attribution" field in the mutation.

func (*NodeMutation) BuildDate

func (m *NodeMutation) BuildDate() (r time.Time, exists bool)

BuildDate returns the value of the "build_date" field in the mutation.

func (*NodeMutation) ClearEdge

func (m *NodeMutation) 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 (*NodeMutation) ClearEdgeTypes

func (m *NodeMutation) ClearEdgeTypes()

ClearEdgeTypes clears the "edge_types" edge to the EdgeType entity.

func (*NodeMutation) ClearExternalReferences

func (m *NodeMutation) ClearExternalReferences()

ClearExternalReferences clears the "external_references" edge to the ExternalReference entity.

func (*NodeMutation) ClearField

func (m *NodeMutation) 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 (*NodeMutation) ClearHashes

func (m *NodeMutation) ClearHashes()

ClearHashes clears the "hashes" edge to the HashesEntry entity.

func (*NodeMutation) ClearIdentifiers

func (m *NodeMutation) ClearIdentifiers()

ClearIdentifiers clears the "identifiers" edge to the IdentifiersEntry entity.

func (*NodeMutation) ClearNodeList

func (m *NodeMutation) ClearNodeList()

ClearNodeList clears the "node_list" edge to the NodeList entity.

func (*NodeMutation) ClearNodes

func (m *NodeMutation) ClearNodes()

ClearNodes clears the "nodes" edge to the Node entity.

func (*NodeMutation) ClearOriginators

func (m *NodeMutation) ClearOriginators()

ClearOriginators clears the "originators" edge to the Person entity.

func (*NodeMutation) ClearPrimaryPurpose

func (m *NodeMutation) ClearPrimaryPurpose()

ClearPrimaryPurpose clears the "primary_purpose" edge to the Purpose entity.

func (*NodeMutation) ClearSuppliers

func (m *NodeMutation) ClearSuppliers()

ClearSuppliers clears the "suppliers" edge to the Person entity.

func (*NodeMutation) ClearedEdges

func (m *NodeMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*NodeMutation) ClearedFields

func (m *NodeMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (NodeMutation) Client

func (m NodeMutation) 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 (*NodeMutation) Comment

func (m *NodeMutation) Comment() (r string, exists bool)

Comment returns the value of the "comment" field in the mutation.

func (*NodeMutation) Copyright

func (m *NodeMutation) Copyright() (r string, exists bool)

Copyright returns the value of the "copyright" field in the mutation.

func (*NodeMutation) Description

func (m *NodeMutation) Description() (r string, exists bool)

Description returns the value of the "description" field in the mutation.

func (*NodeMutation) EdgeCleared

func (m *NodeMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*NodeMutation) EdgeTypesCleared

func (m *NodeMutation) EdgeTypesCleared() bool

EdgeTypesCleared reports if the "edge_types" edge to the EdgeType entity was cleared.

func (*NodeMutation) EdgeTypesIDs

func (m *NodeMutation) EdgeTypesIDs() (ids []int)

EdgeTypesIDs returns the "edge_types" edge IDs in the mutation.

func (*NodeMutation) ExternalReferencesCleared

func (m *NodeMutation) ExternalReferencesCleared() bool

ExternalReferencesCleared reports if the "external_references" edge to the ExternalReference entity was cleared.

func (*NodeMutation) ExternalReferencesIDs

func (m *NodeMutation) ExternalReferencesIDs() (ids []int)

ExternalReferencesIDs returns the "external_references" edge IDs in the mutation.

func (*NodeMutation) Field

func (m *NodeMutation) 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 (*NodeMutation) FieldCleared

func (m *NodeMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*NodeMutation) Fields

func (m *NodeMutation) 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 (*NodeMutation) FileName

func (m *NodeMutation) FileName() (r string, exists bool)

FileName returns the value of the "file_name" field in the mutation.

func (*NodeMutation) FileTypes

func (m *NodeMutation) FileTypes() (r []string, exists bool)

FileTypes returns the value of the "file_types" field in the mutation.

func (*NodeMutation) GetType

func (m *NodeMutation) GetType() (r node.Type, exists bool)

GetType returns the value of the "type" field in the mutation.

func (*NodeMutation) HashesCleared

func (m *NodeMutation) HashesCleared() bool

HashesCleared reports if the "hashes" edge to the HashesEntry entity was cleared.

func (*NodeMutation) HashesIDs

func (m *NodeMutation) HashesIDs() (ids []int)

HashesIDs returns the "hashes" edge IDs in the mutation.

func (*NodeMutation) ID

func (m *NodeMutation) 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 (*NodeMutation) IDs

func (m *NodeMutation) 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 (*NodeMutation) IdentifiersCleared

func (m *NodeMutation) IdentifiersCleared() bool

IdentifiersCleared reports if the "identifiers" edge to the IdentifiersEntry entity was cleared.

func (*NodeMutation) IdentifiersIDs

func (m *NodeMutation) IdentifiersIDs() (ids []int)

IdentifiersIDs returns the "identifiers" edge IDs in the mutation.

func (*NodeMutation) LicenseComments

func (m *NodeMutation) LicenseComments() (r string, exists bool)

LicenseComments returns the value of the "license_comments" field in the mutation.

func (*NodeMutation) LicenseConcluded

func (m *NodeMutation) LicenseConcluded() (r string, exists bool)

LicenseConcluded returns the value of the "license_concluded" field in the mutation.

func (*NodeMutation) Licenses

func (m *NodeMutation) Licenses() (r []string, exists bool)

Licenses returns the value of the "licenses" field in the mutation.

func (*NodeMutation) Name

func (m *NodeMutation) Name() (r string, exists bool)

Name returns the value of the "name" field in the mutation.

func (*NodeMutation) NodeListCleared

func (m *NodeMutation) NodeListCleared() bool

NodeListCleared reports if the "node_list" edge to the NodeList entity was cleared.

func (*NodeMutation) NodeListID

func (m *NodeMutation) NodeListID() (id int, exists bool)

NodeListID returns the "node_list" edge ID in the mutation.

func (*NodeMutation) NodeListIDs

func (m *NodeMutation) NodeListIDs() (ids []int)

NodeListIDs returns the "node_list" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use NodeListID instead. It exists only for internal usage by the builders.

func (*NodeMutation) NodesCleared

func (m *NodeMutation) NodesCleared() bool

NodesCleared reports if the "nodes" edge to the Node entity was cleared.

func (*NodeMutation) NodesIDs

func (m *NodeMutation) NodesIDs() (ids []string)

NodesIDs returns the "nodes" edge IDs in the mutation.

func (*NodeMutation) OldAttribution

func (m *NodeMutation) OldAttribution(ctx context.Context) (v []string, err error)

OldAttribution returns the old "attribution" field's value of the Node entity. If the Node 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 (*NodeMutation) OldBuildDate

func (m *NodeMutation) OldBuildDate(ctx context.Context) (v time.Time, err error)

OldBuildDate returns the old "build_date" field's value of the Node entity. If the Node 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 (*NodeMutation) OldComment

func (m *NodeMutation) OldComment(ctx context.Context) (v string, err error)

OldComment returns the old "comment" field's value of the Node entity. If the Node 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 (*NodeMutation) OldCopyright

func (m *NodeMutation) OldCopyright(ctx context.Context) (v string, err error)

OldCopyright returns the old "copyright" field's value of the Node entity. If the Node 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 (*NodeMutation) OldDescription

func (m *NodeMutation) OldDescription(ctx context.Context) (v string, err error)

OldDescription returns the old "description" field's value of the Node entity. If the Node 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 (*NodeMutation) OldField

func (m *NodeMutation) 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 (*NodeMutation) OldFileName

func (m *NodeMutation) OldFileName(ctx context.Context) (v string, err error)

OldFileName returns the old "file_name" field's value of the Node entity. If the Node 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 (*NodeMutation) OldFileTypes

func (m *NodeMutation) OldFileTypes(ctx context.Context) (v []string, err error)

OldFileTypes returns the old "file_types" field's value of the Node entity. If the Node 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 (*NodeMutation) OldLicenseComments

func (m *NodeMutation) OldLicenseComments(ctx context.Context) (v string, err error)

OldLicenseComments returns the old "license_comments" field's value of the Node entity. If the Node 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 (*NodeMutation) OldLicenseConcluded

func (m *NodeMutation) OldLicenseConcluded(ctx context.Context) (v string, err error)

OldLicenseConcluded returns the old "license_concluded" field's value of the Node entity. If the Node 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 (*NodeMutation) OldLicenses

func (m *NodeMutation) OldLicenses(ctx context.Context) (v []string, err error)

OldLicenses returns the old "licenses" field's value of the Node entity. If the Node 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 (*NodeMutation) OldName

func (m *NodeMutation) OldName(ctx context.Context) (v string, err error)

OldName returns the old "name" field's value of the Node entity. If the Node 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 (*NodeMutation) OldReleaseDate

func (m *NodeMutation) OldReleaseDate(ctx context.Context) (v time.Time, err error)

OldReleaseDate returns the old "release_date" field's value of the Node entity. If the Node 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 (*NodeMutation) OldSourceInfo

func (m *NodeMutation) OldSourceInfo(ctx context.Context) (v string, err error)

OldSourceInfo returns the old "source_info" field's value of the Node entity. If the Node 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 (*NodeMutation) OldSummary

func (m *NodeMutation) OldSummary(ctx context.Context) (v string, err error)

OldSummary returns the old "summary" field's value of the Node entity. If the Node 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 (*NodeMutation) OldType

func (m *NodeMutation) OldType(ctx context.Context) (v node.Type, err error)

OldType returns the old "type" field's value of the Node entity. If the Node 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 (*NodeMutation) OldURLDownload

func (m *NodeMutation) OldURLDownload(ctx context.Context) (v string, err error)

OldURLDownload returns the old "url_download" field's value of the Node entity. If the Node 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 (*NodeMutation) OldURLHome

func (m *NodeMutation) OldURLHome(ctx context.Context) (v string, err error)

OldURLHome returns the old "url_home" field's value of the Node entity. If the Node 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 (*NodeMutation) OldValidUntilDate

func (m *NodeMutation) OldValidUntilDate(ctx context.Context) (v time.Time, err error)

OldValidUntilDate returns the old "valid_until_date" field's value of the Node entity. If the Node 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 (*NodeMutation) OldVersion

func (m *NodeMutation) OldVersion(ctx context.Context) (v string, err error)

OldVersion returns the old "version" field's value of the Node entity. If the Node 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 (*NodeMutation) Op

func (m *NodeMutation) Op() Op

Op returns the operation name.

func (*NodeMutation) OriginatorsCleared

func (m *NodeMutation) OriginatorsCleared() bool

OriginatorsCleared reports if the "originators" edge to the Person entity was cleared.

func (*NodeMutation) OriginatorsIDs

func (m *NodeMutation) OriginatorsIDs() (ids []int)

OriginatorsIDs returns the "originators" edge IDs in the mutation.

func (*NodeMutation) PrimaryPurposeCleared

func (m *NodeMutation) PrimaryPurposeCleared() bool

PrimaryPurposeCleared reports if the "primary_purpose" edge to the Purpose entity was cleared.

func (*NodeMutation) PrimaryPurposeIDs

func (m *NodeMutation) PrimaryPurposeIDs() (ids []int)

PrimaryPurposeIDs returns the "primary_purpose" edge IDs in the mutation.

func (*NodeMutation) ReleaseDate

func (m *NodeMutation) ReleaseDate() (r time.Time, exists bool)

ReleaseDate returns the value of the "release_date" field in the mutation.

func (*NodeMutation) RemoveEdgeTypeIDs

func (m *NodeMutation) RemoveEdgeTypeIDs(ids ...int)

RemoveEdgeTypeIDs removes the "edge_types" edge to the EdgeType entity by IDs.

func (*NodeMutation) RemoveExternalReferenceIDs

func (m *NodeMutation) RemoveExternalReferenceIDs(ids ...int)

RemoveExternalReferenceIDs removes the "external_references" edge to the ExternalReference entity by IDs.

func (*NodeMutation) RemoveHashIDs

func (m *NodeMutation) RemoveHashIDs(ids ...int)

RemoveHashIDs removes the "hashes" edge to the HashesEntry entity by IDs.

func (*NodeMutation) RemoveIdentifierIDs

func (m *NodeMutation) RemoveIdentifierIDs(ids ...int)

RemoveIdentifierIDs removes the "identifiers" edge to the IdentifiersEntry entity by IDs.

func (*NodeMutation) RemoveNodeIDs

func (m *NodeMutation) RemoveNodeIDs(ids ...string)

RemoveNodeIDs removes the "nodes" edge to the Node entity by IDs.

func (*NodeMutation) RemoveOriginatorIDs

func (m *NodeMutation) RemoveOriginatorIDs(ids ...int)

RemoveOriginatorIDs removes the "originators" edge to the Person entity by IDs.

func (*NodeMutation) RemovePrimaryPurposeIDs

func (m *NodeMutation) RemovePrimaryPurposeIDs(ids ...int)

RemovePrimaryPurposeIDs removes the "primary_purpose" edge to the Purpose entity by IDs.

func (*NodeMutation) RemoveSupplierIDs

func (m *NodeMutation) RemoveSupplierIDs(ids ...int)

RemoveSupplierIDs removes the "suppliers" edge to the Person entity by IDs.

func (*NodeMutation) RemovedEdgeTypesIDs

func (m *NodeMutation) RemovedEdgeTypesIDs() (ids []int)

RemovedEdgeTypes returns the removed IDs of the "edge_types" edge to the EdgeType entity.

func (*NodeMutation) RemovedEdges

func (m *NodeMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*NodeMutation) RemovedExternalReferencesIDs

func (m *NodeMutation) RemovedExternalReferencesIDs() (ids []int)

RemovedExternalReferences returns the removed IDs of the "external_references" edge to the ExternalReference entity.

func (*NodeMutation) RemovedHashesIDs

func (m *NodeMutation) RemovedHashesIDs() (ids []int)

RemovedHashes returns the removed IDs of the "hashes" edge to the HashesEntry entity.

func (*NodeMutation) RemovedIDs

func (m *NodeMutation) 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 (*NodeMutation) RemovedIdentifiersIDs

func (m *NodeMutation) RemovedIdentifiersIDs() (ids []int)

RemovedIdentifiers returns the removed IDs of the "identifiers" edge to the IdentifiersEntry entity.

func (*NodeMutation) RemovedNodesIDs

func (m *NodeMutation) RemovedNodesIDs() (ids []string)

RemovedNodes returns the removed IDs of the "nodes" edge to the Node entity.

func (*NodeMutation) RemovedOriginatorsIDs

func (m *NodeMutation) RemovedOriginatorsIDs() (ids []int)

RemovedOriginators returns the removed IDs of the "originators" edge to the Person entity.

func (*NodeMutation) RemovedPrimaryPurposeIDs

func (m *NodeMutation) RemovedPrimaryPurposeIDs() (ids []int)

RemovedPrimaryPurpose returns the removed IDs of the "primary_purpose" edge to the Purpose entity.

func (*NodeMutation) RemovedSuppliersIDs

func (m *NodeMutation) RemovedSuppliersIDs() (ids []int)

RemovedSuppliers returns the removed IDs of the "suppliers" edge to the Person entity.

func (*NodeMutation) ResetAttribution

func (m *NodeMutation) ResetAttribution()

ResetAttribution resets all changes to the "attribution" field.

func (*NodeMutation) ResetBuildDate

func (m *NodeMutation) ResetBuildDate()

ResetBuildDate resets all changes to the "build_date" field.

func (*NodeMutation) ResetComment

func (m *NodeMutation) ResetComment()

ResetComment resets all changes to the "comment" field.

func (*NodeMutation) ResetCopyright

func (m *NodeMutation) ResetCopyright()

ResetCopyright resets all changes to the "copyright" field.

func (*NodeMutation) ResetDescription

func (m *NodeMutation) ResetDescription()

ResetDescription resets all changes to the "description" field.

func (*NodeMutation) ResetEdge

func (m *NodeMutation) 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 (*NodeMutation) ResetEdgeTypes

func (m *NodeMutation) ResetEdgeTypes()

ResetEdgeTypes resets all changes to the "edge_types" edge.

func (*NodeMutation) ResetExternalReferences

func (m *NodeMutation) ResetExternalReferences()

ResetExternalReferences resets all changes to the "external_references" edge.

func (*NodeMutation) ResetField

func (m *NodeMutation) 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 (*NodeMutation) ResetFileName

func (m *NodeMutation) ResetFileName()

ResetFileName resets all changes to the "file_name" field.

func (*NodeMutation) ResetFileTypes

func (m *NodeMutation) ResetFileTypes()

ResetFileTypes resets all changes to the "file_types" field.

func (*NodeMutation) ResetHashes

func (m *NodeMutation) ResetHashes()

ResetHashes resets all changes to the "hashes" edge.

func (*NodeMutation) ResetIdentifiers

func (m *NodeMutation) ResetIdentifiers()

ResetIdentifiers resets all changes to the "identifiers" edge.

func (*NodeMutation) ResetLicenseComments

func (m *NodeMutation) ResetLicenseComments()

ResetLicenseComments resets all changes to the "license_comments" field.

func (*NodeMutation) ResetLicenseConcluded

func (m *NodeMutation) ResetLicenseConcluded()

ResetLicenseConcluded resets all changes to the "license_concluded" field.

func (*NodeMutation) ResetLicenses

func (m *NodeMutation) ResetLicenses()

ResetLicenses resets all changes to the "licenses" field.

func (*NodeMutation) ResetName

func (m *NodeMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*NodeMutation) ResetNodeList

func (m *NodeMutation) ResetNodeList()

ResetNodeList resets all changes to the "node_list" edge.

func (*NodeMutation) ResetNodes

func (m *NodeMutation) ResetNodes()

ResetNodes resets all changes to the "nodes" edge.

func (*NodeMutation) ResetOriginators

func (m *NodeMutation) ResetOriginators()

ResetOriginators resets all changes to the "originators" edge.

func (*NodeMutation) ResetPrimaryPurpose

func (m *NodeMutation) ResetPrimaryPurpose()

ResetPrimaryPurpose resets all changes to the "primary_purpose" edge.

func (*NodeMutation) ResetReleaseDate

func (m *NodeMutation) ResetReleaseDate()

ResetReleaseDate resets all changes to the "release_date" field.

func (*NodeMutation) ResetSourceInfo

func (m *NodeMutation) ResetSourceInfo()

ResetSourceInfo resets all changes to the "source_info" field.

func (*NodeMutation) ResetSummary

func (m *NodeMutation) ResetSummary()

ResetSummary resets all changes to the "summary" field.

func (*NodeMutation) ResetSuppliers

func (m *NodeMutation) ResetSuppliers()

ResetSuppliers resets all changes to the "suppliers" edge.

func (*NodeMutation) ResetType

func (m *NodeMutation) ResetType()

ResetType resets all changes to the "type" field.

func (*NodeMutation) ResetURLDownload

func (m *NodeMutation) ResetURLDownload()

ResetURLDownload resets all changes to the "url_download" field.

func (*NodeMutation) ResetURLHome

func (m *NodeMutation) ResetURLHome()

ResetURLHome resets all changes to the "url_home" field.

func (*NodeMutation) ResetValidUntilDate

func (m *NodeMutation) ResetValidUntilDate()

ResetValidUntilDate resets all changes to the "valid_until_date" field.

func (*NodeMutation) ResetVersion

func (m *NodeMutation) ResetVersion()

ResetVersion resets all changes to the "version" field.

func (*NodeMutation) SetAttribution

func (m *NodeMutation) SetAttribution(s []string)

SetAttribution sets the "attribution" field.

func (*NodeMutation) SetBuildDate

func (m *NodeMutation) SetBuildDate(t time.Time)

SetBuildDate sets the "build_date" field.

func (*NodeMutation) SetComment

func (m *NodeMutation) SetComment(s string)

SetComment sets the "comment" field.

func (*NodeMutation) SetCopyright

func (m *NodeMutation) SetCopyright(s string)

SetCopyright sets the "copyright" field.

func (*NodeMutation) SetDescription

func (m *NodeMutation) SetDescription(s string)

SetDescription sets the "description" field.

func (*NodeMutation) SetField

func (m *NodeMutation) 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 (*NodeMutation) SetFileName

func (m *NodeMutation) SetFileName(s string)

SetFileName sets the "file_name" field.

func (*NodeMutation) SetFileTypes

func (m *NodeMutation) SetFileTypes(s []string)

SetFileTypes sets the "file_types" field.

func (*NodeMutation) SetID

func (m *NodeMutation) SetID(id string)

SetID sets the value of the id field. Note that this operation is only accepted on creation of Node entities.

func (*NodeMutation) SetLicenseComments

func (m *NodeMutation) SetLicenseComments(s string)

SetLicenseComments sets the "license_comments" field.

func (*NodeMutation) SetLicenseConcluded

func (m *NodeMutation) SetLicenseConcluded(s string)

SetLicenseConcluded sets the "license_concluded" field.

func (*NodeMutation) SetLicenses

func (m *NodeMutation) SetLicenses(s []string)

SetLicenses sets the "licenses" field.

func (*NodeMutation) SetName

func (m *NodeMutation) SetName(s string)

SetName sets the "name" field.

func (*NodeMutation) SetNodeListID

func (m *NodeMutation) SetNodeListID(id int)

SetNodeListID sets the "node_list" edge to the NodeList entity by id.

func (*NodeMutation) SetOp

func (m *NodeMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*NodeMutation) SetReleaseDate

func (m *NodeMutation) SetReleaseDate(t time.Time)

SetReleaseDate sets the "release_date" field.

func (*NodeMutation) SetSourceInfo

func (m *NodeMutation) SetSourceInfo(s string)

SetSourceInfo sets the "source_info" field.

func (*NodeMutation) SetSummary

func (m *NodeMutation) SetSummary(s string)

SetSummary sets the "summary" field.

func (*NodeMutation) SetType

func (m *NodeMutation) SetType(n node.Type)

SetType sets the "type" field.

func (*NodeMutation) SetURLDownload

func (m *NodeMutation) SetURLDownload(s string)

SetURLDownload sets the "url_download" field.

func (*NodeMutation) SetURLHome

func (m *NodeMutation) SetURLHome(s string)

SetURLHome sets the "url_home" field.

func (*NodeMutation) SetValidUntilDate

func (m *NodeMutation) SetValidUntilDate(t time.Time)

SetValidUntilDate sets the "valid_until_date" field.

func (*NodeMutation) SetVersion

func (m *NodeMutation) SetVersion(s string)

SetVersion sets the "version" field.

func (*NodeMutation) SourceInfo

func (m *NodeMutation) SourceInfo() (r string, exists bool)

SourceInfo returns the value of the "source_info" field in the mutation.

func (*NodeMutation) Summary

func (m *NodeMutation) Summary() (r string, exists bool)

Summary returns the value of the "summary" field in the mutation.

func (*NodeMutation) SuppliersCleared

func (m *NodeMutation) SuppliersCleared() bool

SuppliersCleared reports if the "suppliers" edge to the Person entity was cleared.

func (*NodeMutation) SuppliersIDs

func (m *NodeMutation) SuppliersIDs() (ids []int)

SuppliersIDs returns the "suppliers" edge IDs in the mutation.

func (NodeMutation) Tx

func (m NodeMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*NodeMutation) Type

func (m *NodeMutation) Type() string

Type returns the node type of this mutation (Node).

func (*NodeMutation) URLDownload

func (m *NodeMutation) URLDownload() (r string, exists bool)

URLDownload returns the value of the "url_download" field in the mutation.

func (*NodeMutation) URLHome

func (m *NodeMutation) URLHome() (r string, exists bool)

URLHome returns the value of the "url_home" field in the mutation.

func (*NodeMutation) ValidUntilDate

func (m *NodeMutation) ValidUntilDate() (r time.Time, exists bool)

ValidUntilDate returns the value of the "valid_until_date" field in the mutation.

func (*NodeMutation) Version

func (m *NodeMutation) Version() (r string, exists bool)

Version returns the value of the "version" field in the mutation.

func (*NodeMutation) Where

func (m *NodeMutation) Where(ps ...predicate.Node)

Where appends a list predicates to the NodeMutation builder.

func (*NodeMutation) WhereP

func (m *NodeMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the NodeMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type NodeQuery

type NodeQuery struct {
	// contains filtered or unexported fields
}

NodeQuery is the builder for querying Node entities.

func (*NodeQuery) Aggregate

func (nq *NodeQuery) Aggregate(fns ...AggregateFunc) *NodeSelect

Aggregate returns a NodeSelect configured with the given aggregations.

func (*NodeQuery) All

func (nq *NodeQuery) All(ctx context.Context) ([]*Node, error)

All executes the query and returns a list of Nodes.

func (*NodeQuery) AllX

func (nq *NodeQuery) AllX(ctx context.Context) []*Node

AllX is like All, but panics if an error occurs.

func (*NodeQuery) Clone

func (nq *NodeQuery) Clone() *NodeQuery

Clone returns a duplicate of the NodeQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*NodeQuery) Count

func (nq *NodeQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*NodeQuery) CountX

func (nq *NodeQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*NodeQuery) Exist

func (nq *NodeQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*NodeQuery) ExistX

func (nq *NodeQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*NodeQuery) First

func (nq *NodeQuery) First(ctx context.Context) (*Node, error)

First returns the first Node entity from the query. Returns a *NotFoundError when no Node was found.

func (*NodeQuery) FirstID

func (nq *NodeQuery) FirstID(ctx context.Context) (id string, err error)

FirstID returns the first Node ID from the query. Returns a *NotFoundError when no Node ID was found.

func (*NodeQuery) FirstIDX

func (nq *NodeQuery) FirstIDX(ctx context.Context) string

FirstIDX is like FirstID, but panics if an error occurs.

func (*NodeQuery) FirstX

func (nq *NodeQuery) FirstX(ctx context.Context) *Node

FirstX is like First, but panics if an error occurs.

func (*NodeQuery) GroupBy

func (nq *NodeQuery) GroupBy(field string, fields ...string) *NodeGroupBy

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 {
	Type node.Type `json:"type,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Node.Query().
	GroupBy(node.FieldType).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*NodeQuery) IDs

func (nq *NodeQuery) IDs(ctx context.Context) (ids []string, err error)

IDs executes the query and returns a list of Node IDs.

func (*NodeQuery) IDsX

func (nq *NodeQuery) IDsX(ctx context.Context) []string

IDsX is like IDs, but panics if an error occurs.

func (*NodeQuery) Limit

func (nq *NodeQuery) Limit(limit int) *NodeQuery

Limit the number of records to be returned by this query.

func (*NodeQuery) Offset

func (nq *NodeQuery) Offset(offset int) *NodeQuery

Offset to start from.

func (*NodeQuery) Only

func (nq *NodeQuery) Only(ctx context.Context) (*Node, error)

Only returns a single Node entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Node entity is found. Returns a *NotFoundError when no Node entities are found.

func (*NodeQuery) OnlyID

func (nq *NodeQuery) OnlyID(ctx context.Context) (id string, err error)

OnlyID is like Only, but returns the only Node ID in the query. Returns a *NotSingularError when more than one Node ID is found. Returns a *NotFoundError when no entities are found.

func (*NodeQuery) OnlyIDX

func (nq *NodeQuery) OnlyIDX(ctx context.Context) string

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*NodeQuery) OnlyX

func (nq *NodeQuery) OnlyX(ctx context.Context) *Node

OnlyX is like Only, but panics if an error occurs.

func (*NodeQuery) Order

func (nq *NodeQuery) Order(o ...node.OrderOption) *NodeQuery

Order specifies how the records should be ordered.

func (*NodeQuery) QueryEdgeTypes

func (nq *NodeQuery) QueryEdgeTypes() *EdgeTypeQuery

QueryEdgeTypes chains the current query on the "edge_types" edge.

func (*NodeQuery) QueryExternalReferences

func (nq *NodeQuery) QueryExternalReferences() *ExternalReferenceQuery

QueryExternalReferences chains the current query on the "external_references" edge.

func (*NodeQuery) QueryHashes

func (nq *NodeQuery) QueryHashes() *HashesEntryQuery

QueryHashes chains the current query on the "hashes" edge.

func (*NodeQuery) QueryIdentifiers

func (nq *NodeQuery) QueryIdentifiers() *IdentifiersEntryQuery

QueryIdentifiers chains the current query on the "identifiers" edge.

func (*NodeQuery) QueryNodeList

func (nq *NodeQuery) QueryNodeList() *NodeListQuery

QueryNodeList chains the current query on the "node_list" edge.

func (*NodeQuery) QueryNodes

func (nq *NodeQuery) QueryNodes() *NodeQuery

QueryNodes chains the current query on the "nodes" edge.

func (*NodeQuery) QueryOriginators

func (nq *NodeQuery) QueryOriginators() *PersonQuery

QueryOriginators chains the current query on the "originators" edge.

func (*NodeQuery) QueryPrimaryPurpose

func (nq *NodeQuery) QueryPrimaryPurpose() *PurposeQuery

QueryPrimaryPurpose chains the current query on the "primary_purpose" edge.

func (*NodeQuery) QuerySuppliers

func (nq *NodeQuery) QuerySuppliers() *PersonQuery

QuerySuppliers chains the current query on the "suppliers" edge.

func (*NodeQuery) Select

func (nq *NodeQuery) Select(fields ...string) *NodeSelect

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 {
	Type node.Type `json:"type,omitempty"`
}

client.Node.Query().
	Select(node.FieldType).
	Scan(ctx, &v)

func (*NodeQuery) Unique

func (nq *NodeQuery) Unique(unique bool) *NodeQuery

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 (*NodeQuery) Where

func (nq *NodeQuery) Where(ps ...predicate.Node) *NodeQuery

Where adds a new predicate for the NodeQuery builder.

func (*NodeQuery) WithEdgeTypes

func (nq *NodeQuery) WithEdgeTypes(opts ...func(*EdgeTypeQuery)) *NodeQuery

WithEdgeTypes tells the query-builder to eager-load the nodes that are connected to the "edge_types" edge. The optional arguments are used to configure the query builder of the edge.

func (*NodeQuery) WithExternalReferences

func (nq *NodeQuery) WithExternalReferences(opts ...func(*ExternalReferenceQuery)) *NodeQuery

WithExternalReferences tells the query-builder to eager-load the nodes that are connected to the "external_references" edge. The optional arguments are used to configure the query builder of the edge.

func (*NodeQuery) WithHashes

func (nq *NodeQuery) WithHashes(opts ...func(*HashesEntryQuery)) *NodeQuery

WithHashes tells the query-builder to eager-load the nodes that are connected to the "hashes" edge. The optional arguments are used to configure the query builder of the edge.

func (*NodeQuery) WithIdentifiers

func (nq *NodeQuery) WithIdentifiers(opts ...func(*IdentifiersEntryQuery)) *NodeQuery

WithIdentifiers tells the query-builder to eager-load the nodes that are connected to the "identifiers" edge. The optional arguments are used to configure the query builder of the edge.

func (*NodeQuery) WithNodeList

func (nq *NodeQuery) WithNodeList(opts ...func(*NodeListQuery)) *NodeQuery

WithNodeList tells the query-builder to eager-load the nodes that are connected to the "node_list" edge. The optional arguments are used to configure the query builder of the edge.

func (*NodeQuery) WithNodes

func (nq *NodeQuery) WithNodes(opts ...func(*NodeQuery)) *NodeQuery

WithNodes tells the query-builder to eager-load the nodes that are connected to the "nodes" edge. The optional arguments are used to configure the query builder of the edge.

func (*NodeQuery) WithOriginators

func (nq *NodeQuery) WithOriginators(opts ...func(*PersonQuery)) *NodeQuery

WithOriginators tells the query-builder to eager-load the nodes that are connected to the "originators" edge. The optional arguments are used to configure the query builder of the edge.

func (*NodeQuery) WithPrimaryPurpose

func (nq *NodeQuery) WithPrimaryPurpose(opts ...func(*PurposeQuery)) *NodeQuery

WithPrimaryPurpose tells the query-builder to eager-load the nodes that are connected to the "primary_purpose" edge. The optional arguments are used to configure the query builder of the edge.

func (*NodeQuery) WithSuppliers

func (nq *NodeQuery) WithSuppliers(opts ...func(*PersonQuery)) *NodeQuery

WithSuppliers tells the query-builder to eager-load the nodes that are connected to the "suppliers" edge. The optional arguments are used to configure the query builder of the edge.

type NodeSelect

type NodeSelect struct {
	*NodeQuery
	// contains filtered or unexported fields
}

NodeSelect is the builder for selecting fields of Node entities.

func (*NodeSelect) Aggregate

func (ns *NodeSelect) Aggregate(fns ...AggregateFunc) *NodeSelect

Aggregate adds the given aggregation functions to the selector query.

func (*NodeSelect) Bool

func (s *NodeSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*NodeSelect) BoolX

func (s *NodeSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*NodeSelect) Bools

func (s *NodeSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*NodeSelect) BoolsX

func (s *NodeSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*NodeSelect) Float64

func (s *NodeSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*NodeSelect) Float64X

func (s *NodeSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*NodeSelect) Float64s

func (s *NodeSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*NodeSelect) Float64sX

func (s *NodeSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*NodeSelect) Int

func (s *NodeSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*NodeSelect) IntX

func (s *NodeSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*NodeSelect) Ints

func (s *NodeSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*NodeSelect) IntsX

func (s *NodeSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*NodeSelect) Scan

func (ns *NodeSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*NodeSelect) ScanX

func (s *NodeSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*NodeSelect) String

func (s *NodeSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*NodeSelect) StringX

func (s *NodeSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*NodeSelect) Strings

func (s *NodeSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*NodeSelect) StringsX

func (s *NodeSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type NodeUpdate

type NodeUpdate struct {
	// contains filtered or unexported fields
}

NodeUpdate is the builder for updating Node entities.

func (*NodeUpdate) AddEdgeTypeIDs

func (nu *NodeUpdate) AddEdgeTypeIDs(ids ...int) *NodeUpdate

AddEdgeTypeIDs adds the "edge_types" edge to the EdgeType entity by IDs.

func (*NodeUpdate) AddEdgeTypes

func (nu *NodeUpdate) AddEdgeTypes(e ...*EdgeType) *NodeUpdate

AddEdgeTypes adds the "edge_types" edges to the EdgeType entity.

func (*NodeUpdate) AddExternalReferenceIDs

func (nu *NodeUpdate) AddExternalReferenceIDs(ids ...int) *NodeUpdate

AddExternalReferenceIDs adds the "external_references" edge to the ExternalReference entity by IDs.

func (*NodeUpdate) AddExternalReferences

func (nu *NodeUpdate) AddExternalReferences(e ...*ExternalReference) *NodeUpdate

AddExternalReferences adds the "external_references" edges to the ExternalReference entity.

func (*NodeUpdate) AddHashIDs

func (nu *NodeUpdate) AddHashIDs(ids ...int) *NodeUpdate

AddHashIDs adds the "hashes" edge to the HashesEntry entity by IDs.

func (*NodeUpdate) AddHashes

func (nu *NodeUpdate) AddHashes(h ...*HashesEntry) *NodeUpdate

AddHashes adds the "hashes" edges to the HashesEntry entity.

func (*NodeUpdate) AddIdentifierIDs

func (nu *NodeUpdate) AddIdentifierIDs(ids ...int) *NodeUpdate

AddIdentifierIDs adds the "identifiers" edge to the IdentifiersEntry entity by IDs.

func (*NodeUpdate) AddIdentifiers

func (nu *NodeUpdate) AddIdentifiers(i ...*IdentifiersEntry) *NodeUpdate

AddIdentifiers adds the "identifiers" edges to the IdentifiersEntry entity.

func (*NodeUpdate) AddNodeIDs

func (nu *NodeUpdate) AddNodeIDs(ids ...string) *NodeUpdate

AddNodeIDs adds the "nodes" edge to the Node entity by IDs.

func (*NodeUpdate) AddNodes

func (nu *NodeUpdate) AddNodes(n ...*Node) *NodeUpdate

AddNodes adds the "nodes" edges to the Node entity.

func (*NodeUpdate) AddOriginatorIDs

func (nu *NodeUpdate) AddOriginatorIDs(ids ...int) *NodeUpdate

AddOriginatorIDs adds the "originators" edge to the Person entity by IDs.

func (*NodeUpdate) AddOriginators

func (nu *NodeUpdate) AddOriginators(p ...*Person) *NodeUpdate

AddOriginators adds the "originators" edges to the Person entity.

func (*NodeUpdate) AddPrimaryPurpose

func (nu *NodeUpdate) AddPrimaryPurpose(p ...*Purpose) *NodeUpdate

AddPrimaryPurpose adds the "primary_purpose" edges to the Purpose entity.

func (*NodeUpdate) AddPrimaryPurposeIDs

func (nu *NodeUpdate) AddPrimaryPurposeIDs(ids ...int) *NodeUpdate

AddPrimaryPurposeIDs adds the "primary_purpose" edge to the Purpose entity by IDs.

func (*NodeUpdate) AddSupplierIDs

func (nu *NodeUpdate) AddSupplierIDs(ids ...int) *NodeUpdate

AddSupplierIDs adds the "suppliers" edge to the Person entity by IDs.

func (*NodeUpdate) AddSuppliers

func (nu *NodeUpdate) AddSuppliers(p ...*Person) *NodeUpdate

AddSuppliers adds the "suppliers" edges to the Person entity.

func (*NodeUpdate) AppendAttribution

func (nu *NodeUpdate) AppendAttribution(s []string) *NodeUpdate

AppendAttribution appends s to the "attribution" field.

func (*NodeUpdate) AppendFileTypes

func (nu *NodeUpdate) AppendFileTypes(s []string) *NodeUpdate

AppendFileTypes appends s to the "file_types" field.

func (*NodeUpdate) AppendLicenses

func (nu *NodeUpdate) AppendLicenses(s []string) *NodeUpdate

AppendLicenses appends s to the "licenses" field.

func (*NodeUpdate) ClearEdgeTypes

func (nu *NodeUpdate) ClearEdgeTypes() *NodeUpdate

ClearEdgeTypes clears all "edge_types" edges to the EdgeType entity.

func (*NodeUpdate) ClearExternalReferences

func (nu *NodeUpdate) ClearExternalReferences() *NodeUpdate

ClearExternalReferences clears all "external_references" edges to the ExternalReference entity.

func (*NodeUpdate) ClearHashes

func (nu *NodeUpdate) ClearHashes() *NodeUpdate

ClearHashes clears all "hashes" edges to the HashesEntry entity.

func (*NodeUpdate) ClearIdentifiers

func (nu *NodeUpdate) ClearIdentifiers() *NodeUpdate

ClearIdentifiers clears all "identifiers" edges to the IdentifiersEntry entity.

func (*NodeUpdate) ClearNodeList

func (nu *NodeUpdate) ClearNodeList() *NodeUpdate

ClearNodeList clears the "node_list" edge to the NodeList entity.

func (*NodeUpdate) ClearNodes

func (nu *NodeUpdate) ClearNodes() *NodeUpdate

ClearNodes clears all "nodes" edges to the Node entity.

func (*NodeUpdate) ClearOriginators

func (nu *NodeUpdate) ClearOriginators() *NodeUpdate

ClearOriginators clears all "originators" edges to the Person entity.

func (*NodeUpdate) ClearPrimaryPurpose

func (nu *NodeUpdate) ClearPrimaryPurpose() *NodeUpdate

ClearPrimaryPurpose clears all "primary_purpose" edges to the Purpose entity.

func (*NodeUpdate) ClearSuppliers

func (nu *NodeUpdate) ClearSuppliers() *NodeUpdate

ClearSuppliers clears all "suppliers" edges to the Person entity.

func (*NodeUpdate) Exec

func (nu *NodeUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*NodeUpdate) ExecX

func (nu *NodeUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*NodeUpdate) Mutation

func (nu *NodeUpdate) Mutation() *NodeMutation

Mutation returns the NodeMutation object of the builder.

func (*NodeUpdate) RemoveEdgeTypeIDs

func (nu *NodeUpdate) RemoveEdgeTypeIDs(ids ...int) *NodeUpdate

RemoveEdgeTypeIDs removes the "edge_types" edge to EdgeType entities by IDs.

func (*NodeUpdate) RemoveEdgeTypes

func (nu *NodeUpdate) RemoveEdgeTypes(e ...*EdgeType) *NodeUpdate

RemoveEdgeTypes removes "edge_types" edges to EdgeType entities.

func (*NodeUpdate) RemoveExternalReferenceIDs

func (nu *NodeUpdate) RemoveExternalReferenceIDs(ids ...int) *NodeUpdate

RemoveExternalReferenceIDs removes the "external_references" edge to ExternalReference entities by IDs.

func (*NodeUpdate) RemoveExternalReferences

func (nu *NodeUpdate) RemoveExternalReferences(e ...*ExternalReference) *NodeUpdate

RemoveExternalReferences removes "external_references" edges to ExternalReference entities.

func (*NodeUpdate) RemoveHashIDs

func (nu *NodeUpdate) RemoveHashIDs(ids ...int) *NodeUpdate

RemoveHashIDs removes the "hashes" edge to HashesEntry entities by IDs.

func (*NodeUpdate) RemoveHashes

func (nu *NodeUpdate) RemoveHashes(h ...*HashesEntry) *NodeUpdate

RemoveHashes removes "hashes" edges to HashesEntry entities.

func (*NodeUpdate) RemoveIdentifierIDs

func (nu *NodeUpdate) RemoveIdentifierIDs(ids ...int) *NodeUpdate

RemoveIdentifierIDs removes the "identifiers" edge to IdentifiersEntry entities by IDs.

func (*NodeUpdate) RemoveIdentifiers

func (nu *NodeUpdate) RemoveIdentifiers(i ...*IdentifiersEntry) *NodeUpdate

RemoveIdentifiers removes "identifiers" edges to IdentifiersEntry entities.

func (*NodeUpdate) RemoveNodeIDs

func (nu *NodeUpdate) RemoveNodeIDs(ids ...string) *NodeUpdate

RemoveNodeIDs removes the "nodes" edge to Node entities by IDs.

func (*NodeUpdate) RemoveNodes

func (nu *NodeUpdate) RemoveNodes(n ...*Node) *NodeUpdate

RemoveNodes removes "nodes" edges to Node entities.

func (*NodeUpdate) RemoveOriginatorIDs

func (nu *NodeUpdate) RemoveOriginatorIDs(ids ...int) *NodeUpdate

RemoveOriginatorIDs removes the "originators" edge to Person entities by IDs.

func (*NodeUpdate) RemoveOriginators

func (nu *NodeUpdate) RemoveOriginators(p ...*Person) *NodeUpdate

RemoveOriginators removes "originators" edges to Person entities.

func (*NodeUpdate) RemovePrimaryPurpose

func (nu *NodeUpdate) RemovePrimaryPurpose(p ...*Purpose) *NodeUpdate

RemovePrimaryPurpose removes "primary_purpose" edges to Purpose entities.

func (*NodeUpdate) RemovePrimaryPurposeIDs

func (nu *NodeUpdate) RemovePrimaryPurposeIDs(ids ...int) *NodeUpdate

RemovePrimaryPurposeIDs removes the "primary_purpose" edge to Purpose entities by IDs.

func (*NodeUpdate) RemoveSupplierIDs

func (nu *NodeUpdate) RemoveSupplierIDs(ids ...int) *NodeUpdate

RemoveSupplierIDs removes the "suppliers" edge to Person entities by IDs.

func (*NodeUpdate) RemoveSuppliers

func (nu *NodeUpdate) RemoveSuppliers(p ...*Person) *NodeUpdate

RemoveSuppliers removes "suppliers" edges to Person entities.

func (*NodeUpdate) Save

func (nu *NodeUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*NodeUpdate) SaveX

func (nu *NodeUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*NodeUpdate) SetAttribution

func (nu *NodeUpdate) SetAttribution(s []string) *NodeUpdate

SetAttribution sets the "attribution" field.

func (*NodeUpdate) SetBuildDate

func (nu *NodeUpdate) SetBuildDate(t time.Time) *NodeUpdate

SetBuildDate sets the "build_date" field.

func (*NodeUpdate) SetComment

func (nu *NodeUpdate) SetComment(s string) *NodeUpdate

SetComment sets the "comment" field.

func (*NodeUpdate) SetCopyright

func (nu *NodeUpdate) SetCopyright(s string) *NodeUpdate

SetCopyright sets the "copyright" field.

func (*NodeUpdate) SetDescription

func (nu *NodeUpdate) SetDescription(s string) *NodeUpdate

SetDescription sets the "description" field.

func (*NodeUpdate) SetFileName

func (nu *NodeUpdate) SetFileName(s string) *NodeUpdate

SetFileName sets the "file_name" field.

func (*NodeUpdate) SetFileTypes

func (nu *NodeUpdate) SetFileTypes(s []string) *NodeUpdate

SetFileTypes sets the "file_types" field.

func (*NodeUpdate) SetLicenseComments

func (nu *NodeUpdate) SetLicenseComments(s string) *NodeUpdate

SetLicenseComments sets the "license_comments" field.

func (*NodeUpdate) SetLicenseConcluded

func (nu *NodeUpdate) SetLicenseConcluded(s string) *NodeUpdate

SetLicenseConcluded sets the "license_concluded" field.

func (*NodeUpdate) SetLicenses

func (nu *NodeUpdate) SetLicenses(s []string) *NodeUpdate

SetLicenses sets the "licenses" field.

func (*NodeUpdate) SetName

func (nu *NodeUpdate) SetName(s string) *NodeUpdate

SetName sets the "name" field.

func (*NodeUpdate) SetNillableBuildDate

func (nu *NodeUpdate) SetNillableBuildDate(t *time.Time) *NodeUpdate

SetNillableBuildDate sets the "build_date" field if the given value is not nil.

func (*NodeUpdate) SetNillableComment

func (nu *NodeUpdate) SetNillableComment(s *string) *NodeUpdate

SetNillableComment sets the "comment" field if the given value is not nil.

func (*NodeUpdate) SetNillableCopyright

func (nu *NodeUpdate) SetNillableCopyright(s *string) *NodeUpdate

SetNillableCopyright sets the "copyright" field if the given value is not nil.

func (*NodeUpdate) SetNillableDescription

func (nu *NodeUpdate) SetNillableDescription(s *string) *NodeUpdate

SetNillableDescription sets the "description" field if the given value is not nil.

func (*NodeUpdate) SetNillableFileName

func (nu *NodeUpdate) SetNillableFileName(s *string) *NodeUpdate

SetNillableFileName sets the "file_name" field if the given value is not nil.

func (*NodeUpdate) SetNillableLicenseComments

func (nu *NodeUpdate) SetNillableLicenseComments(s *string) *NodeUpdate

SetNillableLicenseComments sets the "license_comments" field if the given value is not nil.

func (*NodeUpdate) SetNillableLicenseConcluded

func (nu *NodeUpdate) SetNillableLicenseConcluded(s *string) *NodeUpdate

SetNillableLicenseConcluded sets the "license_concluded" field if the given value is not nil.

func (*NodeUpdate) SetNillableName

func (nu *NodeUpdate) SetNillableName(s *string) *NodeUpdate

SetNillableName sets the "name" field if the given value is not nil.

func (*NodeUpdate) SetNillableReleaseDate

func (nu *NodeUpdate) SetNillableReleaseDate(t *time.Time) *NodeUpdate

SetNillableReleaseDate sets the "release_date" field if the given value is not nil.

func (*NodeUpdate) SetNillableSourceInfo

func (nu *NodeUpdate) SetNillableSourceInfo(s *string) *NodeUpdate

SetNillableSourceInfo sets the "source_info" field if the given value is not nil.

func (*NodeUpdate) SetNillableSummary

func (nu *NodeUpdate) SetNillableSummary(s *string) *NodeUpdate

SetNillableSummary sets the "summary" field if the given value is not nil.

func (*NodeUpdate) SetNillableType

func (nu *NodeUpdate) SetNillableType(n *node.Type) *NodeUpdate

SetNillableType sets the "type" field if the given value is not nil.

func (*NodeUpdate) SetNillableURLDownload

func (nu *NodeUpdate) SetNillableURLDownload(s *string) *NodeUpdate

SetNillableURLDownload sets the "url_download" field if the given value is not nil.

func (*NodeUpdate) SetNillableURLHome

func (nu *NodeUpdate) SetNillableURLHome(s *string) *NodeUpdate

SetNillableURLHome sets the "url_home" field if the given value is not nil.

func (*NodeUpdate) SetNillableValidUntilDate

func (nu *NodeUpdate) SetNillableValidUntilDate(t *time.Time) *NodeUpdate

SetNillableValidUntilDate sets the "valid_until_date" field if the given value is not nil.

func (*NodeUpdate) SetNillableVersion

func (nu *NodeUpdate) SetNillableVersion(s *string) *NodeUpdate

SetNillableVersion sets the "version" field if the given value is not nil.

func (*NodeUpdate) SetNodeList

func (nu *NodeUpdate) SetNodeList(n *NodeList) *NodeUpdate

SetNodeList sets the "node_list" edge to the NodeList entity.

func (*NodeUpdate) SetNodeListID

func (nu *NodeUpdate) SetNodeListID(id int) *NodeUpdate

SetNodeListID sets the "node_list" edge to the NodeList entity by ID.

func (*NodeUpdate) SetReleaseDate

func (nu *NodeUpdate) SetReleaseDate(t time.Time) *NodeUpdate

SetReleaseDate sets the "release_date" field.

func (*NodeUpdate) SetSourceInfo

func (nu *NodeUpdate) SetSourceInfo(s string) *NodeUpdate

SetSourceInfo sets the "source_info" field.

func (*NodeUpdate) SetSummary

func (nu *NodeUpdate) SetSummary(s string) *NodeUpdate

SetSummary sets the "summary" field.

func (*NodeUpdate) SetType

func (nu *NodeUpdate) SetType(n node.Type) *NodeUpdate

SetType sets the "type" field.

func (*NodeUpdate) SetURLDownload

func (nu *NodeUpdate) SetURLDownload(s string) *NodeUpdate

SetURLDownload sets the "url_download" field.

func (*NodeUpdate) SetURLHome

func (nu *NodeUpdate) SetURLHome(s string) *NodeUpdate

SetURLHome sets the "url_home" field.

func (*NodeUpdate) SetValidUntilDate

func (nu *NodeUpdate) SetValidUntilDate(t time.Time) *NodeUpdate

SetValidUntilDate sets the "valid_until_date" field.

func (*NodeUpdate) SetVersion

func (nu *NodeUpdate) SetVersion(s string) *NodeUpdate

SetVersion sets the "version" field.

func (*NodeUpdate) Where

func (nu *NodeUpdate) Where(ps ...predicate.Node) *NodeUpdate

Where appends a list predicates to the NodeUpdate builder.

type NodeUpdateOne

type NodeUpdateOne struct {
	// contains filtered or unexported fields
}

NodeUpdateOne is the builder for updating a single Node entity.

func (*NodeUpdateOne) AddEdgeTypeIDs

func (nuo *NodeUpdateOne) AddEdgeTypeIDs(ids ...int) *NodeUpdateOne

AddEdgeTypeIDs adds the "edge_types" edge to the EdgeType entity by IDs.

func (*NodeUpdateOne) AddEdgeTypes

func (nuo *NodeUpdateOne) AddEdgeTypes(e ...*EdgeType) *NodeUpdateOne

AddEdgeTypes adds the "edge_types" edges to the EdgeType entity.

func (*NodeUpdateOne) AddExternalReferenceIDs

func (nuo *NodeUpdateOne) AddExternalReferenceIDs(ids ...int) *NodeUpdateOne

AddExternalReferenceIDs adds the "external_references" edge to the ExternalReference entity by IDs.

func (*NodeUpdateOne) AddExternalReferences

func (nuo *NodeUpdateOne) AddExternalReferences(e ...*ExternalReference) *NodeUpdateOne

AddExternalReferences adds the "external_references" edges to the ExternalReference entity.

func (*NodeUpdateOne) AddHashIDs

func (nuo *NodeUpdateOne) AddHashIDs(ids ...int) *NodeUpdateOne

AddHashIDs adds the "hashes" edge to the HashesEntry entity by IDs.

func (*NodeUpdateOne) AddHashes

func (nuo *NodeUpdateOne) AddHashes(h ...*HashesEntry) *NodeUpdateOne

AddHashes adds the "hashes" edges to the HashesEntry entity.

func (*NodeUpdateOne) AddIdentifierIDs

func (nuo *NodeUpdateOne) AddIdentifierIDs(ids ...int) *NodeUpdateOne

AddIdentifierIDs adds the "identifiers" edge to the IdentifiersEntry entity by IDs.

func (*NodeUpdateOne) AddIdentifiers

func (nuo *NodeUpdateOne) AddIdentifiers(i ...*IdentifiersEntry) *NodeUpdateOne

AddIdentifiers adds the "identifiers" edges to the IdentifiersEntry entity.

func (*NodeUpdateOne) AddNodeIDs

func (nuo *NodeUpdateOne) AddNodeIDs(ids ...string) *NodeUpdateOne

AddNodeIDs adds the "nodes" edge to the Node entity by IDs.

func (*NodeUpdateOne) AddNodes

func (nuo *NodeUpdateOne) AddNodes(n ...*Node) *NodeUpdateOne

AddNodes adds the "nodes" edges to the Node entity.

func (*NodeUpdateOne) AddOriginatorIDs

func (nuo *NodeUpdateOne) AddOriginatorIDs(ids ...int) *NodeUpdateOne

AddOriginatorIDs adds the "originators" edge to the Person entity by IDs.

func (*NodeUpdateOne) AddOriginators

func (nuo *NodeUpdateOne) AddOriginators(p ...*Person) *NodeUpdateOne

AddOriginators adds the "originators" edges to the Person entity.

func (*NodeUpdateOne) AddPrimaryPurpose

func (nuo *NodeUpdateOne) AddPrimaryPurpose(p ...*Purpose) *NodeUpdateOne

AddPrimaryPurpose adds the "primary_purpose" edges to the Purpose entity.

func (*NodeUpdateOne) AddPrimaryPurposeIDs

func (nuo *NodeUpdateOne) AddPrimaryPurposeIDs(ids ...int) *NodeUpdateOne

AddPrimaryPurposeIDs adds the "primary_purpose" edge to the Purpose entity by IDs.

func (*NodeUpdateOne) AddSupplierIDs

func (nuo *NodeUpdateOne) AddSupplierIDs(ids ...int) *NodeUpdateOne

AddSupplierIDs adds the "suppliers" edge to the Person entity by IDs.

func (*NodeUpdateOne) AddSuppliers

func (nuo *NodeUpdateOne) AddSuppliers(p ...*Person) *NodeUpdateOne

AddSuppliers adds the "suppliers" edges to the Person entity.

func (*NodeUpdateOne) AppendAttribution

func (nuo *NodeUpdateOne) AppendAttribution(s []string) *NodeUpdateOne

AppendAttribution appends s to the "attribution" field.

func (*NodeUpdateOne) AppendFileTypes

func (nuo *NodeUpdateOne) AppendFileTypes(s []string) *NodeUpdateOne

AppendFileTypes appends s to the "file_types" field.

func (*NodeUpdateOne) AppendLicenses

func (nuo *NodeUpdateOne) AppendLicenses(s []string) *NodeUpdateOne

AppendLicenses appends s to the "licenses" field.

func (*NodeUpdateOne) ClearEdgeTypes

func (nuo *NodeUpdateOne) ClearEdgeTypes() *NodeUpdateOne

ClearEdgeTypes clears all "edge_types" edges to the EdgeType entity.

func (*NodeUpdateOne) ClearExternalReferences

func (nuo *NodeUpdateOne) ClearExternalReferences() *NodeUpdateOne

ClearExternalReferences clears all "external_references" edges to the ExternalReference entity.

func (*NodeUpdateOne) ClearHashes

func (nuo *NodeUpdateOne) ClearHashes() *NodeUpdateOne

ClearHashes clears all "hashes" edges to the HashesEntry entity.

func (*NodeUpdateOne) ClearIdentifiers

func (nuo *NodeUpdateOne) ClearIdentifiers() *NodeUpdateOne

ClearIdentifiers clears all "identifiers" edges to the IdentifiersEntry entity.

func (*NodeUpdateOne) ClearNodeList

func (nuo *NodeUpdateOne) ClearNodeList() *NodeUpdateOne

ClearNodeList clears the "node_list" edge to the NodeList entity.

func (*NodeUpdateOne) ClearNodes

func (nuo *NodeUpdateOne) ClearNodes() *NodeUpdateOne

ClearNodes clears all "nodes" edges to the Node entity.

func (*NodeUpdateOne) ClearOriginators

func (nuo *NodeUpdateOne) ClearOriginators() *NodeUpdateOne

ClearOriginators clears all "originators" edges to the Person entity.

func (*NodeUpdateOne) ClearPrimaryPurpose

func (nuo *NodeUpdateOne) ClearPrimaryPurpose() *NodeUpdateOne

ClearPrimaryPurpose clears all "primary_purpose" edges to the Purpose entity.

func (*NodeUpdateOne) ClearSuppliers

func (nuo *NodeUpdateOne) ClearSuppliers() *NodeUpdateOne

ClearSuppliers clears all "suppliers" edges to the Person entity.

func (*NodeUpdateOne) Exec

func (nuo *NodeUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*NodeUpdateOne) ExecX

func (nuo *NodeUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*NodeUpdateOne) Mutation

func (nuo *NodeUpdateOne) Mutation() *NodeMutation

Mutation returns the NodeMutation object of the builder.

func (*NodeUpdateOne) RemoveEdgeTypeIDs

func (nuo *NodeUpdateOne) RemoveEdgeTypeIDs(ids ...int) *NodeUpdateOne

RemoveEdgeTypeIDs removes the "edge_types" edge to EdgeType entities by IDs.

func (*NodeUpdateOne) RemoveEdgeTypes

func (nuo *NodeUpdateOne) RemoveEdgeTypes(e ...*EdgeType) *NodeUpdateOne

RemoveEdgeTypes removes "edge_types" edges to EdgeType entities.

func (*NodeUpdateOne) RemoveExternalReferenceIDs

func (nuo *NodeUpdateOne) RemoveExternalReferenceIDs(ids ...int) *NodeUpdateOne

RemoveExternalReferenceIDs removes the "external_references" edge to ExternalReference entities by IDs.

func (*NodeUpdateOne) RemoveExternalReferences

func (nuo *NodeUpdateOne) RemoveExternalReferences(e ...*ExternalReference) *NodeUpdateOne

RemoveExternalReferences removes "external_references" edges to ExternalReference entities.

func (*NodeUpdateOne) RemoveHashIDs

func (nuo *NodeUpdateOne) RemoveHashIDs(ids ...int) *NodeUpdateOne

RemoveHashIDs removes the "hashes" edge to HashesEntry entities by IDs.

func (*NodeUpdateOne) RemoveHashes

func (nuo *NodeUpdateOne) RemoveHashes(h ...*HashesEntry) *NodeUpdateOne

RemoveHashes removes "hashes" edges to HashesEntry entities.

func (*NodeUpdateOne) RemoveIdentifierIDs

func (nuo *NodeUpdateOne) RemoveIdentifierIDs(ids ...int) *NodeUpdateOne

RemoveIdentifierIDs removes the "identifiers" edge to IdentifiersEntry entities by IDs.

func (*NodeUpdateOne) RemoveIdentifiers

func (nuo *NodeUpdateOne) RemoveIdentifiers(i ...*IdentifiersEntry) *NodeUpdateOne

RemoveIdentifiers removes "identifiers" edges to IdentifiersEntry entities.

func (*NodeUpdateOne) RemoveNodeIDs

func (nuo *NodeUpdateOne) RemoveNodeIDs(ids ...string) *NodeUpdateOne

RemoveNodeIDs removes the "nodes" edge to Node entities by IDs.

func (*NodeUpdateOne) RemoveNodes

func (nuo *NodeUpdateOne) RemoveNodes(n ...*Node) *NodeUpdateOne

RemoveNodes removes "nodes" edges to Node entities.

func (*NodeUpdateOne) RemoveOriginatorIDs

func (nuo *NodeUpdateOne) RemoveOriginatorIDs(ids ...int) *NodeUpdateOne

RemoveOriginatorIDs removes the "originators" edge to Person entities by IDs.

func (*NodeUpdateOne) RemoveOriginators

func (nuo *NodeUpdateOne) RemoveOriginators(p ...*Person) *NodeUpdateOne

RemoveOriginators removes "originators" edges to Person entities.

func (*NodeUpdateOne) RemovePrimaryPurpose

func (nuo *NodeUpdateOne) RemovePrimaryPurpose(p ...*Purpose) *NodeUpdateOne

RemovePrimaryPurpose removes "primary_purpose" edges to Purpose entities.

func (*NodeUpdateOne) RemovePrimaryPurposeIDs

func (nuo *NodeUpdateOne) RemovePrimaryPurposeIDs(ids ...int) *NodeUpdateOne

RemovePrimaryPurposeIDs removes the "primary_purpose" edge to Purpose entities by IDs.

func (*NodeUpdateOne) RemoveSupplierIDs

func (nuo *NodeUpdateOne) RemoveSupplierIDs(ids ...int) *NodeUpdateOne

RemoveSupplierIDs removes the "suppliers" edge to Person entities by IDs.

func (*NodeUpdateOne) RemoveSuppliers

func (nuo *NodeUpdateOne) RemoveSuppliers(p ...*Person) *NodeUpdateOne

RemoveSuppliers removes "suppliers" edges to Person entities.

func (*NodeUpdateOne) Save

func (nuo *NodeUpdateOne) Save(ctx context.Context) (*Node, error)

Save executes the query and returns the updated Node entity.

func (*NodeUpdateOne) SaveX

func (nuo *NodeUpdateOne) SaveX(ctx context.Context) *Node

SaveX is like Save, but panics if an error occurs.

func (*NodeUpdateOne) Select

func (nuo *NodeUpdateOne) Select(field string, fields ...string) *NodeUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*NodeUpdateOne) SetAttribution

func (nuo *NodeUpdateOne) SetAttribution(s []string) *NodeUpdateOne

SetAttribution sets the "attribution" field.

func (*NodeUpdateOne) SetBuildDate

func (nuo *NodeUpdateOne) SetBuildDate(t time.Time) *NodeUpdateOne

SetBuildDate sets the "build_date" field.

func (*NodeUpdateOne) SetComment

func (nuo *NodeUpdateOne) SetComment(s string) *NodeUpdateOne

SetComment sets the "comment" field.

func (*NodeUpdateOne) SetCopyright

func (nuo *NodeUpdateOne) SetCopyright(s string) *NodeUpdateOne

SetCopyright sets the "copyright" field.

func (*NodeUpdateOne) SetDescription

func (nuo *NodeUpdateOne) SetDescription(s string) *NodeUpdateOne

SetDescription sets the "description" field.

func (*NodeUpdateOne) SetFileName

func (nuo *NodeUpdateOne) SetFileName(s string) *NodeUpdateOne

SetFileName sets the "file_name" field.

func (*NodeUpdateOne) SetFileTypes

func (nuo *NodeUpdateOne) SetFileTypes(s []string) *NodeUpdateOne

SetFileTypes sets the "file_types" field.

func (*NodeUpdateOne) SetLicenseComments

func (nuo *NodeUpdateOne) SetLicenseComments(s string) *NodeUpdateOne

SetLicenseComments sets the "license_comments" field.

func (*NodeUpdateOne) SetLicenseConcluded

func (nuo *NodeUpdateOne) SetLicenseConcluded(s string) *NodeUpdateOne

SetLicenseConcluded sets the "license_concluded" field.

func (*NodeUpdateOne) SetLicenses

func (nuo *NodeUpdateOne) SetLicenses(s []string) *NodeUpdateOne

SetLicenses sets the "licenses" field.

func (*NodeUpdateOne) SetName

func (nuo *NodeUpdateOne) SetName(s string) *NodeUpdateOne

SetName sets the "name" field.

func (*NodeUpdateOne) SetNillableBuildDate

func (nuo *NodeUpdateOne) SetNillableBuildDate(t *time.Time) *NodeUpdateOne

SetNillableBuildDate sets the "build_date" field if the given value is not nil.

func (*NodeUpdateOne) SetNillableComment

func (nuo *NodeUpdateOne) SetNillableComment(s *string) *NodeUpdateOne

SetNillableComment sets the "comment" field if the given value is not nil.

func (*NodeUpdateOne) SetNillableCopyright

func (nuo *NodeUpdateOne) SetNillableCopyright(s *string) *NodeUpdateOne

SetNillableCopyright sets the "copyright" field if the given value is not nil.

func (*NodeUpdateOne) SetNillableDescription

func (nuo *NodeUpdateOne) SetNillableDescription(s *string) *NodeUpdateOne

SetNillableDescription sets the "description" field if the given value is not nil.

func (*NodeUpdateOne) SetNillableFileName

func (nuo *NodeUpdateOne) SetNillableFileName(s *string) *NodeUpdateOne

SetNillableFileName sets the "file_name" field if the given value is not nil.

func (*NodeUpdateOne) SetNillableLicenseComments

func (nuo *NodeUpdateOne) SetNillableLicenseComments(s *string) *NodeUpdateOne

SetNillableLicenseComments sets the "license_comments" field if the given value is not nil.

func (*NodeUpdateOne) SetNillableLicenseConcluded

func (nuo *NodeUpdateOne) SetNillableLicenseConcluded(s *string) *NodeUpdateOne

SetNillableLicenseConcluded sets the "license_concluded" field if the given value is not nil.

func (*NodeUpdateOne) SetNillableName

func (nuo *NodeUpdateOne) SetNillableName(s *string) *NodeUpdateOne

SetNillableName sets the "name" field if the given value is not nil.

func (*NodeUpdateOne) SetNillableReleaseDate

func (nuo *NodeUpdateOne) SetNillableReleaseDate(t *time.Time) *NodeUpdateOne

SetNillableReleaseDate sets the "release_date" field if the given value is not nil.

func (*NodeUpdateOne) SetNillableSourceInfo

func (nuo *NodeUpdateOne) SetNillableSourceInfo(s *string) *NodeUpdateOne

SetNillableSourceInfo sets the "source_info" field if the given value is not nil.

func (*NodeUpdateOne) SetNillableSummary

func (nuo *NodeUpdateOne) SetNillableSummary(s *string) *NodeUpdateOne

SetNillableSummary sets the "summary" field if the given value is not nil.

func (*NodeUpdateOne) SetNillableType

func (nuo *NodeUpdateOne) SetNillableType(n *node.Type) *NodeUpdateOne

SetNillableType sets the "type" field if the given value is not nil.

func (*NodeUpdateOne) SetNillableURLDownload

func (nuo *NodeUpdateOne) SetNillableURLDownload(s *string) *NodeUpdateOne

SetNillableURLDownload sets the "url_download" field if the given value is not nil.

func (*NodeUpdateOne) SetNillableURLHome

func (nuo *NodeUpdateOne) SetNillableURLHome(s *string) *NodeUpdateOne

SetNillableURLHome sets the "url_home" field if the given value is not nil.

func (*NodeUpdateOne) SetNillableValidUntilDate

func (nuo *NodeUpdateOne) SetNillableValidUntilDate(t *time.Time) *NodeUpdateOne

SetNillableValidUntilDate sets the "valid_until_date" field if the given value is not nil.

func (*NodeUpdateOne) SetNillableVersion

func (nuo *NodeUpdateOne) SetNillableVersion(s *string) *NodeUpdateOne

SetNillableVersion sets the "version" field if the given value is not nil.

func (*NodeUpdateOne) SetNodeList

func (nuo *NodeUpdateOne) SetNodeList(n *NodeList) *NodeUpdateOne

SetNodeList sets the "node_list" edge to the NodeList entity.

func (*NodeUpdateOne) SetNodeListID

func (nuo *NodeUpdateOne) SetNodeListID(id int) *NodeUpdateOne

SetNodeListID sets the "node_list" edge to the NodeList entity by ID.

func (*NodeUpdateOne) SetReleaseDate

func (nuo *NodeUpdateOne) SetReleaseDate(t time.Time) *NodeUpdateOne

SetReleaseDate sets the "release_date" field.

func (*NodeUpdateOne) SetSourceInfo

func (nuo *NodeUpdateOne) SetSourceInfo(s string) *NodeUpdateOne

SetSourceInfo sets the "source_info" field.

func (*NodeUpdateOne) SetSummary

func (nuo *NodeUpdateOne) SetSummary(s string) *NodeUpdateOne

SetSummary sets the "summary" field.

func (*NodeUpdateOne) SetType

func (nuo *NodeUpdateOne) SetType(n node.Type) *NodeUpdateOne

SetType sets the "type" field.

func (*NodeUpdateOne) SetURLDownload

func (nuo *NodeUpdateOne) SetURLDownload(s string) *NodeUpdateOne

SetURLDownload sets the "url_download" field.

func (*NodeUpdateOne) SetURLHome

func (nuo *NodeUpdateOne) SetURLHome(s string) *NodeUpdateOne

SetURLHome sets the "url_home" field.

func (*NodeUpdateOne) SetValidUntilDate

func (nuo *NodeUpdateOne) SetValidUntilDate(t time.Time) *NodeUpdateOne

SetValidUntilDate sets the "valid_until_date" field.

func (*NodeUpdateOne) SetVersion

func (nuo *NodeUpdateOne) SetVersion(s string) *NodeUpdateOne

SetVersion sets the "version" field.

func (*NodeUpdateOne) Where

func (nuo *NodeUpdateOne) Where(ps ...predicate.Node) *NodeUpdateOne

Where appends a list predicates to the NodeUpdate builder.

type NodeUpsert

type NodeUpsert struct {
	*sql.UpdateSet
}

NodeUpsert is the "OnConflict" setter.

func (*NodeUpsert) SetAttribution

func (u *NodeUpsert) SetAttribution(v []string) *NodeUpsert

SetAttribution sets the "attribution" field.

func (*NodeUpsert) SetBuildDate

func (u *NodeUpsert) SetBuildDate(v time.Time) *NodeUpsert

SetBuildDate sets the "build_date" field.

func (*NodeUpsert) SetComment

func (u *NodeUpsert) SetComment(v string) *NodeUpsert

SetComment sets the "comment" field.

func (*NodeUpsert) SetCopyright

func (u *NodeUpsert) SetCopyright(v string) *NodeUpsert

SetCopyright sets the "copyright" field.

func (*NodeUpsert) SetDescription

func (u *NodeUpsert) SetDescription(v string) *NodeUpsert

SetDescription sets the "description" field.

func (*NodeUpsert) SetFileName

func (u *NodeUpsert) SetFileName(v string) *NodeUpsert

SetFileName sets the "file_name" field.

func (*NodeUpsert) SetFileTypes

func (u *NodeUpsert) SetFileTypes(v []string) *NodeUpsert

SetFileTypes sets the "file_types" field.

func (*NodeUpsert) SetLicenseComments

func (u *NodeUpsert) SetLicenseComments(v string) *NodeUpsert

SetLicenseComments sets the "license_comments" field.

func (*NodeUpsert) SetLicenseConcluded

func (u *NodeUpsert) SetLicenseConcluded(v string) *NodeUpsert

SetLicenseConcluded sets the "license_concluded" field.

func (*NodeUpsert) SetLicenses

func (u *NodeUpsert) SetLicenses(v []string) *NodeUpsert

SetLicenses sets the "licenses" field.

func (*NodeUpsert) SetName

func (u *NodeUpsert) SetName(v string) *NodeUpsert

SetName sets the "name" field.

func (*NodeUpsert) SetReleaseDate

func (u *NodeUpsert) SetReleaseDate(v time.Time) *NodeUpsert

SetReleaseDate sets the "release_date" field.

func (*NodeUpsert) SetSourceInfo

func (u *NodeUpsert) SetSourceInfo(v string) *NodeUpsert

SetSourceInfo sets the "source_info" field.

func (*NodeUpsert) SetSummary

func (u *NodeUpsert) SetSummary(v string) *NodeUpsert

SetSummary sets the "summary" field.

func (*NodeUpsert) SetType

func (u *NodeUpsert) SetType(v node.Type) *NodeUpsert

SetType sets the "type" field.

func (*NodeUpsert) SetURLDownload

func (u *NodeUpsert) SetURLDownload(v string) *NodeUpsert

SetURLDownload sets the "url_download" field.

func (*NodeUpsert) SetURLHome

func (u *NodeUpsert) SetURLHome(v string) *NodeUpsert

SetURLHome sets the "url_home" field.

func (*NodeUpsert) SetValidUntilDate

func (u *NodeUpsert) SetValidUntilDate(v time.Time) *NodeUpsert

SetValidUntilDate sets the "valid_until_date" field.

func (*NodeUpsert) SetVersion

func (u *NodeUpsert) SetVersion(v string) *NodeUpsert

SetVersion sets the "version" field.

func (*NodeUpsert) UpdateAttribution

func (u *NodeUpsert) UpdateAttribution() *NodeUpsert

UpdateAttribution sets the "attribution" field to the value that was provided on create.

func (*NodeUpsert) UpdateBuildDate

func (u *NodeUpsert) UpdateBuildDate() *NodeUpsert

UpdateBuildDate sets the "build_date" field to the value that was provided on create.

func (*NodeUpsert) UpdateComment

func (u *NodeUpsert) UpdateComment() *NodeUpsert

UpdateComment sets the "comment" field to the value that was provided on create.

func (*NodeUpsert) UpdateCopyright

func (u *NodeUpsert) UpdateCopyright() *NodeUpsert

UpdateCopyright sets the "copyright" field to the value that was provided on create.

func (*NodeUpsert) UpdateDescription

func (u *NodeUpsert) UpdateDescription() *NodeUpsert

UpdateDescription sets the "description" field to the value that was provided on create.

func (*NodeUpsert) UpdateFileName

func (u *NodeUpsert) UpdateFileName() *NodeUpsert

UpdateFileName sets the "file_name" field to the value that was provided on create.

func (*NodeUpsert) UpdateFileTypes

func (u *NodeUpsert) UpdateFileTypes() *NodeUpsert

UpdateFileTypes sets the "file_types" field to the value that was provided on create.

func (*NodeUpsert) UpdateLicenseComments

func (u *NodeUpsert) UpdateLicenseComments() *NodeUpsert

UpdateLicenseComments sets the "license_comments" field to the value that was provided on create.

func (*NodeUpsert) UpdateLicenseConcluded

func (u *NodeUpsert) UpdateLicenseConcluded() *NodeUpsert

UpdateLicenseConcluded sets the "license_concluded" field to the value that was provided on create.

func (*NodeUpsert) UpdateLicenses

func (u *NodeUpsert) UpdateLicenses() *NodeUpsert

UpdateLicenses sets the "licenses" field to the value that was provided on create.

func (*NodeUpsert) UpdateName

func (u *NodeUpsert) UpdateName() *NodeUpsert

UpdateName sets the "name" field to the value that was provided on create.

func (*NodeUpsert) UpdateReleaseDate

func (u *NodeUpsert) UpdateReleaseDate() *NodeUpsert

UpdateReleaseDate sets the "release_date" field to the value that was provided on create.

func (*NodeUpsert) UpdateSourceInfo

func (u *NodeUpsert) UpdateSourceInfo() *NodeUpsert

UpdateSourceInfo sets the "source_info" field to the value that was provided on create.

func (*NodeUpsert) UpdateSummary

func (u *NodeUpsert) UpdateSummary() *NodeUpsert

UpdateSummary sets the "summary" field to the value that was provided on create.

func (*NodeUpsert) UpdateType

func (u *NodeUpsert) UpdateType() *NodeUpsert

UpdateType sets the "type" field to the value that was provided on create.

func (*NodeUpsert) UpdateURLDownload

func (u *NodeUpsert) UpdateURLDownload() *NodeUpsert

UpdateURLDownload sets the "url_download" field to the value that was provided on create.

func (*NodeUpsert) UpdateURLHome

func (u *NodeUpsert) UpdateURLHome() *NodeUpsert

UpdateURLHome sets the "url_home" field to the value that was provided on create.

func (*NodeUpsert) UpdateValidUntilDate

func (u *NodeUpsert) UpdateValidUntilDate() *NodeUpsert

UpdateValidUntilDate sets the "valid_until_date" field to the value that was provided on create.

func (*NodeUpsert) UpdateVersion

func (u *NodeUpsert) UpdateVersion() *NodeUpsert

UpdateVersion sets the "version" field to the value that was provided on create.

type NodeUpsertBulk

type NodeUpsertBulk struct {
	// contains filtered or unexported fields
}

NodeUpsertBulk is the builder for "upsert"-ing a bulk of Node nodes.

func (*NodeUpsertBulk) DoNothing

func (u *NodeUpsertBulk) DoNothing() *NodeUpsertBulk

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*NodeUpsertBulk) Exec

func (u *NodeUpsertBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*NodeUpsertBulk) ExecX

func (u *NodeUpsertBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*NodeUpsertBulk) Ignore

func (u *NodeUpsertBulk) Ignore() *NodeUpsertBulk

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.Node.Create().
	OnConflict(sql.ResolveWithIgnore()).
	Exec(ctx)

func (*NodeUpsertBulk) SetAttribution

func (u *NodeUpsertBulk) SetAttribution(v []string) *NodeUpsertBulk

SetAttribution sets the "attribution" field.

func (*NodeUpsertBulk) SetBuildDate

func (u *NodeUpsertBulk) SetBuildDate(v time.Time) *NodeUpsertBulk

SetBuildDate sets the "build_date" field.

func (*NodeUpsertBulk) SetComment

func (u *NodeUpsertBulk) SetComment(v string) *NodeUpsertBulk

SetComment sets the "comment" field.

func (*NodeUpsertBulk) SetCopyright

func (u *NodeUpsertBulk) SetCopyright(v string) *NodeUpsertBulk

SetCopyright sets the "copyright" field.

func (*NodeUpsertBulk) SetDescription

func (u *NodeUpsertBulk) SetDescription(v string) *NodeUpsertBulk

SetDescription sets the "description" field.

func (*NodeUpsertBulk) SetFileName

func (u *NodeUpsertBulk) SetFileName(v string) *NodeUpsertBulk

SetFileName sets the "file_name" field.

func (*NodeUpsertBulk) SetFileTypes

func (u *NodeUpsertBulk) SetFileTypes(v []string) *NodeUpsertBulk

SetFileTypes sets the "file_types" field.

func (*NodeUpsertBulk) SetLicenseComments

func (u *NodeUpsertBulk) SetLicenseComments(v string) *NodeUpsertBulk

SetLicenseComments sets the "license_comments" field.

func (*NodeUpsertBulk) SetLicenseConcluded

func (u *NodeUpsertBulk) SetLicenseConcluded(v string) *NodeUpsertBulk

SetLicenseConcluded sets the "license_concluded" field.

func (*NodeUpsertBulk) SetLicenses

func (u *NodeUpsertBulk) SetLicenses(v []string) *NodeUpsertBulk

SetLicenses sets the "licenses" field.

func (*NodeUpsertBulk) SetName

func (u *NodeUpsertBulk) SetName(v string) *NodeUpsertBulk

SetName sets the "name" field.

func (*NodeUpsertBulk) SetReleaseDate

func (u *NodeUpsertBulk) SetReleaseDate(v time.Time) *NodeUpsertBulk

SetReleaseDate sets the "release_date" field.

func (*NodeUpsertBulk) SetSourceInfo

func (u *NodeUpsertBulk) SetSourceInfo(v string) *NodeUpsertBulk

SetSourceInfo sets the "source_info" field.

func (*NodeUpsertBulk) SetSummary

func (u *NodeUpsertBulk) SetSummary(v string) *NodeUpsertBulk

SetSummary sets the "summary" field.

func (*NodeUpsertBulk) SetType

func (u *NodeUpsertBulk) SetType(v node.Type) *NodeUpsertBulk

SetType sets the "type" field.

func (*NodeUpsertBulk) SetURLDownload

func (u *NodeUpsertBulk) SetURLDownload(v string) *NodeUpsertBulk

SetURLDownload sets the "url_download" field.

func (*NodeUpsertBulk) SetURLHome

func (u *NodeUpsertBulk) SetURLHome(v string) *NodeUpsertBulk

SetURLHome sets the "url_home" field.

func (*NodeUpsertBulk) SetValidUntilDate

func (u *NodeUpsertBulk) SetValidUntilDate(v time.Time) *NodeUpsertBulk

SetValidUntilDate sets the "valid_until_date" field.

func (*NodeUpsertBulk) SetVersion

func (u *NodeUpsertBulk) SetVersion(v string) *NodeUpsertBulk

SetVersion sets the "version" field.

func (*NodeUpsertBulk) Update

func (u *NodeUpsertBulk) Update(set func(*NodeUpsert)) *NodeUpsertBulk

Update allows overriding fields `UPDATE` values. See the NodeCreateBulk.OnConflict documentation for more info.

func (*NodeUpsertBulk) UpdateAttribution

func (u *NodeUpsertBulk) UpdateAttribution() *NodeUpsertBulk

UpdateAttribution sets the "attribution" field to the value that was provided on create.

func (*NodeUpsertBulk) UpdateBuildDate

func (u *NodeUpsertBulk) UpdateBuildDate() *NodeUpsertBulk

UpdateBuildDate sets the "build_date" field to the value that was provided on create.

func (*NodeUpsertBulk) UpdateComment

func (u *NodeUpsertBulk) UpdateComment() *NodeUpsertBulk

UpdateComment sets the "comment" field to the value that was provided on create.

func (*NodeUpsertBulk) UpdateCopyright

func (u *NodeUpsertBulk) UpdateCopyright() *NodeUpsertBulk

UpdateCopyright sets the "copyright" field to the value that was provided on create.

func (*NodeUpsertBulk) UpdateDescription

func (u *NodeUpsertBulk) UpdateDescription() *NodeUpsertBulk

UpdateDescription sets the "description" field to the value that was provided on create.

func (*NodeUpsertBulk) UpdateFileName

func (u *NodeUpsertBulk) UpdateFileName() *NodeUpsertBulk

UpdateFileName sets the "file_name" field to the value that was provided on create.

func (*NodeUpsertBulk) UpdateFileTypes

func (u *NodeUpsertBulk) UpdateFileTypes() *NodeUpsertBulk

UpdateFileTypes sets the "file_types" field to the value that was provided on create.

func (*NodeUpsertBulk) UpdateLicenseComments

func (u *NodeUpsertBulk) UpdateLicenseComments() *NodeUpsertBulk

UpdateLicenseComments sets the "license_comments" field to the value that was provided on create.

func (*NodeUpsertBulk) UpdateLicenseConcluded

func (u *NodeUpsertBulk) UpdateLicenseConcluded() *NodeUpsertBulk

UpdateLicenseConcluded sets the "license_concluded" field to the value that was provided on create.

func (*NodeUpsertBulk) UpdateLicenses

func (u *NodeUpsertBulk) UpdateLicenses() *NodeUpsertBulk

UpdateLicenses sets the "licenses" field to the value that was provided on create.

func (*NodeUpsertBulk) UpdateName

func (u *NodeUpsertBulk) UpdateName() *NodeUpsertBulk

UpdateName sets the "name" field to the value that was provided on create.

func (*NodeUpsertBulk) UpdateNewValues

func (u *NodeUpsertBulk) UpdateNewValues() *NodeUpsertBulk

UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:

client.Node.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
		sql.ResolveWith(func(u *sql.UpdateSet) {
			u.SetIgnore(node.FieldID)
		}),
	).
	Exec(ctx)

func (*NodeUpsertBulk) UpdateReleaseDate

func (u *NodeUpsertBulk) UpdateReleaseDate() *NodeUpsertBulk

UpdateReleaseDate sets the "release_date" field to the value that was provided on create.

func (*NodeUpsertBulk) UpdateSourceInfo

func (u *NodeUpsertBulk) UpdateSourceInfo() *NodeUpsertBulk

UpdateSourceInfo sets the "source_info" field to the value that was provided on create.

func (*NodeUpsertBulk) UpdateSummary

func (u *NodeUpsertBulk) UpdateSummary() *NodeUpsertBulk

UpdateSummary sets the "summary" field to the value that was provided on create.

func (*NodeUpsertBulk) UpdateType

func (u *NodeUpsertBulk) UpdateType() *NodeUpsertBulk

UpdateType sets the "type" field to the value that was provided on create.

func (*NodeUpsertBulk) UpdateURLDownload

func (u *NodeUpsertBulk) UpdateURLDownload() *NodeUpsertBulk

UpdateURLDownload sets the "url_download" field to the value that was provided on create.

func (*NodeUpsertBulk) UpdateURLHome

func (u *NodeUpsertBulk) UpdateURLHome() *NodeUpsertBulk

UpdateURLHome sets the "url_home" field to the value that was provided on create.

func (*NodeUpsertBulk) UpdateValidUntilDate

func (u *NodeUpsertBulk) UpdateValidUntilDate() *NodeUpsertBulk

UpdateValidUntilDate sets the "valid_until_date" field to the value that was provided on create.

func (*NodeUpsertBulk) UpdateVersion

func (u *NodeUpsertBulk) UpdateVersion() *NodeUpsertBulk

UpdateVersion sets the "version" field to the value that was provided on create.

type NodeUpsertOne

type NodeUpsertOne struct {
	// contains filtered or unexported fields
}

NodeUpsertOne is the builder for "upsert"-ing

one Node node.

func (*NodeUpsertOne) DoNothing

func (u *NodeUpsertOne) DoNothing() *NodeUpsertOne

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*NodeUpsertOne) Exec

func (u *NodeUpsertOne) Exec(ctx context.Context) error

Exec executes the query.

func (*NodeUpsertOne) ExecX

func (u *NodeUpsertOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*NodeUpsertOne) ID

func (u *NodeUpsertOne) ID(ctx context.Context) (id string, err error)

Exec executes the UPSERT query and returns the inserted/updated ID.

func (*NodeUpsertOne) IDX

func (u *NodeUpsertOne) IDX(ctx context.Context) string

IDX is like ID, but panics if an error occurs.

func (*NodeUpsertOne) Ignore

func (u *NodeUpsertOne) Ignore() *NodeUpsertOne

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.Node.Create().
    OnConflict(sql.ResolveWithIgnore()).
    Exec(ctx)

func (*NodeUpsertOne) SetAttribution

func (u *NodeUpsertOne) SetAttribution(v []string) *NodeUpsertOne

SetAttribution sets the "attribution" field.

func (*NodeUpsertOne) SetBuildDate

func (u *NodeUpsertOne) SetBuildDate(v time.Time) *NodeUpsertOne

SetBuildDate sets the "build_date" field.

func (*NodeUpsertOne) SetComment

func (u *NodeUpsertOne) SetComment(v string) *NodeUpsertOne

SetComment sets the "comment" field.

func (*NodeUpsertOne) SetCopyright

func (u *NodeUpsertOne) SetCopyright(v string) *NodeUpsertOne

SetCopyright sets the "copyright" field.

func (*NodeUpsertOne) SetDescription

func (u *NodeUpsertOne) SetDescription(v string) *NodeUpsertOne

SetDescription sets the "description" field.

func (*NodeUpsertOne) SetFileName

func (u *NodeUpsertOne) SetFileName(v string) *NodeUpsertOne

SetFileName sets the "file_name" field.

func (*NodeUpsertOne) SetFileTypes

func (u *NodeUpsertOne) SetFileTypes(v []string) *NodeUpsertOne

SetFileTypes sets the "file_types" field.

func (*NodeUpsertOne) SetLicenseComments

func (u *NodeUpsertOne) SetLicenseComments(v string) *NodeUpsertOne

SetLicenseComments sets the "license_comments" field.

func (*NodeUpsertOne) SetLicenseConcluded

func (u *NodeUpsertOne) SetLicenseConcluded(v string) *NodeUpsertOne

SetLicenseConcluded sets the "license_concluded" field.

func (*NodeUpsertOne) SetLicenses

func (u *NodeUpsertOne) SetLicenses(v []string) *NodeUpsertOne

SetLicenses sets the "licenses" field.

func (*NodeUpsertOne) SetName

func (u *NodeUpsertOne) SetName(v string) *NodeUpsertOne

SetName sets the "name" field.

func (*NodeUpsertOne) SetReleaseDate

func (u *NodeUpsertOne) SetReleaseDate(v time.Time) *NodeUpsertOne

SetReleaseDate sets the "release_date" field.

func (*NodeUpsertOne) SetSourceInfo

func (u *NodeUpsertOne) SetSourceInfo(v string) *NodeUpsertOne

SetSourceInfo sets the "source_info" field.

func (*NodeUpsertOne) SetSummary

func (u *NodeUpsertOne) SetSummary(v string) *NodeUpsertOne

SetSummary sets the "summary" field.

func (*NodeUpsertOne) SetType

func (u *NodeUpsertOne) SetType(v node.Type) *NodeUpsertOne

SetType sets the "type" field.

func (*NodeUpsertOne) SetURLDownload

func (u *NodeUpsertOne) SetURLDownload(v string) *NodeUpsertOne

SetURLDownload sets the "url_download" field.

func (*NodeUpsertOne) SetURLHome

func (u *NodeUpsertOne) SetURLHome(v string) *NodeUpsertOne

SetURLHome sets the "url_home" field.

func (*NodeUpsertOne) SetValidUntilDate

func (u *NodeUpsertOne) SetValidUntilDate(v time.Time) *NodeUpsertOne

SetValidUntilDate sets the "valid_until_date" field.

func (*NodeUpsertOne) SetVersion

func (u *NodeUpsertOne) SetVersion(v string) *NodeUpsertOne

SetVersion sets the "version" field.

func (*NodeUpsertOne) Update

func (u *NodeUpsertOne) Update(set func(*NodeUpsert)) *NodeUpsertOne

Update allows overriding fields `UPDATE` values. See the NodeCreate.OnConflict documentation for more info.

func (*NodeUpsertOne) UpdateAttribution

func (u *NodeUpsertOne) UpdateAttribution() *NodeUpsertOne

UpdateAttribution sets the "attribution" field to the value that was provided on create.

func (*NodeUpsertOne) UpdateBuildDate

func (u *NodeUpsertOne) UpdateBuildDate() *NodeUpsertOne

UpdateBuildDate sets the "build_date" field to the value that was provided on create.

func (*NodeUpsertOne) UpdateComment

func (u *NodeUpsertOne) UpdateComment() *NodeUpsertOne

UpdateComment sets the "comment" field to the value that was provided on create.

func (*NodeUpsertOne) UpdateCopyright

func (u *NodeUpsertOne) UpdateCopyright() *NodeUpsertOne

UpdateCopyright sets the "copyright" field to the value that was provided on create.

func (*NodeUpsertOne) UpdateDescription

func (u *NodeUpsertOne) UpdateDescription() *NodeUpsertOne

UpdateDescription sets the "description" field to the value that was provided on create.

func (*NodeUpsertOne) UpdateFileName

func (u *NodeUpsertOne) UpdateFileName() *NodeUpsertOne

UpdateFileName sets the "file_name" field to the value that was provided on create.

func (*NodeUpsertOne) UpdateFileTypes

func (u *NodeUpsertOne) UpdateFileTypes() *NodeUpsertOne

UpdateFileTypes sets the "file_types" field to the value that was provided on create.

func (*NodeUpsertOne) UpdateLicenseComments

func (u *NodeUpsertOne) UpdateLicenseComments() *NodeUpsertOne

UpdateLicenseComments sets the "license_comments" field to the value that was provided on create.

func (*NodeUpsertOne) UpdateLicenseConcluded

func (u *NodeUpsertOne) UpdateLicenseConcluded() *NodeUpsertOne

UpdateLicenseConcluded sets the "license_concluded" field to the value that was provided on create.

func (*NodeUpsertOne) UpdateLicenses

func (u *NodeUpsertOne) UpdateLicenses() *NodeUpsertOne

UpdateLicenses sets the "licenses" field to the value that was provided on create.

func (*NodeUpsertOne) UpdateName

func (u *NodeUpsertOne) UpdateName() *NodeUpsertOne

UpdateName sets the "name" field to the value that was provided on create.

func (*NodeUpsertOne) UpdateNewValues

func (u *NodeUpsertOne) UpdateNewValues() *NodeUpsertOne

UpdateNewValues updates the mutable fields using the new values that were set on create except the ID field. Using this option is equivalent to using:

client.Node.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
		sql.ResolveWith(func(u *sql.UpdateSet) {
			u.SetIgnore(node.FieldID)
		}),
	).
	Exec(ctx)

func (*NodeUpsertOne) UpdateReleaseDate

func (u *NodeUpsertOne) UpdateReleaseDate() *NodeUpsertOne

UpdateReleaseDate sets the "release_date" field to the value that was provided on create.

func (*NodeUpsertOne) UpdateSourceInfo

func (u *NodeUpsertOne) UpdateSourceInfo() *NodeUpsertOne

UpdateSourceInfo sets the "source_info" field to the value that was provided on create.

func (*NodeUpsertOne) UpdateSummary

func (u *NodeUpsertOne) UpdateSummary() *NodeUpsertOne

UpdateSummary sets the "summary" field to the value that was provided on create.

func (*NodeUpsertOne) UpdateType

func (u *NodeUpsertOne) UpdateType() *NodeUpsertOne

UpdateType sets the "type" field to the value that was provided on create.

func (*NodeUpsertOne) UpdateURLDownload

func (u *NodeUpsertOne) UpdateURLDownload() *NodeUpsertOne

UpdateURLDownload sets the "url_download" field to the value that was provided on create.

func (*NodeUpsertOne) UpdateURLHome

func (u *NodeUpsertOne) UpdateURLHome() *NodeUpsertOne

UpdateURLHome sets the "url_home" field to the value that was provided on create.

func (*NodeUpsertOne) UpdateValidUntilDate

func (u *NodeUpsertOne) UpdateValidUntilDate() *NodeUpsertOne

UpdateValidUntilDate sets the "valid_until_date" field to the value that was provided on create.

func (*NodeUpsertOne) UpdateVersion

func (u *NodeUpsertOne) UpdateVersion() *NodeUpsertOne

UpdateVersion sets the "version" field to the value that was provided on create.

type Nodes

type Nodes []*Node

Nodes is a parsable slice of Node.

type NotFoundError

type NotFoundError struct {
	// contains filtered or unexported fields
}

NotFoundError returns when trying to fetch a specific entity and it was not found in the database.

func (*NotFoundError) Error

func (e *NotFoundError) Error() string

Error implements the error interface.

type NotLoadedError

type NotLoadedError struct {
	// contains filtered or unexported fields
}

NotLoadedError returns when trying to get a node that was not loaded by the query.

func (*NotLoadedError) Error

func (e *NotLoadedError) Error() string

Error implements the error interface.

type NotSingularError

type NotSingularError struct {
	// contains filtered or unexported fields
}

NotSingularError returns when trying to fetch a singular entity and more then one was found in the database.

func (*NotSingularError) Error

func (e *NotSingularError) Error() string

Error implements the error interface.

type Op

type Op = ent.Op

ent aliases to avoid import conflicts in user's code.

type Option

type Option func(*config)

Option function to configure the client.

func Debug

func Debug() Option

Debug enables debug logging on the ent.Driver.

func Driver

func Driver(driver dialect.Driver) Option

Driver configures the client driver.

func Log

func Log(fn func(...any)) Option

Log sets the logging function for debug mode.

type OrderFunc

type OrderFunc func(*sql.Selector)

OrderFunc applies an ordering on the sql selector. Deprecated: Use Asc/Desc functions or the package builders instead.

type Person

type Person struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// Name holds the value of the "name" field.
	Name string `json:"name,omitempty"`
	// IsOrg holds the value of the "is_org" field.
	IsOrg bool `json:"is_org,omitempty"`
	// Email holds the value of the "email" field.
	Email string `json:"email,omitempty"`
	// URL holds the value of the "url" field.
	URL string `json:"url,omitempty"`
	// Phone holds the value of the "phone" field.
	Phone string `json:"phone,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the PersonQuery when eager-loading is set.
	Edges PersonEdges `json:"edges"`
	// contains filtered or unexported fields
}

Person is the model entity for the Person schema.

func (*Person) QueryContactOwner

func (pe *Person) QueryContactOwner() *PersonQuery

QueryContactOwner queries the "contact_owner" edge of the Person entity.

func (*Person) QueryContacts

func (pe *Person) QueryContacts() *PersonQuery

QueryContacts queries the "contacts" edge of the Person entity.

func (*Person) QueryMetadata

func (pe *Person) QueryMetadata() *MetadataQuery

QueryMetadata queries the "metadata" edge of the Person entity.

func (*Person) QueryNode

func (pe *Person) QueryNode() *NodeQuery

QueryNode queries the "node" edge of the Person entity.

func (*Person) String

func (pe *Person) String() string

String implements the fmt.Stringer.

func (*Person) Unwrap

func (pe *Person) Unwrap() *Person

Unwrap unwraps the Person 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 (*Person) Update

func (pe *Person) Update() *PersonUpdateOne

Update returns a builder for updating this Person. Note that you need to call Person.Unwrap() before calling this method if this Person was returned from a transaction, and the transaction was committed or rolled back.

func (*Person) Value

func (pe *Person) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the Person. This includes values selected through modifiers, order, etc.

type PersonClient

type PersonClient struct {
	// contains filtered or unexported fields
}

PersonClient is a client for the Person schema.

func NewPersonClient

func NewPersonClient(c config) *PersonClient

NewPersonClient returns a client for the Person from the given config.

func (*PersonClient) Create

func (c *PersonClient) Create() *PersonCreate

Create returns a builder for creating a Person entity.

func (*PersonClient) CreateBulk

func (c *PersonClient) CreateBulk(builders ...*PersonCreate) *PersonCreateBulk

CreateBulk returns a builder for creating a bulk of Person entities.

func (*PersonClient) Delete

func (c *PersonClient) Delete() *PersonDelete

Delete returns a delete builder for Person.

func (*PersonClient) DeleteOne

func (c *PersonClient) DeleteOne(pe *Person) *PersonDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*PersonClient) DeleteOneID

func (c *PersonClient) DeleteOneID(id int) *PersonDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*PersonClient) Get

func (c *PersonClient) Get(ctx context.Context, id int) (*Person, error)

Get returns a Person entity by its id.

func (*PersonClient) GetX

func (c *PersonClient) GetX(ctx context.Context, id int) *Person

GetX is like Get, but panics if an error occurs.

func (*PersonClient) Hooks

func (c *PersonClient) Hooks() []Hook

Hooks returns the client hooks.

func (*PersonClient) Intercept

func (c *PersonClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `person.Intercept(f(g(h())))`.

func (*PersonClient) Interceptors

func (c *PersonClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*PersonClient) MapCreateBulk

func (c *PersonClient) MapCreateBulk(slice any, setFunc func(*PersonCreate, int)) *PersonCreateBulk

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 (*PersonClient) Query

func (c *PersonClient) Query() *PersonQuery

Query returns a query builder for Person.

func (*PersonClient) QueryContactOwner

func (c *PersonClient) QueryContactOwner(pe *Person) *PersonQuery

QueryContactOwner queries the contact_owner edge of a Person.

func (*PersonClient) QueryContacts

func (c *PersonClient) QueryContacts(pe *Person) *PersonQuery

QueryContacts queries the contacts edge of a Person.

func (*PersonClient) QueryMetadata

func (c *PersonClient) QueryMetadata(pe *Person) *MetadataQuery

QueryMetadata queries the metadata edge of a Person.

func (*PersonClient) QueryNode

func (c *PersonClient) QueryNode(pe *Person) *NodeQuery

QueryNode queries the node edge of a Person.

func (*PersonClient) Update

func (c *PersonClient) Update() *PersonUpdate

Update returns an update builder for Person.

func (*PersonClient) UpdateOne

func (c *PersonClient) UpdateOne(pe *Person) *PersonUpdateOne

UpdateOne returns an update builder for the given entity.

func (*PersonClient) UpdateOneID

func (c *PersonClient) UpdateOneID(id int) *PersonUpdateOne

UpdateOneID returns an update builder for the given id.

func (*PersonClient) Use

func (c *PersonClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `person.Hooks(f(g(h())))`.

type PersonCreate

type PersonCreate struct {
	// contains filtered or unexported fields
}

PersonCreate is the builder for creating a Person entity.

func (*PersonCreate) AddContactIDs

func (pc *PersonCreate) AddContactIDs(ids ...int) *PersonCreate

AddContactIDs adds the "contacts" edge to the Person entity by IDs.

func (*PersonCreate) AddContacts

func (pc *PersonCreate) AddContacts(p ...*Person) *PersonCreate

AddContacts adds the "contacts" edges to the Person entity.

func (*PersonCreate) Exec

func (pc *PersonCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*PersonCreate) ExecX

func (pc *PersonCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*PersonCreate) Mutation

func (pc *PersonCreate) Mutation() *PersonMutation

Mutation returns the PersonMutation object of the builder.

func (*PersonCreate) OnConflict

func (pc *PersonCreate) OnConflict(opts ...sql.ConflictOption) *PersonUpsertOne

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.Person.Create().
	SetName(v).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.PersonUpsert) {
		SetName(v+v).
	}).
	Exec(ctx)

func (*PersonCreate) OnConflictColumns

func (pc *PersonCreate) OnConflictColumns(columns ...string) *PersonUpsertOne

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.Person.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*PersonCreate) Save

func (pc *PersonCreate) Save(ctx context.Context) (*Person, error)

Save creates the Person in the database.

func (*PersonCreate) SaveX

func (pc *PersonCreate) SaveX(ctx context.Context) *Person

SaveX calls Save and panics if Save returns an error.

func (*PersonCreate) SetContactOwner

func (pc *PersonCreate) SetContactOwner(p *Person) *PersonCreate

SetContactOwner sets the "contact_owner" edge to the Person entity.

func (*PersonCreate) SetContactOwnerID

func (pc *PersonCreate) SetContactOwnerID(id int) *PersonCreate

SetContactOwnerID sets the "contact_owner" edge to the Person entity by ID.

func (*PersonCreate) SetEmail

func (pc *PersonCreate) SetEmail(s string) *PersonCreate

SetEmail sets the "email" field.

func (*PersonCreate) SetIsOrg

func (pc *PersonCreate) SetIsOrg(b bool) *PersonCreate

SetIsOrg sets the "is_org" field.

func (*PersonCreate) SetMetadata

func (pc *PersonCreate) SetMetadata(m *Metadata) *PersonCreate

SetMetadata sets the "metadata" edge to the Metadata entity.

func (*PersonCreate) SetMetadataID

func (pc *PersonCreate) SetMetadataID(id string) *PersonCreate

SetMetadataID sets the "metadata" edge to the Metadata entity by ID.

func (*PersonCreate) SetName

func (pc *PersonCreate) SetName(s string) *PersonCreate

SetName sets the "name" field.

func (*PersonCreate) SetNillableContactOwnerID

func (pc *PersonCreate) SetNillableContactOwnerID(id *int) *PersonCreate

SetNillableContactOwnerID sets the "contact_owner" edge to the Person entity by ID if the given value is not nil.

func (*PersonCreate) SetNillableMetadataID

func (pc *PersonCreate) SetNillableMetadataID(id *string) *PersonCreate

SetNillableMetadataID sets the "metadata" edge to the Metadata entity by ID if the given value is not nil.

func (*PersonCreate) SetNillableNodeID

func (pc *PersonCreate) SetNillableNodeID(id *string) *PersonCreate

SetNillableNodeID sets the "node" edge to the Node entity by ID if the given value is not nil.

func (*PersonCreate) SetNode

func (pc *PersonCreate) SetNode(n *Node) *PersonCreate

SetNode sets the "node" edge to the Node entity.

func (*PersonCreate) SetNodeID

func (pc *PersonCreate) SetNodeID(id string) *PersonCreate

SetNodeID sets the "node" edge to the Node entity by ID.

func (*PersonCreate) SetPhone

func (pc *PersonCreate) SetPhone(s string) *PersonCreate

SetPhone sets the "phone" field.

func (*PersonCreate) SetURL

func (pc *PersonCreate) SetURL(s string) *PersonCreate

SetURL sets the "url" field.

type PersonCreateBulk

type PersonCreateBulk struct {
	// contains filtered or unexported fields
}

PersonCreateBulk is the builder for creating many Person entities in bulk.

func (*PersonCreateBulk) Exec

func (pcb *PersonCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*PersonCreateBulk) ExecX

func (pcb *PersonCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*PersonCreateBulk) OnConflict

func (pcb *PersonCreateBulk) OnConflict(opts ...sql.ConflictOption) *PersonUpsertBulk

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.Person.CreateBulk(builders...).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.PersonUpsert) {
		SetName(v+v).
	}).
	Exec(ctx)

func (*PersonCreateBulk) OnConflictColumns

func (pcb *PersonCreateBulk) OnConflictColumns(columns ...string) *PersonUpsertBulk

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.Person.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*PersonCreateBulk) Save

func (pcb *PersonCreateBulk) Save(ctx context.Context) ([]*Person, error)

Save creates the Person entities in the database.

func (*PersonCreateBulk) SaveX

func (pcb *PersonCreateBulk) SaveX(ctx context.Context) []*Person

SaveX is like Save, but panics if an error occurs.

type PersonDelete

type PersonDelete struct {
	// contains filtered or unexported fields
}

PersonDelete is the builder for deleting a Person entity.

func (*PersonDelete) Exec

func (pd *PersonDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*PersonDelete) ExecX

func (pd *PersonDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*PersonDelete) Where

func (pd *PersonDelete) Where(ps ...predicate.Person) *PersonDelete

Where appends a list predicates to the PersonDelete builder.

type PersonDeleteOne

type PersonDeleteOne struct {
	// contains filtered or unexported fields
}

PersonDeleteOne is the builder for deleting a single Person entity.

func (*PersonDeleteOne) Exec

func (pdo *PersonDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*PersonDeleteOne) ExecX

func (pdo *PersonDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*PersonDeleteOne) Where

func (pdo *PersonDeleteOne) Where(ps ...predicate.Person) *PersonDeleteOne

Where appends a list predicates to the PersonDelete builder.

type PersonEdges

type PersonEdges struct {
	// ContactOwner holds the value of the contact_owner edge.
	ContactOwner *Person `json:"contact_owner,omitempty"`
	// Contacts holds the value of the contacts edge.
	Contacts []*Person `json:"contacts,omitempty"`
	// Metadata holds the value of the metadata edge.
	Metadata *Metadata `json:"metadata,omitempty"`
	// Node holds the value of the node edge.
	Node *Node `json:"node,omitempty"`
	// contains filtered or unexported fields
}

PersonEdges holds the relations/edges for other nodes in the graph.

func (PersonEdges) ContactOwnerOrErr

func (e PersonEdges) ContactOwnerOrErr() (*Person, error)

ContactOwnerOrErr returns the ContactOwner value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

func (PersonEdges) ContactsOrErr

func (e PersonEdges) ContactsOrErr() ([]*Person, error)

ContactsOrErr returns the Contacts value or an error if the edge was not loaded in eager-loading.

func (PersonEdges) MetadataOrErr

func (e PersonEdges) MetadataOrErr() (*Metadata, error)

MetadataOrErr returns the Metadata value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

func (PersonEdges) NodeOrErr

func (e PersonEdges) NodeOrErr() (*Node, error)

NodeOrErr returns the Node value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

type PersonGroupBy

type PersonGroupBy struct {
	// contains filtered or unexported fields
}

PersonGroupBy is the group-by builder for Person entities.

func (*PersonGroupBy) Aggregate

func (pgb *PersonGroupBy) Aggregate(fns ...AggregateFunc) *PersonGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*PersonGroupBy) Bool

func (s *PersonGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*PersonGroupBy) BoolX

func (s *PersonGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*PersonGroupBy) Bools

func (s *PersonGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*PersonGroupBy) BoolsX

func (s *PersonGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*PersonGroupBy) Float64

func (s *PersonGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*PersonGroupBy) Float64X

func (s *PersonGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*PersonGroupBy) Float64s

func (s *PersonGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*PersonGroupBy) Float64sX

func (s *PersonGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*PersonGroupBy) Int

func (s *PersonGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*PersonGroupBy) IntX

func (s *PersonGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*PersonGroupBy) Ints

func (s *PersonGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*PersonGroupBy) IntsX

func (s *PersonGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*PersonGroupBy) Scan

func (pgb *PersonGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*PersonGroupBy) ScanX

func (s *PersonGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*PersonGroupBy) String

func (s *PersonGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*PersonGroupBy) StringX

func (s *PersonGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*PersonGroupBy) Strings

func (s *PersonGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*PersonGroupBy) StringsX

func (s *PersonGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type PersonMutation

type PersonMutation struct {
	// contains filtered or unexported fields
}

PersonMutation represents an operation that mutates the Person nodes in the graph.

func (*PersonMutation) AddContactIDs

func (m *PersonMutation) AddContactIDs(ids ...int)

AddContactIDs adds the "contacts" edge to the Person entity by ids.

func (*PersonMutation) AddField

func (m *PersonMutation) 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 (*PersonMutation) AddedEdges

func (m *PersonMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*PersonMutation) AddedField

func (m *PersonMutation) 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 (*PersonMutation) AddedFields

func (m *PersonMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*PersonMutation) AddedIDs

func (m *PersonMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*PersonMutation) ClearContactOwner

func (m *PersonMutation) ClearContactOwner()

ClearContactOwner clears the "contact_owner" edge to the Person entity.

func (*PersonMutation) ClearContacts

func (m *PersonMutation) ClearContacts()

ClearContacts clears the "contacts" edge to the Person entity.

func (*PersonMutation) ClearEdge

func (m *PersonMutation) 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 (*PersonMutation) ClearField

func (m *PersonMutation) 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 (*PersonMutation) ClearMetadata

func (m *PersonMutation) ClearMetadata()

ClearMetadata clears the "metadata" edge to the Metadata entity.

func (*PersonMutation) ClearNode

func (m *PersonMutation) ClearNode()

ClearNode clears the "node" edge to the Node entity.

func (*PersonMutation) ClearedEdges

func (m *PersonMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*PersonMutation) ClearedFields

func (m *PersonMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (PersonMutation) Client

func (m PersonMutation) 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 (*PersonMutation) ContactOwnerCleared

func (m *PersonMutation) ContactOwnerCleared() bool

ContactOwnerCleared reports if the "contact_owner" edge to the Person entity was cleared.

func (*PersonMutation) ContactOwnerID

func (m *PersonMutation) ContactOwnerID() (id int, exists bool)

ContactOwnerID returns the "contact_owner" edge ID in the mutation.

func (*PersonMutation) ContactOwnerIDs

func (m *PersonMutation) ContactOwnerIDs() (ids []int)

ContactOwnerIDs returns the "contact_owner" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use ContactOwnerID instead. It exists only for internal usage by the builders.

func (*PersonMutation) ContactsCleared

func (m *PersonMutation) ContactsCleared() bool

ContactsCleared reports if the "contacts" edge to the Person entity was cleared.

func (*PersonMutation) ContactsIDs

func (m *PersonMutation) ContactsIDs() (ids []int)

ContactsIDs returns the "contacts" edge IDs in the mutation.

func (*PersonMutation) EdgeCleared

func (m *PersonMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*PersonMutation) Email

func (m *PersonMutation) Email() (r string, exists bool)

Email returns the value of the "email" field in the mutation.

func (*PersonMutation) Field

func (m *PersonMutation) 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 (*PersonMutation) FieldCleared

func (m *PersonMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*PersonMutation) Fields

func (m *PersonMutation) 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 (*PersonMutation) ID

func (m *PersonMutation) ID() (id int, exists bool)

ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.

func (*PersonMutation) IDs

func (m *PersonMutation) IDs(ctx context.Context) ([]int, error)

IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.

func (*PersonMutation) IsOrg

func (m *PersonMutation) IsOrg() (r bool, exists bool)

IsOrg returns the value of the "is_org" field in the mutation.

func (*PersonMutation) MetadataCleared

func (m *PersonMutation) MetadataCleared() bool

MetadataCleared reports if the "metadata" edge to the Metadata entity was cleared.

func (*PersonMutation) MetadataID

func (m *PersonMutation) MetadataID() (id string, exists bool)

MetadataID returns the "metadata" edge ID in the mutation.

func (*PersonMutation) MetadataIDs

func (m *PersonMutation) MetadataIDs() (ids []string)

MetadataIDs returns the "metadata" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use MetadataID instead. It exists only for internal usage by the builders.

func (*PersonMutation) Name

func (m *PersonMutation) Name() (r string, exists bool)

Name returns the value of the "name" field in the mutation.

func (*PersonMutation) NodeCleared

func (m *PersonMutation) NodeCleared() bool

NodeCleared reports if the "node" edge to the Node entity was cleared.

func (*PersonMutation) NodeID

func (m *PersonMutation) NodeID() (id string, exists bool)

NodeID returns the "node" edge ID in the mutation.

func (*PersonMutation) NodeIDs

func (m *PersonMutation) NodeIDs() (ids []string)

NodeIDs returns the "node" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use NodeID instead. It exists only for internal usage by the builders.

func (*PersonMutation) OldEmail

func (m *PersonMutation) OldEmail(ctx context.Context) (v string, err error)

OldEmail returns the old "email" field's value of the Person entity. If the Person 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 (*PersonMutation) OldField

func (m *PersonMutation) 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 (*PersonMutation) OldIsOrg

func (m *PersonMutation) OldIsOrg(ctx context.Context) (v bool, err error)

OldIsOrg returns the old "is_org" field's value of the Person entity. If the Person 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 (*PersonMutation) OldName

func (m *PersonMutation) OldName(ctx context.Context) (v string, err error)

OldName returns the old "name" field's value of the Person entity. If the Person 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 (*PersonMutation) OldPhone

func (m *PersonMutation) OldPhone(ctx context.Context) (v string, err error)

OldPhone returns the old "phone" field's value of the Person entity. If the Person 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 (*PersonMutation) OldURL

func (m *PersonMutation) OldURL(ctx context.Context) (v string, err error)

OldURL returns the old "url" field's value of the Person entity. If the Person 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 (*PersonMutation) Op

func (m *PersonMutation) Op() Op

Op returns the operation name.

func (*PersonMutation) Phone

func (m *PersonMutation) Phone() (r string, exists bool)

Phone returns the value of the "phone" field in the mutation.

func (*PersonMutation) RemoveContactIDs

func (m *PersonMutation) RemoveContactIDs(ids ...int)

RemoveContactIDs removes the "contacts" edge to the Person entity by IDs.

func (*PersonMutation) RemovedContactsIDs

func (m *PersonMutation) RemovedContactsIDs() (ids []int)

RemovedContacts returns the removed IDs of the "contacts" edge to the Person entity.

func (*PersonMutation) RemovedEdges

func (m *PersonMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*PersonMutation) RemovedIDs

func (m *PersonMutation) 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 (*PersonMutation) ResetContactOwner

func (m *PersonMutation) ResetContactOwner()

ResetContactOwner resets all changes to the "contact_owner" edge.

func (*PersonMutation) ResetContacts

func (m *PersonMutation) ResetContacts()

ResetContacts resets all changes to the "contacts" edge.

func (*PersonMutation) ResetEdge

func (m *PersonMutation) 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 (*PersonMutation) ResetEmail

func (m *PersonMutation) ResetEmail()

ResetEmail resets all changes to the "email" field.

func (*PersonMutation) ResetField

func (m *PersonMutation) 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 (*PersonMutation) ResetIsOrg

func (m *PersonMutation) ResetIsOrg()

ResetIsOrg resets all changes to the "is_org" field.

func (*PersonMutation) ResetMetadata

func (m *PersonMutation) ResetMetadata()

ResetMetadata resets all changes to the "metadata" edge.

func (*PersonMutation) ResetName

func (m *PersonMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*PersonMutation) ResetNode

func (m *PersonMutation) ResetNode()

ResetNode resets all changes to the "node" edge.

func (*PersonMutation) ResetPhone

func (m *PersonMutation) ResetPhone()

ResetPhone resets all changes to the "phone" field.

func (*PersonMutation) ResetURL

func (m *PersonMutation) ResetURL()

ResetURL resets all changes to the "url" field.

func (*PersonMutation) SetContactOwnerID

func (m *PersonMutation) SetContactOwnerID(id int)

SetContactOwnerID sets the "contact_owner" edge to the Person entity by id.

func (*PersonMutation) SetEmail

func (m *PersonMutation) SetEmail(s string)

SetEmail sets the "email" field.

func (*PersonMutation) SetField

func (m *PersonMutation) 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 (*PersonMutation) SetIsOrg

func (m *PersonMutation) SetIsOrg(b bool)

SetIsOrg sets the "is_org" field.

func (*PersonMutation) SetMetadataID

func (m *PersonMutation) SetMetadataID(id string)

SetMetadataID sets the "metadata" edge to the Metadata entity by id.

func (*PersonMutation) SetName

func (m *PersonMutation) SetName(s string)

SetName sets the "name" field.

func (*PersonMutation) SetNodeID

func (m *PersonMutation) SetNodeID(id string)

SetNodeID sets the "node" edge to the Node entity by id.

func (*PersonMutation) SetOp

func (m *PersonMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*PersonMutation) SetPhone

func (m *PersonMutation) SetPhone(s string)

SetPhone sets the "phone" field.

func (*PersonMutation) SetURL

func (m *PersonMutation) SetURL(s string)

SetURL sets the "url" field.

func (PersonMutation) Tx

func (m PersonMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*PersonMutation) Type

func (m *PersonMutation) Type() string

Type returns the node type of this mutation (Person).

func (*PersonMutation) URL

func (m *PersonMutation) URL() (r string, exists bool)

URL returns the value of the "url" field in the mutation.

func (*PersonMutation) Where

func (m *PersonMutation) Where(ps ...predicate.Person)

Where appends a list predicates to the PersonMutation builder.

func (*PersonMutation) WhereP

func (m *PersonMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the PersonMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type PersonQuery

type PersonQuery struct {
	// contains filtered or unexported fields
}

PersonQuery is the builder for querying Person entities.

func (*PersonQuery) Aggregate

func (pq *PersonQuery) Aggregate(fns ...AggregateFunc) *PersonSelect

Aggregate returns a PersonSelect configured with the given aggregations.

func (*PersonQuery) All

func (pq *PersonQuery) All(ctx context.Context) ([]*Person, error)

All executes the query and returns a list of Persons.

func (*PersonQuery) AllX

func (pq *PersonQuery) AllX(ctx context.Context) []*Person

AllX is like All, but panics if an error occurs.

func (*PersonQuery) Clone

func (pq *PersonQuery) Clone() *PersonQuery

Clone returns a duplicate of the PersonQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*PersonQuery) Count

func (pq *PersonQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*PersonQuery) CountX

func (pq *PersonQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*PersonQuery) Exist

func (pq *PersonQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*PersonQuery) ExistX

func (pq *PersonQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*PersonQuery) First

func (pq *PersonQuery) First(ctx context.Context) (*Person, error)

First returns the first Person entity from the query. Returns a *NotFoundError when no Person was found.

func (*PersonQuery) FirstID

func (pq *PersonQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first Person ID from the query. Returns a *NotFoundError when no Person ID was found.

func (*PersonQuery) FirstIDX

func (pq *PersonQuery) FirstIDX(ctx context.Context) int

FirstIDX is like FirstID, but panics if an error occurs.

func (*PersonQuery) FirstX

func (pq *PersonQuery) FirstX(ctx context.Context) *Person

FirstX is like First, but panics if an error occurs.

func (*PersonQuery) GroupBy

func (pq *PersonQuery) GroupBy(field string, fields ...string) *PersonGroupBy

GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.

Example:

var v []struct {
	Name string `json:"name,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Person.Query().
	GroupBy(person.FieldName).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*PersonQuery) IDs

func (pq *PersonQuery) IDs(ctx context.Context) (ids []int, err error)

IDs executes the query and returns a list of Person IDs.

func (*PersonQuery) IDsX

func (pq *PersonQuery) IDsX(ctx context.Context) []int

IDsX is like IDs, but panics if an error occurs.

func (*PersonQuery) Limit

func (pq *PersonQuery) Limit(limit int) *PersonQuery

Limit the number of records to be returned by this query.

func (*PersonQuery) Offset

func (pq *PersonQuery) Offset(offset int) *PersonQuery

Offset to start from.

func (*PersonQuery) Only

func (pq *PersonQuery) Only(ctx context.Context) (*Person, error)

Only returns a single Person entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Person entity is found. Returns a *NotFoundError when no Person entities are found.

func (*PersonQuery) OnlyID

func (pq *PersonQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID is like Only, but returns the only Person ID in the query. Returns a *NotSingularError when more than one Person ID is found. Returns a *NotFoundError when no entities are found.

func (*PersonQuery) OnlyIDX

func (pq *PersonQuery) OnlyIDX(ctx context.Context) int

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*PersonQuery) OnlyX

func (pq *PersonQuery) OnlyX(ctx context.Context) *Person

OnlyX is like Only, but panics if an error occurs.

func (*PersonQuery) Order

func (pq *PersonQuery) Order(o ...person.OrderOption) *PersonQuery

Order specifies how the records should be ordered.

func (*PersonQuery) QueryContactOwner

func (pq *PersonQuery) QueryContactOwner() *PersonQuery

QueryContactOwner chains the current query on the "contact_owner" edge.

func (*PersonQuery) QueryContacts

func (pq *PersonQuery) QueryContacts() *PersonQuery

QueryContacts chains the current query on the "contacts" edge.

func (*PersonQuery) QueryMetadata

func (pq *PersonQuery) QueryMetadata() *MetadataQuery

QueryMetadata chains the current query on the "metadata" edge.

func (*PersonQuery) QueryNode

func (pq *PersonQuery) QueryNode() *NodeQuery

QueryNode chains the current query on the "node" edge.

func (*PersonQuery) Select

func (pq *PersonQuery) Select(fields ...string) *PersonSelect

Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.

Example:

var v []struct {
	Name string `json:"name,omitempty"`
}

client.Person.Query().
	Select(person.FieldName).
	Scan(ctx, &v)

func (*PersonQuery) Unique

func (pq *PersonQuery) Unique(unique bool) *PersonQuery

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 (*PersonQuery) Where

func (pq *PersonQuery) Where(ps ...predicate.Person) *PersonQuery

Where adds a new predicate for the PersonQuery builder.

func (*PersonQuery) WithContactOwner

func (pq *PersonQuery) WithContactOwner(opts ...func(*PersonQuery)) *PersonQuery

WithContactOwner tells the query-builder to eager-load the nodes that are connected to the "contact_owner" edge. The optional arguments are used to configure the query builder of the edge.

func (*PersonQuery) WithContacts

func (pq *PersonQuery) WithContacts(opts ...func(*PersonQuery)) *PersonQuery

WithContacts tells the query-builder to eager-load the nodes that are connected to the "contacts" edge. The optional arguments are used to configure the query builder of the edge.

func (*PersonQuery) WithMetadata

func (pq *PersonQuery) WithMetadata(opts ...func(*MetadataQuery)) *PersonQuery

WithMetadata tells the query-builder to eager-load the nodes that are connected to the "metadata" edge. The optional arguments are used to configure the query builder of the edge.

func (*PersonQuery) WithNode

func (pq *PersonQuery) WithNode(opts ...func(*NodeQuery)) *PersonQuery

WithNode tells the query-builder to eager-load the nodes that are connected to the "node" edge. The optional arguments are used to configure the query builder of the edge.

type PersonSelect

type PersonSelect struct {
	*PersonQuery
	// contains filtered or unexported fields
}

PersonSelect is the builder for selecting fields of Person entities.

func (*PersonSelect) Aggregate

func (ps *PersonSelect) Aggregate(fns ...AggregateFunc) *PersonSelect

Aggregate adds the given aggregation functions to the selector query.

func (*PersonSelect) Bool

func (s *PersonSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*PersonSelect) BoolX

func (s *PersonSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*PersonSelect) Bools

func (s *PersonSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*PersonSelect) BoolsX

func (s *PersonSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*PersonSelect) Float64

func (s *PersonSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*PersonSelect) Float64X

func (s *PersonSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*PersonSelect) Float64s

func (s *PersonSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*PersonSelect) Float64sX

func (s *PersonSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*PersonSelect) Int

func (s *PersonSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*PersonSelect) IntX

func (s *PersonSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*PersonSelect) Ints

func (s *PersonSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*PersonSelect) IntsX

func (s *PersonSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*PersonSelect) Scan

func (ps *PersonSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*PersonSelect) ScanX

func (s *PersonSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*PersonSelect) String

func (s *PersonSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*PersonSelect) StringX

func (s *PersonSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*PersonSelect) Strings

func (s *PersonSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*PersonSelect) StringsX

func (s *PersonSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type PersonUpdate

type PersonUpdate struct {
	// contains filtered or unexported fields
}

PersonUpdate is the builder for updating Person entities.

func (*PersonUpdate) AddContactIDs

func (pu *PersonUpdate) AddContactIDs(ids ...int) *PersonUpdate

AddContactIDs adds the "contacts" edge to the Person entity by IDs.

func (*PersonUpdate) AddContacts

func (pu *PersonUpdate) AddContacts(p ...*Person) *PersonUpdate

AddContacts adds the "contacts" edges to the Person entity.

func (*PersonUpdate) ClearContactOwner

func (pu *PersonUpdate) ClearContactOwner() *PersonUpdate

ClearContactOwner clears the "contact_owner" edge to the Person entity.

func (*PersonUpdate) ClearContacts

func (pu *PersonUpdate) ClearContacts() *PersonUpdate

ClearContacts clears all "contacts" edges to the Person entity.

func (*PersonUpdate) ClearMetadata

func (pu *PersonUpdate) ClearMetadata() *PersonUpdate

ClearMetadata clears the "metadata" edge to the Metadata entity.

func (*PersonUpdate) ClearNode

func (pu *PersonUpdate) ClearNode() *PersonUpdate

ClearNode clears the "node" edge to the Node entity.

func (*PersonUpdate) Exec

func (pu *PersonUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*PersonUpdate) ExecX

func (pu *PersonUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*PersonUpdate) Mutation

func (pu *PersonUpdate) Mutation() *PersonMutation

Mutation returns the PersonMutation object of the builder.

func (*PersonUpdate) RemoveContactIDs

func (pu *PersonUpdate) RemoveContactIDs(ids ...int) *PersonUpdate

RemoveContactIDs removes the "contacts" edge to Person entities by IDs.

func (*PersonUpdate) RemoveContacts

func (pu *PersonUpdate) RemoveContacts(p ...*Person) *PersonUpdate

RemoveContacts removes "contacts" edges to Person entities.

func (*PersonUpdate) Save

func (pu *PersonUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*PersonUpdate) SaveX

func (pu *PersonUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*PersonUpdate) SetContactOwner

func (pu *PersonUpdate) SetContactOwner(p *Person) *PersonUpdate

SetContactOwner sets the "contact_owner" edge to the Person entity.

func (*PersonUpdate) SetContactOwnerID

func (pu *PersonUpdate) SetContactOwnerID(id int) *PersonUpdate

SetContactOwnerID sets the "contact_owner" edge to the Person entity by ID.

func (*PersonUpdate) SetEmail

func (pu *PersonUpdate) SetEmail(s string) *PersonUpdate

SetEmail sets the "email" field.

func (*PersonUpdate) SetIsOrg

func (pu *PersonUpdate) SetIsOrg(b bool) *PersonUpdate

SetIsOrg sets the "is_org" field.

func (*PersonUpdate) SetMetadata

func (pu *PersonUpdate) SetMetadata(m *Metadata) *PersonUpdate

SetMetadata sets the "metadata" edge to the Metadata entity.

func (*PersonUpdate) SetMetadataID

func (pu *PersonUpdate) SetMetadataID(id string) *PersonUpdate

SetMetadataID sets the "metadata" edge to the Metadata entity by ID.

func (*PersonUpdate) SetName

func (pu *PersonUpdate) SetName(s string) *PersonUpdate

SetName sets the "name" field.

func (*PersonUpdate) SetNillableContactOwnerID

func (pu *PersonUpdate) SetNillableContactOwnerID(id *int) *PersonUpdate

SetNillableContactOwnerID sets the "contact_owner" edge to the Person entity by ID if the given value is not nil.

func (*PersonUpdate) SetNillableEmail

func (pu *PersonUpdate) SetNillableEmail(s *string) *PersonUpdate

SetNillableEmail sets the "email" field if the given value is not nil.

func (*PersonUpdate) SetNillableIsOrg

func (pu *PersonUpdate) SetNillableIsOrg(b *bool) *PersonUpdate

SetNillableIsOrg sets the "is_org" field if the given value is not nil.

func (*PersonUpdate) SetNillableMetadataID

func (pu *PersonUpdate) SetNillableMetadataID(id *string) *PersonUpdate

SetNillableMetadataID sets the "metadata" edge to the Metadata entity by ID if the given value is not nil.

func (*PersonUpdate) SetNillableName

func (pu *PersonUpdate) SetNillableName(s *string) *PersonUpdate

SetNillableName sets the "name" field if the given value is not nil.

func (*PersonUpdate) SetNillableNodeID

func (pu *PersonUpdate) SetNillableNodeID(id *string) *PersonUpdate

SetNillableNodeID sets the "node" edge to the Node entity by ID if the given value is not nil.

func (*PersonUpdate) SetNillablePhone

func (pu *PersonUpdate) SetNillablePhone(s *string) *PersonUpdate

SetNillablePhone sets the "phone" field if the given value is not nil.

func (*PersonUpdate) SetNillableURL

func (pu *PersonUpdate) SetNillableURL(s *string) *PersonUpdate

SetNillableURL sets the "url" field if the given value is not nil.

func (*PersonUpdate) SetNode

func (pu *PersonUpdate) SetNode(n *Node) *PersonUpdate

SetNode sets the "node" edge to the Node entity.

func (*PersonUpdate) SetNodeID

func (pu *PersonUpdate) SetNodeID(id string) *PersonUpdate

SetNodeID sets the "node" edge to the Node entity by ID.

func (*PersonUpdate) SetPhone

func (pu *PersonUpdate) SetPhone(s string) *PersonUpdate

SetPhone sets the "phone" field.

func (*PersonUpdate) SetURL

func (pu *PersonUpdate) SetURL(s string) *PersonUpdate

SetURL sets the "url" field.

func (*PersonUpdate) Where

func (pu *PersonUpdate) Where(ps ...predicate.Person) *PersonUpdate

Where appends a list predicates to the PersonUpdate builder.

type PersonUpdateOne

type PersonUpdateOne struct {
	// contains filtered or unexported fields
}

PersonUpdateOne is the builder for updating a single Person entity.

func (*PersonUpdateOne) AddContactIDs

func (puo *PersonUpdateOne) AddContactIDs(ids ...int) *PersonUpdateOne

AddContactIDs adds the "contacts" edge to the Person entity by IDs.

func (*PersonUpdateOne) AddContacts

func (puo *PersonUpdateOne) AddContacts(p ...*Person) *PersonUpdateOne

AddContacts adds the "contacts" edges to the Person entity.

func (*PersonUpdateOne) ClearContactOwner

func (puo *PersonUpdateOne) ClearContactOwner() *PersonUpdateOne

ClearContactOwner clears the "contact_owner" edge to the Person entity.

func (*PersonUpdateOne) ClearContacts

func (puo *PersonUpdateOne) ClearContacts() *PersonUpdateOne

ClearContacts clears all "contacts" edges to the Person entity.

func (*PersonUpdateOne) ClearMetadata

func (puo *PersonUpdateOne) ClearMetadata() *PersonUpdateOne

ClearMetadata clears the "metadata" edge to the Metadata entity.

func (*PersonUpdateOne) ClearNode

func (puo *PersonUpdateOne) ClearNode() *PersonUpdateOne

ClearNode clears the "node" edge to the Node entity.

func (*PersonUpdateOne) Exec

func (puo *PersonUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*PersonUpdateOne) ExecX

func (puo *PersonUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*PersonUpdateOne) Mutation

func (puo *PersonUpdateOne) Mutation() *PersonMutation

Mutation returns the PersonMutation object of the builder.

func (*PersonUpdateOne) RemoveContactIDs

func (puo *PersonUpdateOne) RemoveContactIDs(ids ...int) *PersonUpdateOne

RemoveContactIDs removes the "contacts" edge to Person entities by IDs.

func (*PersonUpdateOne) RemoveContacts

func (puo *PersonUpdateOne) RemoveContacts(p ...*Person) *PersonUpdateOne

RemoveContacts removes "contacts" edges to Person entities.

func (*PersonUpdateOne) Save

func (puo *PersonUpdateOne) Save(ctx context.Context) (*Person, error)

Save executes the query and returns the updated Person entity.

func (*PersonUpdateOne) SaveX

func (puo *PersonUpdateOne) SaveX(ctx context.Context) *Person

SaveX is like Save, but panics if an error occurs.

func (*PersonUpdateOne) Select

func (puo *PersonUpdateOne) Select(field string, fields ...string) *PersonUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*PersonUpdateOne) SetContactOwner

func (puo *PersonUpdateOne) SetContactOwner(p *Person) *PersonUpdateOne

SetContactOwner sets the "contact_owner" edge to the Person entity.

func (*PersonUpdateOne) SetContactOwnerID

func (puo *PersonUpdateOne) SetContactOwnerID(id int) *PersonUpdateOne

SetContactOwnerID sets the "contact_owner" edge to the Person entity by ID.

func (*PersonUpdateOne) SetEmail

func (puo *PersonUpdateOne) SetEmail(s string) *PersonUpdateOne

SetEmail sets the "email" field.

func (*PersonUpdateOne) SetIsOrg

func (puo *PersonUpdateOne) SetIsOrg(b bool) *PersonUpdateOne

SetIsOrg sets the "is_org" field.

func (*PersonUpdateOne) SetMetadata

func (puo *PersonUpdateOne) SetMetadata(m *Metadata) *PersonUpdateOne

SetMetadata sets the "metadata" edge to the Metadata entity.

func (*PersonUpdateOne) SetMetadataID

func (puo *PersonUpdateOne) SetMetadataID(id string) *PersonUpdateOne

SetMetadataID sets the "metadata" edge to the Metadata entity by ID.

func (*PersonUpdateOne) SetName

func (puo *PersonUpdateOne) SetName(s string) *PersonUpdateOne

SetName sets the "name" field.

func (*PersonUpdateOne) SetNillableContactOwnerID

func (puo *PersonUpdateOne) SetNillableContactOwnerID(id *int) *PersonUpdateOne

SetNillableContactOwnerID sets the "contact_owner" edge to the Person entity by ID if the given value is not nil.

func (*PersonUpdateOne) SetNillableEmail

func (puo *PersonUpdateOne) SetNillableEmail(s *string) *PersonUpdateOne

SetNillableEmail sets the "email" field if the given value is not nil.

func (*PersonUpdateOne) SetNillableIsOrg

func (puo *PersonUpdateOne) SetNillableIsOrg(b *bool) *PersonUpdateOne

SetNillableIsOrg sets the "is_org" field if the given value is not nil.

func (*PersonUpdateOne) SetNillableMetadataID

func (puo *PersonUpdateOne) SetNillableMetadataID(id *string) *PersonUpdateOne

SetNillableMetadataID sets the "metadata" edge to the Metadata entity by ID if the given value is not nil.

func (*PersonUpdateOne) SetNillableName

func (puo *PersonUpdateOne) SetNillableName(s *string) *PersonUpdateOne

SetNillableName sets the "name" field if the given value is not nil.

func (*PersonUpdateOne) SetNillableNodeID

func (puo *PersonUpdateOne) SetNillableNodeID(id *string) *PersonUpdateOne

SetNillableNodeID sets the "node" edge to the Node entity by ID if the given value is not nil.

func (*PersonUpdateOne) SetNillablePhone

func (puo *PersonUpdateOne) SetNillablePhone(s *string) *PersonUpdateOne

SetNillablePhone sets the "phone" field if the given value is not nil.

func (*PersonUpdateOne) SetNillableURL

func (puo *PersonUpdateOne) SetNillableURL(s *string) *PersonUpdateOne

SetNillableURL sets the "url" field if the given value is not nil.

func (*PersonUpdateOne) SetNode

func (puo *PersonUpdateOne) SetNode(n *Node) *PersonUpdateOne

SetNode sets the "node" edge to the Node entity.

func (*PersonUpdateOne) SetNodeID

func (puo *PersonUpdateOne) SetNodeID(id string) *PersonUpdateOne

SetNodeID sets the "node" edge to the Node entity by ID.

func (*PersonUpdateOne) SetPhone

func (puo *PersonUpdateOne) SetPhone(s string) *PersonUpdateOne

SetPhone sets the "phone" field.

func (*PersonUpdateOne) SetURL

func (puo *PersonUpdateOne) SetURL(s string) *PersonUpdateOne

SetURL sets the "url" field.

func (*PersonUpdateOne) Where

func (puo *PersonUpdateOne) Where(ps ...predicate.Person) *PersonUpdateOne

Where appends a list predicates to the PersonUpdate builder.

type PersonUpsert

type PersonUpsert struct {
	*sql.UpdateSet
}

PersonUpsert is the "OnConflict" setter.

func (*PersonUpsert) SetEmail

func (u *PersonUpsert) SetEmail(v string) *PersonUpsert

SetEmail sets the "email" field.

func (*PersonUpsert) SetIsOrg

func (u *PersonUpsert) SetIsOrg(v bool) *PersonUpsert

SetIsOrg sets the "is_org" field.

func (*PersonUpsert) SetName

func (u *PersonUpsert) SetName(v string) *PersonUpsert

SetName sets the "name" field.

func (*PersonUpsert) SetPhone

func (u *PersonUpsert) SetPhone(v string) *PersonUpsert

SetPhone sets the "phone" field.

func (*PersonUpsert) SetURL

func (u *PersonUpsert) SetURL(v string) *PersonUpsert

SetURL sets the "url" field.

func (*PersonUpsert) UpdateEmail

func (u *PersonUpsert) UpdateEmail() *PersonUpsert

UpdateEmail sets the "email" field to the value that was provided on create.

func (*PersonUpsert) UpdateIsOrg

func (u *PersonUpsert) UpdateIsOrg() *PersonUpsert

UpdateIsOrg sets the "is_org" field to the value that was provided on create.

func (*PersonUpsert) UpdateName

func (u *PersonUpsert) UpdateName() *PersonUpsert

UpdateName sets the "name" field to the value that was provided on create.

func (*PersonUpsert) UpdatePhone

func (u *PersonUpsert) UpdatePhone() *PersonUpsert

UpdatePhone sets the "phone" field to the value that was provided on create.

func (*PersonUpsert) UpdateURL

func (u *PersonUpsert) UpdateURL() *PersonUpsert

UpdateURL sets the "url" field to the value that was provided on create.

type PersonUpsertBulk

type PersonUpsertBulk struct {
	// contains filtered or unexported fields
}

PersonUpsertBulk is the builder for "upsert"-ing a bulk of Person nodes.

func (*PersonUpsertBulk) DoNothing

func (u *PersonUpsertBulk) DoNothing() *PersonUpsertBulk

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*PersonUpsertBulk) Exec

func (u *PersonUpsertBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*PersonUpsertBulk) ExecX

func (u *PersonUpsertBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*PersonUpsertBulk) Ignore

func (u *PersonUpsertBulk) Ignore() *PersonUpsertBulk

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.Person.Create().
	OnConflict(sql.ResolveWithIgnore()).
	Exec(ctx)

func (*PersonUpsertBulk) SetEmail

func (u *PersonUpsertBulk) SetEmail(v string) *PersonUpsertBulk

SetEmail sets the "email" field.

func (*PersonUpsertBulk) SetIsOrg

func (u *PersonUpsertBulk) SetIsOrg(v bool) *PersonUpsertBulk

SetIsOrg sets the "is_org" field.

func (*PersonUpsertBulk) SetName

func (u *PersonUpsertBulk) SetName(v string) *PersonUpsertBulk

SetName sets the "name" field.

func (*PersonUpsertBulk) SetPhone

func (u *PersonUpsertBulk) SetPhone(v string) *PersonUpsertBulk

SetPhone sets the "phone" field.

func (*PersonUpsertBulk) SetURL

SetURL sets the "url" field.

func (*PersonUpsertBulk) Update

func (u *PersonUpsertBulk) Update(set func(*PersonUpsert)) *PersonUpsertBulk

Update allows overriding fields `UPDATE` values. See the PersonCreateBulk.OnConflict documentation for more info.

func (*PersonUpsertBulk) UpdateEmail

func (u *PersonUpsertBulk) UpdateEmail() *PersonUpsertBulk

UpdateEmail sets the "email" field to the value that was provided on create.

func (*PersonUpsertBulk) UpdateIsOrg

func (u *PersonUpsertBulk) UpdateIsOrg() *PersonUpsertBulk

UpdateIsOrg sets the "is_org" field to the value that was provided on create.

func (*PersonUpsertBulk) UpdateName

func (u *PersonUpsertBulk) UpdateName() *PersonUpsertBulk

UpdateName sets the "name" field to the value that was provided on create.

func (*PersonUpsertBulk) UpdateNewValues

func (u *PersonUpsertBulk) UpdateNewValues() *PersonUpsertBulk

UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:

client.Person.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
	).
	Exec(ctx)

func (*PersonUpsertBulk) UpdatePhone

func (u *PersonUpsertBulk) UpdatePhone() *PersonUpsertBulk

UpdatePhone sets the "phone" field to the value that was provided on create.

func (*PersonUpsertBulk) UpdateURL

func (u *PersonUpsertBulk) UpdateURL() *PersonUpsertBulk

UpdateURL sets the "url" field to the value that was provided on create.

type PersonUpsertOne

type PersonUpsertOne struct {
	// contains filtered or unexported fields
}

PersonUpsertOne is the builder for "upsert"-ing

one Person node.

func (*PersonUpsertOne) DoNothing

func (u *PersonUpsertOne) DoNothing() *PersonUpsertOne

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*PersonUpsertOne) Exec

func (u *PersonUpsertOne) Exec(ctx context.Context) error

Exec executes the query.

func (*PersonUpsertOne) ExecX

func (u *PersonUpsertOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*PersonUpsertOne) ID

func (u *PersonUpsertOne) ID(ctx context.Context) (id int, err error)

Exec executes the UPSERT query and returns the inserted/updated ID.

func (*PersonUpsertOne) IDX

func (u *PersonUpsertOne) IDX(ctx context.Context) int

IDX is like ID, but panics if an error occurs.

func (*PersonUpsertOne) Ignore

func (u *PersonUpsertOne) Ignore() *PersonUpsertOne

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.Person.Create().
    OnConflict(sql.ResolveWithIgnore()).
    Exec(ctx)

func (*PersonUpsertOne) SetEmail

func (u *PersonUpsertOne) SetEmail(v string) *PersonUpsertOne

SetEmail sets the "email" field.

func (*PersonUpsertOne) SetIsOrg

func (u *PersonUpsertOne) SetIsOrg(v bool) *PersonUpsertOne

SetIsOrg sets the "is_org" field.

func (*PersonUpsertOne) SetName

func (u *PersonUpsertOne) SetName(v string) *PersonUpsertOne

SetName sets the "name" field.

func (*PersonUpsertOne) SetPhone

func (u *PersonUpsertOne) SetPhone(v string) *PersonUpsertOne

SetPhone sets the "phone" field.

func (*PersonUpsertOne) SetURL

func (u *PersonUpsertOne) SetURL(v string) *PersonUpsertOne

SetURL sets the "url" field.

func (*PersonUpsertOne) Update

func (u *PersonUpsertOne) Update(set func(*PersonUpsert)) *PersonUpsertOne

Update allows overriding fields `UPDATE` values. See the PersonCreate.OnConflict documentation for more info.

func (*PersonUpsertOne) UpdateEmail

func (u *PersonUpsertOne) UpdateEmail() *PersonUpsertOne

UpdateEmail sets the "email" field to the value that was provided on create.

func (*PersonUpsertOne) UpdateIsOrg

func (u *PersonUpsertOne) UpdateIsOrg() *PersonUpsertOne

UpdateIsOrg sets the "is_org" field to the value that was provided on create.

func (*PersonUpsertOne) UpdateName

func (u *PersonUpsertOne) UpdateName() *PersonUpsertOne

UpdateName sets the "name" field to the value that was provided on create.

func (*PersonUpsertOne) UpdateNewValues

func (u *PersonUpsertOne) UpdateNewValues() *PersonUpsertOne

UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:

client.Person.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
	).
	Exec(ctx)

func (*PersonUpsertOne) UpdatePhone

func (u *PersonUpsertOne) UpdatePhone() *PersonUpsertOne

UpdatePhone sets the "phone" field to the value that was provided on create.

func (*PersonUpsertOne) UpdateURL

func (u *PersonUpsertOne) UpdateURL() *PersonUpsertOne

UpdateURL sets the "url" field to the value that was provided on create.

type Persons

type Persons []*Person

Persons is a parsable slice of Person.

type Policy

type Policy = ent.Policy

ent aliases to avoid import conflicts in user's code.

type Purpose

type Purpose struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// PrimaryPurpose holds the value of the "primary_purpose" field.
	PrimaryPurpose purpose.PrimaryPurpose `json:"primary_purpose,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the PurposeQuery when eager-loading is set.
	Edges PurposeEdges `json:"edges"`
	// contains filtered or unexported fields
}

Purpose is the model entity for the Purpose schema.

func (*Purpose) QueryNode

func (pu *Purpose) QueryNode() *NodeQuery

QueryNode queries the "node" edge of the Purpose entity.

func (*Purpose) String

func (pu *Purpose) String() string

String implements the fmt.Stringer.

func (*Purpose) Unwrap

func (pu *Purpose) Unwrap() *Purpose

Unwrap unwraps the Purpose 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 (*Purpose) Update

func (pu *Purpose) Update() *PurposeUpdateOne

Update returns a builder for updating this Purpose. Note that you need to call Purpose.Unwrap() before calling this method if this Purpose was returned from a transaction, and the transaction was committed or rolled back.

func (*Purpose) Value

func (pu *Purpose) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the Purpose. This includes values selected through modifiers, order, etc.

type PurposeClient

type PurposeClient struct {
	// contains filtered or unexported fields
}

PurposeClient is a client for the Purpose schema.

func NewPurposeClient

func NewPurposeClient(c config) *PurposeClient

NewPurposeClient returns a client for the Purpose from the given config.

func (*PurposeClient) Create

func (c *PurposeClient) Create() *PurposeCreate

Create returns a builder for creating a Purpose entity.

func (*PurposeClient) CreateBulk

func (c *PurposeClient) CreateBulk(builders ...*PurposeCreate) *PurposeCreateBulk

CreateBulk returns a builder for creating a bulk of Purpose entities.

func (*PurposeClient) Delete

func (c *PurposeClient) Delete() *PurposeDelete

Delete returns a delete builder for Purpose.

func (*PurposeClient) DeleteOne

func (c *PurposeClient) DeleteOne(pu *Purpose) *PurposeDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*PurposeClient) DeleteOneID

func (c *PurposeClient) DeleteOneID(id int) *PurposeDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*PurposeClient) Get

func (c *PurposeClient) Get(ctx context.Context, id int) (*Purpose, error)

Get returns a Purpose entity by its id.

func (*PurposeClient) GetX

func (c *PurposeClient) GetX(ctx context.Context, id int) *Purpose

GetX is like Get, but panics if an error occurs.

func (*PurposeClient) Hooks

func (c *PurposeClient) Hooks() []Hook

Hooks returns the client hooks.

func (*PurposeClient) Intercept

func (c *PurposeClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `purpose.Intercept(f(g(h())))`.

func (*PurposeClient) Interceptors

func (c *PurposeClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*PurposeClient) MapCreateBulk

func (c *PurposeClient) MapCreateBulk(slice any, setFunc func(*PurposeCreate, int)) *PurposeCreateBulk

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 (*PurposeClient) Query

func (c *PurposeClient) Query() *PurposeQuery

Query returns a query builder for Purpose.

func (*PurposeClient) QueryNode

func (c *PurposeClient) QueryNode(pu *Purpose) *NodeQuery

QueryNode queries the node edge of a Purpose.

func (*PurposeClient) Update

func (c *PurposeClient) Update() *PurposeUpdate

Update returns an update builder for Purpose.

func (*PurposeClient) UpdateOne

func (c *PurposeClient) UpdateOne(pu *Purpose) *PurposeUpdateOne

UpdateOne returns an update builder for the given entity.

func (*PurposeClient) UpdateOneID

func (c *PurposeClient) UpdateOneID(id int) *PurposeUpdateOne

UpdateOneID returns an update builder for the given id.

func (*PurposeClient) Use

func (c *PurposeClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `purpose.Hooks(f(g(h())))`.

type PurposeCreate

type PurposeCreate struct {
	// contains filtered or unexported fields
}

PurposeCreate is the builder for creating a Purpose entity.

func (*PurposeCreate) AddNode

func (pc *PurposeCreate) AddNode(n ...*Node) *PurposeCreate

AddNode adds the "node" edges to the Node entity.

func (*PurposeCreate) AddNodeIDs

func (pc *PurposeCreate) AddNodeIDs(ids ...string) *PurposeCreate

AddNodeIDs adds the "node" edge to the Node entity by IDs.

func (*PurposeCreate) Exec

func (pc *PurposeCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*PurposeCreate) ExecX

func (pc *PurposeCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*PurposeCreate) Mutation

func (pc *PurposeCreate) Mutation() *PurposeMutation

Mutation returns the PurposeMutation object of the builder.

func (*PurposeCreate) OnConflict

func (pc *PurposeCreate) OnConflict(opts ...sql.ConflictOption) *PurposeUpsertOne

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.Purpose.Create().
	SetPrimaryPurpose(v).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.PurposeUpsert) {
		SetPrimaryPurpose(v+v).
	}).
	Exec(ctx)

func (*PurposeCreate) OnConflictColumns

func (pc *PurposeCreate) OnConflictColumns(columns ...string) *PurposeUpsertOne

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.Purpose.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*PurposeCreate) Save

func (pc *PurposeCreate) Save(ctx context.Context) (*Purpose, error)

Save creates the Purpose in the database.

func (*PurposeCreate) SaveX

func (pc *PurposeCreate) SaveX(ctx context.Context) *Purpose

SaveX calls Save and panics if Save returns an error.

func (*PurposeCreate) SetPrimaryPurpose

func (pc *PurposeCreate) SetPrimaryPurpose(pp purpose.PrimaryPurpose) *PurposeCreate

SetPrimaryPurpose sets the "primary_purpose" field.

type PurposeCreateBulk

type PurposeCreateBulk struct {
	// contains filtered or unexported fields
}

PurposeCreateBulk is the builder for creating many Purpose entities in bulk.

func (*PurposeCreateBulk) Exec

func (pcb *PurposeCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*PurposeCreateBulk) ExecX

func (pcb *PurposeCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*PurposeCreateBulk) OnConflict

func (pcb *PurposeCreateBulk) OnConflict(opts ...sql.ConflictOption) *PurposeUpsertBulk

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.Purpose.CreateBulk(builders...).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.PurposeUpsert) {
		SetPrimaryPurpose(v+v).
	}).
	Exec(ctx)

func (*PurposeCreateBulk) OnConflictColumns

func (pcb *PurposeCreateBulk) OnConflictColumns(columns ...string) *PurposeUpsertBulk

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.Purpose.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*PurposeCreateBulk) Save

func (pcb *PurposeCreateBulk) Save(ctx context.Context) ([]*Purpose, error)

Save creates the Purpose entities in the database.

func (*PurposeCreateBulk) SaveX

func (pcb *PurposeCreateBulk) SaveX(ctx context.Context) []*Purpose

SaveX is like Save, but panics if an error occurs.

type PurposeDelete

type PurposeDelete struct {
	// contains filtered or unexported fields
}

PurposeDelete is the builder for deleting a Purpose entity.

func (*PurposeDelete) Exec

func (pd *PurposeDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*PurposeDelete) ExecX

func (pd *PurposeDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*PurposeDelete) Where

func (pd *PurposeDelete) Where(ps ...predicate.Purpose) *PurposeDelete

Where appends a list predicates to the PurposeDelete builder.

type PurposeDeleteOne

type PurposeDeleteOne struct {
	// contains filtered or unexported fields
}

PurposeDeleteOne is the builder for deleting a single Purpose entity.

func (*PurposeDeleteOne) Exec

func (pdo *PurposeDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*PurposeDeleteOne) ExecX

func (pdo *PurposeDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*PurposeDeleteOne) Where

Where appends a list predicates to the PurposeDelete builder.

type PurposeEdges

type PurposeEdges struct {
	// Node holds the value of the node edge.
	Node []*Node `json:"node,omitempty"`
	// contains filtered or unexported fields
}

PurposeEdges holds the relations/edges for other nodes in the graph.

func (PurposeEdges) NodeOrErr

func (e PurposeEdges) NodeOrErr() ([]*Node, error)

NodeOrErr returns the Node value or an error if the edge was not loaded in eager-loading.

type PurposeGroupBy

type PurposeGroupBy struct {
	// contains filtered or unexported fields
}

PurposeGroupBy is the group-by builder for Purpose entities.

func (*PurposeGroupBy) Aggregate

func (pgb *PurposeGroupBy) Aggregate(fns ...AggregateFunc) *PurposeGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*PurposeGroupBy) Bool

func (s *PurposeGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*PurposeGroupBy) BoolX

func (s *PurposeGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*PurposeGroupBy) Bools

func (s *PurposeGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*PurposeGroupBy) BoolsX

func (s *PurposeGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*PurposeGroupBy) Float64

func (s *PurposeGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*PurposeGroupBy) Float64X

func (s *PurposeGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*PurposeGroupBy) Float64s

func (s *PurposeGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*PurposeGroupBy) Float64sX

func (s *PurposeGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*PurposeGroupBy) Int

func (s *PurposeGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*PurposeGroupBy) IntX

func (s *PurposeGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*PurposeGroupBy) Ints

func (s *PurposeGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*PurposeGroupBy) IntsX

func (s *PurposeGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*PurposeGroupBy) Scan

func (pgb *PurposeGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*PurposeGroupBy) ScanX

func (s *PurposeGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*PurposeGroupBy) String

func (s *PurposeGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*PurposeGroupBy) StringX

func (s *PurposeGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*PurposeGroupBy) Strings

func (s *PurposeGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*PurposeGroupBy) StringsX

func (s *PurposeGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type PurposeMutation

type PurposeMutation struct {
	// contains filtered or unexported fields
}

PurposeMutation represents an operation that mutates the Purpose nodes in the graph.

func (*PurposeMutation) AddField

func (m *PurposeMutation) 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 (*PurposeMutation) AddNodeIDs

func (m *PurposeMutation) AddNodeIDs(ids ...string)

AddNodeIDs adds the "node" edge to the Node entity by ids.

func (*PurposeMutation) AddedEdges

func (m *PurposeMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*PurposeMutation) AddedField

func (m *PurposeMutation) 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 (*PurposeMutation) AddedFields

func (m *PurposeMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*PurposeMutation) AddedIDs

func (m *PurposeMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*PurposeMutation) ClearEdge

func (m *PurposeMutation) 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 (*PurposeMutation) ClearField

func (m *PurposeMutation) 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 (*PurposeMutation) ClearNode

func (m *PurposeMutation) ClearNode()

ClearNode clears the "node" edge to the Node entity.

func (*PurposeMutation) ClearedEdges

func (m *PurposeMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*PurposeMutation) ClearedFields

func (m *PurposeMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (PurposeMutation) Client

func (m PurposeMutation) 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 (*PurposeMutation) EdgeCleared

func (m *PurposeMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*PurposeMutation) Field

func (m *PurposeMutation) 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 (*PurposeMutation) FieldCleared

func (m *PurposeMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*PurposeMutation) Fields

func (m *PurposeMutation) 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 (*PurposeMutation) ID

func (m *PurposeMutation) ID() (id int, exists bool)

ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.

func (*PurposeMutation) IDs

func (m *PurposeMutation) IDs(ctx context.Context) ([]int, error)

IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.

func (*PurposeMutation) NodeCleared

func (m *PurposeMutation) NodeCleared() bool

NodeCleared reports if the "node" edge to the Node entity was cleared.

func (*PurposeMutation) NodeIDs

func (m *PurposeMutation) NodeIDs() (ids []string)

NodeIDs returns the "node" edge IDs in the mutation.

func (*PurposeMutation) OldField

func (m *PurposeMutation) 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 (*PurposeMutation) OldPrimaryPurpose

func (m *PurposeMutation) OldPrimaryPurpose(ctx context.Context) (v purpose.PrimaryPurpose, err error)

OldPrimaryPurpose returns the old "primary_purpose" field's value of the Purpose entity. If the Purpose 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 (*PurposeMutation) Op

func (m *PurposeMutation) Op() Op

Op returns the operation name.

func (*PurposeMutation) PrimaryPurpose

func (m *PurposeMutation) PrimaryPurpose() (r purpose.PrimaryPurpose, exists bool)

PrimaryPurpose returns the value of the "primary_purpose" field in the mutation.

func (*PurposeMutation) RemoveNodeIDs

func (m *PurposeMutation) RemoveNodeIDs(ids ...string)

RemoveNodeIDs removes the "node" edge to the Node entity by IDs.

func (*PurposeMutation) RemovedEdges

func (m *PurposeMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*PurposeMutation) RemovedIDs

func (m *PurposeMutation) 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 (*PurposeMutation) RemovedNodeIDs

func (m *PurposeMutation) RemovedNodeIDs() (ids []string)

RemovedNode returns the removed IDs of the "node" edge to the Node entity.

func (*PurposeMutation) ResetEdge

func (m *PurposeMutation) 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 (*PurposeMutation) ResetField

func (m *PurposeMutation) 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 (*PurposeMutation) ResetNode

func (m *PurposeMutation) ResetNode()

ResetNode resets all changes to the "node" edge.

func (*PurposeMutation) ResetPrimaryPurpose

func (m *PurposeMutation) ResetPrimaryPurpose()

ResetPrimaryPurpose resets all changes to the "primary_purpose" field.

func (*PurposeMutation) SetField

func (m *PurposeMutation) 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 (*PurposeMutation) SetOp

func (m *PurposeMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*PurposeMutation) SetPrimaryPurpose

func (m *PurposeMutation) SetPrimaryPurpose(pp purpose.PrimaryPurpose)

SetPrimaryPurpose sets the "primary_purpose" field.

func (PurposeMutation) Tx

func (m PurposeMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*PurposeMutation) Type

func (m *PurposeMutation) Type() string

Type returns the node type of this mutation (Purpose).

func (*PurposeMutation) Where

func (m *PurposeMutation) Where(ps ...predicate.Purpose)

Where appends a list predicates to the PurposeMutation builder.

func (*PurposeMutation) WhereP

func (m *PurposeMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the PurposeMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type PurposeQuery

type PurposeQuery struct {
	// contains filtered or unexported fields
}

PurposeQuery is the builder for querying Purpose entities.

func (*PurposeQuery) Aggregate

func (pq *PurposeQuery) Aggregate(fns ...AggregateFunc) *PurposeSelect

Aggregate returns a PurposeSelect configured with the given aggregations.

func (*PurposeQuery) All

func (pq *PurposeQuery) All(ctx context.Context) ([]*Purpose, error)

All executes the query and returns a list of Purposes.

func (*PurposeQuery) AllX

func (pq *PurposeQuery) AllX(ctx context.Context) []*Purpose

AllX is like All, but panics if an error occurs.

func (*PurposeQuery) Clone

func (pq *PurposeQuery) Clone() *PurposeQuery

Clone returns a duplicate of the PurposeQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*PurposeQuery) Count

func (pq *PurposeQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*PurposeQuery) CountX

func (pq *PurposeQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*PurposeQuery) Exist

func (pq *PurposeQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*PurposeQuery) ExistX

func (pq *PurposeQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*PurposeQuery) First

func (pq *PurposeQuery) First(ctx context.Context) (*Purpose, error)

First returns the first Purpose entity from the query. Returns a *NotFoundError when no Purpose was found.

func (*PurposeQuery) FirstID

func (pq *PurposeQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first Purpose ID from the query. Returns a *NotFoundError when no Purpose ID was found.

func (*PurposeQuery) FirstIDX

func (pq *PurposeQuery) FirstIDX(ctx context.Context) int

FirstIDX is like FirstID, but panics if an error occurs.

func (*PurposeQuery) FirstX

func (pq *PurposeQuery) FirstX(ctx context.Context) *Purpose

FirstX is like First, but panics if an error occurs.

func (*PurposeQuery) GroupBy

func (pq *PurposeQuery) GroupBy(field string, fields ...string) *PurposeGroupBy

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 {
	PrimaryPurpose purpose.PrimaryPurpose `json:"primary_purpose,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Purpose.Query().
	GroupBy(purpose.FieldPrimaryPurpose).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*PurposeQuery) IDs

func (pq *PurposeQuery) IDs(ctx context.Context) (ids []int, err error)

IDs executes the query and returns a list of Purpose IDs.

func (*PurposeQuery) IDsX

func (pq *PurposeQuery) IDsX(ctx context.Context) []int

IDsX is like IDs, but panics if an error occurs.

func (*PurposeQuery) Limit

func (pq *PurposeQuery) Limit(limit int) *PurposeQuery

Limit the number of records to be returned by this query.

func (*PurposeQuery) Offset

func (pq *PurposeQuery) Offset(offset int) *PurposeQuery

Offset to start from.

func (*PurposeQuery) Only

func (pq *PurposeQuery) Only(ctx context.Context) (*Purpose, error)

Only returns a single Purpose entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Purpose entity is found. Returns a *NotFoundError when no Purpose entities are found.

func (*PurposeQuery) OnlyID

func (pq *PurposeQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID is like Only, but returns the only Purpose ID in the query. Returns a *NotSingularError when more than one Purpose ID is found. Returns a *NotFoundError when no entities are found.

func (*PurposeQuery) OnlyIDX

func (pq *PurposeQuery) OnlyIDX(ctx context.Context) int

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*PurposeQuery) OnlyX

func (pq *PurposeQuery) OnlyX(ctx context.Context) *Purpose

OnlyX is like Only, but panics if an error occurs.

func (*PurposeQuery) Order

func (pq *PurposeQuery) Order(o ...purpose.OrderOption) *PurposeQuery

Order specifies how the records should be ordered.

func (*PurposeQuery) QueryNode

func (pq *PurposeQuery) QueryNode() *NodeQuery

QueryNode chains the current query on the "node" edge.

func (*PurposeQuery) Select

func (pq *PurposeQuery) Select(fields ...string) *PurposeSelect

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 {
	PrimaryPurpose purpose.PrimaryPurpose `json:"primary_purpose,omitempty"`
}

client.Purpose.Query().
	Select(purpose.FieldPrimaryPurpose).
	Scan(ctx, &v)

func (*PurposeQuery) Unique

func (pq *PurposeQuery) Unique(unique bool) *PurposeQuery

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 (*PurposeQuery) Where

func (pq *PurposeQuery) Where(ps ...predicate.Purpose) *PurposeQuery

Where adds a new predicate for the PurposeQuery builder.

func (*PurposeQuery) WithNode

func (pq *PurposeQuery) WithNode(opts ...func(*NodeQuery)) *PurposeQuery

WithNode tells the query-builder to eager-load the nodes that are connected to the "node" edge. The optional arguments are used to configure the query builder of the edge.

type PurposeSelect

type PurposeSelect struct {
	*PurposeQuery
	// contains filtered or unexported fields
}

PurposeSelect is the builder for selecting fields of Purpose entities.

func (*PurposeSelect) Aggregate

func (ps *PurposeSelect) Aggregate(fns ...AggregateFunc) *PurposeSelect

Aggregate adds the given aggregation functions to the selector query.

func (*PurposeSelect) Bool

func (s *PurposeSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*PurposeSelect) BoolX

func (s *PurposeSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*PurposeSelect) Bools

func (s *PurposeSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*PurposeSelect) BoolsX

func (s *PurposeSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*PurposeSelect) Float64

func (s *PurposeSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*PurposeSelect) Float64X

func (s *PurposeSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*PurposeSelect) Float64s

func (s *PurposeSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*PurposeSelect) Float64sX

func (s *PurposeSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*PurposeSelect) Int

func (s *PurposeSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*PurposeSelect) IntX

func (s *PurposeSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*PurposeSelect) Ints

func (s *PurposeSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*PurposeSelect) IntsX

func (s *PurposeSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*PurposeSelect) Scan

func (ps *PurposeSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*PurposeSelect) ScanX

func (s *PurposeSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*PurposeSelect) String

func (s *PurposeSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*PurposeSelect) StringX

func (s *PurposeSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*PurposeSelect) Strings

func (s *PurposeSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*PurposeSelect) StringsX

func (s *PurposeSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type PurposeUpdate

type PurposeUpdate struct {
	// contains filtered or unexported fields
}

PurposeUpdate is the builder for updating Purpose entities.

func (*PurposeUpdate) AddNode

func (pu *PurposeUpdate) AddNode(n ...*Node) *PurposeUpdate

AddNode adds the "node" edges to the Node entity.

func (*PurposeUpdate) AddNodeIDs

func (pu *PurposeUpdate) AddNodeIDs(ids ...string) *PurposeUpdate

AddNodeIDs adds the "node" edge to the Node entity by IDs.

func (*PurposeUpdate) ClearNode

func (pu *PurposeUpdate) ClearNode() *PurposeUpdate

ClearNode clears all "node" edges to the Node entity.

func (*PurposeUpdate) Exec

func (pu *PurposeUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*PurposeUpdate) ExecX

func (pu *PurposeUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*PurposeUpdate) Mutation

func (pu *PurposeUpdate) Mutation() *PurposeMutation

Mutation returns the PurposeMutation object of the builder.

func (*PurposeUpdate) RemoveNode

func (pu *PurposeUpdate) RemoveNode(n ...*Node) *PurposeUpdate

RemoveNode removes "node" edges to Node entities.

func (*PurposeUpdate) RemoveNodeIDs

func (pu *PurposeUpdate) RemoveNodeIDs(ids ...string) *PurposeUpdate

RemoveNodeIDs removes the "node" edge to Node entities by IDs.

func (*PurposeUpdate) Save

func (pu *PurposeUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*PurposeUpdate) SaveX

func (pu *PurposeUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*PurposeUpdate) SetNillablePrimaryPurpose

func (pu *PurposeUpdate) SetNillablePrimaryPurpose(pp *purpose.PrimaryPurpose) *PurposeUpdate

SetNillablePrimaryPurpose sets the "primary_purpose" field if the given value is not nil.

func (*PurposeUpdate) SetPrimaryPurpose

func (pu *PurposeUpdate) SetPrimaryPurpose(pp purpose.PrimaryPurpose) *PurposeUpdate

SetPrimaryPurpose sets the "primary_purpose" field.

func (*PurposeUpdate) Where

func (pu *PurposeUpdate) Where(ps ...predicate.Purpose) *PurposeUpdate

Where appends a list predicates to the PurposeUpdate builder.

type PurposeUpdateOne

type PurposeUpdateOne struct {
	// contains filtered or unexported fields
}

PurposeUpdateOne is the builder for updating a single Purpose entity.

func (*PurposeUpdateOne) AddNode

func (puo *PurposeUpdateOne) AddNode(n ...*Node) *PurposeUpdateOne

AddNode adds the "node" edges to the Node entity.

func (*PurposeUpdateOne) AddNodeIDs

func (puo *PurposeUpdateOne) AddNodeIDs(ids ...string) *PurposeUpdateOne

AddNodeIDs adds the "node" edge to the Node entity by IDs.

func (*PurposeUpdateOne) ClearNode

func (puo *PurposeUpdateOne) ClearNode() *PurposeUpdateOne

ClearNode clears all "node" edges to the Node entity.

func (*PurposeUpdateOne) Exec

func (puo *PurposeUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*PurposeUpdateOne) ExecX

func (puo *PurposeUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*PurposeUpdateOne) Mutation

func (puo *PurposeUpdateOne) Mutation() *PurposeMutation

Mutation returns the PurposeMutation object of the builder.

func (*PurposeUpdateOne) RemoveNode

func (puo *PurposeUpdateOne) RemoveNode(n ...*Node) *PurposeUpdateOne

RemoveNode removes "node" edges to Node entities.

func (*PurposeUpdateOne) RemoveNodeIDs

func (puo *PurposeUpdateOne) RemoveNodeIDs(ids ...string) *PurposeUpdateOne

RemoveNodeIDs removes the "node" edge to Node entities by IDs.

func (*PurposeUpdateOne) Save

func (puo *PurposeUpdateOne) Save(ctx context.Context) (*Purpose, error)

Save executes the query and returns the updated Purpose entity.

func (*PurposeUpdateOne) SaveX

func (puo *PurposeUpdateOne) SaveX(ctx context.Context) *Purpose

SaveX is like Save, but panics if an error occurs.

func (*PurposeUpdateOne) Select

func (puo *PurposeUpdateOne) Select(field string, fields ...string) *PurposeUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*PurposeUpdateOne) SetNillablePrimaryPurpose

func (puo *PurposeUpdateOne) SetNillablePrimaryPurpose(pp *purpose.PrimaryPurpose) *PurposeUpdateOne

SetNillablePrimaryPurpose sets the "primary_purpose" field if the given value is not nil.

func (*PurposeUpdateOne) SetPrimaryPurpose

func (puo *PurposeUpdateOne) SetPrimaryPurpose(pp purpose.PrimaryPurpose) *PurposeUpdateOne

SetPrimaryPurpose sets the "primary_purpose" field.

func (*PurposeUpdateOne) Where

Where appends a list predicates to the PurposeUpdate builder.

type PurposeUpsert

type PurposeUpsert struct {
	*sql.UpdateSet
}

PurposeUpsert is the "OnConflict" setter.

func (*PurposeUpsert) SetPrimaryPurpose

func (u *PurposeUpsert) SetPrimaryPurpose(v purpose.PrimaryPurpose) *PurposeUpsert

SetPrimaryPurpose sets the "primary_purpose" field.

func (*PurposeUpsert) UpdatePrimaryPurpose

func (u *PurposeUpsert) UpdatePrimaryPurpose() *PurposeUpsert

UpdatePrimaryPurpose sets the "primary_purpose" field to the value that was provided on create.

type PurposeUpsertBulk

type PurposeUpsertBulk struct {
	// contains filtered or unexported fields
}

PurposeUpsertBulk is the builder for "upsert"-ing a bulk of Purpose nodes.

func (*PurposeUpsertBulk) DoNothing

func (u *PurposeUpsertBulk) DoNothing() *PurposeUpsertBulk

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*PurposeUpsertBulk) Exec

func (u *PurposeUpsertBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*PurposeUpsertBulk) ExecX

func (u *PurposeUpsertBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*PurposeUpsertBulk) Ignore

func (u *PurposeUpsertBulk) Ignore() *PurposeUpsertBulk

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.Purpose.Create().
	OnConflict(sql.ResolveWithIgnore()).
	Exec(ctx)

func (*PurposeUpsertBulk) SetPrimaryPurpose

func (u *PurposeUpsertBulk) SetPrimaryPurpose(v purpose.PrimaryPurpose) *PurposeUpsertBulk

SetPrimaryPurpose sets the "primary_purpose" field.

func (*PurposeUpsertBulk) Update

func (u *PurposeUpsertBulk) Update(set func(*PurposeUpsert)) *PurposeUpsertBulk

Update allows overriding fields `UPDATE` values. See the PurposeCreateBulk.OnConflict documentation for more info.

func (*PurposeUpsertBulk) UpdateNewValues

func (u *PurposeUpsertBulk) UpdateNewValues() *PurposeUpsertBulk

UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:

client.Purpose.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
	).
	Exec(ctx)

func (*PurposeUpsertBulk) UpdatePrimaryPurpose

func (u *PurposeUpsertBulk) UpdatePrimaryPurpose() *PurposeUpsertBulk

UpdatePrimaryPurpose sets the "primary_purpose" field to the value that was provided on create.

type PurposeUpsertOne

type PurposeUpsertOne struct {
	// contains filtered or unexported fields
}

PurposeUpsertOne is the builder for "upsert"-ing

one Purpose node.

func (*PurposeUpsertOne) DoNothing

func (u *PurposeUpsertOne) DoNothing() *PurposeUpsertOne

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*PurposeUpsertOne) Exec

func (u *PurposeUpsertOne) Exec(ctx context.Context) error

Exec executes the query.

func (*PurposeUpsertOne) ExecX

func (u *PurposeUpsertOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*PurposeUpsertOne) ID

func (u *PurposeUpsertOne) ID(ctx context.Context) (id int, err error)

Exec executes the UPSERT query and returns the inserted/updated ID.

func (*PurposeUpsertOne) IDX

func (u *PurposeUpsertOne) IDX(ctx context.Context) int

IDX is like ID, but panics if an error occurs.

func (*PurposeUpsertOne) Ignore

func (u *PurposeUpsertOne) Ignore() *PurposeUpsertOne

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.Purpose.Create().
    OnConflict(sql.ResolveWithIgnore()).
    Exec(ctx)

func (*PurposeUpsertOne) SetPrimaryPurpose

func (u *PurposeUpsertOne) SetPrimaryPurpose(v purpose.PrimaryPurpose) *PurposeUpsertOne

SetPrimaryPurpose sets the "primary_purpose" field.

func (*PurposeUpsertOne) Update

func (u *PurposeUpsertOne) Update(set func(*PurposeUpsert)) *PurposeUpsertOne

Update allows overriding fields `UPDATE` values. See the PurposeCreate.OnConflict documentation for more info.

func (*PurposeUpsertOne) UpdateNewValues

func (u *PurposeUpsertOne) UpdateNewValues() *PurposeUpsertOne

UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:

client.Purpose.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
	).
	Exec(ctx)

func (*PurposeUpsertOne) UpdatePrimaryPurpose

func (u *PurposeUpsertOne) UpdatePrimaryPurpose() *PurposeUpsertOne

UpdatePrimaryPurpose sets the "primary_purpose" field to the value that was provided on create.

type Purposes

type Purposes []*Purpose

Purposes is a parsable slice of Purpose.

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 Tool

type Tool struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// Name holds the value of the "name" field.
	Name string `json:"name,omitempty"`
	// Version holds the value of the "version" field.
	Version string `json:"version,omitempty"`
	// Vendor holds the value of the "vendor" field.
	Vendor string `json:"vendor,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the ToolQuery when eager-loading is set.
	Edges ToolEdges `json:"edges"`
	// contains filtered or unexported fields
}

Tool is the model entity for the Tool schema.

func (*Tool) QueryMetadata

func (t *Tool) QueryMetadata() *MetadataQuery

QueryMetadata queries the "metadata" edge of the Tool entity.

func (*Tool) String

func (t *Tool) String() string

String implements the fmt.Stringer.

func (*Tool) Unwrap

func (t *Tool) Unwrap() *Tool

Unwrap unwraps the Tool 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 (*Tool) Update

func (t *Tool) Update() *ToolUpdateOne

Update returns a builder for updating this Tool. Note that you need to call Tool.Unwrap() before calling this method if this Tool was returned from a transaction, and the transaction was committed or rolled back.

func (*Tool) Value

func (t *Tool) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the Tool. This includes values selected through modifiers, order, etc.

type ToolClient

type ToolClient struct {
	// contains filtered or unexported fields
}

ToolClient is a client for the Tool schema.

func NewToolClient

func NewToolClient(c config) *ToolClient

NewToolClient returns a client for the Tool from the given config.

func (*ToolClient) Create

func (c *ToolClient) Create() *ToolCreate

Create returns a builder for creating a Tool entity.

func (*ToolClient) CreateBulk

func (c *ToolClient) CreateBulk(builders ...*ToolCreate) *ToolCreateBulk

CreateBulk returns a builder for creating a bulk of Tool entities.

func (*ToolClient) Delete

func (c *ToolClient) Delete() *ToolDelete

Delete returns a delete builder for Tool.

func (*ToolClient) DeleteOne

func (c *ToolClient) DeleteOne(t *Tool) *ToolDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*ToolClient) DeleteOneID

func (c *ToolClient) DeleteOneID(id int) *ToolDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*ToolClient) Get

func (c *ToolClient) Get(ctx context.Context, id int) (*Tool, error)

Get returns a Tool entity by its id.

func (*ToolClient) GetX

func (c *ToolClient) GetX(ctx context.Context, id int) *Tool

GetX is like Get, but panics if an error occurs.

func (*ToolClient) Hooks

func (c *ToolClient) Hooks() []Hook

Hooks returns the client hooks.

func (*ToolClient) Intercept

func (c *ToolClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `tool.Intercept(f(g(h())))`.

func (*ToolClient) Interceptors

func (c *ToolClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*ToolClient) MapCreateBulk

func (c *ToolClient) MapCreateBulk(slice any, setFunc func(*ToolCreate, int)) *ToolCreateBulk

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 (*ToolClient) Query

func (c *ToolClient) Query() *ToolQuery

Query returns a query builder for Tool.

func (*ToolClient) QueryMetadata

func (c *ToolClient) QueryMetadata(t *Tool) *MetadataQuery

QueryMetadata queries the metadata edge of a Tool.

func (*ToolClient) Update

func (c *ToolClient) Update() *ToolUpdate

Update returns an update builder for Tool.

func (*ToolClient) UpdateOne

func (c *ToolClient) UpdateOne(t *Tool) *ToolUpdateOne

UpdateOne returns an update builder for the given entity.

func (*ToolClient) UpdateOneID

func (c *ToolClient) UpdateOneID(id int) *ToolUpdateOne

UpdateOneID returns an update builder for the given id.

func (*ToolClient) Use

func (c *ToolClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `tool.Hooks(f(g(h())))`.

type ToolCreate

type ToolCreate struct {
	// contains filtered or unexported fields
}

ToolCreate is the builder for creating a Tool entity.

func (*ToolCreate) Exec

func (tc *ToolCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*ToolCreate) ExecX

func (tc *ToolCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ToolCreate) Mutation

func (tc *ToolCreate) Mutation() *ToolMutation

Mutation returns the ToolMutation object of the builder.

func (*ToolCreate) OnConflict

func (tc *ToolCreate) OnConflict(opts ...sql.ConflictOption) *ToolUpsertOne

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.Tool.Create().
	SetName(v).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.ToolUpsert) {
		SetName(v+v).
	}).
	Exec(ctx)

func (*ToolCreate) OnConflictColumns

func (tc *ToolCreate) OnConflictColumns(columns ...string) *ToolUpsertOne

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.Tool.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*ToolCreate) Save

func (tc *ToolCreate) Save(ctx context.Context) (*Tool, error)

Save creates the Tool in the database.

func (*ToolCreate) SaveX

func (tc *ToolCreate) SaveX(ctx context.Context) *Tool

SaveX calls Save and panics if Save returns an error.

func (*ToolCreate) SetMetadata

func (tc *ToolCreate) SetMetadata(m *Metadata) *ToolCreate

SetMetadata sets the "metadata" edge to the Metadata entity.

func (*ToolCreate) SetMetadataID

func (tc *ToolCreate) SetMetadataID(id string) *ToolCreate

SetMetadataID sets the "metadata" edge to the Metadata entity by ID.

func (*ToolCreate) SetName

func (tc *ToolCreate) SetName(s string) *ToolCreate

SetName sets the "name" field.

func (*ToolCreate) SetNillableMetadataID

func (tc *ToolCreate) SetNillableMetadataID(id *string) *ToolCreate

SetNillableMetadataID sets the "metadata" edge to the Metadata entity by ID if the given value is not nil.

func (*ToolCreate) SetVendor

func (tc *ToolCreate) SetVendor(s string) *ToolCreate

SetVendor sets the "vendor" field.

func (*ToolCreate) SetVersion

func (tc *ToolCreate) SetVersion(s string) *ToolCreate

SetVersion sets the "version" field.

type ToolCreateBulk

type ToolCreateBulk struct {
	// contains filtered or unexported fields
}

ToolCreateBulk is the builder for creating many Tool entities in bulk.

func (*ToolCreateBulk) Exec

func (tcb *ToolCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*ToolCreateBulk) ExecX

func (tcb *ToolCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ToolCreateBulk) OnConflict

func (tcb *ToolCreateBulk) OnConflict(opts ...sql.ConflictOption) *ToolUpsertBulk

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.Tool.CreateBulk(builders...).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.ToolUpsert) {
		SetName(v+v).
	}).
	Exec(ctx)

func (*ToolCreateBulk) OnConflictColumns

func (tcb *ToolCreateBulk) OnConflictColumns(columns ...string) *ToolUpsertBulk

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.Tool.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*ToolCreateBulk) Save

func (tcb *ToolCreateBulk) Save(ctx context.Context) ([]*Tool, error)

Save creates the Tool entities in the database.

func (*ToolCreateBulk) SaveX

func (tcb *ToolCreateBulk) SaveX(ctx context.Context) []*Tool

SaveX is like Save, but panics if an error occurs.

type ToolDelete

type ToolDelete struct {
	// contains filtered or unexported fields
}

ToolDelete is the builder for deleting a Tool entity.

func (*ToolDelete) Exec

func (td *ToolDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*ToolDelete) ExecX

func (td *ToolDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*ToolDelete) Where

func (td *ToolDelete) Where(ps ...predicate.Tool) *ToolDelete

Where appends a list predicates to the ToolDelete builder.

type ToolDeleteOne

type ToolDeleteOne struct {
	// contains filtered or unexported fields
}

ToolDeleteOne is the builder for deleting a single Tool entity.

func (*ToolDeleteOne) Exec

func (tdo *ToolDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*ToolDeleteOne) ExecX

func (tdo *ToolDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ToolDeleteOne) Where

func (tdo *ToolDeleteOne) Where(ps ...predicate.Tool) *ToolDeleteOne

Where appends a list predicates to the ToolDelete builder.

type ToolEdges

type ToolEdges struct {
	// Metadata holds the value of the metadata edge.
	Metadata *Metadata `json:"metadata,omitempty"`
	// contains filtered or unexported fields
}

ToolEdges holds the relations/edges for other nodes in the graph.

func (ToolEdges) MetadataOrErr

func (e ToolEdges) MetadataOrErr() (*Metadata, error)

MetadataOrErr returns the Metadata value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

type ToolGroupBy

type ToolGroupBy struct {
	// contains filtered or unexported fields
}

ToolGroupBy is the group-by builder for Tool entities.

func (*ToolGroupBy) Aggregate

func (tgb *ToolGroupBy) Aggregate(fns ...AggregateFunc) *ToolGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*ToolGroupBy) Bool

func (s *ToolGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*ToolGroupBy) BoolX

func (s *ToolGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*ToolGroupBy) Bools

func (s *ToolGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*ToolGroupBy) BoolsX

func (s *ToolGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*ToolGroupBy) Float64

func (s *ToolGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*ToolGroupBy) Float64X

func (s *ToolGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*ToolGroupBy) Float64s

func (s *ToolGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*ToolGroupBy) Float64sX

func (s *ToolGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*ToolGroupBy) Int

func (s *ToolGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*ToolGroupBy) IntX

func (s *ToolGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*ToolGroupBy) Ints

func (s *ToolGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*ToolGroupBy) IntsX

func (s *ToolGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*ToolGroupBy) Scan

func (tgb *ToolGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*ToolGroupBy) ScanX

func (s *ToolGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*ToolGroupBy) String

func (s *ToolGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*ToolGroupBy) StringX

func (s *ToolGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*ToolGroupBy) Strings

func (s *ToolGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*ToolGroupBy) StringsX

func (s *ToolGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type ToolMutation

type ToolMutation struct {
	// contains filtered or unexported fields
}

ToolMutation represents an operation that mutates the Tool nodes in the graph.

func (*ToolMutation) AddField

func (m *ToolMutation) 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 (*ToolMutation) AddedEdges

func (m *ToolMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*ToolMutation) AddedField

func (m *ToolMutation) 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 (*ToolMutation) AddedFields

func (m *ToolMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*ToolMutation) AddedIDs

func (m *ToolMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*ToolMutation) ClearEdge

func (m *ToolMutation) 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 (*ToolMutation) ClearField

func (m *ToolMutation) 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 (*ToolMutation) ClearMetadata

func (m *ToolMutation) ClearMetadata()

ClearMetadata clears the "metadata" edge to the Metadata entity.

func (*ToolMutation) ClearedEdges

func (m *ToolMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*ToolMutation) ClearedFields

func (m *ToolMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (ToolMutation) Client

func (m ToolMutation) 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 (*ToolMutation) EdgeCleared

func (m *ToolMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*ToolMutation) Field

func (m *ToolMutation) 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 (*ToolMutation) FieldCleared

func (m *ToolMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*ToolMutation) Fields

func (m *ToolMutation) 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 (*ToolMutation) ID

func (m *ToolMutation) ID() (id int, exists bool)

ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.

func (*ToolMutation) IDs

func (m *ToolMutation) IDs(ctx context.Context) ([]int, error)

IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.

func (*ToolMutation) MetadataCleared

func (m *ToolMutation) MetadataCleared() bool

MetadataCleared reports if the "metadata" edge to the Metadata entity was cleared.

func (*ToolMutation) MetadataID

func (m *ToolMutation) MetadataID() (id string, exists bool)

MetadataID returns the "metadata" edge ID in the mutation.

func (*ToolMutation) MetadataIDs

func (m *ToolMutation) MetadataIDs() (ids []string)

MetadataIDs returns the "metadata" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use MetadataID instead. It exists only for internal usage by the builders.

func (*ToolMutation) Name

func (m *ToolMutation) Name() (r string, exists bool)

Name returns the value of the "name" field in the mutation.

func (*ToolMutation) OldField

func (m *ToolMutation) 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 (*ToolMutation) OldName

func (m *ToolMutation) OldName(ctx context.Context) (v string, err error)

OldName returns the old "name" field's value of the Tool entity. If the Tool 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 (*ToolMutation) OldVendor

func (m *ToolMutation) OldVendor(ctx context.Context) (v string, err error)

OldVendor returns the old "vendor" field's value of the Tool entity. If the Tool 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 (*ToolMutation) OldVersion

func (m *ToolMutation) OldVersion(ctx context.Context) (v string, err error)

OldVersion returns the old "version" field's value of the Tool entity. If the Tool 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 (*ToolMutation) Op

func (m *ToolMutation) Op() Op

Op returns the operation name.

func (*ToolMutation) RemovedEdges

func (m *ToolMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*ToolMutation) RemovedIDs

func (m *ToolMutation) 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 (*ToolMutation) ResetEdge

func (m *ToolMutation) 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 (*ToolMutation) ResetField

func (m *ToolMutation) 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 (*ToolMutation) ResetMetadata

func (m *ToolMutation) ResetMetadata()

ResetMetadata resets all changes to the "metadata" edge.

func (*ToolMutation) ResetName

func (m *ToolMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*ToolMutation) ResetVendor

func (m *ToolMutation) ResetVendor()

ResetVendor resets all changes to the "vendor" field.

func (*ToolMutation) ResetVersion

func (m *ToolMutation) ResetVersion()

ResetVersion resets all changes to the "version" field.

func (*ToolMutation) SetField

func (m *ToolMutation) 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 (*ToolMutation) SetMetadataID

func (m *ToolMutation) SetMetadataID(id string)

SetMetadataID sets the "metadata" edge to the Metadata entity by id.

func (*ToolMutation) SetName

func (m *ToolMutation) SetName(s string)

SetName sets the "name" field.

func (*ToolMutation) SetOp

func (m *ToolMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*ToolMutation) SetVendor

func (m *ToolMutation) SetVendor(s string)

SetVendor sets the "vendor" field.

func (*ToolMutation) SetVersion

func (m *ToolMutation) SetVersion(s string)

SetVersion sets the "version" field.

func (ToolMutation) Tx

func (m ToolMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*ToolMutation) Type

func (m *ToolMutation) Type() string

Type returns the node type of this mutation (Tool).

func (*ToolMutation) Vendor

func (m *ToolMutation) Vendor() (r string, exists bool)

Vendor returns the value of the "vendor" field in the mutation.

func (*ToolMutation) Version

func (m *ToolMutation) Version() (r string, exists bool)

Version returns the value of the "version" field in the mutation.

func (*ToolMutation) Where

func (m *ToolMutation) Where(ps ...predicate.Tool)

Where appends a list predicates to the ToolMutation builder.

func (*ToolMutation) WhereP

func (m *ToolMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the ToolMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type ToolQuery

type ToolQuery struct {
	// contains filtered or unexported fields
}

ToolQuery is the builder for querying Tool entities.

func (*ToolQuery) Aggregate

func (tq *ToolQuery) Aggregate(fns ...AggregateFunc) *ToolSelect

Aggregate returns a ToolSelect configured with the given aggregations.

func (*ToolQuery) All

func (tq *ToolQuery) All(ctx context.Context) ([]*Tool, error)

All executes the query and returns a list of Tools.

func (*ToolQuery) AllX

func (tq *ToolQuery) AllX(ctx context.Context) []*Tool

AllX is like All, but panics if an error occurs.

func (*ToolQuery) Clone

func (tq *ToolQuery) Clone() *ToolQuery

Clone returns a duplicate of the ToolQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*ToolQuery) Count

func (tq *ToolQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*ToolQuery) CountX

func (tq *ToolQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*ToolQuery) Exist

func (tq *ToolQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*ToolQuery) ExistX

func (tq *ToolQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*ToolQuery) First

func (tq *ToolQuery) First(ctx context.Context) (*Tool, error)

First returns the first Tool entity from the query. Returns a *NotFoundError when no Tool was found.

func (*ToolQuery) FirstID

func (tq *ToolQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first Tool ID from the query. Returns a *NotFoundError when no Tool ID was found.

func (*ToolQuery) FirstIDX

func (tq *ToolQuery) FirstIDX(ctx context.Context) int

FirstIDX is like FirstID, but panics if an error occurs.

func (*ToolQuery) FirstX

func (tq *ToolQuery) FirstX(ctx context.Context) *Tool

FirstX is like First, but panics if an error occurs.

func (*ToolQuery) GroupBy

func (tq *ToolQuery) GroupBy(field string, fields ...string) *ToolGroupBy

GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.

Example:

var v []struct {
	Name string `json:"name,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Tool.Query().
	GroupBy(tool.FieldName).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*ToolQuery) IDs

func (tq *ToolQuery) IDs(ctx context.Context) (ids []int, err error)

IDs executes the query and returns a list of Tool IDs.

func (*ToolQuery) IDsX

func (tq *ToolQuery) IDsX(ctx context.Context) []int

IDsX is like IDs, but panics if an error occurs.

func (*ToolQuery) Limit

func (tq *ToolQuery) Limit(limit int) *ToolQuery

Limit the number of records to be returned by this query.

func (*ToolQuery) Offset

func (tq *ToolQuery) Offset(offset int) *ToolQuery

Offset to start from.

func (*ToolQuery) Only

func (tq *ToolQuery) Only(ctx context.Context) (*Tool, error)

Only returns a single Tool entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Tool entity is found. Returns a *NotFoundError when no Tool entities are found.

func (*ToolQuery) OnlyID

func (tq *ToolQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID is like Only, but returns the only Tool ID in the query. Returns a *NotSingularError when more than one Tool ID is found. Returns a *NotFoundError when no entities are found.

func (*ToolQuery) OnlyIDX

func (tq *ToolQuery) OnlyIDX(ctx context.Context) int

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*ToolQuery) OnlyX

func (tq *ToolQuery) OnlyX(ctx context.Context) *Tool

OnlyX is like Only, but panics if an error occurs.

func (*ToolQuery) Order

func (tq *ToolQuery) Order(o ...tool.OrderOption) *ToolQuery

Order specifies how the records should be ordered.

func (*ToolQuery) QueryMetadata

func (tq *ToolQuery) QueryMetadata() *MetadataQuery

QueryMetadata chains the current query on the "metadata" edge.

func (*ToolQuery) Select

func (tq *ToolQuery) Select(fields ...string) *ToolSelect

Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.

Example:

var v []struct {
	Name string `json:"name,omitempty"`
}

client.Tool.Query().
	Select(tool.FieldName).
	Scan(ctx, &v)

func (*ToolQuery) Unique

func (tq *ToolQuery) Unique(unique bool) *ToolQuery

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 (*ToolQuery) Where

func (tq *ToolQuery) Where(ps ...predicate.Tool) *ToolQuery

Where adds a new predicate for the ToolQuery builder.

func (*ToolQuery) WithMetadata

func (tq *ToolQuery) WithMetadata(opts ...func(*MetadataQuery)) *ToolQuery

WithMetadata tells the query-builder to eager-load the nodes that are connected to the "metadata" edge. The optional arguments are used to configure the query builder of the edge.

type ToolSelect

type ToolSelect struct {
	*ToolQuery
	// contains filtered or unexported fields
}

ToolSelect is the builder for selecting fields of Tool entities.

func (*ToolSelect) Aggregate

func (ts *ToolSelect) Aggregate(fns ...AggregateFunc) *ToolSelect

Aggregate adds the given aggregation functions to the selector query.

func (*ToolSelect) Bool

func (s *ToolSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*ToolSelect) BoolX

func (s *ToolSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*ToolSelect) Bools

func (s *ToolSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*ToolSelect) BoolsX

func (s *ToolSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*ToolSelect) Float64

func (s *ToolSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*ToolSelect) Float64X

func (s *ToolSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*ToolSelect) Float64s

func (s *ToolSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*ToolSelect) Float64sX

func (s *ToolSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*ToolSelect) Int

func (s *ToolSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*ToolSelect) IntX

func (s *ToolSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*ToolSelect) Ints

func (s *ToolSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*ToolSelect) IntsX

func (s *ToolSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*ToolSelect) Scan

func (ts *ToolSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*ToolSelect) ScanX

func (s *ToolSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*ToolSelect) String

func (s *ToolSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*ToolSelect) StringX

func (s *ToolSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*ToolSelect) Strings

func (s *ToolSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*ToolSelect) StringsX

func (s *ToolSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type ToolUpdate

type ToolUpdate struct {
	// contains filtered or unexported fields
}

ToolUpdate is the builder for updating Tool entities.

func (*ToolUpdate) ClearMetadata

func (tu *ToolUpdate) ClearMetadata() *ToolUpdate

ClearMetadata clears the "metadata" edge to the Metadata entity.

func (*ToolUpdate) Exec

func (tu *ToolUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*ToolUpdate) ExecX

func (tu *ToolUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ToolUpdate) Mutation

func (tu *ToolUpdate) Mutation() *ToolMutation

Mutation returns the ToolMutation object of the builder.

func (*ToolUpdate) Save

func (tu *ToolUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*ToolUpdate) SaveX

func (tu *ToolUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*ToolUpdate) SetMetadata

func (tu *ToolUpdate) SetMetadata(m *Metadata) *ToolUpdate

SetMetadata sets the "metadata" edge to the Metadata entity.

func (*ToolUpdate) SetMetadataID

func (tu *ToolUpdate) SetMetadataID(id string) *ToolUpdate

SetMetadataID sets the "metadata" edge to the Metadata entity by ID.

func (*ToolUpdate) SetName

func (tu *ToolUpdate) SetName(s string) *ToolUpdate

SetName sets the "name" field.

func (*ToolUpdate) SetNillableMetadataID

func (tu *ToolUpdate) SetNillableMetadataID(id *string) *ToolUpdate

SetNillableMetadataID sets the "metadata" edge to the Metadata entity by ID if the given value is not nil.

func (*ToolUpdate) SetNillableName

func (tu *ToolUpdate) SetNillableName(s *string) *ToolUpdate

SetNillableName sets the "name" field if the given value is not nil.

func (*ToolUpdate) SetNillableVendor

func (tu *ToolUpdate) SetNillableVendor(s *string) *ToolUpdate

SetNillableVendor sets the "vendor" field if the given value is not nil.

func (*ToolUpdate) SetNillableVersion

func (tu *ToolUpdate) SetNillableVersion(s *string) *ToolUpdate

SetNillableVersion sets the "version" field if the given value is not nil.

func (*ToolUpdate) SetVendor

func (tu *ToolUpdate) SetVendor(s string) *ToolUpdate

SetVendor sets the "vendor" field.

func (*ToolUpdate) SetVersion

func (tu *ToolUpdate) SetVersion(s string) *ToolUpdate

SetVersion sets the "version" field.

func (*ToolUpdate) Where

func (tu *ToolUpdate) Where(ps ...predicate.Tool) *ToolUpdate

Where appends a list predicates to the ToolUpdate builder.

type ToolUpdateOne

type ToolUpdateOne struct {
	// contains filtered or unexported fields
}

ToolUpdateOne is the builder for updating a single Tool entity.

func (*ToolUpdateOne) ClearMetadata

func (tuo *ToolUpdateOne) ClearMetadata() *ToolUpdateOne

ClearMetadata clears the "metadata" edge to the Metadata entity.

func (*ToolUpdateOne) Exec

func (tuo *ToolUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*ToolUpdateOne) ExecX

func (tuo *ToolUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ToolUpdateOne) Mutation

func (tuo *ToolUpdateOne) Mutation() *ToolMutation

Mutation returns the ToolMutation object of the builder.

func (*ToolUpdateOne) Save

func (tuo *ToolUpdateOne) Save(ctx context.Context) (*Tool, error)

Save executes the query and returns the updated Tool entity.

func (*ToolUpdateOne) SaveX

func (tuo *ToolUpdateOne) SaveX(ctx context.Context) *Tool

SaveX is like Save, but panics if an error occurs.

func (*ToolUpdateOne) Select

func (tuo *ToolUpdateOne) Select(field string, fields ...string) *ToolUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*ToolUpdateOne) SetMetadata

func (tuo *ToolUpdateOne) SetMetadata(m *Metadata) *ToolUpdateOne

SetMetadata sets the "metadata" edge to the Metadata entity.

func (*ToolUpdateOne) SetMetadataID

func (tuo *ToolUpdateOne) SetMetadataID(id string) *ToolUpdateOne

SetMetadataID sets the "metadata" edge to the Metadata entity by ID.

func (*ToolUpdateOne) SetName

func (tuo *ToolUpdateOne) SetName(s string) *ToolUpdateOne

SetName sets the "name" field.

func (*ToolUpdateOne) SetNillableMetadataID

func (tuo *ToolUpdateOne) SetNillableMetadataID(id *string) *ToolUpdateOne

SetNillableMetadataID sets the "metadata" edge to the Metadata entity by ID if the given value is not nil.

func (*ToolUpdateOne) SetNillableName

func (tuo *ToolUpdateOne) SetNillableName(s *string) *ToolUpdateOne

SetNillableName sets the "name" field if the given value is not nil.

func (*ToolUpdateOne) SetNillableVendor

func (tuo *ToolUpdateOne) SetNillableVendor(s *string) *ToolUpdateOne

SetNillableVendor sets the "vendor" field if the given value is not nil.

func (*ToolUpdateOne) SetNillableVersion

func (tuo *ToolUpdateOne) SetNillableVersion(s *string) *ToolUpdateOne

SetNillableVersion sets the "version" field if the given value is not nil.

func (*ToolUpdateOne) SetVendor

func (tuo *ToolUpdateOne) SetVendor(s string) *ToolUpdateOne

SetVendor sets the "vendor" field.

func (*ToolUpdateOne) SetVersion

func (tuo *ToolUpdateOne) SetVersion(s string) *ToolUpdateOne

SetVersion sets the "version" field.

func (*ToolUpdateOne) Where

func (tuo *ToolUpdateOne) Where(ps ...predicate.Tool) *ToolUpdateOne

Where appends a list predicates to the ToolUpdate builder.

type ToolUpsert

type ToolUpsert struct {
	*sql.UpdateSet
}

ToolUpsert is the "OnConflict" setter.

func (*ToolUpsert) SetName

func (u *ToolUpsert) SetName(v string) *ToolUpsert

SetName sets the "name" field.

func (*ToolUpsert) SetVendor

func (u *ToolUpsert) SetVendor(v string) *ToolUpsert

SetVendor sets the "vendor" field.

func (*ToolUpsert) SetVersion

func (u *ToolUpsert) SetVersion(v string) *ToolUpsert

SetVersion sets the "version" field.

func (*ToolUpsert) UpdateName

func (u *ToolUpsert) UpdateName() *ToolUpsert

UpdateName sets the "name" field to the value that was provided on create.

func (*ToolUpsert) UpdateVendor

func (u *ToolUpsert) UpdateVendor() *ToolUpsert

UpdateVendor sets the "vendor" field to the value that was provided on create.

func (*ToolUpsert) UpdateVersion

func (u *ToolUpsert) UpdateVersion() *ToolUpsert

UpdateVersion sets the "version" field to the value that was provided on create.

type ToolUpsertBulk

type ToolUpsertBulk struct {
	// contains filtered or unexported fields
}

ToolUpsertBulk is the builder for "upsert"-ing a bulk of Tool nodes.

func (*ToolUpsertBulk) DoNothing

func (u *ToolUpsertBulk) DoNothing() *ToolUpsertBulk

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*ToolUpsertBulk) Exec

func (u *ToolUpsertBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*ToolUpsertBulk) ExecX

func (u *ToolUpsertBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ToolUpsertBulk) Ignore

func (u *ToolUpsertBulk) Ignore() *ToolUpsertBulk

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.Tool.Create().
	OnConflict(sql.ResolveWithIgnore()).
	Exec(ctx)

func (*ToolUpsertBulk) SetName

func (u *ToolUpsertBulk) SetName(v string) *ToolUpsertBulk

SetName sets the "name" field.

func (*ToolUpsertBulk) SetVendor

func (u *ToolUpsertBulk) SetVendor(v string) *ToolUpsertBulk

SetVendor sets the "vendor" field.

func (*ToolUpsertBulk) SetVersion

func (u *ToolUpsertBulk) SetVersion(v string) *ToolUpsertBulk

SetVersion sets the "version" field.

func (*ToolUpsertBulk) Update

func (u *ToolUpsertBulk) Update(set func(*ToolUpsert)) *ToolUpsertBulk

Update allows overriding fields `UPDATE` values. See the ToolCreateBulk.OnConflict documentation for more info.

func (*ToolUpsertBulk) UpdateName

func (u *ToolUpsertBulk) UpdateName() *ToolUpsertBulk

UpdateName sets the "name" field to the value that was provided on create.

func (*ToolUpsertBulk) UpdateNewValues

func (u *ToolUpsertBulk) UpdateNewValues() *ToolUpsertBulk

UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:

client.Tool.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
	).
	Exec(ctx)

func (*ToolUpsertBulk) UpdateVendor

func (u *ToolUpsertBulk) UpdateVendor() *ToolUpsertBulk

UpdateVendor sets the "vendor" field to the value that was provided on create.

func (*ToolUpsertBulk) UpdateVersion

func (u *ToolUpsertBulk) UpdateVersion() *ToolUpsertBulk

UpdateVersion sets the "version" field to the value that was provided on create.

type ToolUpsertOne

type ToolUpsertOne struct {
	// contains filtered or unexported fields
}

ToolUpsertOne is the builder for "upsert"-ing

one Tool node.

func (*ToolUpsertOne) DoNothing

func (u *ToolUpsertOne) DoNothing() *ToolUpsertOne

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*ToolUpsertOne) Exec

func (u *ToolUpsertOne) Exec(ctx context.Context) error

Exec executes the query.

func (*ToolUpsertOne) ExecX

func (u *ToolUpsertOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ToolUpsertOne) ID

func (u *ToolUpsertOne) ID(ctx context.Context) (id int, err error)

Exec executes the UPSERT query and returns the inserted/updated ID.

func (*ToolUpsertOne) IDX

func (u *ToolUpsertOne) IDX(ctx context.Context) int

IDX is like ID, but panics if an error occurs.

func (*ToolUpsertOne) Ignore

func (u *ToolUpsertOne) Ignore() *ToolUpsertOne

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.Tool.Create().
    OnConflict(sql.ResolveWithIgnore()).
    Exec(ctx)

func (*ToolUpsertOne) SetName

func (u *ToolUpsertOne) SetName(v string) *ToolUpsertOne

SetName sets the "name" field.

func (*ToolUpsertOne) SetVendor

func (u *ToolUpsertOne) SetVendor(v string) *ToolUpsertOne

SetVendor sets the "vendor" field.

func (*ToolUpsertOne) SetVersion

func (u *ToolUpsertOne) SetVersion(v string) *ToolUpsertOne

SetVersion sets the "version" field.

func (*ToolUpsertOne) Update

func (u *ToolUpsertOne) Update(set func(*ToolUpsert)) *ToolUpsertOne

Update allows overriding fields `UPDATE` values. See the ToolCreate.OnConflict documentation for more info.

func (*ToolUpsertOne) UpdateName

func (u *ToolUpsertOne) UpdateName() *ToolUpsertOne

UpdateName sets the "name" field to the value that was provided on create.

func (*ToolUpsertOne) UpdateNewValues

func (u *ToolUpsertOne) UpdateNewValues() *ToolUpsertOne

UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:

client.Tool.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
	).
	Exec(ctx)

func (*ToolUpsertOne) UpdateVendor

func (u *ToolUpsertOne) UpdateVendor() *ToolUpsertOne

UpdateVendor sets the "vendor" field to the value that was provided on create.

func (*ToolUpsertOne) UpdateVersion

func (u *ToolUpsertOne) UpdateVersion() *ToolUpsertOne

UpdateVersion sets the "version" field to the value that was provided on create.

type Tools

type Tools []*Tool

Tools is a parsable slice of Tool.

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 {

	// Document is the client for interacting with the Document builders.
	Document *DocumentClient
	// DocumentType is the client for interacting with the DocumentType builders.
	DocumentType *DocumentTypeClient
	// EdgeType is the client for interacting with the EdgeType builders.
	EdgeType *EdgeTypeClient
	// ExternalReference is the client for interacting with the ExternalReference builders.
	ExternalReference *ExternalReferenceClient
	// HashesEntry is the client for interacting with the HashesEntry builders.
	HashesEntry *HashesEntryClient
	// IdentifiersEntry is the client for interacting with the IdentifiersEntry builders.
	IdentifiersEntry *IdentifiersEntryClient
	// Metadata is the client for interacting with the Metadata builders.
	Metadata *MetadataClient
	// Node is the client for interacting with the Node builders.
	Node *NodeClient
	// NodeList is the client for interacting with the NodeList builders.
	NodeList *NodeListClient
	// Person is the client for interacting with the Person builders.
	Person *PersonClient
	// Purpose is the client for interacting with the Purpose builders.
	Purpose *PurposeClient
	// Tool is the client for interacting with the Tool builders.
	Tool *ToolClient
	// contains filtered or unexported fields
}

Tx is a transactional client that is created by calling Client.Tx().

func TxFromContext

func TxFromContext(ctx context.Context) *Tx

TxFromContext returns a Tx stored inside a context, or nil if there isn't one.

func (*Tx) Client

func (tx *Tx) Client() *Client

Client returns a Client that binds to current transaction.

func (*Tx) Commit

func (tx *Tx) Commit() error

Commit commits the transaction.

func (*Tx) OnCommit

func (tx *Tx) OnCommit(f CommitHook)

OnCommit adds a hook to call on commit.

func (*Tx) OnRollback

func (tx *Tx) OnRollback(f RollbackHook)

OnRollback adds a hook to call on rollback.

func (*Tx) Rollback

func (tx *Tx) Rollback() error

Rollback rollbacks the transaction.

type ValidationError

type ValidationError struct {
	Name string // Field or edge name.
	// contains filtered or unexported fields
}

ValidationError returns when validating a field or edge fails.

func (*ValidationError) Error

func (e *ValidationError) Error() string

Error implements the error interface.

func (*ValidationError) Unwrap

func (e *ValidationError) Unwrap() error

Unwrap implements the errors.Wrapper interface.

type Value

type Value = ent.Value

ent aliases to avoid import conflicts in user's code.

Directories

Path Synopsis
-------------------------------------------------------------- SPDX-FileCopyrightText: Copyright © 2024 The Protobom Authors SPDX-FileType: SOURCE SPDX-License-Identifier: Apache-2.0 --------------------------------------------------------------
-------------------------------------------------------------- SPDX-FileCopyrightText: Copyright © 2024 The Protobom Authors SPDX-FileType: SOURCE SPDX-License-Identifier: Apache-2.0 --------------------------------------------------------------

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL