ent

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2023 License: GPL-3.0 Imports: 40 Imported by: 0

Documentation

Index

Constants

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

	// Node types.
	TypeCompany   = "Company"
	TypeCountry   = "Country"
	TypeEmail     = "Email"
	TypeImage     = "Image"
	TypeLocation  = "Location"
	TypePhone     = "Phone"
	TypeProduct   = "Product"
	TypeVendor    = "Vendor"
	TypeWarehouse = "Warehouse"
	TypeWebsite   = "Website"
)

Variables

View Source
var (
	// CompanyOrderFieldName orders Company by name.
	CompanyOrderFieldName = &CompanyOrderField{
		field: company.FieldName,
		toCursor: func(c *Company) Cursor {
			return Cursor{
				ID:    c.ID,
				Value: c.Name,
			}
		},
	}
	// CompanyOrderFieldDescription orders Company by description.
	CompanyOrderFieldDescription = &CompanyOrderField{
		field: company.FieldDescription,
		toCursor: func(c *Company) Cursor {
			return Cursor{
				ID:    c.ID,
				Value: c.Description,
			}
		},
	}
)
View Source
var (
	// CountryOrderFieldName orders Country by name.
	CountryOrderFieldName = &CountryOrderField{
		field: country.FieldName,
		toCursor: func(c *Country) Cursor {
			return Cursor{
				ID:    c.ID,
				Value: c.Name,
			}
		},
	}
	// CountryOrderFieldCode orders Country by code.
	CountryOrderFieldCode = &CountryOrderField{
		field: country.FieldCode,
		toCursor: func(c *Country) Cursor {
			return Cursor{
				ID:    c.ID,
				Value: c.Code,
			}
		},
	}
)
View Source
var (
	// EmailOrderFieldTitle orders Email by title.
	EmailOrderFieldTitle = &EmailOrderField{
		field: email.FieldTitle,
		toCursor: func(e *Email) Cursor {
			return Cursor{
				ID:    e.ID,
				Value: e.Title,
			}
		},
	}
	// EmailOrderFieldDescription orders Email by description.
	EmailOrderFieldDescription = &EmailOrderField{
		field: email.FieldDescription,
		toCursor: func(e *Email) Cursor {
			return Cursor{
				ID:    e.ID,
				Value: e.Description,
			}
		},
	}
	// EmailOrderFieldAddress orders Email by address.
	EmailOrderFieldAddress = &EmailOrderField{
		field: email.FieldAddress,
		toCursor: func(e *Email) Cursor {
			return Cursor{
				ID:    e.ID,
				Value: e.Address,
			}
		},
	}
)
View Source
var (
	// ImageOrderFieldTitle orders Image by title.
	ImageOrderFieldTitle = &ImageOrderField{
		field: image.FieldTitle,
		toCursor: func(i *Image) Cursor {
			return Cursor{
				ID:    i.ID,
				Value: i.Title,
			}
		},
	}
	// ImageOrderFieldOriginalURL orders Image by original_url.
	ImageOrderFieldOriginalURL = &ImageOrderField{
		field: image.FieldOriginalURL,
		toCursor: func(i *Image) Cursor {
			return Cursor{
				ID:    i.ID,
				Value: i.OriginalURL,
			}
		},
	}
)
View Source
var (
	// LocationOrderFieldTitle orders Location by title.
	LocationOrderFieldTitle = &LocationOrderField{
		field: location.FieldTitle,
		toCursor: func(l *Location) Cursor {
			return Cursor{
				ID:    l.ID,
				Value: l.Title,
			}
		},
	}
	// LocationOrderFieldDescription orders Location by description.
	LocationOrderFieldDescription = &LocationOrderField{
		field: location.FieldDescription,
		toCursor: func(l *Location) Cursor {
			return Cursor{
				ID:    l.ID,
				Value: l.Description,
			}
		},
	}
	// LocationOrderFieldLatitude orders Location by latitude.
	LocationOrderFieldLatitude = &LocationOrderField{
		field: location.FieldLatitude,
		toCursor: func(l *Location) Cursor {
			return Cursor{
				ID:    l.ID,
				Value: l.Latitude,
			}
		},
	}
	// LocationOrderFieldLongitude orders Location by longitude.
	LocationOrderFieldLongitude = &LocationOrderField{
		field: location.FieldLongitude,
		toCursor: func(l *Location) Cursor {
			return Cursor{
				ID:    l.ID,
				Value: l.Longitude,
			}
		},
	}
	// LocationOrderFieldAddress orders Location by address.
	LocationOrderFieldAddress = &LocationOrderField{
		field: location.FieldAddress,
		toCursor: func(l *Location) Cursor {
			return Cursor{
				ID:    l.ID,
				Value: l.Address,
			}
		},
	}
	// LocationOrderFieldPostcode orders Location by postcode.
	LocationOrderFieldPostcode = &LocationOrderField{
		field: location.FieldPostcode,
		toCursor: func(l *Location) Cursor {
			return Cursor{
				ID:    l.ID,
				Value: l.Postcode,
			}
		},
	}
	// LocationOrderFieldType orders Location by type.
	LocationOrderFieldType = &LocationOrderField{
		field: location.FieldType,
		toCursor: func(l *Location) Cursor {
			return Cursor{
				ID:    l.ID,
				Value: l.Type,
			}
		},
	}
	// LocationOrderFieldState orders Location by state.
	LocationOrderFieldState = &LocationOrderField{
		field: location.FieldState,
		toCursor: func(l *Location) Cursor {
			return Cursor{
				ID:    l.ID,
				Value: l.State,
			}
		},
	}
	// LocationOrderFieldSuburb orders Location by suburb.
	LocationOrderFieldSuburb = &LocationOrderField{
		field: location.FieldSuburb,
		toCursor: func(l *Location) Cursor {
			return Cursor{
				ID:    l.ID,
				Value: l.Suburb,
			}
		},
	}
	// LocationOrderFieldStreetType orders Location by street_type.
	LocationOrderFieldStreetType = &LocationOrderField{
		field: location.FieldStreetType,
		toCursor: func(l *Location) Cursor {
			return Cursor{
				ID:    l.ID,
				Value: l.StreetType,
			}
		},
	}
	// LocationOrderFieldStreetName orders Location by street_name.
	LocationOrderFieldStreetName = &LocationOrderField{
		field: location.FieldStreetName,
		toCursor: func(l *Location) Cursor {
			return Cursor{
				ID:    l.ID,
				Value: l.StreetName,
			}
		},
	}
)
View Source
var (
	// PhoneOrderFieldTitle orders Phone by title.
	PhoneOrderFieldTitle = &PhoneOrderField{
		field: phone.FieldTitle,
		toCursor: func(ph *Phone) Cursor {
			return Cursor{
				ID:    ph.ID,
				Value: ph.Title,
			}
		},
	}
	// PhoneOrderFieldDescription orders Phone by description.
	PhoneOrderFieldDescription = &PhoneOrderField{
		field: phone.FieldDescription,
		toCursor: func(ph *Phone) Cursor {
			return Cursor{
				ID:    ph.ID,
				Value: ph.Description,
			}
		},
	}
	// PhoneOrderFieldNumber orders Phone by number.
	PhoneOrderFieldNumber = &PhoneOrderField{
		field: phone.FieldNumber,
		toCursor: func(ph *Phone) Cursor {
			return Cursor{
				ID:    ph.ID,
				Value: ph.Number,
			}
		},
	}
	// PhoneOrderFieldType orders Phone by type.
	PhoneOrderFieldType = &PhoneOrderField{
		field: phone.FieldType,
		toCursor: func(ph *Phone) Cursor {
			return Cursor{
				ID:    ph.ID,
				Value: ph.Type,
			}
		},
	}
)
View Source
var (
	// ProductOrderFieldName orders Product by name.
	ProductOrderFieldName = &ProductOrderField{
		field: product.FieldName,
		toCursor: func(pr *Product) Cursor {
			return Cursor{
				ID:    pr.ID,
				Value: pr.Name,
			}
		},
	}
	// ProductOrderFieldDescription orders Product by description.
	ProductOrderFieldDescription = &ProductOrderField{
		field: product.FieldDescription,
		toCursor: func(pr *Product) Cursor {
			return Cursor{
				ID:    pr.ID,
				Value: pr.Description,
			}
		},
	}
	// ProductOrderFieldImage orders Product by image.
	ProductOrderFieldImage = &ProductOrderField{
		field: product.FieldImage,
		toCursor: func(pr *Product) Cursor {
			return Cursor{
				ID:    pr.ID,
				Value: pr.Image,
			}
		},
	}
	// ProductOrderFieldURL orders Product by url.
	ProductOrderFieldURL = &ProductOrderField{
		field: product.FieldURL,
		toCursor: func(pr *Product) Cursor {
			return Cursor{
				ID:    pr.ID,
				Value: pr.URL,
			}
		},
	}
	// ProductOrderFieldLastSell orders Product by last_sell.
	ProductOrderFieldLastSell = &ProductOrderField{
		field: product.FieldLastSell,
		toCursor: func(pr *Product) Cursor {
			return Cursor{
				ID:    pr.ID,
				Value: pr.LastSell,
			}
		},
	}
	// ProductOrderFieldCreatedAt orders Product by created_at.
	ProductOrderFieldCreatedAt = &ProductOrderField{
		field: product.FieldCreatedAt,
		toCursor: func(pr *Product) Cursor {
			return Cursor{
				ID:    pr.ID,
				Value: pr.CreatedAt,
			}
		},
	}
	// ProductOrderFieldStatus orders Product by status.
	ProductOrderFieldStatus = &ProductOrderField{
		field: product.FieldStatus,
		toCursor: func(pr *Product) Cursor {
			return Cursor{
				ID:    pr.ID,
				Value: pr.Status,
			}
		},
	}
	// ProductOrderFieldBuildStatus orders Product by build_status.
	ProductOrderFieldBuildStatus = &ProductOrderField{
		field: product.FieldBuildStatus,
		toCursor: func(pr *Product) Cursor {
			return Cursor{
				ID:    pr.ID,
				Value: pr.BuildStatus,
			}
		},
	}
)
View Source
var (
	// VendorOrderFieldName orders Vendor by name.
	VendorOrderFieldName = &VendorOrderField{
		field: vendor.FieldName,
		toCursor: func(v *Vendor) Cursor {
			return Cursor{
				ID:    v.ID,
				Value: v.Name,
			}
		},
	}
	// VendorOrderFieldSchema orders Vendor by schema.
	VendorOrderFieldSchema = &VendorOrderField{
		field: vendor.FieldSchema,
		toCursor: func(v *Vendor) Cursor {
			return Cursor{
				ID:    v.ID,
				Value: v.Schema,
			}
		},
	}
)
View Source
var (
	// WarehouseOrderFieldName orders Warehouse by name.
	WarehouseOrderFieldName = &WarehouseOrderField{
		field: warehouse.FieldName,
		toCursor: func(w *Warehouse) Cursor {
			return Cursor{
				ID:    w.ID,
				Value: w.Name,
			}
		},
	}
	// WarehouseOrderFieldLastUpdate orders Warehouse by last_update.
	WarehouseOrderFieldLastUpdate = &WarehouseOrderField{
		field: warehouse.FieldLastUpdate,
		toCursor: func(w *Warehouse) Cursor {
			return Cursor{
				ID:    w.ID,
				Value: w.LastUpdate,
			}
		},
	}
	// WarehouseOrderFieldEnabled orders Warehouse by enabled.
	WarehouseOrderFieldEnabled = &WarehouseOrderField{
		field: warehouse.FieldEnabled,
		toCursor: func(w *Warehouse) Cursor {
			return Cursor{
				ID:    w.ID,
				Value: w.Enabled,
			}
		},
	}
)
View Source
var (
	// WebsiteOrderFieldTitle orders Website by title.
	WebsiteOrderFieldTitle = &WebsiteOrderField{
		field: website.FieldTitle,
		toCursor: func(w *Website) Cursor {
			return Cursor{
				ID:    w.ID,
				Value: w.Title,
			}
		},
	}
	// WebsiteOrderFieldDescription orders Website by description.
	WebsiteOrderFieldDescription = &WebsiteOrderField{
		field: website.FieldDescription,
		toCursor: func(w *Website) Cursor {
			return Cursor{
				ID:    w.ID,
				Value: w.Description,
			}
		},
	}
	// WebsiteOrderFieldURL orders Website by url.
	WebsiteOrderFieldURL = &WebsiteOrderField{
		field: website.FieldURL,
		toCursor: func(w *Website) Cursor {
			return Cursor{
				ID:    w.ID,
				Value: w.URL,
			}
		},
	}
)
View Source
var DefaultCompanyOrder = &CompanyOrder{
	Direction: OrderDirectionAsc,
	Field: &CompanyOrderField{
		field: company.FieldID,
		toCursor: func(c *Company) Cursor {
			return Cursor{ID: c.ID}
		},
	},
}

DefaultCompanyOrder is the default ordering of Company.

View Source
var DefaultCountryOrder = &CountryOrder{
	Direction: OrderDirectionAsc,
	Field: &CountryOrderField{
		field: country.FieldID,
		toCursor: func(c *Country) Cursor {
			return Cursor{ID: c.ID}
		},
	},
}

DefaultCountryOrder is the default ordering of Country.

View Source
var DefaultEmailOrder = &EmailOrder{
	Direction: OrderDirectionAsc,
	Field: &EmailOrderField{
		field: email.FieldID,
		toCursor: func(e *Email) Cursor {
			return Cursor{ID: e.ID}
		},
	},
}

DefaultEmailOrder is the default ordering of Email.

View Source
var DefaultImageOrder = &ImageOrder{
	Direction: OrderDirectionAsc,
	Field: &ImageOrderField{
		field: image.FieldID,
		toCursor: func(i *Image) Cursor {
			return Cursor{ID: i.ID}
		},
	},
}

DefaultImageOrder is the default ordering of Image.

View Source
var DefaultLocationOrder = &LocationOrder{
	Direction: OrderDirectionAsc,
	Field: &LocationOrderField{
		field: location.FieldID,
		toCursor: func(l *Location) Cursor {
			return Cursor{ID: l.ID}
		},
	},
}

DefaultLocationOrder is the default ordering of Location.

View Source
var DefaultPhoneOrder = &PhoneOrder{
	Direction: OrderDirectionAsc,
	Field: &PhoneOrderField{
		field: phone.FieldID,
		toCursor: func(ph *Phone) Cursor {
			return Cursor{ID: ph.ID}
		},
	},
}

DefaultPhoneOrder is the default ordering of Phone.

View Source
var DefaultProductOrder = &ProductOrder{
	Direction: OrderDirectionAsc,
	Field: &ProductOrderField{
		field: product.FieldID,
		toCursor: func(pr *Product) Cursor {
			return Cursor{ID: pr.ID}
		},
	},
}

DefaultProductOrder is the default ordering of Product.

View Source
var DefaultVendorOrder = &VendorOrder{
	Direction: OrderDirectionAsc,
	Field: &VendorOrderField{
		field: vendor.FieldID,
		toCursor: func(v *Vendor) Cursor {
			return Cursor{ID: v.ID}
		},
	},
}

DefaultVendorOrder is the default ordering of Vendor.

View Source
var DefaultWarehouseOrder = &WarehouseOrder{
	Direction: OrderDirectionAsc,
	Field: &WarehouseOrderField{
		field: warehouse.FieldID,
		toCursor: func(w *Warehouse) Cursor {
			return Cursor{ID: w.ID}
		},
	},
}

DefaultWarehouseOrder is the default ordering of Warehouse.

View Source
var DefaultWebsiteOrder = &WebsiteOrder{
	Direction: OrderDirectionAsc,
	Field: &WebsiteOrderField{
		field: website.FieldID,
		toCursor: func(w *Website) Cursor {
			return Cursor{ID: w.ID}
		},
	},
}

DefaultWebsiteOrder is the default ordering of Website.

View Source
var ErrEmptyCompanyWhereInput = errors.New("ent: empty predicate CompanyWhereInput")

ErrEmptyCompanyWhereInput is returned in case the CompanyWhereInput is empty.

View Source
var ErrEmptyCountryWhereInput = errors.New("ent: empty predicate CountryWhereInput")

ErrEmptyCountryWhereInput is returned in case the CountryWhereInput is empty.

View Source
var ErrEmptyEmailWhereInput = errors.New("ent: empty predicate EmailWhereInput")

ErrEmptyEmailWhereInput is returned in case the EmailWhereInput is empty.

View Source
var ErrEmptyImageWhereInput = errors.New("ent: empty predicate ImageWhereInput")

ErrEmptyImageWhereInput is returned in case the ImageWhereInput is empty.

View Source
var ErrEmptyLocationWhereInput = errors.New("ent: empty predicate LocationWhereInput")

ErrEmptyLocationWhereInput is returned in case the LocationWhereInput is empty.

View Source
var ErrEmptyPhoneWhereInput = errors.New("ent: empty predicate PhoneWhereInput")

ErrEmptyPhoneWhereInput is returned in case the PhoneWhereInput is empty.

View Source
var ErrEmptyProductWhereInput = errors.New("ent: empty predicate ProductWhereInput")

ErrEmptyProductWhereInput is returned in case the ProductWhereInput is empty.

View Source
var ErrEmptyVendorWhereInput = errors.New("ent: empty predicate VendorWhereInput")

ErrEmptyVendorWhereInput is returned in case the VendorWhereInput is empty.

View Source
var ErrEmptyWarehouseWhereInput = errors.New("ent: empty predicate WarehouseWhereInput")

ErrEmptyWarehouseWhereInput is returned in case the WarehouseWhereInput is empty.

View Source
var ErrEmptyWebsiteWhereInput = errors.New("ent: empty predicate WebsiteWhereInput")

ErrEmptyWebsiteWhereInput is returned in case the WebsiteWhereInput is empty.

Functions

func IsConstraintError

func IsConstraintError(err error) bool

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

func IsNotFound

func IsNotFound(err error) bool

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

func IsNotLoaded

func IsNotLoaded(err error) bool

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

func IsNotSingular

func IsNotSingular(err error) bool

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

func IsValidationError

func IsValidationError(err error) bool

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

func MaskNotFound

func MaskNotFound(err error) error

MaskNotFound masks not found error.

func NewContext

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

NewContext returns a new context with the given Client attached.

func NewTxContext

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

NewTxContext returns a new context with the given Tx attached.

func OpenTxFromContext

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

OpenTxFromContext open transactions from client stored in context.

Types

type AggregateFunc

type AggregateFunc func(*sql.Selector) string

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

func As

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

GroupBy(field1, field2).
Aggregate(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
	// Company is the client for interacting with the Company builders.
	Company *CompanyClient
	// Country is the client for interacting with the Country builders.
	Country *CountryClient
	// Email is the client for interacting with the Email builders.
	Email *EmailClient
	// Image is the client for interacting with the Image builders.
	Image *ImageClient
	// Location is the client for interacting with the Location builders.
	Location *LocationClient
	// Phone is the client for interacting with the Phone builders.
	Phone *PhoneClient
	// Product is the client for interacting with the Product builders.
	Product *ProductClient
	// Vendor is the client for interacting with the Vendor builders.
	Vendor *VendorClient
	// Warehouse is the client for interacting with the Warehouse builders.
	Warehouse *WarehouseClient
	// Website is the client for interacting with the Website builders.
	Website *WebsiteClient
	// 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().
	Company.
	Query().
	Count(ctx)

func (*Client) Intercept

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

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

func (*Client) Mutate

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

Mutate implements the ent.Mutator interface.

func (*Client) Noder

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

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

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

func (*Client) Noders

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

func (*Client) OpenTx

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

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

func (*Client) Tx

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

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

func (*Client) Use

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

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

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 Companies

type Companies []*Company

Companies is a parsable slice of Company.

type Company

type Company struct {

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

Company is the model entity for the Company schema.

func (*Company) Countries

func (c *Company) Countries(
	ctx context.Context, after *Cursor, first *int, before *Cursor, last *int, orderBy *CountryOrder, where *CountryWhereInput,
) (*CountryConnection, error)

func (*Company) CoverImage

func (c *Company) CoverImage(ctx context.Context) (*Image, error)

func (*Company) Emails

func (c *Company) Emails(
	ctx context.Context, after *Cursor, first *int, before *Cursor, last *int, orderBy *EmailOrder, where *EmailWhereInput,
) (*EmailConnection, error)

func (*Company) GalleryImages

func (c *Company) GalleryImages(
	ctx context.Context, after *Cursor, first *int, before *Cursor, last *int, orderBy *ImageOrder, where *ImageWhereInput,
) (*ImageConnection, error)

func (*Company) IsNode

func (n *Company) IsNode()

IsNode implements the Node interface check for GQLGen.

func (*Company) Locations

func (c *Company) Locations(
	ctx context.Context, after *Cursor, first *int, before *Cursor, last *int, orderBy *LocationOrder, where *LocationWhereInput,
) (*LocationConnection, error)

func (*Company) LogoImage

func (c *Company) LogoImage(ctx context.Context) (*Image, error)

func (*Company) NamedCountries

func (c *Company) NamedCountries(name string) ([]*Country, error)

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

func (*Company) NamedEmails

func (c *Company) NamedEmails(name string) ([]*Email, error)

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

func (*Company) NamedGalleryImages

func (c *Company) NamedGalleryImages(name string) ([]*Image, error)

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

func (*Company) NamedLocations

func (c *Company) NamedLocations(name string) ([]*Location, error)

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

func (*Company) NamedPhones

func (c *Company) NamedPhones(name string) ([]*Phone, error)

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

func (*Company) NamedWebsites

func (c *Company) NamedWebsites(name string) ([]*Website, error)

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

func (*Company) Phones

func (c *Company) Phones(
	ctx context.Context, after *Cursor, first *int, before *Cursor, last *int, orderBy *PhoneOrder, where *PhoneWhereInput,
) (*PhoneConnection, error)

func (*Company) QueryCountries

func (c *Company) QueryCountries() *CountryQuery

QueryCountries queries the "countries" edge of the Company entity.

func (*Company) QueryCoverImage

func (c *Company) QueryCoverImage() *ImageQuery

QueryCoverImage queries the "cover_image" edge of the Company entity.

func (*Company) QueryEmails

func (c *Company) QueryEmails() *EmailQuery

QueryEmails queries the "emails" edge of the Company entity.

func (*Company) QueryGalleryImages

func (c *Company) QueryGalleryImages() *ImageQuery

QueryGalleryImages queries the "gallery_images" edge of the Company entity.

func (*Company) QueryLocations

func (c *Company) QueryLocations() *LocationQuery

QueryLocations queries the "locations" edge of the Company entity.

func (*Company) QueryLogoImage

func (c *Company) QueryLogoImage() *ImageQuery

QueryLogoImage queries the "logo_image" edge of the Company entity.

func (*Company) QueryPhones

func (c *Company) QueryPhones() *PhoneQuery

QueryPhones queries the "phones" edge of the Company entity.

func (*Company) QueryWebsites

func (c *Company) QueryWebsites() *WebsiteQuery

QueryWebsites queries the "websites" edge of the Company entity.

func (*Company) String

func (c *Company) String() string

String implements the fmt.Stringer.

func (*Company) ToEdge

func (c *Company) ToEdge(order *CompanyOrder) *CompanyEdge

ToEdge converts Company into CompanyEdge.

func (*Company) Unwrap

func (c *Company) Unwrap() *Company

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

func (c *Company) Update() *CompanyUpdateOne

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

func (*Company) Websites

func (c *Company) Websites(
	ctx context.Context, after *Cursor, first *int, before *Cursor, last *int, orderBy *WebsiteOrder, where *WebsiteWhereInput,
) (*WebsiteConnection, error)

type CompanyClient

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

CompanyClient is a client for the Company schema.

func NewCompanyClient

func NewCompanyClient(c config) *CompanyClient

NewCompanyClient returns a client for the Company from the given config.

func (*CompanyClient) Create

func (c *CompanyClient) Create() *CompanyCreate

Create returns a builder for creating a Company entity.

func (*CompanyClient) CreateBulk

func (c *CompanyClient) CreateBulk(builders ...*CompanyCreate) *CompanyCreateBulk

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

func (*CompanyClient) Delete

func (c *CompanyClient) Delete() *CompanyDelete

Delete returns a delete builder for Company.

func (*CompanyClient) DeleteOne

func (c *CompanyClient) DeleteOne(co *Company) *CompanyDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*CompanyClient) DeleteOneID

func (c *CompanyClient) DeleteOneID(id uuid.UUID) *CompanyDeleteOne

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

func (*CompanyClient) Get

func (c *CompanyClient) Get(ctx context.Context, id uuid.UUID) (*Company, error)

Get returns a Company entity by its id.

func (*CompanyClient) GetX

func (c *CompanyClient) GetX(ctx context.Context, id uuid.UUID) *Company

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

func (*CompanyClient) Hooks

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

Hooks returns the client hooks.

func (*CompanyClient) Intercept

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

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

func (*CompanyClient) Interceptors

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

Interceptors returns the client interceptors.

func (*CompanyClient) Query

func (c *CompanyClient) Query() *CompanyQuery

Query returns a query builder for Company.

func (*CompanyClient) QueryCountries

func (c *CompanyClient) QueryCountries(co *Company) *CountryQuery

QueryCountries queries the countries edge of a Company.

func (*CompanyClient) QueryCoverImage

func (c *CompanyClient) QueryCoverImage(co *Company) *ImageQuery

QueryCoverImage queries the cover_image edge of a Company.

func (*CompanyClient) QueryEmails

func (c *CompanyClient) QueryEmails(co *Company) *EmailQuery

QueryEmails queries the emails edge of a Company.

func (*CompanyClient) QueryGalleryImages

func (c *CompanyClient) QueryGalleryImages(co *Company) *ImageQuery

QueryGalleryImages queries the gallery_images edge of a Company.

func (*CompanyClient) QueryLocations

func (c *CompanyClient) QueryLocations(co *Company) *LocationQuery

QueryLocations queries the locations edge of a Company.

func (*CompanyClient) QueryLogoImage

func (c *CompanyClient) QueryLogoImage(co *Company) *ImageQuery

QueryLogoImage queries the logo_image edge of a Company.

func (*CompanyClient) QueryPhones

func (c *CompanyClient) QueryPhones(co *Company) *PhoneQuery

QueryPhones queries the phones edge of a Company.

func (*CompanyClient) QueryWebsites

func (c *CompanyClient) QueryWebsites(co *Company) *WebsiteQuery

QueryWebsites queries the websites edge of a Company.

func (*CompanyClient) Update

func (c *CompanyClient) Update() *CompanyUpdate

Update returns an update builder for Company.

func (*CompanyClient) UpdateOne

func (c *CompanyClient) UpdateOne(co *Company) *CompanyUpdateOne

UpdateOne returns an update builder for the given entity.

func (*CompanyClient) UpdateOneID

func (c *CompanyClient) UpdateOneID(id uuid.UUID) *CompanyUpdateOne

UpdateOneID returns an update builder for the given id.

func (*CompanyClient) Use

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

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

type CompanyConnection

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

CompanyConnection is the connection containing edges to Company.

type CompanyCreate

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

CompanyCreate is the builder for creating a Company entity.

func (*CompanyCreate) AddCountries

func (cc *CompanyCreate) AddCountries(c ...*Country) *CompanyCreate

AddCountries adds the "countries" edges to the Country entity.

func (*CompanyCreate) AddCountryIDs

func (cc *CompanyCreate) AddCountryIDs(ids ...uuid.UUID) *CompanyCreate

AddCountryIDs adds the "countries" edge to the Country entity by IDs.

func (*CompanyCreate) AddEmailIDs

func (cc *CompanyCreate) AddEmailIDs(ids ...uuid.UUID) *CompanyCreate

AddEmailIDs adds the "emails" edge to the Email entity by IDs.

func (*CompanyCreate) AddEmails

func (cc *CompanyCreate) AddEmails(e ...*Email) *CompanyCreate

AddEmails adds the "emails" edges to the Email entity.

func (*CompanyCreate) AddGalleryImageIDs

func (cc *CompanyCreate) AddGalleryImageIDs(ids ...uuid.UUID) *CompanyCreate

AddGalleryImageIDs adds the "gallery_images" edge to the Image entity by IDs.

func (*CompanyCreate) AddGalleryImages

func (cc *CompanyCreate) AddGalleryImages(i ...*Image) *CompanyCreate

AddGalleryImages adds the "gallery_images" edges to the Image entity.

func (*CompanyCreate) AddLocationIDs

func (cc *CompanyCreate) AddLocationIDs(ids ...uuid.UUID) *CompanyCreate

AddLocationIDs adds the "locations" edge to the Location entity by IDs.

func (*CompanyCreate) AddLocations

func (cc *CompanyCreate) AddLocations(l ...*Location) *CompanyCreate

AddLocations adds the "locations" edges to the Location entity.

func (*CompanyCreate) AddPhoneIDs

func (cc *CompanyCreate) AddPhoneIDs(ids ...uuid.UUID) *CompanyCreate

AddPhoneIDs adds the "phones" edge to the Phone entity by IDs.

func (*CompanyCreate) AddPhones

func (cc *CompanyCreate) AddPhones(p ...*Phone) *CompanyCreate

AddPhones adds the "phones" edges to the Phone entity.

func (*CompanyCreate) AddWebsiteIDs

func (cc *CompanyCreate) AddWebsiteIDs(ids ...uuid.UUID) *CompanyCreate

AddWebsiteIDs adds the "websites" edge to the Website entity by IDs.

func (*CompanyCreate) AddWebsites

func (cc *CompanyCreate) AddWebsites(w ...*Website) *CompanyCreate

AddWebsites adds the "websites" edges to the Website entity.

func (*CompanyCreate) Exec

func (cc *CompanyCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*CompanyCreate) ExecX

func (cc *CompanyCreate) ExecX(ctx context.Context)

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

func (*CompanyCreate) Mutation

func (cc *CompanyCreate) Mutation() *CompanyMutation

Mutation returns the CompanyMutation object of the builder.

func (*CompanyCreate) Save

func (cc *CompanyCreate) Save(ctx context.Context) (*Company, error)

Save creates the Company in the database.

func (*CompanyCreate) SaveX

func (cc *CompanyCreate) SaveX(ctx context.Context) *Company

SaveX calls Save and panics if Save returns an error.

func (*CompanyCreate) SetCoverImage

func (cc *CompanyCreate) SetCoverImage(i *Image) *CompanyCreate

SetCoverImage sets the "cover_image" edge to the Image entity.

func (*CompanyCreate) SetCoverImageID

func (cc *CompanyCreate) SetCoverImageID(id uuid.UUID) *CompanyCreate

SetCoverImageID sets the "cover_image" edge to the Image entity by ID.

func (*CompanyCreate) SetDescription

func (cc *CompanyCreate) SetDescription(s string) *CompanyCreate

SetDescription sets the "description" field.

func (*CompanyCreate) SetID

func (cc *CompanyCreate) SetID(u uuid.UUID) *CompanyCreate

SetID sets the "id" field.

func (*CompanyCreate) SetInput

SetInput applies the change-set in the CreateCompanyInput on the CompanyCreate builder.

func (*CompanyCreate) SetLogoImage

func (cc *CompanyCreate) SetLogoImage(i *Image) *CompanyCreate

SetLogoImage sets the "logo_image" edge to the Image entity.

func (*CompanyCreate) SetLogoImageID

func (cc *CompanyCreate) SetLogoImageID(id uuid.UUID) *CompanyCreate

SetLogoImageID sets the "logo_image" edge to the Image entity by ID.

func (*CompanyCreate) SetName

func (cc *CompanyCreate) SetName(s string) *CompanyCreate

SetName sets the "name" field.

func (*CompanyCreate) SetNillableCoverImageID

func (cc *CompanyCreate) SetNillableCoverImageID(id *uuid.UUID) *CompanyCreate

SetNillableCoverImageID sets the "cover_image" edge to the Image entity by ID if the given value is not nil.

func (*CompanyCreate) SetNillableID

func (cc *CompanyCreate) SetNillableID(u *uuid.UUID) *CompanyCreate

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

func (*CompanyCreate) SetNillableLogoImageID

func (cc *CompanyCreate) SetNillableLogoImageID(id *uuid.UUID) *CompanyCreate

SetNillableLogoImageID sets the "logo_image" edge to the Image entity by ID if the given value is not nil.

type CompanyCreateBulk

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

CompanyCreateBulk is the builder for creating many Company entities in bulk.

func (*CompanyCreateBulk) Exec

func (ccb *CompanyCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*CompanyCreateBulk) ExecX

func (ccb *CompanyCreateBulk) ExecX(ctx context.Context)

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

func (*CompanyCreateBulk) Save

func (ccb *CompanyCreateBulk) Save(ctx context.Context) ([]*Company, error)

Save creates the Company entities in the database.

func (*CompanyCreateBulk) SaveX

func (ccb *CompanyCreateBulk) SaveX(ctx context.Context) []*Company

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

type CompanyDelete

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

CompanyDelete is the builder for deleting a Company entity.

func (*CompanyDelete) Exec

func (cd *CompanyDelete) Exec(ctx context.Context) (int, error)

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

func (*CompanyDelete) ExecX

func (cd *CompanyDelete) ExecX(ctx context.Context) int

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

func (*CompanyDelete) Where

func (cd *CompanyDelete) Where(ps ...predicate.Company) *CompanyDelete

Where appends a list predicates to the CompanyDelete builder.

type CompanyDeleteOne

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

CompanyDeleteOne is the builder for deleting a single Company entity.

func (*CompanyDeleteOne) Exec

func (cdo *CompanyDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*CompanyDeleteOne) ExecX

func (cdo *CompanyDeleteOne) ExecX(ctx context.Context)

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

type CompanyEdge

type CompanyEdge struct {
	Node   *Company `json:"node"`
	Cursor Cursor   `json:"cursor"`
}

CompanyEdge is the edge representation of Company.

type CompanyEdges

type CompanyEdges struct {
	// Countries holds the value of the countries edge.
	Countries []*Country `json:"countries,omitempty"`
	// Phones holds the value of the phones edge.
	Phones []*Phone `json:"phones,omitempty"`
	// Emails holds the value of the emails edge.
	Emails []*Email `json:"emails,omitempty"`
	// Websites holds the value of the websites edge.
	Websites []*Website `json:"websites,omitempty"`
	// Locations holds the value of the locations edge.
	Locations []*Location `json:"locations,omitempty"`
	// LogoImage holds the value of the logo_image edge.
	LogoImage *Image `json:"logo_image,omitempty"`
	// CoverImage holds the value of the cover_image edge.
	CoverImage *Image `json:"cover_image,omitempty"`
	// GalleryImages holds the value of the gallery_images edge.
	GalleryImages []*Image `json:"gallery_images,omitempty"`
	// contains filtered or unexported fields
}

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

func (CompanyEdges) CountriesOrErr

func (e CompanyEdges) CountriesOrErr() ([]*Country, error)

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

func (CompanyEdges) CoverImageOrErr

func (e CompanyEdges) CoverImageOrErr() (*Image, error)

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

func (CompanyEdges) EmailsOrErr

func (e CompanyEdges) EmailsOrErr() ([]*Email, error)

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

func (CompanyEdges) GalleryImagesOrErr

func (e CompanyEdges) GalleryImagesOrErr() ([]*Image, error)

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

func (CompanyEdges) LocationsOrErr

func (e CompanyEdges) LocationsOrErr() ([]*Location, error)

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

func (CompanyEdges) LogoImageOrErr

func (e CompanyEdges) LogoImageOrErr() (*Image, error)

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

func (CompanyEdges) PhonesOrErr

func (e CompanyEdges) PhonesOrErr() ([]*Phone, error)

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

func (CompanyEdges) WebsitesOrErr

func (e CompanyEdges) WebsitesOrErr() ([]*Website, error)

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

type CompanyGroupBy

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

CompanyGroupBy is the group-by builder for Company entities.

func (*CompanyGroupBy) Aggregate

func (cgb *CompanyGroupBy) Aggregate(fns ...AggregateFunc) *CompanyGroupBy

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

func (*CompanyGroupBy) Bool

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

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

func (*CompanyGroupBy) BoolX

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

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

func (*CompanyGroupBy) Bools

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

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

func (*CompanyGroupBy) BoolsX

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

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

func (*CompanyGroupBy) Float64

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

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

func (*CompanyGroupBy) Float64X

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

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

func (*CompanyGroupBy) Float64s

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

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

func (*CompanyGroupBy) Float64sX

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

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

func (*CompanyGroupBy) Int

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

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

func (*CompanyGroupBy) IntX

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

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

func (*CompanyGroupBy) Ints

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

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

func (*CompanyGroupBy) IntsX

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

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

func (*CompanyGroupBy) Scan

func (cgb *CompanyGroupBy) Scan(ctx context.Context, v any) error

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

func (*CompanyGroupBy) ScanX

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

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

func (*CompanyGroupBy) String

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

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

func (*CompanyGroupBy) StringX

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

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

func (*CompanyGroupBy) Strings

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

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

func (*CompanyGroupBy) StringsX

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

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

type CompanyMutation

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

CompanyMutation represents an operation that mutates the Company nodes in the graph.

func (*CompanyMutation) AddCountryIDs

func (m *CompanyMutation) AddCountryIDs(ids ...uuid.UUID)

AddCountryIDs adds the "countries" edge to the Country entity by ids.

func (*CompanyMutation) AddEmailIDs

func (m *CompanyMutation) AddEmailIDs(ids ...uuid.UUID)

AddEmailIDs adds the "emails" edge to the Email entity by ids.

func (*CompanyMutation) AddField

func (m *CompanyMutation) 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 (*CompanyMutation) AddGalleryImageIDs

func (m *CompanyMutation) AddGalleryImageIDs(ids ...uuid.UUID)

AddGalleryImageIDs adds the "gallery_images" edge to the Image entity by ids.

func (*CompanyMutation) AddLocationIDs

func (m *CompanyMutation) AddLocationIDs(ids ...uuid.UUID)

AddLocationIDs adds the "locations" edge to the Location entity by ids.

func (*CompanyMutation) AddPhoneIDs

func (m *CompanyMutation) AddPhoneIDs(ids ...uuid.UUID)

AddPhoneIDs adds the "phones" edge to the Phone entity by ids.

func (*CompanyMutation) AddWebsiteIDs

func (m *CompanyMutation) AddWebsiteIDs(ids ...uuid.UUID)

AddWebsiteIDs adds the "websites" edge to the Website entity by ids.

func (*CompanyMutation) AddedEdges

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

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

func (*CompanyMutation) AddedField

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

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

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

func (*CompanyMutation) AddedIDs

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

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

func (*CompanyMutation) ClearCountries

func (m *CompanyMutation) ClearCountries()

ClearCountries clears the "countries" edge to the Country entity.

func (*CompanyMutation) ClearCoverImage

func (m *CompanyMutation) ClearCoverImage()

ClearCoverImage clears the "cover_image" edge to the Image entity.

func (*CompanyMutation) ClearEdge

func (m *CompanyMutation) 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 (*CompanyMutation) ClearEmails

func (m *CompanyMutation) ClearEmails()

ClearEmails clears the "emails" edge to the Email entity.

func (*CompanyMutation) ClearField

func (m *CompanyMutation) 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 (*CompanyMutation) ClearGalleryImages

func (m *CompanyMutation) ClearGalleryImages()

ClearGalleryImages clears the "gallery_images" edge to the Image entity.

func (*CompanyMutation) ClearLocations

func (m *CompanyMutation) ClearLocations()

ClearLocations clears the "locations" edge to the Location entity.

func (*CompanyMutation) ClearLogoImage

func (m *CompanyMutation) ClearLogoImage()

ClearLogoImage clears the "logo_image" edge to the Image entity.

func (*CompanyMutation) ClearPhones

func (m *CompanyMutation) ClearPhones()

ClearPhones clears the "phones" edge to the Phone entity.

func (*CompanyMutation) ClearWebsites

func (m *CompanyMutation) ClearWebsites()

ClearWebsites clears the "websites" edge to the Website entity.

func (*CompanyMutation) ClearedEdges

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

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

func (*CompanyMutation) ClearedFields

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

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

func (CompanyMutation) Client

func (m CompanyMutation) 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 (*CompanyMutation) CountriesCleared

func (m *CompanyMutation) CountriesCleared() bool

CountriesCleared reports if the "countries" edge to the Country entity was cleared.

func (*CompanyMutation) CountriesIDs

func (m *CompanyMutation) CountriesIDs() (ids []uuid.UUID)

CountriesIDs returns the "countries" edge IDs in the mutation.

func (*CompanyMutation) CoverImageCleared

func (m *CompanyMutation) CoverImageCleared() bool

CoverImageCleared reports if the "cover_image" edge to the Image entity was cleared.

func (*CompanyMutation) CoverImageID

func (m *CompanyMutation) CoverImageID() (id uuid.UUID, exists bool)

CoverImageID returns the "cover_image" edge ID in the mutation.

func (*CompanyMutation) CoverImageIDs

func (m *CompanyMutation) CoverImageIDs() (ids []uuid.UUID)

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

func (*CompanyMutation) Description

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

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

func (*CompanyMutation) EdgeCleared

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

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

func (*CompanyMutation) EmailsCleared

func (m *CompanyMutation) EmailsCleared() bool

EmailsCleared reports if the "emails" edge to the Email entity was cleared.

func (*CompanyMutation) EmailsIDs

func (m *CompanyMutation) EmailsIDs() (ids []uuid.UUID)

EmailsIDs returns the "emails" edge IDs in the mutation.

func (*CompanyMutation) Field

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

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

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

func (*CompanyMutation) Fields

func (m *CompanyMutation) 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 (*CompanyMutation) GalleryImagesCleared

func (m *CompanyMutation) GalleryImagesCleared() bool

GalleryImagesCleared reports if the "gallery_images" edge to the Image entity was cleared.

func (*CompanyMutation) GalleryImagesIDs

func (m *CompanyMutation) GalleryImagesIDs() (ids []uuid.UUID)

GalleryImagesIDs returns the "gallery_images" edge IDs in the mutation.

func (*CompanyMutation) ID

func (m *CompanyMutation) ID() (id uuid.UUID, 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 (*CompanyMutation) IDs

func (m *CompanyMutation) IDs(ctx context.Context) ([]uuid.UUID, 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 (*CompanyMutation) LocationsCleared

func (m *CompanyMutation) LocationsCleared() bool

LocationsCleared reports if the "locations" edge to the Location entity was cleared.

func (*CompanyMutation) LocationsIDs

func (m *CompanyMutation) LocationsIDs() (ids []uuid.UUID)

LocationsIDs returns the "locations" edge IDs in the mutation.

func (*CompanyMutation) LogoImageCleared

func (m *CompanyMutation) LogoImageCleared() bool

LogoImageCleared reports if the "logo_image" edge to the Image entity was cleared.

func (*CompanyMutation) LogoImageID

func (m *CompanyMutation) LogoImageID() (id uuid.UUID, exists bool)

LogoImageID returns the "logo_image" edge ID in the mutation.

func (*CompanyMutation) LogoImageIDs

func (m *CompanyMutation) LogoImageIDs() (ids []uuid.UUID)

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

func (*CompanyMutation) Name

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

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

func (*CompanyMutation) OldDescription

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

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

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

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

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

func (m *CompanyMutation) Op() Op

Op returns the operation name.

func (*CompanyMutation) PhonesCleared

func (m *CompanyMutation) PhonesCleared() bool

PhonesCleared reports if the "phones" edge to the Phone entity was cleared.

func (*CompanyMutation) PhonesIDs

func (m *CompanyMutation) PhonesIDs() (ids []uuid.UUID)

PhonesIDs returns the "phones" edge IDs in the mutation.

func (*CompanyMutation) RemoveCountryIDs

func (m *CompanyMutation) RemoveCountryIDs(ids ...uuid.UUID)

RemoveCountryIDs removes the "countries" edge to the Country entity by IDs.

func (*CompanyMutation) RemoveEmailIDs

func (m *CompanyMutation) RemoveEmailIDs(ids ...uuid.UUID)

RemoveEmailIDs removes the "emails" edge to the Email entity by IDs.

func (*CompanyMutation) RemoveGalleryImageIDs

func (m *CompanyMutation) RemoveGalleryImageIDs(ids ...uuid.UUID)

RemoveGalleryImageIDs removes the "gallery_images" edge to the Image entity by IDs.

func (*CompanyMutation) RemoveLocationIDs

func (m *CompanyMutation) RemoveLocationIDs(ids ...uuid.UUID)

RemoveLocationIDs removes the "locations" edge to the Location entity by IDs.

func (*CompanyMutation) RemovePhoneIDs

func (m *CompanyMutation) RemovePhoneIDs(ids ...uuid.UUID)

RemovePhoneIDs removes the "phones" edge to the Phone entity by IDs.

func (*CompanyMutation) RemoveWebsiteIDs

func (m *CompanyMutation) RemoveWebsiteIDs(ids ...uuid.UUID)

RemoveWebsiteIDs removes the "websites" edge to the Website entity by IDs.

func (*CompanyMutation) RemovedCountriesIDs

func (m *CompanyMutation) RemovedCountriesIDs() (ids []uuid.UUID)

RemovedCountries returns the removed IDs of the "countries" edge to the Country entity.

func (*CompanyMutation) RemovedEdges

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

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

func (*CompanyMutation) RemovedEmailsIDs

func (m *CompanyMutation) RemovedEmailsIDs() (ids []uuid.UUID)

RemovedEmails returns the removed IDs of the "emails" edge to the Email entity.

func (*CompanyMutation) RemovedGalleryImagesIDs

func (m *CompanyMutation) RemovedGalleryImagesIDs() (ids []uuid.UUID)

RemovedGalleryImages returns the removed IDs of the "gallery_images" edge to the Image entity.

func (*CompanyMutation) RemovedIDs

func (m *CompanyMutation) 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 (*CompanyMutation) RemovedLocationsIDs

func (m *CompanyMutation) RemovedLocationsIDs() (ids []uuid.UUID)

RemovedLocations returns the removed IDs of the "locations" edge to the Location entity.

func (*CompanyMutation) RemovedPhonesIDs

func (m *CompanyMutation) RemovedPhonesIDs() (ids []uuid.UUID)

RemovedPhones returns the removed IDs of the "phones" edge to the Phone entity.

func (*CompanyMutation) RemovedWebsitesIDs

func (m *CompanyMutation) RemovedWebsitesIDs() (ids []uuid.UUID)

RemovedWebsites returns the removed IDs of the "websites" edge to the Website entity.

func (*CompanyMutation) ResetCountries

func (m *CompanyMutation) ResetCountries()

ResetCountries resets all changes to the "countries" edge.

func (*CompanyMutation) ResetCoverImage

func (m *CompanyMutation) ResetCoverImage()

ResetCoverImage resets all changes to the "cover_image" edge.

func (*CompanyMutation) ResetDescription

func (m *CompanyMutation) ResetDescription()

ResetDescription resets all changes to the "description" field.

func (*CompanyMutation) ResetEdge

func (m *CompanyMutation) 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 (*CompanyMutation) ResetEmails

func (m *CompanyMutation) ResetEmails()

ResetEmails resets all changes to the "emails" edge.

func (*CompanyMutation) ResetField

func (m *CompanyMutation) 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 (*CompanyMutation) ResetGalleryImages

func (m *CompanyMutation) ResetGalleryImages()

ResetGalleryImages resets all changes to the "gallery_images" edge.

func (*CompanyMutation) ResetLocations

func (m *CompanyMutation) ResetLocations()

ResetLocations resets all changes to the "locations" edge.

func (*CompanyMutation) ResetLogoImage

func (m *CompanyMutation) ResetLogoImage()

ResetLogoImage resets all changes to the "logo_image" edge.

func (*CompanyMutation) ResetName

func (m *CompanyMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*CompanyMutation) ResetPhones

func (m *CompanyMutation) ResetPhones()

ResetPhones resets all changes to the "phones" edge.

func (*CompanyMutation) ResetWebsites

func (m *CompanyMutation) ResetWebsites()

ResetWebsites resets all changes to the "websites" edge.

func (*CompanyMutation) SetCoverImageID

func (m *CompanyMutation) SetCoverImageID(id uuid.UUID)

SetCoverImageID sets the "cover_image" edge to the Image entity by id.

func (*CompanyMutation) SetDescription

func (m *CompanyMutation) SetDescription(s string)

SetDescription sets the "description" field.

func (*CompanyMutation) SetField

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

func (m *CompanyMutation) SetID(id uuid.UUID)

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

func (*CompanyMutation) SetLogoImageID

func (m *CompanyMutation) SetLogoImageID(id uuid.UUID)

SetLogoImageID sets the "logo_image" edge to the Image entity by id.

func (*CompanyMutation) SetName

func (m *CompanyMutation) SetName(s string)

SetName sets the "name" field.

func (*CompanyMutation) SetOp

func (m *CompanyMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (CompanyMutation) Tx

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

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

func (*CompanyMutation) Type

func (m *CompanyMutation) Type() string

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

func (*CompanyMutation) WebsitesCleared

func (m *CompanyMutation) WebsitesCleared() bool

WebsitesCleared reports if the "websites" edge to the Website entity was cleared.

func (*CompanyMutation) WebsitesIDs

func (m *CompanyMutation) WebsitesIDs() (ids []uuid.UUID)

WebsitesIDs returns the "websites" edge IDs in the mutation.

func (*CompanyMutation) Where

func (m *CompanyMutation) Where(ps ...predicate.Company)

Where appends a list predicates to the CompanyMutation builder.

func (*CompanyMutation) WhereP

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

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

type CompanyOrder

type CompanyOrder struct {
	Direction OrderDirection     `json:"direction"`
	Field     *CompanyOrderField `json:"field"`
}

CompanyOrder defines the ordering of Company.

type CompanyOrderField

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

CompanyOrderField defines the ordering field of Company.

func (CompanyOrderField) MarshalGQL

func (f CompanyOrderField) MarshalGQL(w io.Writer)

MarshalGQL implements graphql.Marshaler interface.

func (CompanyOrderField) String

func (f CompanyOrderField) String() string

String implement fmt.Stringer interface.

func (*CompanyOrderField) UnmarshalGQL

func (f *CompanyOrderField) UnmarshalGQL(v interface{}) error

UnmarshalGQL implements graphql.Unmarshaler interface.

type CompanyPaginateOption

type CompanyPaginateOption func(*companyPager) error

CompanyPaginateOption enables pagination customization.

func WithCompanyFilter

func WithCompanyFilter(filter func(*CompanyQuery) (*CompanyQuery, error)) CompanyPaginateOption

WithCompanyFilter configures pagination filter.

func WithCompanyOrder

func WithCompanyOrder(order *CompanyOrder) CompanyPaginateOption

WithCompanyOrder configures pagination ordering.

type CompanyQuery

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

CompanyQuery is the builder for querying Company entities.

func (*CompanyQuery) Aggregate

func (cq *CompanyQuery) Aggregate(fns ...AggregateFunc) *CompanySelect

Aggregate returns a CompanySelect configured with the given aggregations.

func (*CompanyQuery) All

func (cq *CompanyQuery) All(ctx context.Context) ([]*Company, error)

All executes the query and returns a list of Companies.

func (*CompanyQuery) AllX

func (cq *CompanyQuery) AllX(ctx context.Context) []*Company

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

func (*CompanyQuery) Clone

func (cq *CompanyQuery) Clone() *CompanyQuery

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

func (*CompanyQuery) CollectFields

func (c *CompanyQuery) CollectFields(ctx context.Context, satisfies ...string) (*CompanyQuery, error)

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

func (*CompanyQuery) Count

func (cq *CompanyQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*CompanyQuery) CountX

func (cq *CompanyQuery) CountX(ctx context.Context) int

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

func (*CompanyQuery) Exist

func (cq *CompanyQuery) Exist(ctx context.Context) (bool, error)

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

func (*CompanyQuery) ExistX

func (cq *CompanyQuery) ExistX(ctx context.Context) bool

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

func (*CompanyQuery) First

func (cq *CompanyQuery) First(ctx context.Context) (*Company, error)

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

func (*CompanyQuery) FirstID

func (cq *CompanyQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

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

func (*CompanyQuery) FirstIDX

func (cq *CompanyQuery) FirstIDX(ctx context.Context) uuid.UUID

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

func (*CompanyQuery) FirstX

func (cq *CompanyQuery) FirstX(ctx context.Context) *Company

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

func (*CompanyQuery) GroupBy

func (cq *CompanyQuery) GroupBy(field string, fields ...string) *CompanyGroupBy

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

func (*CompanyQuery) IDs

func (cq *CompanyQuery) IDs(ctx context.Context) ([]uuid.UUID, error)

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

func (*CompanyQuery) IDsX

func (cq *CompanyQuery) IDsX(ctx context.Context) []uuid.UUID

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

func (*CompanyQuery) Limit

func (cq *CompanyQuery) Limit(limit int) *CompanyQuery

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

func (*CompanyQuery) Offset

func (cq *CompanyQuery) Offset(offset int) *CompanyQuery

Offset to start from.

func (*CompanyQuery) Only

func (cq *CompanyQuery) Only(ctx context.Context) (*Company, error)

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

func (*CompanyQuery) OnlyID

func (cq *CompanyQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

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

func (*CompanyQuery) OnlyIDX

func (cq *CompanyQuery) OnlyIDX(ctx context.Context) uuid.UUID

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

func (*CompanyQuery) OnlyX

func (cq *CompanyQuery) OnlyX(ctx context.Context) *Company

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

func (*CompanyQuery) Order

func (cq *CompanyQuery) Order(o ...OrderFunc) *CompanyQuery

Order specifies how the records should be ordered.

func (*CompanyQuery) Paginate

func (c *CompanyQuery) Paginate(
	ctx context.Context, after *Cursor, first *int,
	before *Cursor, last *int, opts ...CompanyPaginateOption,
) (*CompanyConnection, error)

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

func (*CompanyQuery) QueryCountries

func (cq *CompanyQuery) QueryCountries() *CountryQuery

QueryCountries chains the current query on the "countries" edge.

func (*CompanyQuery) QueryCoverImage

func (cq *CompanyQuery) QueryCoverImage() *ImageQuery

QueryCoverImage chains the current query on the "cover_image" edge.

func (*CompanyQuery) QueryEmails

func (cq *CompanyQuery) QueryEmails() *EmailQuery

QueryEmails chains the current query on the "emails" edge.

func (*CompanyQuery) QueryGalleryImages

func (cq *CompanyQuery) QueryGalleryImages() *ImageQuery

QueryGalleryImages chains the current query on the "gallery_images" edge.

func (*CompanyQuery) QueryLocations

func (cq *CompanyQuery) QueryLocations() *LocationQuery

QueryLocations chains the current query on the "locations" edge.

func (*CompanyQuery) QueryLogoImage

func (cq *CompanyQuery) QueryLogoImage() *ImageQuery

QueryLogoImage chains the current query on the "logo_image" edge.

func (*CompanyQuery) QueryPhones

func (cq *CompanyQuery) QueryPhones() *PhoneQuery

QueryPhones chains the current query on the "phones" edge.

func (*CompanyQuery) QueryWebsites

func (cq *CompanyQuery) QueryWebsites() *WebsiteQuery

QueryWebsites chains the current query on the "websites" edge.

func (*CompanyQuery) Select

func (cq *CompanyQuery) Select(fields ...string) *CompanySelect

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

func (*CompanyQuery) Unique

func (cq *CompanyQuery) Unique(unique bool) *CompanyQuery

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

func (cq *CompanyQuery) Where(ps ...predicate.Company) *CompanyQuery

Where adds a new predicate for the CompanyQuery builder.

func (*CompanyQuery) WithCountries

func (cq *CompanyQuery) WithCountries(opts ...func(*CountryQuery)) *CompanyQuery

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

func (*CompanyQuery) WithCoverImage

func (cq *CompanyQuery) WithCoverImage(opts ...func(*ImageQuery)) *CompanyQuery

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

func (*CompanyQuery) WithEmails

func (cq *CompanyQuery) WithEmails(opts ...func(*EmailQuery)) *CompanyQuery

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

func (*CompanyQuery) WithGalleryImages

func (cq *CompanyQuery) WithGalleryImages(opts ...func(*ImageQuery)) *CompanyQuery

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

func (*CompanyQuery) WithLocations

func (cq *CompanyQuery) WithLocations(opts ...func(*LocationQuery)) *CompanyQuery

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

func (*CompanyQuery) WithLogoImage

func (cq *CompanyQuery) WithLogoImage(opts ...func(*ImageQuery)) *CompanyQuery

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

func (*CompanyQuery) WithNamedCountries

func (cq *CompanyQuery) WithNamedCountries(name string, opts ...func(*CountryQuery)) *CompanyQuery

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

func (*CompanyQuery) WithNamedEmails

func (cq *CompanyQuery) WithNamedEmails(name string, opts ...func(*EmailQuery)) *CompanyQuery

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

func (*CompanyQuery) WithNamedGalleryImages

func (cq *CompanyQuery) WithNamedGalleryImages(name string, opts ...func(*ImageQuery)) *CompanyQuery

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

func (*CompanyQuery) WithNamedLocations

func (cq *CompanyQuery) WithNamedLocations(name string, opts ...func(*LocationQuery)) *CompanyQuery

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

func (*CompanyQuery) WithNamedPhones

func (cq *CompanyQuery) WithNamedPhones(name string, opts ...func(*PhoneQuery)) *CompanyQuery

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

func (*CompanyQuery) WithNamedWebsites

func (cq *CompanyQuery) WithNamedWebsites(name string, opts ...func(*WebsiteQuery)) *CompanyQuery

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

func (*CompanyQuery) WithPhones

func (cq *CompanyQuery) WithPhones(opts ...func(*PhoneQuery)) *CompanyQuery

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

func (*CompanyQuery) WithWebsites

func (cq *CompanyQuery) WithWebsites(opts ...func(*WebsiteQuery)) *CompanyQuery

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

type CompanySelect

type CompanySelect struct {
	*CompanyQuery
	// contains filtered or unexported fields
}

CompanySelect is the builder for selecting fields of Company entities.

func (*CompanySelect) Aggregate

func (cs *CompanySelect) Aggregate(fns ...AggregateFunc) *CompanySelect

Aggregate adds the given aggregation functions to the selector query.

func (*CompanySelect) Bool

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

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

func (*CompanySelect) BoolX

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

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

func (*CompanySelect) Bools

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

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

func (*CompanySelect) BoolsX

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

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

func (*CompanySelect) Float64

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

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

func (*CompanySelect) Float64X

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

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

func (*CompanySelect) Float64s

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

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

func (*CompanySelect) Float64sX

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

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

func (*CompanySelect) Int

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

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

func (*CompanySelect) IntX

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

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

func (*CompanySelect) Ints

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

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

func (*CompanySelect) IntsX

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

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

func (*CompanySelect) Scan

func (cs *CompanySelect) Scan(ctx context.Context, v any) error

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

func (*CompanySelect) ScanX

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

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

func (*CompanySelect) String

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

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

func (*CompanySelect) StringX

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

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

func (*CompanySelect) Strings

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

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

func (*CompanySelect) StringsX

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

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

type CompanyUpdate

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

CompanyUpdate is the builder for updating Company entities.

func (*CompanyUpdate) AddCountries

func (cu *CompanyUpdate) AddCountries(c ...*Country) *CompanyUpdate

AddCountries adds the "countries" edges to the Country entity.

func (*CompanyUpdate) AddCountryIDs

func (cu *CompanyUpdate) AddCountryIDs(ids ...uuid.UUID) *CompanyUpdate

AddCountryIDs adds the "countries" edge to the Country entity by IDs.

func (*CompanyUpdate) AddEmailIDs

func (cu *CompanyUpdate) AddEmailIDs(ids ...uuid.UUID) *CompanyUpdate

AddEmailIDs adds the "emails" edge to the Email entity by IDs.

func (*CompanyUpdate) AddEmails

func (cu *CompanyUpdate) AddEmails(e ...*Email) *CompanyUpdate

AddEmails adds the "emails" edges to the Email entity.

func (*CompanyUpdate) AddGalleryImageIDs

func (cu *CompanyUpdate) AddGalleryImageIDs(ids ...uuid.UUID) *CompanyUpdate

AddGalleryImageIDs adds the "gallery_images" edge to the Image entity by IDs.

func (*CompanyUpdate) AddGalleryImages

func (cu *CompanyUpdate) AddGalleryImages(i ...*Image) *CompanyUpdate

AddGalleryImages adds the "gallery_images" edges to the Image entity.

func (*CompanyUpdate) AddLocationIDs

func (cu *CompanyUpdate) AddLocationIDs(ids ...uuid.UUID) *CompanyUpdate

AddLocationIDs adds the "locations" edge to the Location entity by IDs.

func (*CompanyUpdate) AddLocations

func (cu *CompanyUpdate) AddLocations(l ...*Location) *CompanyUpdate

AddLocations adds the "locations" edges to the Location entity.

func (*CompanyUpdate) AddPhoneIDs

func (cu *CompanyUpdate) AddPhoneIDs(ids ...uuid.UUID) *CompanyUpdate

AddPhoneIDs adds the "phones" edge to the Phone entity by IDs.

func (*CompanyUpdate) AddPhones

func (cu *CompanyUpdate) AddPhones(p ...*Phone) *CompanyUpdate

AddPhones adds the "phones" edges to the Phone entity.

func (*CompanyUpdate) AddWebsiteIDs

func (cu *CompanyUpdate) AddWebsiteIDs(ids ...uuid.UUID) *CompanyUpdate

AddWebsiteIDs adds the "websites" edge to the Website entity by IDs.

func (*CompanyUpdate) AddWebsites

func (cu *CompanyUpdate) AddWebsites(w ...*Website) *CompanyUpdate

AddWebsites adds the "websites" edges to the Website entity.

func (*CompanyUpdate) ClearCountries

func (cu *CompanyUpdate) ClearCountries() *CompanyUpdate

ClearCountries clears all "countries" edges to the Country entity.

func (*CompanyUpdate) ClearCoverImage

func (cu *CompanyUpdate) ClearCoverImage() *CompanyUpdate

ClearCoverImage clears the "cover_image" edge to the Image entity.

func (*CompanyUpdate) ClearEmails

func (cu *CompanyUpdate) ClearEmails() *CompanyUpdate

ClearEmails clears all "emails" edges to the Email entity.

func (*CompanyUpdate) ClearGalleryImages

func (cu *CompanyUpdate) ClearGalleryImages() *CompanyUpdate

ClearGalleryImages clears all "gallery_images" edges to the Image entity.

func (*CompanyUpdate) ClearLocations

func (cu *CompanyUpdate) ClearLocations() *CompanyUpdate

ClearLocations clears all "locations" edges to the Location entity.

func (*CompanyUpdate) ClearLogoImage

func (cu *CompanyUpdate) ClearLogoImage() *CompanyUpdate

ClearLogoImage clears the "logo_image" edge to the Image entity.

func (*CompanyUpdate) ClearPhones

func (cu *CompanyUpdate) ClearPhones() *CompanyUpdate

ClearPhones clears all "phones" edges to the Phone entity.

func (*CompanyUpdate) ClearWebsites

func (cu *CompanyUpdate) ClearWebsites() *CompanyUpdate

ClearWebsites clears all "websites" edges to the Website entity.

func (*CompanyUpdate) Exec

func (cu *CompanyUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*CompanyUpdate) ExecX

func (cu *CompanyUpdate) ExecX(ctx context.Context)

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

func (*CompanyUpdate) Mutation

func (cu *CompanyUpdate) Mutation() *CompanyMutation

Mutation returns the CompanyMutation object of the builder.

func (*CompanyUpdate) RemoveCountries

func (cu *CompanyUpdate) RemoveCountries(c ...*Country) *CompanyUpdate

RemoveCountries removes "countries" edges to Country entities.

func (*CompanyUpdate) RemoveCountryIDs

func (cu *CompanyUpdate) RemoveCountryIDs(ids ...uuid.UUID) *CompanyUpdate

RemoveCountryIDs removes the "countries" edge to Country entities by IDs.

func (*CompanyUpdate) RemoveEmailIDs

func (cu *CompanyUpdate) RemoveEmailIDs(ids ...uuid.UUID) *CompanyUpdate

RemoveEmailIDs removes the "emails" edge to Email entities by IDs.

func (*CompanyUpdate) RemoveEmails

func (cu *CompanyUpdate) RemoveEmails(e ...*Email) *CompanyUpdate

RemoveEmails removes "emails" edges to Email entities.

func (*CompanyUpdate) RemoveGalleryImageIDs

func (cu *CompanyUpdate) RemoveGalleryImageIDs(ids ...uuid.UUID) *CompanyUpdate

RemoveGalleryImageIDs removes the "gallery_images" edge to Image entities by IDs.

func (*CompanyUpdate) RemoveGalleryImages

func (cu *CompanyUpdate) RemoveGalleryImages(i ...*Image) *CompanyUpdate

RemoveGalleryImages removes "gallery_images" edges to Image entities.

func (*CompanyUpdate) RemoveLocationIDs

func (cu *CompanyUpdate) RemoveLocationIDs(ids ...uuid.UUID) *CompanyUpdate

RemoveLocationIDs removes the "locations" edge to Location entities by IDs.

func (*CompanyUpdate) RemoveLocations

func (cu *CompanyUpdate) RemoveLocations(l ...*Location) *CompanyUpdate

RemoveLocations removes "locations" edges to Location entities.

func (*CompanyUpdate) RemovePhoneIDs

func (cu *CompanyUpdate) RemovePhoneIDs(ids ...uuid.UUID) *CompanyUpdate

RemovePhoneIDs removes the "phones" edge to Phone entities by IDs.

func (*CompanyUpdate) RemovePhones

func (cu *CompanyUpdate) RemovePhones(p ...*Phone) *CompanyUpdate

RemovePhones removes "phones" edges to Phone entities.

func (*CompanyUpdate) RemoveWebsiteIDs

func (cu *CompanyUpdate) RemoveWebsiteIDs(ids ...uuid.UUID) *CompanyUpdate

RemoveWebsiteIDs removes the "websites" edge to Website entities by IDs.

func (*CompanyUpdate) RemoveWebsites

func (cu *CompanyUpdate) RemoveWebsites(w ...*Website) *CompanyUpdate

RemoveWebsites removes "websites" edges to Website entities.

func (*CompanyUpdate) Save

func (cu *CompanyUpdate) Save(ctx context.Context) (int, error)

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

func (*CompanyUpdate) SaveX

func (cu *CompanyUpdate) SaveX(ctx context.Context) int

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

func (*CompanyUpdate) SetCoverImage

func (cu *CompanyUpdate) SetCoverImage(i *Image) *CompanyUpdate

SetCoverImage sets the "cover_image" edge to the Image entity.

func (*CompanyUpdate) SetCoverImageID

func (cu *CompanyUpdate) SetCoverImageID(id uuid.UUID) *CompanyUpdate

SetCoverImageID sets the "cover_image" edge to the Image entity by ID.

func (*CompanyUpdate) SetDescription

func (cu *CompanyUpdate) SetDescription(s string) *CompanyUpdate

SetDescription sets the "description" field.

func (*CompanyUpdate) SetInput

SetInput applies the change-set in the UpdateCompanyInput on the CompanyUpdate builder.

func (*CompanyUpdate) SetLogoImage

func (cu *CompanyUpdate) SetLogoImage(i *Image) *CompanyUpdate

SetLogoImage sets the "logo_image" edge to the Image entity.

func (*CompanyUpdate) SetLogoImageID

func (cu *CompanyUpdate) SetLogoImageID(id uuid.UUID) *CompanyUpdate

SetLogoImageID sets the "logo_image" edge to the Image entity by ID.

func (*CompanyUpdate) SetName

func (cu *CompanyUpdate) SetName(s string) *CompanyUpdate

SetName sets the "name" field.

func (*CompanyUpdate) SetNillableCoverImageID

func (cu *CompanyUpdate) SetNillableCoverImageID(id *uuid.UUID) *CompanyUpdate

SetNillableCoverImageID sets the "cover_image" edge to the Image entity by ID if the given value is not nil.

func (*CompanyUpdate) SetNillableLogoImageID

func (cu *CompanyUpdate) SetNillableLogoImageID(id *uuid.UUID) *CompanyUpdate

SetNillableLogoImageID sets the "logo_image" edge to the Image entity by ID if the given value is not nil.

func (*CompanyUpdate) Where

func (cu *CompanyUpdate) Where(ps ...predicate.Company) *CompanyUpdate

Where appends a list predicates to the CompanyUpdate builder.

type CompanyUpdateOne

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

CompanyUpdateOne is the builder for updating a single Company entity.

func (*CompanyUpdateOne) AddCountries

func (cuo *CompanyUpdateOne) AddCountries(c ...*Country) *CompanyUpdateOne

AddCountries adds the "countries" edges to the Country entity.

func (*CompanyUpdateOne) AddCountryIDs

func (cuo *CompanyUpdateOne) AddCountryIDs(ids ...uuid.UUID) *CompanyUpdateOne

AddCountryIDs adds the "countries" edge to the Country entity by IDs.

func (*CompanyUpdateOne) AddEmailIDs

func (cuo *CompanyUpdateOne) AddEmailIDs(ids ...uuid.UUID) *CompanyUpdateOne

AddEmailIDs adds the "emails" edge to the Email entity by IDs.

func (*CompanyUpdateOne) AddEmails

func (cuo *CompanyUpdateOne) AddEmails(e ...*Email) *CompanyUpdateOne

AddEmails adds the "emails" edges to the Email entity.

func (*CompanyUpdateOne) AddGalleryImageIDs

func (cuo *CompanyUpdateOne) AddGalleryImageIDs(ids ...uuid.UUID) *CompanyUpdateOne

AddGalleryImageIDs adds the "gallery_images" edge to the Image entity by IDs.

func (*CompanyUpdateOne) AddGalleryImages

func (cuo *CompanyUpdateOne) AddGalleryImages(i ...*Image) *CompanyUpdateOne

AddGalleryImages adds the "gallery_images" edges to the Image entity.

func (*CompanyUpdateOne) AddLocationIDs

func (cuo *CompanyUpdateOne) AddLocationIDs(ids ...uuid.UUID) *CompanyUpdateOne

AddLocationIDs adds the "locations" edge to the Location entity by IDs.

func (*CompanyUpdateOne) AddLocations

func (cuo *CompanyUpdateOne) AddLocations(l ...*Location) *CompanyUpdateOne

AddLocations adds the "locations" edges to the Location entity.

func (*CompanyUpdateOne) AddPhoneIDs

func (cuo *CompanyUpdateOne) AddPhoneIDs(ids ...uuid.UUID) *CompanyUpdateOne

AddPhoneIDs adds the "phones" edge to the Phone entity by IDs.

func (*CompanyUpdateOne) AddPhones

func (cuo *CompanyUpdateOne) AddPhones(p ...*Phone) *CompanyUpdateOne

AddPhones adds the "phones" edges to the Phone entity.

func (*CompanyUpdateOne) AddWebsiteIDs

func (cuo *CompanyUpdateOne) AddWebsiteIDs(ids ...uuid.UUID) *CompanyUpdateOne

AddWebsiteIDs adds the "websites" edge to the Website entity by IDs.

func (*CompanyUpdateOne) AddWebsites

func (cuo *CompanyUpdateOne) AddWebsites(w ...*Website) *CompanyUpdateOne

AddWebsites adds the "websites" edges to the Website entity.

func (*CompanyUpdateOne) ClearCountries

func (cuo *CompanyUpdateOne) ClearCountries() *CompanyUpdateOne

ClearCountries clears all "countries" edges to the Country entity.

func (*CompanyUpdateOne) ClearCoverImage

func (cuo *CompanyUpdateOne) ClearCoverImage() *CompanyUpdateOne

ClearCoverImage clears the "cover_image" edge to the Image entity.

func (*CompanyUpdateOne) ClearEmails

func (cuo *CompanyUpdateOne) ClearEmails() *CompanyUpdateOne

ClearEmails clears all "emails" edges to the Email entity.

func (*CompanyUpdateOne) ClearGalleryImages

func (cuo *CompanyUpdateOne) ClearGalleryImages() *CompanyUpdateOne

ClearGalleryImages clears all "gallery_images" edges to the Image entity.

func (*CompanyUpdateOne) ClearLocations

func (cuo *CompanyUpdateOne) ClearLocations() *CompanyUpdateOne

ClearLocations clears all "locations" edges to the Location entity.

func (*CompanyUpdateOne) ClearLogoImage

func (cuo *CompanyUpdateOne) ClearLogoImage() *CompanyUpdateOne

ClearLogoImage clears the "logo_image" edge to the Image entity.

func (*CompanyUpdateOne) ClearPhones

func (cuo *CompanyUpdateOne) ClearPhones() *CompanyUpdateOne

ClearPhones clears all "phones" edges to the Phone entity.

func (*CompanyUpdateOne) ClearWebsites

func (cuo *CompanyUpdateOne) ClearWebsites() *CompanyUpdateOne

ClearWebsites clears all "websites" edges to the Website entity.

func (*CompanyUpdateOne) Exec

func (cuo *CompanyUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*CompanyUpdateOne) ExecX

func (cuo *CompanyUpdateOne) ExecX(ctx context.Context)

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

func (*CompanyUpdateOne) Mutation

func (cuo *CompanyUpdateOne) Mutation() *CompanyMutation

Mutation returns the CompanyMutation object of the builder.

func (*CompanyUpdateOne) RemoveCountries

func (cuo *CompanyUpdateOne) RemoveCountries(c ...*Country) *CompanyUpdateOne

RemoveCountries removes "countries" edges to Country entities.

func (*CompanyUpdateOne) RemoveCountryIDs

func (cuo *CompanyUpdateOne) RemoveCountryIDs(ids ...uuid.UUID) *CompanyUpdateOne

RemoveCountryIDs removes the "countries" edge to Country entities by IDs.

func (*CompanyUpdateOne) RemoveEmailIDs

func (cuo *CompanyUpdateOne) RemoveEmailIDs(ids ...uuid.UUID) *CompanyUpdateOne

RemoveEmailIDs removes the "emails" edge to Email entities by IDs.

func (*CompanyUpdateOne) RemoveEmails

func (cuo *CompanyUpdateOne) RemoveEmails(e ...*Email) *CompanyUpdateOne

RemoveEmails removes "emails" edges to Email entities.

func (*CompanyUpdateOne) RemoveGalleryImageIDs

func (cuo *CompanyUpdateOne) RemoveGalleryImageIDs(ids ...uuid.UUID) *CompanyUpdateOne

RemoveGalleryImageIDs removes the "gallery_images" edge to Image entities by IDs.

func (*CompanyUpdateOne) RemoveGalleryImages

func (cuo *CompanyUpdateOne) RemoveGalleryImages(i ...*Image) *CompanyUpdateOne

RemoveGalleryImages removes "gallery_images" edges to Image entities.

func (*CompanyUpdateOne) RemoveLocationIDs

func (cuo *CompanyUpdateOne) RemoveLocationIDs(ids ...uuid.UUID) *CompanyUpdateOne

RemoveLocationIDs removes the "locations" edge to Location entities by IDs.

func (*CompanyUpdateOne) RemoveLocations

func (cuo *CompanyUpdateOne) RemoveLocations(l ...*Location) *CompanyUpdateOne

RemoveLocations removes "locations" edges to Location entities.

func (*CompanyUpdateOne) RemovePhoneIDs

func (cuo *CompanyUpdateOne) RemovePhoneIDs(ids ...uuid.UUID) *CompanyUpdateOne

RemovePhoneIDs removes the "phones" edge to Phone entities by IDs.

func (*CompanyUpdateOne) RemovePhones

func (cuo *CompanyUpdateOne) RemovePhones(p ...*Phone) *CompanyUpdateOne

RemovePhones removes "phones" edges to Phone entities.

func (*CompanyUpdateOne) RemoveWebsiteIDs

func (cuo *CompanyUpdateOne) RemoveWebsiteIDs(ids ...uuid.UUID) *CompanyUpdateOne

RemoveWebsiteIDs removes the "websites" edge to Website entities by IDs.

func (*CompanyUpdateOne) RemoveWebsites

func (cuo *CompanyUpdateOne) RemoveWebsites(w ...*Website) *CompanyUpdateOne

RemoveWebsites removes "websites" edges to Website entities.

func (*CompanyUpdateOne) Save

func (cuo *CompanyUpdateOne) Save(ctx context.Context) (*Company, error)

Save executes the query and returns the updated Company entity.

func (*CompanyUpdateOne) SaveX

func (cuo *CompanyUpdateOne) SaveX(ctx context.Context) *Company

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

func (*CompanyUpdateOne) Select

func (cuo *CompanyUpdateOne) Select(field string, fields ...string) *CompanyUpdateOne

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

func (*CompanyUpdateOne) SetCoverImage

func (cuo *CompanyUpdateOne) SetCoverImage(i *Image) *CompanyUpdateOne

SetCoverImage sets the "cover_image" edge to the Image entity.

func (*CompanyUpdateOne) SetCoverImageID

func (cuo *CompanyUpdateOne) SetCoverImageID(id uuid.UUID) *CompanyUpdateOne

SetCoverImageID sets the "cover_image" edge to the Image entity by ID.

func (*CompanyUpdateOne) SetDescription

func (cuo *CompanyUpdateOne) SetDescription(s string) *CompanyUpdateOne

SetDescription sets the "description" field.

func (*CompanyUpdateOne) SetInput

SetInput applies the change-set in the UpdateCompanyInput on the CompanyUpdateOne builder.

func (*CompanyUpdateOne) SetLogoImage

func (cuo *CompanyUpdateOne) SetLogoImage(i *Image) *CompanyUpdateOne

SetLogoImage sets the "logo_image" edge to the Image entity.

func (*CompanyUpdateOne) SetLogoImageID

func (cuo *CompanyUpdateOne) SetLogoImageID(id uuid.UUID) *CompanyUpdateOne

SetLogoImageID sets the "logo_image" edge to the Image entity by ID.

func (*CompanyUpdateOne) SetName

func (cuo *CompanyUpdateOne) SetName(s string) *CompanyUpdateOne

SetName sets the "name" field.

func (*CompanyUpdateOne) SetNillableCoverImageID

func (cuo *CompanyUpdateOne) SetNillableCoverImageID(id *uuid.UUID) *CompanyUpdateOne

SetNillableCoverImageID sets the "cover_image" edge to the Image entity by ID if the given value is not nil.

func (*CompanyUpdateOne) SetNillableLogoImageID

func (cuo *CompanyUpdateOne) SetNillableLogoImageID(id *uuid.UUID) *CompanyUpdateOne

SetNillableLogoImageID sets the "logo_image" edge to the Image entity by ID if the given value is not nil.

type CompanyWhereInput

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

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

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

	// "description" field predicates.
	Description             *string  `json:"description,omitempty"`
	DescriptionNEQ          *string  `json:"descriptionNEQ,omitempty"`
	DescriptionIn           []string `json:"descriptionIn,omitempty"`
	DescriptionNotIn        []string `json:"descriptionNotIn,omitempty"`
	DescriptionGT           *string  `json:"descriptionGT,omitempty"`
	DescriptionGTE          *string  `json:"descriptionGTE,omitempty"`
	DescriptionLT           *string  `json:"descriptionLT,omitempty"`
	DescriptionLTE          *string  `json:"descriptionLTE,omitempty"`
	DescriptionContains     *string  `json:"descriptionContains,omitempty"`
	DescriptionHasPrefix    *string  `json:"descriptionHasPrefix,omitempty"`
	DescriptionHasSuffix    *string  `json:"descriptionHasSuffix,omitempty"`
	DescriptionEqualFold    *string  `json:"descriptionEqualFold,omitempty"`
	DescriptionContainsFold *string  `json:"descriptionContainsFold,omitempty"`

	// "countries" edge predicates.
	HasCountries     *bool                `json:"hasCountries,omitempty"`
	HasCountriesWith []*CountryWhereInput `json:"hasCountriesWith,omitempty"`

	// "phones" edge predicates.
	HasPhones     *bool              `json:"hasPhones,omitempty"`
	HasPhonesWith []*PhoneWhereInput `json:"hasPhonesWith,omitempty"`

	// "emails" edge predicates.
	HasEmails     *bool              `json:"hasEmails,omitempty"`
	HasEmailsWith []*EmailWhereInput `json:"hasEmailsWith,omitempty"`

	// "websites" edge predicates.
	HasWebsites     *bool                `json:"hasWebsites,omitempty"`
	HasWebsitesWith []*WebsiteWhereInput `json:"hasWebsitesWith,omitempty"`

	// "locations" edge predicates.
	HasLocations     *bool                 `json:"hasLocations,omitempty"`
	HasLocationsWith []*LocationWhereInput `json:"hasLocationsWith,omitempty"`

	// "logo_image" edge predicates.
	HasLogoImage     *bool              `json:"hasLogoImage,omitempty"`
	HasLogoImageWith []*ImageWhereInput `json:"hasLogoImageWith,omitempty"`

	// "cover_image" edge predicates.
	HasCoverImage     *bool              `json:"hasCoverImage,omitempty"`
	HasCoverImageWith []*ImageWhereInput `json:"hasCoverImageWith,omitempty"`

	// "gallery_images" edge predicates.
	HasGalleryImages     *bool              `json:"hasGalleryImages,omitempty"`
	HasGalleryImagesWith []*ImageWhereInput `json:"hasGalleryImagesWith,omitempty"`
}

CompanyWhereInput represents a where input for filtering Company queries.

func (*CompanyWhereInput) AddPredicates

func (i *CompanyWhereInput) AddPredicates(predicates ...predicate.Company)

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

func (*CompanyWhereInput) ApplySearchQuery

func (cwi *CompanyWhereInput) ApplySearchQuery(q *string) *CompanyWhereInput

func (*CompanyWhereInput) Filter

Filter applies the CompanyWhereInput filter on the CompanyQuery builder.

func (*CompanyWhereInput) P

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

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 Countries

type Countries []*Country

Countries is a parsable slice of Country.

type Country

type Country struct {

	// ID of the ent.
	ID uuid.UUID `json:"id,omitempty"`
	// Name holds the value of the "name" field.
	Name string `json:"name,omitempty"`
	// Code holds the value of the "code" field.
	Code string `json:"code,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the CountryQuery when eager-loading is set.
	Edges CountryEdges `json:"edges"`
	// contains filtered or unexported fields
}

Country is the model entity for the Country schema.

func (*Country) Companies

func (c *Country) Companies(
	ctx context.Context, after *Cursor, first *int, before *Cursor, last *int, orderBy *CompanyOrder, where *CompanyWhereInput,
) (*CompanyConnection, error)

func (*Country) Emails

func (c *Country) Emails(
	ctx context.Context, after *Cursor, first *int, before *Cursor, last *int, orderBy *EmailOrder, where *EmailWhereInput,
) (*EmailConnection, error)

func (*Country) IsNode

func (n *Country) IsNode()

IsNode implements the Node interface check for GQLGen.

func (*Country) Locations

func (c *Country) Locations(
	ctx context.Context, after *Cursor, first *int, before *Cursor, last *int, orderBy *LocationOrder, where *LocationWhereInput,
) (*LocationConnection, error)

func (*Country) NamedCompanies

func (c *Country) NamedCompanies(name string) ([]*Company, error)

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

func (*Country) NamedEmails

func (c *Country) NamedEmails(name string) ([]*Email, error)

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

func (*Country) NamedLocations

func (c *Country) NamedLocations(name string) ([]*Location, error)

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

func (*Country) NamedPhones

func (c *Country) NamedPhones(name string) ([]*Phone, error)

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

func (*Country) NamedWebsites

func (c *Country) NamedWebsites(name string) ([]*Website, error)

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

func (*Country) Phones

func (c *Country) Phones(
	ctx context.Context, after *Cursor, first *int, before *Cursor, last *int, orderBy *PhoneOrder, where *PhoneWhereInput,
) (*PhoneConnection, error)

func (*Country) QueryCompanies

func (c *Country) QueryCompanies() *CompanyQuery

QueryCompanies queries the "companies" edge of the Country entity.

func (*Country) QueryEmails

func (c *Country) QueryEmails() *EmailQuery

QueryEmails queries the "emails" edge of the Country entity.

func (*Country) QueryLocations

func (c *Country) QueryLocations() *LocationQuery

QueryLocations queries the "locations" edge of the Country entity.

func (*Country) QueryPhones

func (c *Country) QueryPhones() *PhoneQuery

QueryPhones queries the "phones" edge of the Country entity.

func (*Country) QueryWebsites

func (c *Country) QueryWebsites() *WebsiteQuery

QueryWebsites queries the "websites" edge of the Country entity.

func (*Country) String

func (c *Country) String() string

String implements the fmt.Stringer.

func (*Country) ToEdge

func (c *Country) ToEdge(order *CountryOrder) *CountryEdge

ToEdge converts Country into CountryEdge.

func (*Country) Unwrap

func (c *Country) Unwrap() *Country

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

func (c *Country) Update() *CountryUpdateOne

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

func (*Country) Websites

func (c *Country) Websites(
	ctx context.Context, after *Cursor, first *int, before *Cursor, last *int, orderBy *WebsiteOrder, where *WebsiteWhereInput,
) (*WebsiteConnection, error)

type CountryClient

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

CountryClient is a client for the Country schema.

func NewCountryClient

func NewCountryClient(c config) *CountryClient

NewCountryClient returns a client for the Country from the given config.

func (*CountryClient) Create

func (c *CountryClient) Create() *CountryCreate

Create returns a builder for creating a Country entity.

func (*CountryClient) CreateBulk

func (c *CountryClient) CreateBulk(builders ...*CountryCreate) *CountryCreateBulk

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

func (*CountryClient) Delete

func (c *CountryClient) Delete() *CountryDelete

Delete returns a delete builder for Country.

func (*CountryClient) DeleteOne

func (c *CountryClient) DeleteOne(co *Country) *CountryDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*CountryClient) DeleteOneID

func (c *CountryClient) DeleteOneID(id uuid.UUID) *CountryDeleteOne

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

func (*CountryClient) Get

func (c *CountryClient) Get(ctx context.Context, id uuid.UUID) (*Country, error)

Get returns a Country entity by its id.

func (*CountryClient) GetX

func (c *CountryClient) GetX(ctx context.Context, id uuid.UUID) *Country

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

func (*CountryClient) Hooks

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

Hooks returns the client hooks.

func (*CountryClient) Intercept

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

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

func (*CountryClient) Interceptors

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

Interceptors returns the client interceptors.

func (*CountryClient) Query

func (c *CountryClient) Query() *CountryQuery

Query returns a query builder for Country.

func (*CountryClient) QueryCompanies

func (c *CountryClient) QueryCompanies(co *Country) *CompanyQuery

QueryCompanies queries the companies edge of a Country.

func (*CountryClient) QueryEmails

func (c *CountryClient) QueryEmails(co *Country) *EmailQuery

QueryEmails queries the emails edge of a Country.

func (*CountryClient) QueryLocations

func (c *CountryClient) QueryLocations(co *Country) *LocationQuery

QueryLocations queries the locations edge of a Country.

func (*CountryClient) QueryPhones

func (c *CountryClient) QueryPhones(co *Country) *PhoneQuery

QueryPhones queries the phones edge of a Country.

func (*CountryClient) QueryWebsites

func (c *CountryClient) QueryWebsites(co *Country) *WebsiteQuery

QueryWebsites queries the websites edge of a Country.

func (*CountryClient) Update

func (c *CountryClient) Update() *CountryUpdate

Update returns an update builder for Country.

func (*CountryClient) UpdateOne

func (c *CountryClient) UpdateOne(co *Country) *CountryUpdateOne

UpdateOne returns an update builder for the given entity.

func (*CountryClient) UpdateOneID

func (c *CountryClient) UpdateOneID(id uuid.UUID) *CountryUpdateOne

UpdateOneID returns an update builder for the given id.

func (*CountryClient) Use

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

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

type CountryConnection

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

CountryConnection is the connection containing edges to Country.

type CountryCreate

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

CountryCreate is the builder for creating a Country entity.

func (*CountryCreate) AddCompanies

func (cc *CountryCreate) AddCompanies(c ...*Company) *CountryCreate

AddCompanies adds the "companies" edges to the Company entity.

func (*CountryCreate) AddCompanyIDs

func (cc *CountryCreate) AddCompanyIDs(ids ...uuid.UUID) *CountryCreate

AddCompanyIDs adds the "companies" edge to the Company entity by IDs.

func (*CountryCreate) AddEmailIDs

func (cc *CountryCreate) AddEmailIDs(ids ...uuid.UUID) *CountryCreate

AddEmailIDs adds the "emails" edge to the Email entity by IDs.

func (*CountryCreate) AddEmails

func (cc *CountryCreate) AddEmails(e ...*Email) *CountryCreate

AddEmails adds the "emails" edges to the Email entity.

func (*CountryCreate) AddLocationIDs

func (cc *CountryCreate) AddLocationIDs(ids ...uuid.UUID) *CountryCreate

AddLocationIDs adds the "locations" edge to the Location entity by IDs.

func (*CountryCreate) AddLocations

func (cc *CountryCreate) AddLocations(l ...*Location) *CountryCreate

AddLocations adds the "locations" edges to the Location entity.

func (*CountryCreate) AddPhoneIDs

func (cc *CountryCreate) AddPhoneIDs(ids ...uuid.UUID) *CountryCreate

AddPhoneIDs adds the "phones" edge to the Phone entity by IDs.

func (*CountryCreate) AddPhones

func (cc *CountryCreate) AddPhones(p ...*Phone) *CountryCreate

AddPhones adds the "phones" edges to the Phone entity.

func (*CountryCreate) AddWebsiteIDs

func (cc *CountryCreate) AddWebsiteIDs(ids ...uuid.UUID) *CountryCreate

AddWebsiteIDs adds the "websites" edge to the Website entity by IDs.

func (*CountryCreate) AddWebsites

func (cc *CountryCreate) AddWebsites(w ...*Website) *CountryCreate

AddWebsites adds the "websites" edges to the Website entity.

func (*CountryCreate) Exec

func (cc *CountryCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*CountryCreate) ExecX

func (cc *CountryCreate) ExecX(ctx context.Context)

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

func (*CountryCreate) Mutation

func (cc *CountryCreate) Mutation() *CountryMutation

Mutation returns the CountryMutation object of the builder.

func (*CountryCreate) Save

func (cc *CountryCreate) Save(ctx context.Context) (*Country, error)

Save creates the Country in the database.

func (*CountryCreate) SaveX

func (cc *CountryCreate) SaveX(ctx context.Context) *Country

SaveX calls Save and panics if Save returns an error.

func (*CountryCreate) SetCode

func (cc *CountryCreate) SetCode(s string) *CountryCreate

SetCode sets the "code" field.

func (*CountryCreate) SetID

func (cc *CountryCreate) SetID(u uuid.UUID) *CountryCreate

SetID sets the "id" field.

func (*CountryCreate) SetInput

SetInput applies the change-set in the CreateCountryInput on the CountryCreate builder.

func (*CountryCreate) SetName

func (cc *CountryCreate) SetName(s string) *CountryCreate

SetName sets the "name" field.

func (*CountryCreate) SetNillableID

func (cc *CountryCreate) SetNillableID(u *uuid.UUID) *CountryCreate

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

type CountryCreateBulk

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

CountryCreateBulk is the builder for creating many Country entities in bulk.

func (*CountryCreateBulk) Exec

func (ccb *CountryCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*CountryCreateBulk) ExecX

func (ccb *CountryCreateBulk) ExecX(ctx context.Context)

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

func (*CountryCreateBulk) Save

func (ccb *CountryCreateBulk) Save(ctx context.Context) ([]*Country, error)

Save creates the Country entities in the database.

func (*CountryCreateBulk) SaveX

func (ccb *CountryCreateBulk) SaveX(ctx context.Context) []*Country

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

type CountryDelete

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

CountryDelete is the builder for deleting a Country entity.

func (*CountryDelete) Exec

func (cd *CountryDelete) Exec(ctx context.Context) (int, error)

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

func (*CountryDelete) ExecX

func (cd *CountryDelete) ExecX(ctx context.Context) int

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

func (*CountryDelete) Where

func (cd *CountryDelete) Where(ps ...predicate.Country) *CountryDelete

Where appends a list predicates to the CountryDelete builder.

type CountryDeleteOne

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

CountryDeleteOne is the builder for deleting a single Country entity.

func (*CountryDeleteOne) Exec

func (cdo *CountryDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*CountryDeleteOne) ExecX

func (cdo *CountryDeleteOne) ExecX(ctx context.Context)

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

type CountryEdge

type CountryEdge struct {
	Node   *Country `json:"node"`
	Cursor Cursor   `json:"cursor"`
}

CountryEdge is the edge representation of Country.

type CountryEdges

type CountryEdges struct {
	// Companies holds the value of the companies edge.
	Companies []*Company `json:"companies,omitempty"`
	// Phones holds the value of the phones edge.
	Phones []*Phone `json:"phones,omitempty"`
	// Emails holds the value of the emails edge.
	Emails []*Email `json:"emails,omitempty"`
	// Websites holds the value of the websites edge.
	Websites []*Website `json:"websites,omitempty"`
	// Locations holds the value of the locations edge.
	Locations []*Location `json:"locations,omitempty"`
	// contains filtered or unexported fields
}

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

func (CountryEdges) CompaniesOrErr

func (e CountryEdges) CompaniesOrErr() ([]*Company, error)

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

func (CountryEdges) EmailsOrErr

func (e CountryEdges) EmailsOrErr() ([]*Email, error)

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

func (CountryEdges) LocationsOrErr

func (e CountryEdges) LocationsOrErr() ([]*Location, error)

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

func (CountryEdges) PhonesOrErr

func (e CountryEdges) PhonesOrErr() ([]*Phone, error)

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

func (CountryEdges) WebsitesOrErr

func (e CountryEdges) WebsitesOrErr() ([]*Website, error)

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

type CountryGroupBy

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

CountryGroupBy is the group-by builder for Country entities.

func (*CountryGroupBy) Aggregate

func (cgb *CountryGroupBy) Aggregate(fns ...AggregateFunc) *CountryGroupBy

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

func (*CountryGroupBy) Bool

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

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

func (*CountryGroupBy) BoolX

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

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

func (*CountryGroupBy) Bools

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

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

func (*CountryGroupBy) BoolsX

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

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

func (*CountryGroupBy) Float64

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

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

func (*CountryGroupBy) Float64X

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

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

func (*CountryGroupBy) Float64s

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

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

func (*CountryGroupBy) Float64sX

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

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

func (*CountryGroupBy) Int

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

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

func (*CountryGroupBy) IntX

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

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

func (*CountryGroupBy) Ints

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

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

func (*CountryGroupBy) IntsX

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

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

func (*CountryGroupBy) Scan

func (cgb *CountryGroupBy) Scan(ctx context.Context, v any) error

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

func (*CountryGroupBy) ScanX

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

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

func (*CountryGroupBy) String

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

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

func (*CountryGroupBy) StringX

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

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

func (*CountryGroupBy) Strings

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

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

func (*CountryGroupBy) StringsX

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

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

type CountryMutation

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

CountryMutation represents an operation that mutates the Country nodes in the graph.

func (*CountryMutation) AddCompanyIDs

func (m *CountryMutation) AddCompanyIDs(ids ...uuid.UUID)

AddCompanyIDs adds the "companies" edge to the Company entity by ids.

func (*CountryMutation) AddEmailIDs

func (m *CountryMutation) AddEmailIDs(ids ...uuid.UUID)

AddEmailIDs adds the "emails" edge to the Email entity by ids.

func (*CountryMutation) AddField

func (m *CountryMutation) 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 (*CountryMutation) AddLocationIDs

func (m *CountryMutation) AddLocationIDs(ids ...uuid.UUID)

AddLocationIDs adds the "locations" edge to the Location entity by ids.

func (*CountryMutation) AddPhoneIDs

func (m *CountryMutation) AddPhoneIDs(ids ...uuid.UUID)

AddPhoneIDs adds the "phones" edge to the Phone entity by ids.

func (*CountryMutation) AddWebsiteIDs

func (m *CountryMutation) AddWebsiteIDs(ids ...uuid.UUID)

AddWebsiteIDs adds the "websites" edge to the Website entity by ids.

func (*CountryMutation) AddedEdges

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

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

func (*CountryMutation) AddedField

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

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

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

func (*CountryMutation) AddedIDs

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

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

func (*CountryMutation) ClearCompanies

func (m *CountryMutation) ClearCompanies()

ClearCompanies clears the "companies" edge to the Company entity.

func (*CountryMutation) ClearEdge

func (m *CountryMutation) 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 (*CountryMutation) ClearEmails

func (m *CountryMutation) ClearEmails()

ClearEmails clears the "emails" edge to the Email entity.

func (*CountryMutation) ClearField

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

func (m *CountryMutation) ClearLocations()

ClearLocations clears the "locations" edge to the Location entity.

func (*CountryMutation) ClearPhones

func (m *CountryMutation) ClearPhones()

ClearPhones clears the "phones" edge to the Phone entity.

func (*CountryMutation) ClearWebsites

func (m *CountryMutation) ClearWebsites()

ClearWebsites clears the "websites" edge to the Website entity.

func (*CountryMutation) ClearedEdges

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

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

func (*CountryMutation) ClearedFields

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

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

func (CountryMutation) Client

func (m CountryMutation) 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 (*CountryMutation) Code

func (m *CountryMutation) Code() (r string, exists bool)

Code returns the value of the "code" field in the mutation.

func (*CountryMutation) CompaniesCleared

func (m *CountryMutation) CompaniesCleared() bool

CompaniesCleared reports if the "companies" edge to the Company entity was cleared.

func (*CountryMutation) CompaniesIDs

func (m *CountryMutation) CompaniesIDs() (ids []uuid.UUID)

CompaniesIDs returns the "companies" edge IDs in the mutation.

func (*CountryMutation) EdgeCleared

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

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

func (*CountryMutation) EmailsCleared

func (m *CountryMutation) EmailsCleared() bool

EmailsCleared reports if the "emails" edge to the Email entity was cleared.

func (*CountryMutation) EmailsIDs

func (m *CountryMutation) EmailsIDs() (ids []uuid.UUID)

EmailsIDs returns the "emails" edge IDs in the mutation.

func (*CountryMutation) Field

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

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

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

func (*CountryMutation) Fields

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

func (m *CountryMutation) ID() (id uuid.UUID, 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 (*CountryMutation) IDs

func (m *CountryMutation) IDs(ctx context.Context) ([]uuid.UUID, 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 (*CountryMutation) LocationsCleared

func (m *CountryMutation) LocationsCleared() bool

LocationsCleared reports if the "locations" edge to the Location entity was cleared.

func (*CountryMutation) LocationsIDs

func (m *CountryMutation) LocationsIDs() (ids []uuid.UUID)

LocationsIDs returns the "locations" edge IDs in the mutation.

func (*CountryMutation) Name

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

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

func (*CountryMutation) OldCode

func (m *CountryMutation) OldCode(ctx context.Context) (v string, err error)

OldCode returns the old "code" field's value of the Country entity. If the Country 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 (*CountryMutation) OldField

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

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

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

func (m *CountryMutation) Op() Op

Op returns the operation name.

func (*CountryMutation) PhonesCleared

func (m *CountryMutation) PhonesCleared() bool

PhonesCleared reports if the "phones" edge to the Phone entity was cleared.

func (*CountryMutation) PhonesIDs

func (m *CountryMutation) PhonesIDs() (ids []uuid.UUID)

PhonesIDs returns the "phones" edge IDs in the mutation.

func (*CountryMutation) RemoveCompanyIDs

func (m *CountryMutation) RemoveCompanyIDs(ids ...uuid.UUID)

RemoveCompanyIDs removes the "companies" edge to the Company entity by IDs.

func (*CountryMutation) RemoveEmailIDs

func (m *CountryMutation) RemoveEmailIDs(ids ...uuid.UUID)

RemoveEmailIDs removes the "emails" edge to the Email entity by IDs.

func (*CountryMutation) RemoveLocationIDs

func (m *CountryMutation) RemoveLocationIDs(ids ...uuid.UUID)

RemoveLocationIDs removes the "locations" edge to the Location entity by IDs.

func (*CountryMutation) RemovePhoneIDs

func (m *CountryMutation) RemovePhoneIDs(ids ...uuid.UUID)

RemovePhoneIDs removes the "phones" edge to the Phone entity by IDs.

func (*CountryMutation) RemoveWebsiteIDs

func (m *CountryMutation) RemoveWebsiteIDs(ids ...uuid.UUID)

RemoveWebsiteIDs removes the "websites" edge to the Website entity by IDs.

func (*CountryMutation) RemovedCompaniesIDs

func (m *CountryMutation) RemovedCompaniesIDs() (ids []uuid.UUID)

RemovedCompanies returns the removed IDs of the "companies" edge to the Company entity.

func (*CountryMutation) RemovedEdges

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

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

func (*CountryMutation) RemovedEmailsIDs

func (m *CountryMutation) RemovedEmailsIDs() (ids []uuid.UUID)

RemovedEmails returns the removed IDs of the "emails" edge to the Email entity.

func (*CountryMutation) RemovedIDs

func (m *CountryMutation) 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 (*CountryMutation) RemovedLocationsIDs

func (m *CountryMutation) RemovedLocationsIDs() (ids []uuid.UUID)

RemovedLocations returns the removed IDs of the "locations" edge to the Location entity.

func (*CountryMutation) RemovedPhonesIDs

func (m *CountryMutation) RemovedPhonesIDs() (ids []uuid.UUID)

RemovedPhones returns the removed IDs of the "phones" edge to the Phone entity.

func (*CountryMutation) RemovedWebsitesIDs

func (m *CountryMutation) RemovedWebsitesIDs() (ids []uuid.UUID)

RemovedWebsites returns the removed IDs of the "websites" edge to the Website entity.

func (*CountryMutation) ResetCode

func (m *CountryMutation) ResetCode()

ResetCode resets all changes to the "code" field.

func (*CountryMutation) ResetCompanies

func (m *CountryMutation) ResetCompanies()

ResetCompanies resets all changes to the "companies" edge.

func (*CountryMutation) ResetEdge

func (m *CountryMutation) 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 (*CountryMutation) ResetEmails

func (m *CountryMutation) ResetEmails()

ResetEmails resets all changes to the "emails" edge.

func (*CountryMutation) ResetField

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

func (m *CountryMutation) ResetLocations()

ResetLocations resets all changes to the "locations" edge.

func (*CountryMutation) ResetName

func (m *CountryMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*CountryMutation) ResetPhones

func (m *CountryMutation) ResetPhones()

ResetPhones resets all changes to the "phones" edge.

func (*CountryMutation) ResetWebsites

func (m *CountryMutation) ResetWebsites()

ResetWebsites resets all changes to the "websites" edge.

func (*CountryMutation) SetCode

func (m *CountryMutation) SetCode(s string)

SetCode sets the "code" field.

func (*CountryMutation) SetField

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

func (m *CountryMutation) SetID(id uuid.UUID)

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

func (*CountryMutation) SetName

func (m *CountryMutation) SetName(s string)

SetName sets the "name" field.

func (*CountryMutation) SetOp

func (m *CountryMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (CountryMutation) Tx

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

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

func (*CountryMutation) Type

func (m *CountryMutation) Type() string

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

func (*CountryMutation) WebsitesCleared

func (m *CountryMutation) WebsitesCleared() bool

WebsitesCleared reports if the "websites" edge to the Website entity was cleared.

func (*CountryMutation) WebsitesIDs

func (m *CountryMutation) WebsitesIDs() (ids []uuid.UUID)

WebsitesIDs returns the "websites" edge IDs in the mutation.

func (*CountryMutation) Where

func (m *CountryMutation) Where(ps ...predicate.Country)

Where appends a list predicates to the CountryMutation builder.

func (*CountryMutation) WhereP

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

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

type CountryOrder

type CountryOrder struct {
	Direction OrderDirection     `json:"direction"`
	Field     *CountryOrderField `json:"field"`
}

CountryOrder defines the ordering of Country.

type CountryOrderField

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

CountryOrderField defines the ordering field of Country.

func (CountryOrderField) MarshalGQL

func (f CountryOrderField) MarshalGQL(w io.Writer)

MarshalGQL implements graphql.Marshaler interface.

func (CountryOrderField) String

func (f CountryOrderField) String() string

String implement fmt.Stringer interface.

func (*CountryOrderField) UnmarshalGQL

func (f *CountryOrderField) UnmarshalGQL(v interface{}) error

UnmarshalGQL implements graphql.Unmarshaler interface.

type CountryPaginateOption

type CountryPaginateOption func(*countryPager) error

CountryPaginateOption enables pagination customization.

func WithCountryFilter

func WithCountryFilter(filter func(*CountryQuery) (*CountryQuery, error)) CountryPaginateOption

WithCountryFilter configures pagination filter.

func WithCountryOrder

func WithCountryOrder(order *CountryOrder) CountryPaginateOption

WithCountryOrder configures pagination ordering.

type CountryQuery

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

CountryQuery is the builder for querying Country entities.

func (*CountryQuery) Aggregate

func (cq *CountryQuery) Aggregate(fns ...AggregateFunc) *CountrySelect

Aggregate returns a CountrySelect configured with the given aggregations.

func (*CountryQuery) All

func (cq *CountryQuery) All(ctx context.Context) ([]*Country, error)

All executes the query and returns a list of Countries.

func (*CountryQuery) AllX

func (cq *CountryQuery) AllX(ctx context.Context) []*Country

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

func (*CountryQuery) Clone

func (cq *CountryQuery) Clone() *CountryQuery

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

func (*CountryQuery) CollectFields

func (c *CountryQuery) CollectFields(ctx context.Context, satisfies ...string) (*CountryQuery, error)

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

func (*CountryQuery) Count

func (cq *CountryQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*CountryQuery) CountX

func (cq *CountryQuery) CountX(ctx context.Context) int

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

func (*CountryQuery) Exist

func (cq *CountryQuery) Exist(ctx context.Context) (bool, error)

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

func (*CountryQuery) ExistX

func (cq *CountryQuery) ExistX(ctx context.Context) bool

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

func (*CountryQuery) First

func (cq *CountryQuery) First(ctx context.Context) (*Country, error)

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

func (*CountryQuery) FirstID

func (cq *CountryQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

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

func (*CountryQuery) FirstIDX

func (cq *CountryQuery) FirstIDX(ctx context.Context) uuid.UUID

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

func (*CountryQuery) FirstX

func (cq *CountryQuery) FirstX(ctx context.Context) *Country

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

func (*CountryQuery) GroupBy

func (cq *CountryQuery) GroupBy(field string, fields ...string) *CountryGroupBy

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

func (*CountryQuery) IDs

func (cq *CountryQuery) IDs(ctx context.Context) ([]uuid.UUID, error)

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

func (*CountryQuery) IDsX

func (cq *CountryQuery) IDsX(ctx context.Context) []uuid.UUID

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

func (*CountryQuery) Limit

func (cq *CountryQuery) Limit(limit int) *CountryQuery

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

func (*CountryQuery) Offset

func (cq *CountryQuery) Offset(offset int) *CountryQuery

Offset to start from.

func (*CountryQuery) Only

func (cq *CountryQuery) Only(ctx context.Context) (*Country, error)

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

func (*CountryQuery) OnlyID

func (cq *CountryQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

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

func (*CountryQuery) OnlyIDX

func (cq *CountryQuery) OnlyIDX(ctx context.Context) uuid.UUID

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

func (*CountryQuery) OnlyX

func (cq *CountryQuery) OnlyX(ctx context.Context) *Country

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

func (*CountryQuery) Order

func (cq *CountryQuery) Order(o ...OrderFunc) *CountryQuery

Order specifies how the records should be ordered.

func (*CountryQuery) Paginate

func (c *CountryQuery) Paginate(
	ctx context.Context, after *Cursor, first *int,
	before *Cursor, last *int, opts ...CountryPaginateOption,
) (*CountryConnection, error)

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

func (*CountryQuery) QueryCompanies

func (cq *CountryQuery) QueryCompanies() *CompanyQuery

QueryCompanies chains the current query on the "companies" edge.

func (*CountryQuery) QueryEmails

func (cq *CountryQuery) QueryEmails() *EmailQuery

QueryEmails chains the current query on the "emails" edge.

func (*CountryQuery) QueryLocations

func (cq *CountryQuery) QueryLocations() *LocationQuery

QueryLocations chains the current query on the "locations" edge.

func (*CountryQuery) QueryPhones

func (cq *CountryQuery) QueryPhones() *PhoneQuery

QueryPhones chains the current query on the "phones" edge.

func (*CountryQuery) QueryWebsites

func (cq *CountryQuery) QueryWebsites() *WebsiteQuery

QueryWebsites chains the current query on the "websites" edge.

func (*CountryQuery) Select

func (cq *CountryQuery) Select(fields ...string) *CountrySelect

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

func (*CountryQuery) Unique

func (cq *CountryQuery) Unique(unique bool) *CountryQuery

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

func (cq *CountryQuery) Where(ps ...predicate.Country) *CountryQuery

Where adds a new predicate for the CountryQuery builder.

func (*CountryQuery) WithCompanies

func (cq *CountryQuery) WithCompanies(opts ...func(*CompanyQuery)) *CountryQuery

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

func (*CountryQuery) WithEmails

func (cq *CountryQuery) WithEmails(opts ...func(*EmailQuery)) *CountryQuery

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

func (*CountryQuery) WithLocations

func (cq *CountryQuery) WithLocations(opts ...func(*LocationQuery)) *CountryQuery

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

func (*CountryQuery) WithNamedCompanies

func (cq *CountryQuery) WithNamedCompanies(name string, opts ...func(*CompanyQuery)) *CountryQuery

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

func (*CountryQuery) WithNamedEmails

func (cq *CountryQuery) WithNamedEmails(name string, opts ...func(*EmailQuery)) *CountryQuery

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

func (*CountryQuery) WithNamedLocations

func (cq *CountryQuery) WithNamedLocations(name string, opts ...func(*LocationQuery)) *CountryQuery

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

func (*CountryQuery) WithNamedPhones

func (cq *CountryQuery) WithNamedPhones(name string, opts ...func(*PhoneQuery)) *CountryQuery

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

func (*CountryQuery) WithNamedWebsites

func (cq *CountryQuery) WithNamedWebsites(name string, opts ...func(*WebsiteQuery)) *CountryQuery

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

func (*CountryQuery) WithPhones

func (cq *CountryQuery) WithPhones(opts ...func(*PhoneQuery)) *CountryQuery

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

func (*CountryQuery) WithWebsites

func (cq *CountryQuery) WithWebsites(opts ...func(*WebsiteQuery)) *CountryQuery

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

type CountrySelect

type CountrySelect struct {
	*CountryQuery
	// contains filtered or unexported fields
}

CountrySelect is the builder for selecting fields of Country entities.

func (*CountrySelect) Aggregate

func (cs *CountrySelect) Aggregate(fns ...AggregateFunc) *CountrySelect

Aggregate adds the given aggregation functions to the selector query.

func (*CountrySelect) Bool

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

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

func (*CountrySelect) BoolX

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

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

func (*CountrySelect) Bools

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

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

func (*CountrySelect) BoolsX

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

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

func (*CountrySelect) Float64

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

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

func (*CountrySelect) Float64X

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

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

func (*CountrySelect) Float64s

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

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

func (*CountrySelect) Float64sX

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

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

func (*CountrySelect) Int

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

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

func (*CountrySelect) IntX

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

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

func (*CountrySelect) Ints

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

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

func (*CountrySelect) IntsX

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

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

func (*CountrySelect) Scan

func (cs *CountrySelect) Scan(ctx context.Context, v any) error

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

func (*CountrySelect) ScanX

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

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

func (*CountrySelect) String

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

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

func (*CountrySelect) StringX

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

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

func (*CountrySelect) Strings

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

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

func (*CountrySelect) StringsX

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

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

type CountryUpdate

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

CountryUpdate is the builder for updating Country entities.

func (*CountryUpdate) AddCompanies

func (cu *CountryUpdate) AddCompanies(c ...*Company) *CountryUpdate

AddCompanies adds the "companies" edges to the Company entity.

func (*CountryUpdate) AddCompanyIDs

func (cu *CountryUpdate) AddCompanyIDs(ids ...uuid.UUID) *CountryUpdate

AddCompanyIDs adds the "companies" edge to the Company entity by IDs.

func (*CountryUpdate) AddEmailIDs

func (cu *CountryUpdate) AddEmailIDs(ids ...uuid.UUID) *CountryUpdate

AddEmailIDs adds the "emails" edge to the Email entity by IDs.

func (*CountryUpdate) AddEmails

func (cu *CountryUpdate) AddEmails(e ...*Email) *CountryUpdate

AddEmails adds the "emails" edges to the Email entity.

func (*CountryUpdate) AddLocationIDs

func (cu *CountryUpdate) AddLocationIDs(ids ...uuid.UUID) *CountryUpdate

AddLocationIDs adds the "locations" edge to the Location entity by IDs.

func (*CountryUpdate) AddLocations

func (cu *CountryUpdate) AddLocations(l ...*Location) *CountryUpdate

AddLocations adds the "locations" edges to the Location entity.

func (*CountryUpdate) AddPhoneIDs

func (cu *CountryUpdate) AddPhoneIDs(ids ...uuid.UUID) *CountryUpdate

AddPhoneIDs adds the "phones" edge to the Phone entity by IDs.

func (*CountryUpdate) AddPhones

func (cu *CountryUpdate) AddPhones(p ...*Phone) *CountryUpdate

AddPhones adds the "phones" edges to the Phone entity.

func (*CountryUpdate) AddWebsiteIDs

func (cu *CountryUpdate) AddWebsiteIDs(ids ...uuid.UUID) *CountryUpdate

AddWebsiteIDs adds the "websites" edge to the Website entity by IDs.

func (*CountryUpdate) AddWebsites

func (cu *CountryUpdate) AddWebsites(w ...*Website) *CountryUpdate

AddWebsites adds the "websites" edges to the Website entity.

func (*CountryUpdate) ClearCompanies

func (cu *CountryUpdate) ClearCompanies() *CountryUpdate

ClearCompanies clears all "companies" edges to the Company entity.

func (*CountryUpdate) ClearEmails

func (cu *CountryUpdate) ClearEmails() *CountryUpdate

ClearEmails clears all "emails" edges to the Email entity.

func (*CountryUpdate) ClearLocations

func (cu *CountryUpdate) ClearLocations() *CountryUpdate

ClearLocations clears all "locations" edges to the Location entity.

func (*CountryUpdate) ClearPhones

func (cu *CountryUpdate) ClearPhones() *CountryUpdate

ClearPhones clears all "phones" edges to the Phone entity.

func (*CountryUpdate) ClearWebsites

func (cu *CountryUpdate) ClearWebsites() *CountryUpdate

ClearWebsites clears all "websites" edges to the Website entity.

func (*CountryUpdate) Exec

func (cu *CountryUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*CountryUpdate) ExecX

func (cu *CountryUpdate) ExecX(ctx context.Context)

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

func (*CountryUpdate) Mutation

func (cu *CountryUpdate) Mutation() *CountryMutation

Mutation returns the CountryMutation object of the builder.

func (*CountryUpdate) RemoveCompanies

func (cu *CountryUpdate) RemoveCompanies(c ...*Company) *CountryUpdate

RemoveCompanies removes "companies" edges to Company entities.

func (*CountryUpdate) RemoveCompanyIDs

func (cu *CountryUpdate) RemoveCompanyIDs(ids ...uuid.UUID) *CountryUpdate

RemoveCompanyIDs removes the "companies" edge to Company entities by IDs.

func (*CountryUpdate) RemoveEmailIDs

func (cu *CountryUpdate) RemoveEmailIDs(ids ...uuid.UUID) *CountryUpdate

RemoveEmailIDs removes the "emails" edge to Email entities by IDs.

func (*CountryUpdate) RemoveEmails

func (cu *CountryUpdate) RemoveEmails(e ...*Email) *CountryUpdate

RemoveEmails removes "emails" edges to Email entities.

func (*CountryUpdate) RemoveLocationIDs

func (cu *CountryUpdate) RemoveLocationIDs(ids ...uuid.UUID) *CountryUpdate

RemoveLocationIDs removes the "locations" edge to Location entities by IDs.

func (*CountryUpdate) RemoveLocations

func (cu *CountryUpdate) RemoveLocations(l ...*Location) *CountryUpdate

RemoveLocations removes "locations" edges to Location entities.

func (*CountryUpdate) RemovePhoneIDs

func (cu *CountryUpdate) RemovePhoneIDs(ids ...uuid.UUID) *CountryUpdate

RemovePhoneIDs removes the "phones" edge to Phone entities by IDs.

func (*CountryUpdate) RemovePhones

func (cu *CountryUpdate) RemovePhones(p ...*Phone) *CountryUpdate

RemovePhones removes "phones" edges to Phone entities.

func (*CountryUpdate) RemoveWebsiteIDs

func (cu *CountryUpdate) RemoveWebsiteIDs(ids ...uuid.UUID) *CountryUpdate

RemoveWebsiteIDs removes the "websites" edge to Website entities by IDs.

func (*CountryUpdate) RemoveWebsites

func (cu *CountryUpdate) RemoveWebsites(w ...*Website) *CountryUpdate

RemoveWebsites removes "websites" edges to Website entities.

func (*CountryUpdate) Save

func (cu *CountryUpdate) Save(ctx context.Context) (int, error)

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

func (*CountryUpdate) SaveX

func (cu *CountryUpdate) SaveX(ctx context.Context) int

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

func (*CountryUpdate) SetCode

func (cu *CountryUpdate) SetCode(s string) *CountryUpdate

SetCode sets the "code" field.

func (*CountryUpdate) SetInput

SetInput applies the change-set in the UpdateCountryInput on the CountryUpdate builder.

func (*CountryUpdate) SetName

func (cu *CountryUpdate) SetName(s string) *CountryUpdate

SetName sets the "name" field.

func (*CountryUpdate) Where

func (cu *CountryUpdate) Where(ps ...predicate.Country) *CountryUpdate

Where appends a list predicates to the CountryUpdate builder.

type CountryUpdateOne

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

CountryUpdateOne is the builder for updating a single Country entity.

func (*CountryUpdateOne) AddCompanies

func (cuo *CountryUpdateOne) AddCompanies(c ...*Company) *CountryUpdateOne

AddCompanies adds the "companies" edges to the Company entity.

func (*CountryUpdateOne) AddCompanyIDs

func (cuo *CountryUpdateOne) AddCompanyIDs(ids ...uuid.UUID) *CountryUpdateOne

AddCompanyIDs adds the "companies" edge to the Company entity by IDs.

func (*CountryUpdateOne) AddEmailIDs

func (cuo *CountryUpdateOne) AddEmailIDs(ids ...uuid.UUID) *CountryUpdateOne

AddEmailIDs adds the "emails" edge to the Email entity by IDs.

func (*CountryUpdateOne) AddEmails

func (cuo *CountryUpdateOne) AddEmails(e ...*Email) *CountryUpdateOne

AddEmails adds the "emails" edges to the Email entity.

func (*CountryUpdateOne) AddLocationIDs

func (cuo *CountryUpdateOne) AddLocationIDs(ids ...uuid.UUID) *CountryUpdateOne

AddLocationIDs adds the "locations" edge to the Location entity by IDs.

func (*CountryUpdateOne) AddLocations

func (cuo *CountryUpdateOne) AddLocations(l ...*Location) *CountryUpdateOne

AddLocations adds the "locations" edges to the Location entity.

func (*CountryUpdateOne) AddPhoneIDs

func (cuo *CountryUpdateOne) AddPhoneIDs(ids ...uuid.UUID) *CountryUpdateOne

AddPhoneIDs adds the "phones" edge to the Phone entity by IDs.

func (*CountryUpdateOne) AddPhones

func (cuo *CountryUpdateOne) AddPhones(p ...*Phone) *CountryUpdateOne

AddPhones adds the "phones" edges to the Phone entity.

func (*CountryUpdateOne) AddWebsiteIDs

func (cuo *CountryUpdateOne) AddWebsiteIDs(ids ...uuid.UUID) *CountryUpdateOne

AddWebsiteIDs adds the "websites" edge to the Website entity by IDs.

func (*CountryUpdateOne) AddWebsites

func (cuo *CountryUpdateOne) AddWebsites(w ...*Website) *CountryUpdateOne

AddWebsites adds the "websites" edges to the Website entity.

func (*CountryUpdateOne) ClearCompanies

func (cuo *CountryUpdateOne) ClearCompanies() *CountryUpdateOne

ClearCompanies clears all "companies" edges to the Company entity.

func (*CountryUpdateOne) ClearEmails

func (cuo *CountryUpdateOne) ClearEmails() *CountryUpdateOne

ClearEmails clears all "emails" edges to the Email entity.

func (*CountryUpdateOne) ClearLocations

func (cuo *CountryUpdateOne) ClearLocations() *CountryUpdateOne

ClearLocations clears all "locations" edges to the Location entity.

func (*CountryUpdateOne) ClearPhones

func (cuo *CountryUpdateOne) ClearPhones() *CountryUpdateOne

ClearPhones clears all "phones" edges to the Phone entity.

func (*CountryUpdateOne) ClearWebsites

func (cuo *CountryUpdateOne) ClearWebsites() *CountryUpdateOne

ClearWebsites clears all "websites" edges to the Website entity.

func (*CountryUpdateOne) Exec

func (cuo *CountryUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*CountryUpdateOne) ExecX

func (cuo *CountryUpdateOne) ExecX(ctx context.Context)

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

func (*CountryUpdateOne) Mutation

func (cuo *CountryUpdateOne) Mutation() *CountryMutation

Mutation returns the CountryMutation object of the builder.

func (*CountryUpdateOne) RemoveCompanies

func (cuo *CountryUpdateOne) RemoveCompanies(c ...*Company) *CountryUpdateOne

RemoveCompanies removes "companies" edges to Company entities.

func (*CountryUpdateOne) RemoveCompanyIDs

func (cuo *CountryUpdateOne) RemoveCompanyIDs(ids ...uuid.UUID) *CountryUpdateOne

RemoveCompanyIDs removes the "companies" edge to Company entities by IDs.

func (*CountryUpdateOne) RemoveEmailIDs

func (cuo *CountryUpdateOne) RemoveEmailIDs(ids ...uuid.UUID) *CountryUpdateOne

RemoveEmailIDs removes the "emails" edge to Email entities by IDs.

func (*CountryUpdateOne) RemoveEmails

func (cuo *CountryUpdateOne) RemoveEmails(e ...*Email) *CountryUpdateOne

RemoveEmails removes "emails" edges to Email entities.

func (*CountryUpdateOne) RemoveLocationIDs

func (cuo *CountryUpdateOne) RemoveLocationIDs(ids ...uuid.UUID) *CountryUpdateOne

RemoveLocationIDs removes the "locations" edge to Location entities by IDs.

func (*CountryUpdateOne) RemoveLocations

func (cuo *CountryUpdateOne) RemoveLocations(l ...*Location) *CountryUpdateOne

RemoveLocations removes "locations" edges to Location entities.

func (*CountryUpdateOne) RemovePhoneIDs

func (cuo *CountryUpdateOne) RemovePhoneIDs(ids ...uuid.UUID) *CountryUpdateOne

RemovePhoneIDs removes the "phones" edge to Phone entities by IDs.

func (*CountryUpdateOne) RemovePhones

func (cuo *CountryUpdateOne) RemovePhones(p ...*Phone) *CountryUpdateOne

RemovePhones removes "phones" edges to Phone entities.

func (*CountryUpdateOne) RemoveWebsiteIDs

func (cuo *CountryUpdateOne) RemoveWebsiteIDs(ids ...uuid.UUID) *CountryUpdateOne

RemoveWebsiteIDs removes the "websites" edge to Website entities by IDs.

func (*CountryUpdateOne) RemoveWebsites

func (cuo *CountryUpdateOne) RemoveWebsites(w ...*Website) *CountryUpdateOne

RemoveWebsites removes "websites" edges to Website entities.

func (*CountryUpdateOne) Save

func (cuo *CountryUpdateOne) Save(ctx context.Context) (*Country, error)

Save executes the query and returns the updated Country entity.

func (*CountryUpdateOne) SaveX

func (cuo *CountryUpdateOne) SaveX(ctx context.Context) *Country

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

func (*CountryUpdateOne) Select

func (cuo *CountryUpdateOne) Select(field string, fields ...string) *CountryUpdateOne

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

func (*CountryUpdateOne) SetCode

func (cuo *CountryUpdateOne) SetCode(s string) *CountryUpdateOne

SetCode sets the "code" field.

func (*CountryUpdateOne) SetInput

SetInput applies the change-set in the UpdateCountryInput on the CountryUpdateOne builder.

func (*CountryUpdateOne) SetName

func (cuo *CountryUpdateOne) SetName(s string) *CountryUpdateOne

SetName sets the "name" field.

type CountryWhereInput

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

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

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

	// "code" field predicates.
	Code             *string  `json:"code,omitempty"`
	CodeNEQ          *string  `json:"codeNEQ,omitempty"`
	CodeIn           []string `json:"codeIn,omitempty"`
	CodeNotIn        []string `json:"codeNotIn,omitempty"`
	CodeGT           *string  `json:"codeGT,omitempty"`
	CodeGTE          *string  `json:"codeGTE,omitempty"`
	CodeLT           *string  `json:"codeLT,omitempty"`
	CodeLTE          *string  `json:"codeLTE,omitempty"`
	CodeContains     *string  `json:"codeContains,omitempty"`
	CodeHasPrefix    *string  `json:"codeHasPrefix,omitempty"`
	CodeHasSuffix    *string  `json:"codeHasSuffix,omitempty"`
	CodeEqualFold    *string  `json:"codeEqualFold,omitempty"`
	CodeContainsFold *string  `json:"codeContainsFold,omitempty"`

	// "companies" edge predicates.
	HasCompanies     *bool                `json:"hasCompanies,omitempty"`
	HasCompaniesWith []*CompanyWhereInput `json:"hasCompaniesWith,omitempty"`

	// "phones" edge predicates.
	HasPhones     *bool              `json:"hasPhones,omitempty"`
	HasPhonesWith []*PhoneWhereInput `json:"hasPhonesWith,omitempty"`

	// "emails" edge predicates.
	HasEmails     *bool              `json:"hasEmails,omitempty"`
	HasEmailsWith []*EmailWhereInput `json:"hasEmailsWith,omitempty"`

	// "websites" edge predicates.
	HasWebsites     *bool                `json:"hasWebsites,omitempty"`
	HasWebsitesWith []*WebsiteWhereInput `json:"hasWebsitesWith,omitempty"`

	// "locations" edge predicates.
	HasLocations     *bool                 `json:"hasLocations,omitempty"`
	HasLocationsWith []*LocationWhereInput `json:"hasLocationsWith,omitempty"`
}

CountryWhereInput represents a where input for filtering Country queries.

func (*CountryWhereInput) AddPredicates

func (i *CountryWhereInput) AddPredicates(predicates ...predicate.Country)

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

func (*CountryWhereInput) ApplySearchQuery

func (cwi *CountryWhereInput) ApplySearchQuery(q *string) *CountryWhereInput

func (*CountryWhereInput) Filter

Filter applies the CountryWhereInput filter on the CountryQuery builder.

func (*CountryWhereInput) P

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

type CreateCompanyInput

type CreateCompanyInput struct {
	Name            string
	Description     string
	CountryIDs      []uuid.UUID
	PhoneIDs        []uuid.UUID
	EmailIDs        []uuid.UUID
	WebsiteIDs      []uuid.UUID
	LocationIDs     []uuid.UUID
	LogoImageID     *uuid.UUID
	CoverImageID    *uuid.UUID
	GalleryImageIDs []uuid.UUID
}

CreateCompanyInput represents a mutation input for creating companies.

func (*CreateCompanyInput) Mutate

func (i *CreateCompanyInput) Mutate(m *CompanyMutation)

Mutate applies the CreateCompanyInput on the CompanyMutation builder.

type CreateCountryInput

type CreateCountryInput struct {
	Name        string
	Code        string
	CompanyIDs  []uuid.UUID
	PhoneIDs    []uuid.UUID
	EmailIDs    []uuid.UUID
	WebsiteIDs  []uuid.UUID
	LocationIDs []uuid.UUID
}

CreateCountryInput represents a mutation input for creating countries.

func (*CreateCountryInput) Mutate

func (i *CreateCountryInput) Mutate(m *CountryMutation)

Mutate applies the CreateCountryInput on the CountryMutation builder.

type CreateEmailInput

type CreateEmailInput struct {
	Title       string
	Description string
	Address     string
	CompanyID   *uuid.UUID
	CountryID   *uuid.UUID
}

CreateEmailInput represents a mutation input for creating emails.

func (*CreateEmailInput) Mutate

func (i *CreateEmailInput) Mutate(m *EmailMutation)

Mutate applies the CreateEmailInput on the EmailMutation builder.

type CreateImageInput

type CreateImageInput struct {
	Title            string
	OriginalURL      string
	GalleryCompanyID *uuid.UUID
	LogoCompanyID    *uuid.UUID
	CoverCompanyID   *uuid.UUID
}

CreateImageInput represents a mutation input for creating images.

func (*CreateImageInput) Mutate

func (i *CreateImageInput) Mutate(m *ImageMutation)

Mutate applies the CreateImageInput on the ImageMutation builder.

type CreateLocationInput

type CreateLocationInput struct {
	Title       string
	Description string
	Latitude    float64
	Longitude   float64
	Address     string
	Postcode    string
	Type        string
	State       string
	Suburb      string
	StreetType  string
	StreetName  string
	CompanyID   *uuid.UUID
	CountryID   *uuid.UUID
}

CreateLocationInput represents a mutation input for creating locations.

func (*CreateLocationInput) Mutate

func (i *CreateLocationInput) Mutate(m *LocationMutation)

Mutate applies the CreateLocationInput on the LocationMutation builder.

type CreatePhoneInput

type CreatePhoneInput struct {
	Title       string
	Description string
	Number      string
	Type        string
	CompanyID   *uuid.UUID
	CountryID   *uuid.UUID
}

CreatePhoneInput represents a mutation input for creating phones.

func (*CreatePhoneInput) Mutate

func (i *CreatePhoneInput) Mutate(m *PhoneMutation)

Mutate applies the CreatePhoneInput on the PhoneMutation builder.

type CreateProductInput

type CreateProductInput struct {
	Name        string
	Description string
	Image       string
	URL         string
	Status      *enums.ProcessStatus
	BuildStatus *enums.ProcessStatus
	WarehouseID *uuid.UUID
	VendorID    *uuid.UUID
}

CreateProductInput represents a mutation input for creating products.

func (*CreateProductInput) Mutate

func (i *CreateProductInput) Mutate(m *ProductMutation)

Mutate applies the CreateProductInput on the ProductMutation builder.

type CreateVendorInput

type CreateVendorInput struct {
	Name         string
	Schema       string
	WarehouseIDs []uuid.UUID
	ProductIDs   []uuid.UUID
}

CreateVendorInput represents a mutation input for creating vendors.

func (*CreateVendorInput) Mutate

func (i *CreateVendorInput) Mutate(m *VendorMutation)

Mutate applies the CreateVendorInput on the VendorMutation builder.

type CreateWarehouseInput

type CreateWarehouseInput struct {
	Name         string
	OriginalData *string
	Enabled      *bool
	Filters      []string
	ProductIDs   []uuid.UUID
	VendorID     *uuid.UUID
}

CreateWarehouseInput represents a mutation input for creating warehouses.

func (*CreateWarehouseInput) Mutate

Mutate applies the CreateWarehouseInput on the WarehouseMutation builder.

type CreateWebsiteInput

type CreateWebsiteInput struct {
	Title       string
	Description string
	URL         string
	CompanyID   *uuid.UUID
	CountryID   *uuid.UUID
}

CreateWebsiteInput represents a mutation input for creating websites.

func (*CreateWebsiteInput) Mutate

func (i *CreateWebsiteInput) Mutate(m *WebsiteMutation)

Mutate applies the CreateWebsiteInput on the WebsiteMutation builder.

type Cursor

type Cursor struct {
	ID    uuid.UUID `msgpack:"i"`
	Value Value     `msgpack:"v,omitempty"`
}

Cursor of an edge type.

func (Cursor) MarshalGQL

func (c Cursor) MarshalGQL(w io.Writer)

MarshalGQL implements graphql.Marshaler interface.

func (*Cursor) UnmarshalGQL

func (c *Cursor) UnmarshalGQL(v interface{}) error

UnmarshalGQL implements graphql.Unmarshaler interface.

type Email

type Email struct {

	// ID of the ent.
	ID uuid.UUID `json:"id,omitempty"`
	// Title holds the value of the "title" field.
	Title string `json:"title,omitempty"`
	// Description holds the value of the "description" field.
	Description string `json:"description,omitempty"`
	// Address holds the value of the "address" field.
	Address string `json:"address,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the EmailQuery when eager-loading is set.
	Edges EmailEdges `json:"edges"`
	// contains filtered or unexported fields
}

Email is the model entity for the Email schema.

func (*Email) Company

func (e *Email) Company(ctx context.Context) (*Company, error)

func (*Email) Country

func (e *Email) Country(ctx context.Context) (*Country, error)

func (*Email) IsNode

func (n *Email) IsNode()

IsNode implements the Node interface check for GQLGen.

func (*Email) QueryCompany

func (e *Email) QueryCompany() *CompanyQuery

QueryCompany queries the "company" edge of the Email entity.

func (*Email) QueryCountry

func (e *Email) QueryCountry() *CountryQuery

QueryCountry queries the "country" edge of the Email entity.

func (*Email) String

func (e *Email) String() string

String implements the fmt.Stringer.

func (*Email) ToEdge

func (e *Email) ToEdge(order *EmailOrder) *EmailEdge

ToEdge converts Email into EmailEdge.

func (*Email) Unwrap

func (e *Email) Unwrap() *Email

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

func (e *Email) Update() *EmailUpdateOne

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

type EmailClient

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

EmailClient is a client for the Email schema.

func NewEmailClient

func NewEmailClient(c config) *EmailClient

NewEmailClient returns a client for the Email from the given config.

func (*EmailClient) Create

func (c *EmailClient) Create() *EmailCreate

Create returns a builder for creating a Email entity.

func (*EmailClient) CreateBulk

func (c *EmailClient) CreateBulk(builders ...*EmailCreate) *EmailCreateBulk

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

func (*EmailClient) Delete

func (c *EmailClient) Delete() *EmailDelete

Delete returns a delete builder for Email.

func (*EmailClient) DeleteOne

func (c *EmailClient) DeleteOne(e *Email) *EmailDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*EmailClient) DeleteOneID

func (c *EmailClient) DeleteOneID(id uuid.UUID) *EmailDeleteOne

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

func (*EmailClient) Get

func (c *EmailClient) Get(ctx context.Context, id uuid.UUID) (*Email, error)

Get returns a Email entity by its id.

func (*EmailClient) GetX

func (c *EmailClient) GetX(ctx context.Context, id uuid.UUID) *Email

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

func (*EmailClient) Hooks

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

Hooks returns the client hooks.

func (*EmailClient) Intercept

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

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

func (*EmailClient) Interceptors

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

Interceptors returns the client interceptors.

func (*EmailClient) Query

func (c *EmailClient) Query() *EmailQuery

Query returns a query builder for Email.

func (*EmailClient) QueryCompany

func (c *EmailClient) QueryCompany(e *Email) *CompanyQuery

QueryCompany queries the company edge of a Email.

func (*EmailClient) QueryCountry

func (c *EmailClient) QueryCountry(e *Email) *CountryQuery

QueryCountry queries the country edge of a Email.

func (*EmailClient) Update

func (c *EmailClient) Update() *EmailUpdate

Update returns an update builder for Email.

func (*EmailClient) UpdateOne

func (c *EmailClient) UpdateOne(e *Email) *EmailUpdateOne

UpdateOne returns an update builder for the given entity.

func (*EmailClient) UpdateOneID

func (c *EmailClient) UpdateOneID(id uuid.UUID) *EmailUpdateOne

UpdateOneID returns an update builder for the given id.

func (*EmailClient) Use

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

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

type EmailConnection

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

EmailConnection is the connection containing edges to Email.

type EmailCreate

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

EmailCreate is the builder for creating a Email entity.

func (*EmailCreate) Exec

func (ec *EmailCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*EmailCreate) ExecX

func (ec *EmailCreate) ExecX(ctx context.Context)

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

func (*EmailCreate) Mutation

func (ec *EmailCreate) Mutation() *EmailMutation

Mutation returns the EmailMutation object of the builder.

func (*EmailCreate) Save

func (ec *EmailCreate) Save(ctx context.Context) (*Email, error)

Save creates the Email in the database.

func (*EmailCreate) SaveX

func (ec *EmailCreate) SaveX(ctx context.Context) *Email

SaveX calls Save and panics if Save returns an error.

func (*EmailCreate) SetAddress

func (ec *EmailCreate) SetAddress(s string) *EmailCreate

SetAddress sets the "address" field.

func (*EmailCreate) SetCompany

func (ec *EmailCreate) SetCompany(c *Company) *EmailCreate

SetCompany sets the "company" edge to the Company entity.

func (*EmailCreate) SetCompanyID

func (ec *EmailCreate) SetCompanyID(id uuid.UUID) *EmailCreate

SetCompanyID sets the "company" edge to the Company entity by ID.

func (*EmailCreate) SetCountry

func (ec *EmailCreate) SetCountry(c *Country) *EmailCreate

SetCountry sets the "country" edge to the Country entity.

func (*EmailCreate) SetCountryID

func (ec *EmailCreate) SetCountryID(id uuid.UUID) *EmailCreate

SetCountryID sets the "country" edge to the Country entity by ID.

func (*EmailCreate) SetDescription

func (ec *EmailCreate) SetDescription(s string) *EmailCreate

SetDescription sets the "description" field.

func (*EmailCreate) SetID

func (ec *EmailCreate) SetID(u uuid.UUID) *EmailCreate

SetID sets the "id" field.

func (*EmailCreate) SetInput

func (c *EmailCreate) SetInput(i CreateEmailInput) *EmailCreate

SetInput applies the change-set in the CreateEmailInput on the EmailCreate builder.

func (*EmailCreate) SetNillableCompanyID

func (ec *EmailCreate) SetNillableCompanyID(id *uuid.UUID) *EmailCreate

SetNillableCompanyID sets the "company" edge to the Company entity by ID if the given value is not nil.

func (*EmailCreate) SetNillableCountryID

func (ec *EmailCreate) SetNillableCountryID(id *uuid.UUID) *EmailCreate

SetNillableCountryID sets the "country" edge to the Country entity by ID if the given value is not nil.

func (*EmailCreate) SetNillableID

func (ec *EmailCreate) SetNillableID(u *uuid.UUID) *EmailCreate

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

func (*EmailCreate) SetTitle

func (ec *EmailCreate) SetTitle(s string) *EmailCreate

SetTitle sets the "title" field.

type EmailCreateBulk

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

EmailCreateBulk is the builder for creating many Email entities in bulk.

func (*EmailCreateBulk) Exec

func (ecb *EmailCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*EmailCreateBulk) ExecX

func (ecb *EmailCreateBulk) ExecX(ctx context.Context)

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

func (*EmailCreateBulk) Save

func (ecb *EmailCreateBulk) Save(ctx context.Context) ([]*Email, error)

Save creates the Email entities in the database.

func (*EmailCreateBulk) SaveX

func (ecb *EmailCreateBulk) SaveX(ctx context.Context) []*Email

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

type EmailDelete

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

EmailDelete is the builder for deleting a Email entity.

func (*EmailDelete) Exec

func (ed *EmailDelete) Exec(ctx context.Context) (int, error)

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

func (*EmailDelete) ExecX

func (ed *EmailDelete) ExecX(ctx context.Context) int

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

func (*EmailDelete) Where

func (ed *EmailDelete) Where(ps ...predicate.Email) *EmailDelete

Where appends a list predicates to the EmailDelete builder.

type EmailDeleteOne

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

EmailDeleteOne is the builder for deleting a single Email entity.

func (*EmailDeleteOne) Exec

func (edo *EmailDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*EmailDeleteOne) ExecX

func (edo *EmailDeleteOne) ExecX(ctx context.Context)

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

type EmailEdge

type EmailEdge struct {
	Node   *Email `json:"node"`
	Cursor Cursor `json:"cursor"`
}

EmailEdge is the edge representation of Email.

type EmailEdges

type EmailEdges struct {
	// Company holds the value of the company edge.
	Company *Company `json:"company,omitempty"`
	// Country holds the value of the country edge.
	Country *Country `json:"country,omitempty"`
	// contains filtered or unexported fields
}

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

func (EmailEdges) CompanyOrErr

func (e EmailEdges) CompanyOrErr() (*Company, error)

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

func (EmailEdges) CountryOrErr

func (e EmailEdges) CountryOrErr() (*Country, error)

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

type EmailGroupBy

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

EmailGroupBy is the group-by builder for Email entities.

func (*EmailGroupBy) Aggregate

func (egb *EmailGroupBy) Aggregate(fns ...AggregateFunc) *EmailGroupBy

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

func (*EmailGroupBy) Bool

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

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

func (*EmailGroupBy) BoolX

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

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

func (*EmailGroupBy) Bools

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

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

func (*EmailGroupBy) BoolsX

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

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

func (*EmailGroupBy) Float64

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

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

func (*EmailGroupBy) Float64X

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

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

func (*EmailGroupBy) Float64s

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

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

func (*EmailGroupBy) Float64sX

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

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

func (*EmailGroupBy) Int

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

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

func (*EmailGroupBy) IntX

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

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

func (*EmailGroupBy) Ints

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

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

func (*EmailGroupBy) IntsX

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

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

func (*EmailGroupBy) Scan

func (egb *EmailGroupBy) Scan(ctx context.Context, v any) error

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

func (*EmailGroupBy) ScanX

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

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

func (*EmailGroupBy) String

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

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

func (*EmailGroupBy) StringX

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

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

func (*EmailGroupBy) Strings

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

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

func (*EmailGroupBy) StringsX

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

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

type EmailMutation

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

EmailMutation represents an operation that mutates the Email nodes in the graph.

func (*EmailMutation) AddField

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

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

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

func (*EmailMutation) AddedField

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

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

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

func (*EmailMutation) AddedIDs

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

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

func (*EmailMutation) Address

func (m *EmailMutation) Address() (r string, exists bool)

Address returns the value of the "address" field in the mutation.

func (*EmailMutation) ClearCompany

func (m *EmailMutation) ClearCompany()

ClearCompany clears the "company" edge to the Company entity.

func (*EmailMutation) ClearCountry

func (m *EmailMutation) ClearCountry()

ClearCountry clears the "country" edge to the Country entity.

func (*EmailMutation) ClearEdge

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

func (m *EmailMutation) 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 (*EmailMutation) ClearedEdges

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

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

func (*EmailMutation) ClearedFields

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

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

func (EmailMutation) Client

func (m EmailMutation) 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 (*EmailMutation) CompanyCleared

func (m *EmailMutation) CompanyCleared() bool

CompanyCleared reports if the "company" edge to the Company entity was cleared.

func (*EmailMutation) CompanyID

func (m *EmailMutation) CompanyID() (id uuid.UUID, exists bool)

CompanyID returns the "company" edge ID in the mutation.

func (*EmailMutation) CompanyIDs

func (m *EmailMutation) CompanyIDs() (ids []uuid.UUID)

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

func (*EmailMutation) CountryCleared

func (m *EmailMutation) CountryCleared() bool

CountryCleared reports if the "country" edge to the Country entity was cleared.

func (*EmailMutation) CountryID

func (m *EmailMutation) CountryID() (id uuid.UUID, exists bool)

CountryID returns the "country" edge ID in the mutation.

func (*EmailMutation) CountryIDs

func (m *EmailMutation) CountryIDs() (ids []uuid.UUID)

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

func (*EmailMutation) Description

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

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

func (*EmailMutation) EdgeCleared

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

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

func (*EmailMutation) Field

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

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

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

func (*EmailMutation) Fields

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

func (m *EmailMutation) ID() (id uuid.UUID, 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 (*EmailMutation) IDs

func (m *EmailMutation) IDs(ctx context.Context) ([]uuid.UUID, 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 (*EmailMutation) OldAddress

func (m *EmailMutation) OldAddress(ctx context.Context) (v string, err error)

OldAddress returns the old "address" field's value of the Email entity. If the Email 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 (*EmailMutation) OldDescription

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

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

func (m *EmailMutation) 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 (*EmailMutation) OldTitle

func (m *EmailMutation) OldTitle(ctx context.Context) (v string, err error)

OldTitle returns the old "title" field's value of the Email entity. If the Email 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 (*EmailMutation) Op

func (m *EmailMutation) Op() Op

Op returns the operation name.

func (*EmailMutation) RemovedEdges

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

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

func (*EmailMutation) RemovedIDs

func (m *EmailMutation) 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 (*EmailMutation) ResetAddress

func (m *EmailMutation) ResetAddress()

ResetAddress resets all changes to the "address" field.

func (*EmailMutation) ResetCompany

func (m *EmailMutation) ResetCompany()

ResetCompany resets all changes to the "company" edge.

func (*EmailMutation) ResetCountry

func (m *EmailMutation) ResetCountry()

ResetCountry resets all changes to the "country" edge.

func (*EmailMutation) ResetDescription

func (m *EmailMutation) ResetDescription()

ResetDescription resets all changes to the "description" field.

func (*EmailMutation) ResetEdge

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

func (m *EmailMutation) 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 (*EmailMutation) ResetTitle

func (m *EmailMutation) ResetTitle()

ResetTitle resets all changes to the "title" field.

func (*EmailMutation) SetAddress

func (m *EmailMutation) SetAddress(s string)

SetAddress sets the "address" field.

func (*EmailMutation) SetCompanyID

func (m *EmailMutation) SetCompanyID(id uuid.UUID)

SetCompanyID sets the "company" edge to the Company entity by id.

func (*EmailMutation) SetCountryID

func (m *EmailMutation) SetCountryID(id uuid.UUID)

SetCountryID sets the "country" edge to the Country entity by id.

func (*EmailMutation) SetDescription

func (m *EmailMutation) SetDescription(s string)

SetDescription sets the "description" field.

func (*EmailMutation) SetField

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

func (m *EmailMutation) SetID(id uuid.UUID)

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

func (*EmailMutation) SetOp

func (m *EmailMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*EmailMutation) SetTitle

func (m *EmailMutation) SetTitle(s string)

SetTitle sets the "title" field.

func (*EmailMutation) Title

func (m *EmailMutation) Title() (r string, exists bool)

Title returns the value of the "title" field in the mutation.

func (EmailMutation) Tx

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

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

func (*EmailMutation) Type

func (m *EmailMutation) Type() string

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

func (*EmailMutation) Where

func (m *EmailMutation) Where(ps ...predicate.Email)

Where appends a list predicates to the EmailMutation builder.

func (*EmailMutation) WhereP

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

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

type EmailOrder

type EmailOrder struct {
	Direction OrderDirection   `json:"direction"`
	Field     *EmailOrderField `json:"field"`
}

EmailOrder defines the ordering of Email.

type EmailOrderField

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

EmailOrderField defines the ordering field of Email.

func (EmailOrderField) MarshalGQL

func (f EmailOrderField) MarshalGQL(w io.Writer)

MarshalGQL implements graphql.Marshaler interface.

func (EmailOrderField) String

func (f EmailOrderField) String() string

String implement fmt.Stringer interface.

func (*EmailOrderField) UnmarshalGQL

func (f *EmailOrderField) UnmarshalGQL(v interface{}) error

UnmarshalGQL implements graphql.Unmarshaler interface.

type EmailPaginateOption

type EmailPaginateOption func(*emailPager) error

EmailPaginateOption enables pagination customization.

func WithEmailFilter

func WithEmailFilter(filter func(*EmailQuery) (*EmailQuery, error)) EmailPaginateOption

WithEmailFilter configures pagination filter.

func WithEmailOrder

func WithEmailOrder(order *EmailOrder) EmailPaginateOption

WithEmailOrder configures pagination ordering.

type EmailQuery

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

EmailQuery is the builder for querying Email entities.

func (*EmailQuery) Aggregate

func (eq *EmailQuery) Aggregate(fns ...AggregateFunc) *EmailSelect

Aggregate returns a EmailSelect configured with the given aggregations.

func (*EmailQuery) All

func (eq *EmailQuery) All(ctx context.Context) ([]*Email, error)

All executes the query and returns a list of Emails.

func (*EmailQuery) AllX

func (eq *EmailQuery) AllX(ctx context.Context) []*Email

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

func (*EmailQuery) Clone

func (eq *EmailQuery) Clone() *EmailQuery

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

func (*EmailQuery) CollectFields

func (e *EmailQuery) CollectFields(ctx context.Context, satisfies ...string) (*EmailQuery, error)

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

func (*EmailQuery) Count

func (eq *EmailQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*EmailQuery) CountX

func (eq *EmailQuery) CountX(ctx context.Context) int

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

func (*EmailQuery) Exist

func (eq *EmailQuery) Exist(ctx context.Context) (bool, error)

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

func (*EmailQuery) ExistX

func (eq *EmailQuery) ExistX(ctx context.Context) bool

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

func (*EmailQuery) First

func (eq *EmailQuery) First(ctx context.Context) (*Email, error)

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

func (*EmailQuery) FirstID

func (eq *EmailQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

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

func (*EmailQuery) FirstIDX

func (eq *EmailQuery) FirstIDX(ctx context.Context) uuid.UUID

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

func (*EmailQuery) FirstX

func (eq *EmailQuery) FirstX(ctx context.Context) *Email

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

func (*EmailQuery) GroupBy

func (eq *EmailQuery) GroupBy(field string, fields ...string) *EmailGroupBy

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

client.Email.Query().
	GroupBy(email.FieldTitle).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*EmailQuery) IDs

func (eq *EmailQuery) IDs(ctx context.Context) ([]uuid.UUID, error)

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

func (*EmailQuery) IDsX

func (eq *EmailQuery) IDsX(ctx context.Context) []uuid.UUID

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

func (*EmailQuery) Limit

func (eq *EmailQuery) Limit(limit int) *EmailQuery

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

func (*EmailQuery) Offset

func (eq *EmailQuery) Offset(offset int) *EmailQuery

Offset to start from.

func (*EmailQuery) Only

func (eq *EmailQuery) Only(ctx context.Context) (*Email, error)

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

func (*EmailQuery) OnlyID

func (eq *EmailQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

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

func (*EmailQuery) OnlyIDX

func (eq *EmailQuery) OnlyIDX(ctx context.Context) uuid.UUID

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

func (*EmailQuery) OnlyX

func (eq *EmailQuery) OnlyX(ctx context.Context) *Email

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

func (*EmailQuery) Order

func (eq *EmailQuery) Order(o ...OrderFunc) *EmailQuery

Order specifies how the records should be ordered.

func (*EmailQuery) Paginate

func (e *EmailQuery) Paginate(
	ctx context.Context, after *Cursor, first *int,
	before *Cursor, last *int, opts ...EmailPaginateOption,
) (*EmailConnection, error)

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

func (*EmailQuery) QueryCompany

func (eq *EmailQuery) QueryCompany() *CompanyQuery

QueryCompany chains the current query on the "company" edge.

func (*EmailQuery) QueryCountry

func (eq *EmailQuery) QueryCountry() *CountryQuery

QueryCountry chains the current query on the "country" edge.

func (*EmailQuery) Select

func (eq *EmailQuery) Select(fields ...string) *EmailSelect

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

client.Email.Query().
	Select(email.FieldTitle).
	Scan(ctx, &v)

func (*EmailQuery) Unique

func (eq *EmailQuery) Unique(unique bool) *EmailQuery

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

func (eq *EmailQuery) Where(ps ...predicate.Email) *EmailQuery

Where adds a new predicate for the EmailQuery builder.

func (*EmailQuery) WithCompany

func (eq *EmailQuery) WithCompany(opts ...func(*CompanyQuery)) *EmailQuery

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

func (*EmailQuery) WithCountry

func (eq *EmailQuery) WithCountry(opts ...func(*CountryQuery)) *EmailQuery

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

type EmailSelect

type EmailSelect struct {
	*EmailQuery
	// contains filtered or unexported fields
}

EmailSelect is the builder for selecting fields of Email entities.

func (*EmailSelect) Aggregate

func (es *EmailSelect) Aggregate(fns ...AggregateFunc) *EmailSelect

Aggregate adds the given aggregation functions to the selector query.

func (*EmailSelect) Bool

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

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

func (*EmailSelect) BoolX

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

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

func (*EmailSelect) Bools

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

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

func (*EmailSelect) BoolsX

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

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

func (*EmailSelect) Float64

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

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

func (*EmailSelect) Float64X

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

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

func (*EmailSelect) Float64s

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

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

func (*EmailSelect) Float64sX

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

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

func (*EmailSelect) Int

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

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

func (*EmailSelect) IntX

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

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

func (*EmailSelect) Ints

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

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

func (*EmailSelect) IntsX

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

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

func (*EmailSelect) Scan

func (es *EmailSelect) Scan(ctx context.Context, v any) error

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

func (*EmailSelect) ScanX

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

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

func (*EmailSelect) String

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

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

func (*EmailSelect) StringX

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

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

func (*EmailSelect) Strings

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

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

func (*EmailSelect) StringsX

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

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

type EmailUpdate

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

EmailUpdate is the builder for updating Email entities.

func (*EmailUpdate) ClearCompany

func (eu *EmailUpdate) ClearCompany() *EmailUpdate

ClearCompany clears the "company" edge to the Company entity.

func (*EmailUpdate) ClearCountry

func (eu *EmailUpdate) ClearCountry() *EmailUpdate

ClearCountry clears the "country" edge to the Country entity.

func (*EmailUpdate) Exec

func (eu *EmailUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*EmailUpdate) ExecX

func (eu *EmailUpdate) ExecX(ctx context.Context)

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

func (*EmailUpdate) Mutation

func (eu *EmailUpdate) Mutation() *EmailMutation

Mutation returns the EmailMutation object of the builder.

func (*EmailUpdate) Save

func (eu *EmailUpdate) Save(ctx context.Context) (int, error)

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

func (*EmailUpdate) SaveX

func (eu *EmailUpdate) SaveX(ctx context.Context) int

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

func (*EmailUpdate) SetAddress

func (eu *EmailUpdate) SetAddress(s string) *EmailUpdate

SetAddress sets the "address" field.

func (*EmailUpdate) SetCompany

func (eu *EmailUpdate) SetCompany(c *Company) *EmailUpdate

SetCompany sets the "company" edge to the Company entity.

func (*EmailUpdate) SetCompanyID

func (eu *EmailUpdate) SetCompanyID(id uuid.UUID) *EmailUpdate

SetCompanyID sets the "company" edge to the Company entity by ID.

func (*EmailUpdate) SetCountry

func (eu *EmailUpdate) SetCountry(c *Country) *EmailUpdate

SetCountry sets the "country" edge to the Country entity.

func (*EmailUpdate) SetCountryID

func (eu *EmailUpdate) SetCountryID(id uuid.UUID) *EmailUpdate

SetCountryID sets the "country" edge to the Country entity by ID.

func (*EmailUpdate) SetDescription

func (eu *EmailUpdate) SetDescription(s string) *EmailUpdate

SetDescription sets the "description" field.

func (*EmailUpdate) SetInput

func (c *EmailUpdate) SetInput(i UpdateEmailInput) *EmailUpdate

SetInput applies the change-set in the UpdateEmailInput on the EmailUpdate builder.

func (*EmailUpdate) SetNillableCompanyID

func (eu *EmailUpdate) SetNillableCompanyID(id *uuid.UUID) *EmailUpdate

SetNillableCompanyID sets the "company" edge to the Company entity by ID if the given value is not nil.

func (*EmailUpdate) SetNillableCountryID

func (eu *EmailUpdate) SetNillableCountryID(id *uuid.UUID) *EmailUpdate

SetNillableCountryID sets the "country" edge to the Country entity by ID if the given value is not nil.

func (*EmailUpdate) SetTitle

func (eu *EmailUpdate) SetTitle(s string) *EmailUpdate

SetTitle sets the "title" field.

func (*EmailUpdate) Where

func (eu *EmailUpdate) Where(ps ...predicate.Email) *EmailUpdate

Where appends a list predicates to the EmailUpdate builder.

type EmailUpdateOne

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

EmailUpdateOne is the builder for updating a single Email entity.

func (*EmailUpdateOne) ClearCompany

func (euo *EmailUpdateOne) ClearCompany() *EmailUpdateOne

ClearCompany clears the "company" edge to the Company entity.

func (*EmailUpdateOne) ClearCountry

func (euo *EmailUpdateOne) ClearCountry() *EmailUpdateOne

ClearCountry clears the "country" edge to the Country entity.

func (*EmailUpdateOne) Exec

func (euo *EmailUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*EmailUpdateOne) ExecX

func (euo *EmailUpdateOne) ExecX(ctx context.Context)

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

func (*EmailUpdateOne) Mutation

func (euo *EmailUpdateOne) Mutation() *EmailMutation

Mutation returns the EmailMutation object of the builder.

func (*EmailUpdateOne) Save

func (euo *EmailUpdateOne) Save(ctx context.Context) (*Email, error)

Save executes the query and returns the updated Email entity.

func (*EmailUpdateOne) SaveX

func (euo *EmailUpdateOne) SaveX(ctx context.Context) *Email

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

func (*EmailUpdateOne) Select

func (euo *EmailUpdateOne) Select(field string, fields ...string) *EmailUpdateOne

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

func (*EmailUpdateOne) SetAddress

func (euo *EmailUpdateOne) SetAddress(s string) *EmailUpdateOne

SetAddress sets the "address" field.

func (*EmailUpdateOne) SetCompany

func (euo *EmailUpdateOne) SetCompany(c *Company) *EmailUpdateOne

SetCompany sets the "company" edge to the Company entity.

func (*EmailUpdateOne) SetCompanyID

func (euo *EmailUpdateOne) SetCompanyID(id uuid.UUID) *EmailUpdateOne

SetCompanyID sets the "company" edge to the Company entity by ID.

func (*EmailUpdateOne) SetCountry

func (euo *EmailUpdateOne) SetCountry(c *Country) *EmailUpdateOne

SetCountry sets the "country" edge to the Country entity.

func (*EmailUpdateOne) SetCountryID

func (euo *EmailUpdateOne) SetCountryID(id uuid.UUID) *EmailUpdateOne

SetCountryID sets the "country" edge to the Country entity by ID.

func (*EmailUpdateOne) SetDescription

func (euo *EmailUpdateOne) SetDescription(s string) *EmailUpdateOne

SetDescription sets the "description" field.

func (*EmailUpdateOne) SetInput

SetInput applies the change-set in the UpdateEmailInput on the EmailUpdateOne builder.

func (*EmailUpdateOne) SetNillableCompanyID

func (euo *EmailUpdateOne) SetNillableCompanyID(id *uuid.UUID) *EmailUpdateOne

SetNillableCompanyID sets the "company" edge to the Company entity by ID if the given value is not nil.

func (*EmailUpdateOne) SetNillableCountryID

func (euo *EmailUpdateOne) SetNillableCountryID(id *uuid.UUID) *EmailUpdateOne

SetNillableCountryID sets the "country" edge to the Country entity by ID if the given value is not nil.

func (*EmailUpdateOne) SetTitle

func (euo *EmailUpdateOne) SetTitle(s string) *EmailUpdateOne

SetTitle sets the "title" field.

type EmailWhereInput

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

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

	// "title" field predicates.
	Title             *string  `json:"title,omitempty"`
	TitleNEQ          *string  `json:"titleNEQ,omitempty"`
	TitleIn           []string `json:"titleIn,omitempty"`
	TitleNotIn        []string `json:"titleNotIn,omitempty"`
	TitleGT           *string  `json:"titleGT,omitempty"`
	TitleGTE          *string  `json:"titleGTE,omitempty"`
	TitleLT           *string  `json:"titleLT,omitempty"`
	TitleLTE          *string  `json:"titleLTE,omitempty"`
	TitleContains     *string  `json:"titleContains,omitempty"`
	TitleHasPrefix    *string  `json:"titleHasPrefix,omitempty"`
	TitleHasSuffix    *string  `json:"titleHasSuffix,omitempty"`
	TitleEqualFold    *string  `json:"titleEqualFold,omitempty"`
	TitleContainsFold *string  `json:"titleContainsFold,omitempty"`

	// "description" field predicates.
	Description             *string  `json:"description,omitempty"`
	DescriptionNEQ          *string  `json:"descriptionNEQ,omitempty"`
	DescriptionIn           []string `json:"descriptionIn,omitempty"`
	DescriptionNotIn        []string `json:"descriptionNotIn,omitempty"`
	DescriptionGT           *string  `json:"descriptionGT,omitempty"`
	DescriptionGTE          *string  `json:"descriptionGTE,omitempty"`
	DescriptionLT           *string  `json:"descriptionLT,omitempty"`
	DescriptionLTE          *string  `json:"descriptionLTE,omitempty"`
	DescriptionContains     *string  `json:"descriptionContains,omitempty"`
	DescriptionHasPrefix    *string  `json:"descriptionHasPrefix,omitempty"`
	DescriptionHasSuffix    *string  `json:"descriptionHasSuffix,omitempty"`
	DescriptionEqualFold    *string  `json:"descriptionEqualFold,omitempty"`
	DescriptionContainsFold *string  `json:"descriptionContainsFold,omitempty"`

	// "address" field predicates.
	Address             *string  `json:"address,omitempty"`
	AddressNEQ          *string  `json:"addressNEQ,omitempty"`
	AddressIn           []string `json:"addressIn,omitempty"`
	AddressNotIn        []string `json:"addressNotIn,omitempty"`
	AddressGT           *string  `json:"addressGT,omitempty"`
	AddressGTE          *string  `json:"addressGTE,omitempty"`
	AddressLT           *string  `json:"addressLT,omitempty"`
	AddressLTE          *string  `json:"addressLTE,omitempty"`
	AddressContains     *string  `json:"addressContains,omitempty"`
	AddressHasPrefix    *string  `json:"addressHasPrefix,omitempty"`
	AddressHasSuffix    *string  `json:"addressHasSuffix,omitempty"`
	AddressEqualFold    *string  `json:"addressEqualFold,omitempty"`
	AddressContainsFold *string  `json:"addressContainsFold,omitempty"`

	// "company" edge predicates.
	HasCompany     *bool                `json:"hasCompany,omitempty"`
	HasCompanyWith []*CompanyWhereInput `json:"hasCompanyWith,omitempty"`

	// "country" edge predicates.
	HasCountry     *bool                `json:"hasCountry,omitempty"`
	HasCountryWith []*CountryWhereInput `json:"hasCountryWith,omitempty"`
}

EmailWhereInput represents a where input for filtering Email queries.

func (*EmailWhereInput) AddPredicates

func (i *EmailWhereInput) AddPredicates(predicates ...predicate.Email)

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

func (*EmailWhereInput) ApplySearchQuery

func (ewi *EmailWhereInput) ApplySearchQuery(q *string) *EmailWhereInput

func (*EmailWhereInput) Filter

func (i *EmailWhereInput) Filter(q *EmailQuery) (*EmailQuery, error)

Filter applies the EmailWhereInput filter on the EmailQuery builder.

func (*EmailWhereInput) P

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

type Emails

type Emails []*Email

Emails is a parsable slice of Email.

type Hook

type Hook = ent.Hook

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

type Image

type Image struct {

	// ID of the ent.
	ID uuid.UUID `json:"id,omitempty"`
	// Title holds the value of the "title" field.
	Title string `json:"title,omitempty"`
	// OriginalURL holds the value of the "original_url" field.
	OriginalURL string `json:"original_url,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the ImageQuery when eager-loading is set.
	Edges ImageEdges `json:"edges"`
	// contains filtered or unexported fields
}

Image is the model entity for the Image schema.

func (*Image) CoverCompany

func (i *Image) CoverCompany(ctx context.Context) (*Company, error)

func (*Image) GalleryCompany

func (i *Image) GalleryCompany(ctx context.Context) (*Company, error)

func (*Image) IsNode

func (n *Image) IsNode()

IsNode implements the Node interface check for GQLGen.

func (*Image) LogoCompany

func (i *Image) LogoCompany(ctx context.Context) (*Company, error)

func (*Image) QueryCoverCompany

func (i *Image) QueryCoverCompany() *CompanyQuery

QueryCoverCompany queries the "cover_company" edge of the Image entity.

func (*Image) QueryGalleryCompany

func (i *Image) QueryGalleryCompany() *CompanyQuery

QueryGalleryCompany queries the "gallery_company" edge of the Image entity.

func (*Image) QueryLogoCompany

func (i *Image) QueryLogoCompany() *CompanyQuery

QueryLogoCompany queries the "logo_company" edge of the Image entity.

func (*Image) String

func (i *Image) String() string

String implements the fmt.Stringer.

func (*Image) ToEdge

func (i *Image) ToEdge(order *ImageOrder) *ImageEdge

ToEdge converts Image into ImageEdge.

func (*Image) Unwrap

func (i *Image) Unwrap() *Image

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

func (i *Image) Update() *ImageUpdateOne

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

type ImageClient

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

ImageClient is a client for the Image schema.

func NewImageClient

func NewImageClient(c config) *ImageClient

NewImageClient returns a client for the Image from the given config.

func (*ImageClient) Create

func (c *ImageClient) Create() *ImageCreate

Create returns a builder for creating a Image entity.

func (*ImageClient) CreateBulk

func (c *ImageClient) CreateBulk(builders ...*ImageCreate) *ImageCreateBulk

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

func (*ImageClient) Delete

func (c *ImageClient) Delete() *ImageDelete

Delete returns a delete builder for Image.

func (*ImageClient) DeleteOne

func (c *ImageClient) DeleteOne(i *Image) *ImageDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*ImageClient) DeleteOneID

func (c *ImageClient) DeleteOneID(id uuid.UUID) *ImageDeleteOne

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

func (*ImageClient) Get

func (c *ImageClient) Get(ctx context.Context, id uuid.UUID) (*Image, error)

Get returns a Image entity by its id.

func (*ImageClient) GetX

func (c *ImageClient) GetX(ctx context.Context, id uuid.UUID) *Image

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

func (*ImageClient) Hooks

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

Hooks returns the client hooks.

func (*ImageClient) Intercept

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

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

func (*ImageClient) Interceptors

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

Interceptors returns the client interceptors.

func (*ImageClient) Query

func (c *ImageClient) Query() *ImageQuery

Query returns a query builder for Image.

func (*ImageClient) QueryCoverCompany

func (c *ImageClient) QueryCoverCompany(i *Image) *CompanyQuery

QueryCoverCompany queries the cover_company edge of a Image.

func (*ImageClient) QueryGalleryCompany

func (c *ImageClient) QueryGalleryCompany(i *Image) *CompanyQuery

QueryGalleryCompany queries the gallery_company edge of a Image.

func (*ImageClient) QueryLogoCompany

func (c *ImageClient) QueryLogoCompany(i *Image) *CompanyQuery

QueryLogoCompany queries the logo_company edge of a Image.

func (*ImageClient) Update

func (c *ImageClient) Update() *ImageUpdate

Update returns an update builder for Image.

func (*ImageClient) UpdateOne

func (c *ImageClient) UpdateOne(i *Image) *ImageUpdateOne

UpdateOne returns an update builder for the given entity.

func (*ImageClient) UpdateOneID

func (c *ImageClient) UpdateOneID(id uuid.UUID) *ImageUpdateOne

UpdateOneID returns an update builder for the given id.

func (*ImageClient) Use

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

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

type ImageConnection

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

ImageConnection is the connection containing edges to Image.

type ImageCreate

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

ImageCreate is the builder for creating a Image entity.

func (*ImageCreate) Exec

func (ic *ImageCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*ImageCreate) ExecX

func (ic *ImageCreate) ExecX(ctx context.Context)

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

func (*ImageCreate) Mutation

func (ic *ImageCreate) Mutation() *ImageMutation

Mutation returns the ImageMutation object of the builder.

func (*ImageCreate) Save

func (ic *ImageCreate) Save(ctx context.Context) (*Image, error)

Save creates the Image in the database.

func (*ImageCreate) SaveX

func (ic *ImageCreate) SaveX(ctx context.Context) *Image

SaveX calls Save and panics if Save returns an error.

func (*ImageCreate) SetCoverCompany

func (ic *ImageCreate) SetCoverCompany(c *Company) *ImageCreate

SetCoverCompany sets the "cover_company" edge to the Company entity.

func (*ImageCreate) SetCoverCompanyID

func (ic *ImageCreate) SetCoverCompanyID(id uuid.UUID) *ImageCreate

SetCoverCompanyID sets the "cover_company" edge to the Company entity by ID.

func (*ImageCreate) SetGalleryCompany

func (ic *ImageCreate) SetGalleryCompany(c *Company) *ImageCreate

SetGalleryCompany sets the "gallery_company" edge to the Company entity.

func (*ImageCreate) SetGalleryCompanyID

func (ic *ImageCreate) SetGalleryCompanyID(id uuid.UUID) *ImageCreate

SetGalleryCompanyID sets the "gallery_company" edge to the Company entity by ID.

func (*ImageCreate) SetID

func (ic *ImageCreate) SetID(u uuid.UUID) *ImageCreate

SetID sets the "id" field.

func (*ImageCreate) SetInput

func (c *ImageCreate) SetInput(i CreateImageInput) *ImageCreate

SetInput applies the change-set in the CreateImageInput on the ImageCreate builder.

func (*ImageCreate) SetLogoCompany

func (ic *ImageCreate) SetLogoCompany(c *Company) *ImageCreate

SetLogoCompany sets the "logo_company" edge to the Company entity.

func (*ImageCreate) SetLogoCompanyID

func (ic *ImageCreate) SetLogoCompanyID(id uuid.UUID) *ImageCreate

SetLogoCompanyID sets the "logo_company" edge to the Company entity by ID.

func (*ImageCreate) SetNillableCoverCompanyID

func (ic *ImageCreate) SetNillableCoverCompanyID(id *uuid.UUID) *ImageCreate

SetNillableCoverCompanyID sets the "cover_company" edge to the Company entity by ID if the given value is not nil.

func (*ImageCreate) SetNillableGalleryCompanyID

func (ic *ImageCreate) SetNillableGalleryCompanyID(id *uuid.UUID) *ImageCreate

SetNillableGalleryCompanyID sets the "gallery_company" edge to the Company entity by ID if the given value is not nil.

func (*ImageCreate) SetNillableID

func (ic *ImageCreate) SetNillableID(u *uuid.UUID) *ImageCreate

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

func (*ImageCreate) SetNillableLogoCompanyID

func (ic *ImageCreate) SetNillableLogoCompanyID(id *uuid.UUID) *ImageCreate

SetNillableLogoCompanyID sets the "logo_company" edge to the Company entity by ID if the given value is not nil.

func (*ImageCreate) SetOriginalURL

func (ic *ImageCreate) SetOriginalURL(s string) *ImageCreate

SetOriginalURL sets the "original_url" field.

func (*ImageCreate) SetTitle

func (ic *ImageCreate) SetTitle(s string) *ImageCreate

SetTitle sets the "title" field.

type ImageCreateBulk

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

ImageCreateBulk is the builder for creating many Image entities in bulk.

func (*ImageCreateBulk) Exec

func (icb *ImageCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*ImageCreateBulk) ExecX

func (icb *ImageCreateBulk) ExecX(ctx context.Context)

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

func (*ImageCreateBulk) Save

func (icb *ImageCreateBulk) Save(ctx context.Context) ([]*Image, error)

Save creates the Image entities in the database.

func (*ImageCreateBulk) SaveX

func (icb *ImageCreateBulk) SaveX(ctx context.Context) []*Image

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

type ImageDelete

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

ImageDelete is the builder for deleting a Image entity.

func (*ImageDelete) Exec

func (id *ImageDelete) Exec(ctx context.Context) (int, error)

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

func (*ImageDelete) ExecX

func (id *ImageDelete) ExecX(ctx context.Context) int

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

func (*ImageDelete) Where

func (id *ImageDelete) Where(ps ...predicate.Image) *ImageDelete

Where appends a list predicates to the ImageDelete builder.

type ImageDeleteOne

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

ImageDeleteOne is the builder for deleting a single Image entity.

func (*ImageDeleteOne) Exec

func (ido *ImageDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*ImageDeleteOne) ExecX

func (ido *ImageDeleteOne) ExecX(ctx context.Context)

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

type ImageEdge

type ImageEdge struct {
	Node   *Image `json:"node"`
	Cursor Cursor `json:"cursor"`
}

ImageEdge is the edge representation of Image.

type ImageEdges

type ImageEdges struct {
	// GalleryCompany holds the value of the gallery_company edge.
	GalleryCompany *Company `json:"gallery_company,omitempty"`
	// LogoCompany holds the value of the logo_company edge.
	LogoCompany *Company `json:"logo_company,omitempty"`
	// CoverCompany holds the value of the cover_company edge.
	CoverCompany *Company `json:"cover_company,omitempty"`
	// contains filtered or unexported fields
}

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

func (ImageEdges) CoverCompanyOrErr

func (e ImageEdges) CoverCompanyOrErr() (*Company, error)

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

func (ImageEdges) GalleryCompanyOrErr

func (e ImageEdges) GalleryCompanyOrErr() (*Company, error)

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

func (ImageEdges) LogoCompanyOrErr

func (e ImageEdges) LogoCompanyOrErr() (*Company, error)

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

type ImageGroupBy

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

ImageGroupBy is the group-by builder for Image entities.

func (*ImageGroupBy) Aggregate

func (igb *ImageGroupBy) Aggregate(fns ...AggregateFunc) *ImageGroupBy

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

func (*ImageGroupBy) Bool

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

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

func (*ImageGroupBy) BoolX

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

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

func (*ImageGroupBy) Bools

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

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

func (*ImageGroupBy) BoolsX

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

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

func (*ImageGroupBy) Float64

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

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

func (*ImageGroupBy) Float64X

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

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

func (*ImageGroupBy) Float64s

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

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

func (*ImageGroupBy) Float64sX

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

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

func (*ImageGroupBy) Int

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

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

func (*ImageGroupBy) IntX

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

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

func (*ImageGroupBy) Ints

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

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

func (*ImageGroupBy) IntsX

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

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

func (*ImageGroupBy) Scan

func (igb *ImageGroupBy) Scan(ctx context.Context, v any) error

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

func (*ImageGroupBy) ScanX

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

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

func (*ImageGroupBy) String

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

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

func (*ImageGroupBy) StringX

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

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

func (*ImageGroupBy) Strings

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

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

func (*ImageGroupBy) StringsX

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

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

type ImageMutation

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

ImageMutation represents an operation that mutates the Image nodes in the graph.

func (*ImageMutation) AddField

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

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

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

func (*ImageMutation) AddedField

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

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

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

func (*ImageMutation) AddedIDs

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

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

func (*ImageMutation) ClearCoverCompany

func (m *ImageMutation) ClearCoverCompany()

ClearCoverCompany clears the "cover_company" edge to the Company entity.

func (*ImageMutation) ClearEdge

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

func (m *ImageMutation) 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 (*ImageMutation) ClearGalleryCompany

func (m *ImageMutation) ClearGalleryCompany()

ClearGalleryCompany clears the "gallery_company" edge to the Company entity.

func (*ImageMutation) ClearLogoCompany

func (m *ImageMutation) ClearLogoCompany()

ClearLogoCompany clears the "logo_company" edge to the Company entity.

func (*ImageMutation) ClearedEdges

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

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

func (*ImageMutation) ClearedFields

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

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

func (ImageMutation) Client

func (m ImageMutation) 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 (*ImageMutation) CoverCompanyCleared

func (m *ImageMutation) CoverCompanyCleared() bool

CoverCompanyCleared reports if the "cover_company" edge to the Company entity was cleared.

func (*ImageMutation) CoverCompanyID

func (m *ImageMutation) CoverCompanyID() (id uuid.UUID, exists bool)

CoverCompanyID returns the "cover_company" edge ID in the mutation.

func (*ImageMutation) CoverCompanyIDs

func (m *ImageMutation) CoverCompanyIDs() (ids []uuid.UUID)

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

func (*ImageMutation) EdgeCleared

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

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

func (*ImageMutation) Field

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

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

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

func (*ImageMutation) Fields

func (m *ImageMutation) 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 (*ImageMutation) GalleryCompanyCleared

func (m *ImageMutation) GalleryCompanyCleared() bool

GalleryCompanyCleared reports if the "gallery_company" edge to the Company entity was cleared.

func (*ImageMutation) GalleryCompanyID

func (m *ImageMutation) GalleryCompanyID() (id uuid.UUID, exists bool)

GalleryCompanyID returns the "gallery_company" edge ID in the mutation.

func (*ImageMutation) GalleryCompanyIDs

func (m *ImageMutation) GalleryCompanyIDs() (ids []uuid.UUID)

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

func (*ImageMutation) ID

func (m *ImageMutation) ID() (id uuid.UUID, 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 (*ImageMutation) IDs

func (m *ImageMutation) IDs(ctx context.Context) ([]uuid.UUID, 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 (*ImageMutation) LogoCompanyCleared

func (m *ImageMutation) LogoCompanyCleared() bool

LogoCompanyCleared reports if the "logo_company" edge to the Company entity was cleared.

func (*ImageMutation) LogoCompanyID

func (m *ImageMutation) LogoCompanyID() (id uuid.UUID, exists bool)

LogoCompanyID returns the "logo_company" edge ID in the mutation.

func (*ImageMutation) LogoCompanyIDs

func (m *ImageMutation) LogoCompanyIDs() (ids []uuid.UUID)

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

func (*ImageMutation) OldField

func (m *ImageMutation) 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 (*ImageMutation) OldOriginalURL

func (m *ImageMutation) OldOriginalURL(ctx context.Context) (v string, err error)

OldOriginalURL returns the old "original_url" field's value of the Image entity. If the Image 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 (*ImageMutation) OldTitle

func (m *ImageMutation) OldTitle(ctx context.Context) (v string, err error)

OldTitle returns the old "title" field's value of the Image entity. If the Image 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 (*ImageMutation) Op

func (m *ImageMutation) Op() Op

Op returns the operation name.

func (*ImageMutation) OriginalURL

func (m *ImageMutation) OriginalURL() (r string, exists bool)

OriginalURL returns the value of the "original_url" field in the mutation.

func (*ImageMutation) RemovedEdges

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

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

func (*ImageMutation) RemovedIDs

func (m *ImageMutation) 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 (*ImageMutation) ResetCoverCompany

func (m *ImageMutation) ResetCoverCompany()

ResetCoverCompany resets all changes to the "cover_company" edge.

func (*ImageMutation) ResetEdge

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

func (m *ImageMutation) 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 (*ImageMutation) ResetGalleryCompany

func (m *ImageMutation) ResetGalleryCompany()

ResetGalleryCompany resets all changes to the "gallery_company" edge.

func (*ImageMutation) ResetLogoCompany

func (m *ImageMutation) ResetLogoCompany()

ResetLogoCompany resets all changes to the "logo_company" edge.

func (*ImageMutation) ResetOriginalURL

func (m *ImageMutation) ResetOriginalURL()

ResetOriginalURL resets all changes to the "original_url" field.

func (*ImageMutation) ResetTitle

func (m *ImageMutation) ResetTitle()

ResetTitle resets all changes to the "title" field.

func (*ImageMutation) SetCoverCompanyID

func (m *ImageMutation) SetCoverCompanyID(id uuid.UUID)

SetCoverCompanyID sets the "cover_company" edge to the Company entity by id.

func (*ImageMutation) SetField

func (m *ImageMutation) 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 (*ImageMutation) SetGalleryCompanyID

func (m *ImageMutation) SetGalleryCompanyID(id uuid.UUID)

SetGalleryCompanyID sets the "gallery_company" edge to the Company entity by id.

func (*ImageMutation) SetID

func (m *ImageMutation) SetID(id uuid.UUID)

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

func (*ImageMutation) SetLogoCompanyID

func (m *ImageMutation) SetLogoCompanyID(id uuid.UUID)

SetLogoCompanyID sets the "logo_company" edge to the Company entity by id.

func (*ImageMutation) SetOp

func (m *ImageMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*ImageMutation) SetOriginalURL

func (m *ImageMutation) SetOriginalURL(s string)

SetOriginalURL sets the "original_url" field.

func (*ImageMutation) SetTitle

func (m *ImageMutation) SetTitle(s string)

SetTitle sets the "title" field.

func (*ImageMutation) Title

func (m *ImageMutation) Title() (r string, exists bool)

Title returns the value of the "title" field in the mutation.

func (ImageMutation) Tx

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

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

func (*ImageMutation) Type

func (m *ImageMutation) Type() string

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

func (*ImageMutation) Where

func (m *ImageMutation) Where(ps ...predicate.Image)

Where appends a list predicates to the ImageMutation builder.

func (*ImageMutation) WhereP

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

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

type ImageOrder

type ImageOrder struct {
	Direction OrderDirection   `json:"direction"`
	Field     *ImageOrderField `json:"field"`
}

ImageOrder defines the ordering of Image.

type ImageOrderField

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

ImageOrderField defines the ordering field of Image.

func (ImageOrderField) MarshalGQL

func (f ImageOrderField) MarshalGQL(w io.Writer)

MarshalGQL implements graphql.Marshaler interface.

func (ImageOrderField) String

func (f ImageOrderField) String() string

String implement fmt.Stringer interface.

func (*ImageOrderField) UnmarshalGQL

func (f *ImageOrderField) UnmarshalGQL(v interface{}) error

UnmarshalGQL implements graphql.Unmarshaler interface.

type ImagePaginateOption

type ImagePaginateOption func(*imagePager) error

ImagePaginateOption enables pagination customization.

func WithImageFilter

func WithImageFilter(filter func(*ImageQuery) (*ImageQuery, error)) ImagePaginateOption

WithImageFilter configures pagination filter.

func WithImageOrder

func WithImageOrder(order *ImageOrder) ImagePaginateOption

WithImageOrder configures pagination ordering.

type ImageQuery

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

ImageQuery is the builder for querying Image entities.

func (*ImageQuery) Aggregate

func (iq *ImageQuery) Aggregate(fns ...AggregateFunc) *ImageSelect

Aggregate returns a ImageSelect configured with the given aggregations.

func (*ImageQuery) All

func (iq *ImageQuery) All(ctx context.Context) ([]*Image, error)

All executes the query and returns a list of Images.

func (*ImageQuery) AllX

func (iq *ImageQuery) AllX(ctx context.Context) []*Image

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

func (*ImageQuery) Clone

func (iq *ImageQuery) Clone() *ImageQuery

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

func (*ImageQuery) CollectFields

func (i *ImageQuery) CollectFields(ctx context.Context, satisfies ...string) (*ImageQuery, error)

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

func (*ImageQuery) Count

func (iq *ImageQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*ImageQuery) CountX

func (iq *ImageQuery) CountX(ctx context.Context) int

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

func (*ImageQuery) Exist

func (iq *ImageQuery) Exist(ctx context.Context) (bool, error)

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

func (*ImageQuery) ExistX

func (iq *ImageQuery) ExistX(ctx context.Context) bool

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

func (*ImageQuery) First

func (iq *ImageQuery) First(ctx context.Context) (*Image, error)

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

func (*ImageQuery) FirstID

func (iq *ImageQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

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

func (*ImageQuery) FirstIDX

func (iq *ImageQuery) FirstIDX(ctx context.Context) uuid.UUID

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

func (*ImageQuery) FirstX

func (iq *ImageQuery) FirstX(ctx context.Context) *Image

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

func (*ImageQuery) GroupBy

func (iq *ImageQuery) GroupBy(field string, fields ...string) *ImageGroupBy

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

client.Image.Query().
	GroupBy(image.FieldTitle).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*ImageQuery) IDs

func (iq *ImageQuery) IDs(ctx context.Context) ([]uuid.UUID, error)

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

func (*ImageQuery) IDsX

func (iq *ImageQuery) IDsX(ctx context.Context) []uuid.UUID

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

func (*ImageQuery) Limit

func (iq *ImageQuery) Limit(limit int) *ImageQuery

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

func (*ImageQuery) Offset

func (iq *ImageQuery) Offset(offset int) *ImageQuery

Offset to start from.

func (*ImageQuery) Only

func (iq *ImageQuery) Only(ctx context.Context) (*Image, error)

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

func (*ImageQuery) OnlyID

func (iq *ImageQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

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

func (*ImageQuery) OnlyIDX

func (iq *ImageQuery) OnlyIDX(ctx context.Context) uuid.UUID

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

func (*ImageQuery) OnlyX

func (iq *ImageQuery) OnlyX(ctx context.Context) *Image

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

func (*ImageQuery) Order

func (iq *ImageQuery) Order(o ...OrderFunc) *ImageQuery

Order specifies how the records should be ordered.

func (*ImageQuery) Paginate

func (i *ImageQuery) Paginate(
	ctx context.Context, after *Cursor, first *int,
	before *Cursor, last *int, opts ...ImagePaginateOption,
) (*ImageConnection, error)

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

func (*ImageQuery) QueryCoverCompany

func (iq *ImageQuery) QueryCoverCompany() *CompanyQuery

QueryCoverCompany chains the current query on the "cover_company" edge.

func (*ImageQuery) QueryGalleryCompany

func (iq *ImageQuery) QueryGalleryCompany() *CompanyQuery

QueryGalleryCompany chains the current query on the "gallery_company" edge.

func (*ImageQuery) QueryLogoCompany

func (iq *ImageQuery) QueryLogoCompany() *CompanyQuery

QueryLogoCompany chains the current query on the "logo_company" edge.

func (*ImageQuery) Select

func (iq *ImageQuery) Select(fields ...string) *ImageSelect

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

client.Image.Query().
	Select(image.FieldTitle).
	Scan(ctx, &v)

func (*ImageQuery) Unique

func (iq *ImageQuery) Unique(unique bool) *ImageQuery

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

func (iq *ImageQuery) Where(ps ...predicate.Image) *ImageQuery

Where adds a new predicate for the ImageQuery builder.

func (*ImageQuery) WithCoverCompany

func (iq *ImageQuery) WithCoverCompany(opts ...func(*CompanyQuery)) *ImageQuery

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

func (*ImageQuery) WithGalleryCompany

func (iq *ImageQuery) WithGalleryCompany(opts ...func(*CompanyQuery)) *ImageQuery

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

func (*ImageQuery) WithLogoCompany

func (iq *ImageQuery) WithLogoCompany(opts ...func(*CompanyQuery)) *ImageQuery

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

type ImageSelect

type ImageSelect struct {
	*ImageQuery
	// contains filtered or unexported fields
}

ImageSelect is the builder for selecting fields of Image entities.

func (*ImageSelect) Aggregate

func (is *ImageSelect) Aggregate(fns ...AggregateFunc) *ImageSelect

Aggregate adds the given aggregation functions to the selector query.

func (*ImageSelect) Bool

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

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

func (*ImageSelect) BoolX

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

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

func (*ImageSelect) Bools

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

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

func (*ImageSelect) BoolsX

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

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

func (*ImageSelect) Float64

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

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

func (*ImageSelect) Float64X

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

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

func (*ImageSelect) Float64s

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

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

func (*ImageSelect) Float64sX

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

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

func (*ImageSelect) Int

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

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

func (*ImageSelect) IntX

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

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

func (*ImageSelect) Ints

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

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

func (*ImageSelect) IntsX

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

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

func (*ImageSelect) Scan

func (is *ImageSelect) Scan(ctx context.Context, v any) error

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

func (*ImageSelect) ScanX

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

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

func (*ImageSelect) String

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

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

func (*ImageSelect) StringX

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

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

func (*ImageSelect) Strings

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

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

func (*ImageSelect) StringsX

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

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

type ImageUpdate

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

ImageUpdate is the builder for updating Image entities.

func (*ImageUpdate) ClearCoverCompany

func (iu *ImageUpdate) ClearCoverCompany() *ImageUpdate

ClearCoverCompany clears the "cover_company" edge to the Company entity.

func (*ImageUpdate) ClearGalleryCompany

func (iu *ImageUpdate) ClearGalleryCompany() *ImageUpdate

ClearGalleryCompany clears the "gallery_company" edge to the Company entity.

func (*ImageUpdate) ClearLogoCompany

func (iu *ImageUpdate) ClearLogoCompany() *ImageUpdate

ClearLogoCompany clears the "logo_company" edge to the Company entity.

func (*ImageUpdate) Exec

func (iu *ImageUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*ImageUpdate) ExecX

func (iu *ImageUpdate) ExecX(ctx context.Context)

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

func (*ImageUpdate) Mutation

func (iu *ImageUpdate) Mutation() *ImageMutation

Mutation returns the ImageMutation object of the builder.

func (*ImageUpdate) Save

func (iu *ImageUpdate) Save(ctx context.Context) (int, error)

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

func (*ImageUpdate) SaveX

func (iu *ImageUpdate) SaveX(ctx context.Context) int

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

func (*ImageUpdate) SetCoverCompany

func (iu *ImageUpdate) SetCoverCompany(c *Company) *ImageUpdate

SetCoverCompany sets the "cover_company" edge to the Company entity.

func (*ImageUpdate) SetCoverCompanyID

func (iu *ImageUpdate) SetCoverCompanyID(id uuid.UUID) *ImageUpdate

SetCoverCompanyID sets the "cover_company" edge to the Company entity by ID.

func (*ImageUpdate) SetGalleryCompany

func (iu *ImageUpdate) SetGalleryCompany(c *Company) *ImageUpdate

SetGalleryCompany sets the "gallery_company" edge to the Company entity.

func (*ImageUpdate) SetGalleryCompanyID

func (iu *ImageUpdate) SetGalleryCompanyID(id uuid.UUID) *ImageUpdate

SetGalleryCompanyID sets the "gallery_company" edge to the Company entity by ID.

func (*ImageUpdate) SetInput

func (c *ImageUpdate) SetInput(i UpdateImageInput) *ImageUpdate

SetInput applies the change-set in the UpdateImageInput on the ImageUpdate builder.

func (*ImageUpdate) SetLogoCompany

func (iu *ImageUpdate) SetLogoCompany(c *Company) *ImageUpdate

SetLogoCompany sets the "logo_company" edge to the Company entity.

func (*ImageUpdate) SetLogoCompanyID

func (iu *ImageUpdate) SetLogoCompanyID(id uuid.UUID) *ImageUpdate

SetLogoCompanyID sets the "logo_company" edge to the Company entity by ID.

func (*ImageUpdate) SetNillableCoverCompanyID

func (iu *ImageUpdate) SetNillableCoverCompanyID(id *uuid.UUID) *ImageUpdate

SetNillableCoverCompanyID sets the "cover_company" edge to the Company entity by ID if the given value is not nil.

func (*ImageUpdate) SetNillableGalleryCompanyID

func (iu *ImageUpdate) SetNillableGalleryCompanyID(id *uuid.UUID) *ImageUpdate

SetNillableGalleryCompanyID sets the "gallery_company" edge to the Company entity by ID if the given value is not nil.

func (*ImageUpdate) SetNillableLogoCompanyID

func (iu *ImageUpdate) SetNillableLogoCompanyID(id *uuid.UUID) *ImageUpdate

SetNillableLogoCompanyID sets the "logo_company" edge to the Company entity by ID if the given value is not nil.

func (*ImageUpdate) SetOriginalURL

func (iu *ImageUpdate) SetOriginalURL(s string) *ImageUpdate

SetOriginalURL sets the "original_url" field.

func (*ImageUpdate) SetTitle

func (iu *ImageUpdate) SetTitle(s string) *ImageUpdate

SetTitle sets the "title" field.

func (*ImageUpdate) Where

func (iu *ImageUpdate) Where(ps ...predicate.Image) *ImageUpdate

Where appends a list predicates to the ImageUpdate builder.

type ImageUpdateOne

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

ImageUpdateOne is the builder for updating a single Image entity.

func (*ImageUpdateOne) ClearCoverCompany

func (iuo *ImageUpdateOne) ClearCoverCompany() *ImageUpdateOne

ClearCoverCompany clears the "cover_company" edge to the Company entity.

func (*ImageUpdateOne) ClearGalleryCompany

func (iuo *ImageUpdateOne) ClearGalleryCompany() *ImageUpdateOne

ClearGalleryCompany clears the "gallery_company" edge to the Company entity.

func (*ImageUpdateOne) ClearLogoCompany

func (iuo *ImageUpdateOne) ClearLogoCompany() *ImageUpdateOne

ClearLogoCompany clears the "logo_company" edge to the Company entity.

func (*ImageUpdateOne) Exec

func (iuo *ImageUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*ImageUpdateOne) ExecX

func (iuo *ImageUpdateOne) ExecX(ctx context.Context)

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

func (*ImageUpdateOne) Mutation

func (iuo *ImageUpdateOne) Mutation() *ImageMutation

Mutation returns the ImageMutation object of the builder.

func (*ImageUpdateOne) Save

func (iuo *ImageUpdateOne) Save(ctx context.Context) (*Image, error)

Save executes the query and returns the updated Image entity.

func (*ImageUpdateOne) SaveX

func (iuo *ImageUpdateOne) SaveX(ctx context.Context) *Image

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

func (*ImageUpdateOne) Select

func (iuo *ImageUpdateOne) Select(field string, fields ...string) *ImageUpdateOne

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

func (*ImageUpdateOne) SetCoverCompany

func (iuo *ImageUpdateOne) SetCoverCompany(c *Company) *ImageUpdateOne

SetCoverCompany sets the "cover_company" edge to the Company entity.

func (*ImageUpdateOne) SetCoverCompanyID

func (iuo *ImageUpdateOne) SetCoverCompanyID(id uuid.UUID) *ImageUpdateOne

SetCoverCompanyID sets the "cover_company" edge to the Company entity by ID.

func (*ImageUpdateOne) SetGalleryCompany

func (iuo *ImageUpdateOne) SetGalleryCompany(c *Company) *ImageUpdateOne

SetGalleryCompany sets the "gallery_company" edge to the Company entity.

func (*ImageUpdateOne) SetGalleryCompanyID

func (iuo *ImageUpdateOne) SetGalleryCompanyID(id uuid.UUID) *ImageUpdateOne

SetGalleryCompanyID sets the "gallery_company" edge to the Company entity by ID.

func (*ImageUpdateOne) SetInput

SetInput applies the change-set in the UpdateImageInput on the ImageUpdateOne builder.

func (*ImageUpdateOne) SetLogoCompany

func (iuo *ImageUpdateOne) SetLogoCompany(c *Company) *ImageUpdateOne

SetLogoCompany sets the "logo_company" edge to the Company entity.

func (*ImageUpdateOne) SetLogoCompanyID

func (iuo *ImageUpdateOne) SetLogoCompanyID(id uuid.UUID) *ImageUpdateOne

SetLogoCompanyID sets the "logo_company" edge to the Company entity by ID.

func (*ImageUpdateOne) SetNillableCoverCompanyID

func (iuo *ImageUpdateOne) SetNillableCoverCompanyID(id *uuid.UUID) *ImageUpdateOne

SetNillableCoverCompanyID sets the "cover_company" edge to the Company entity by ID if the given value is not nil.

func (*ImageUpdateOne) SetNillableGalleryCompanyID

func (iuo *ImageUpdateOne) SetNillableGalleryCompanyID(id *uuid.UUID) *ImageUpdateOne

SetNillableGalleryCompanyID sets the "gallery_company" edge to the Company entity by ID if the given value is not nil.

func (*ImageUpdateOne) SetNillableLogoCompanyID

func (iuo *ImageUpdateOne) SetNillableLogoCompanyID(id *uuid.UUID) *ImageUpdateOne

SetNillableLogoCompanyID sets the "logo_company" edge to the Company entity by ID if the given value is not nil.

func (*ImageUpdateOne) SetOriginalURL

func (iuo *ImageUpdateOne) SetOriginalURL(s string) *ImageUpdateOne

SetOriginalURL sets the "original_url" field.

func (*ImageUpdateOne) SetTitle

func (iuo *ImageUpdateOne) SetTitle(s string) *ImageUpdateOne

SetTitle sets the "title" field.

type ImageWhereInput

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

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

	// "title" field predicates.
	Title             *string  `json:"title,omitempty"`
	TitleNEQ          *string  `json:"titleNEQ,omitempty"`
	TitleIn           []string `json:"titleIn,omitempty"`
	TitleNotIn        []string `json:"titleNotIn,omitempty"`
	TitleGT           *string  `json:"titleGT,omitempty"`
	TitleGTE          *string  `json:"titleGTE,omitempty"`
	TitleLT           *string  `json:"titleLT,omitempty"`
	TitleLTE          *string  `json:"titleLTE,omitempty"`
	TitleContains     *string  `json:"titleContains,omitempty"`
	TitleHasPrefix    *string  `json:"titleHasPrefix,omitempty"`
	TitleHasSuffix    *string  `json:"titleHasSuffix,omitempty"`
	TitleEqualFold    *string  `json:"titleEqualFold,omitempty"`
	TitleContainsFold *string  `json:"titleContainsFold,omitempty"`

	// "original_url" field predicates.
	OriginalURL             *string  `json:"originalURL,omitempty"`
	OriginalURLNEQ          *string  `json:"originalURLNEQ,omitempty"`
	OriginalURLIn           []string `json:"originalURLIn,omitempty"`
	OriginalURLNotIn        []string `json:"originalURLNotIn,omitempty"`
	OriginalURLGT           *string  `json:"originalURLGT,omitempty"`
	OriginalURLGTE          *string  `json:"originalURLGTE,omitempty"`
	OriginalURLLT           *string  `json:"originalURLLT,omitempty"`
	OriginalURLLTE          *string  `json:"originalURLLTE,omitempty"`
	OriginalURLContains     *string  `json:"originalURLContains,omitempty"`
	OriginalURLHasPrefix    *string  `json:"originalURLHasPrefix,omitempty"`
	OriginalURLHasSuffix    *string  `json:"originalURLHasSuffix,omitempty"`
	OriginalURLEqualFold    *string  `json:"originalURLEqualFold,omitempty"`
	OriginalURLContainsFold *string  `json:"originalURLContainsFold,omitempty"`

	// "gallery_company" edge predicates.
	HasGalleryCompany     *bool                `json:"hasGalleryCompany,omitempty"`
	HasGalleryCompanyWith []*CompanyWhereInput `json:"hasGalleryCompanyWith,omitempty"`

	// "logo_company" edge predicates.
	HasLogoCompany     *bool                `json:"hasLogoCompany,omitempty"`
	HasLogoCompanyWith []*CompanyWhereInput `json:"hasLogoCompanyWith,omitempty"`

	// "cover_company" edge predicates.
	HasCoverCompany     *bool                `json:"hasCoverCompany,omitempty"`
	HasCoverCompanyWith []*CompanyWhereInput `json:"hasCoverCompanyWith,omitempty"`
}

ImageWhereInput represents a where input for filtering Image queries.

func (*ImageWhereInput) AddPredicates

func (i *ImageWhereInput) AddPredicates(predicates ...predicate.Image)

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

func (*ImageWhereInput) ApplySearchQuery

func (iwi *ImageWhereInput) ApplySearchQuery(q *string) *ImageWhereInput

func (*ImageWhereInput) Filter

func (i *ImageWhereInput) Filter(q *ImageQuery) (*ImageQuery, error)

Filter applies the ImageWhereInput filter on the ImageQuery builder.

func (*ImageWhereInput) P

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

type Images

type Images []*Image

Images is a parsable slice of Image.

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 Location

type Location struct {

	// ID of the ent.
	ID uuid.UUID `json:"id,omitempty"`
	// Title holds the value of the "title" field.
	Title string `json:"title,omitempty"`
	// Description holds the value of the "description" field.
	Description string `json:"description,omitempty"`
	// Latitude holds the value of the "latitude" field.
	Latitude float64 `json:"latitude,omitempty"`
	// Longitude holds the value of the "longitude" field.
	Longitude float64 `json:"longitude,omitempty"`
	// Address holds the value of the "address" field.
	Address string `json:"address,omitempty"`
	// Postcode holds the value of the "postcode" field.
	Postcode string `json:"postcode,omitempty"`
	// Type holds the value of the "type" field.
	Type string `json:"type,omitempty"`
	// State holds the value of the "state" field.
	State string `json:"state,omitempty"`
	// Suburb holds the value of the "suburb" field.
	Suburb string `json:"suburb,omitempty"`
	// StreetType holds the value of the "street_type" field.
	StreetType string `json:"street_type,omitempty"`
	// StreetName holds the value of the "street_name" field.
	StreetName string `json:"street_name,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the LocationQuery when eager-loading is set.
	Edges LocationEdges `json:"edges"`
	// contains filtered or unexported fields
}

Location is the model entity for the Location schema.

func (*Location) Company

func (l *Location) Company(ctx context.Context) (*Company, error)

func (*Location) Country

func (l *Location) Country(ctx context.Context) (*Country, error)

func (*Location) IsNode

func (n *Location) IsNode()

IsNode implements the Node interface check for GQLGen.

func (*Location) QueryCompany

func (l *Location) QueryCompany() *CompanyQuery

QueryCompany queries the "company" edge of the Location entity.

func (*Location) QueryCountry

func (l *Location) QueryCountry() *CountryQuery

QueryCountry queries the "country" edge of the Location entity.

func (*Location) String

func (l *Location) String() string

String implements the fmt.Stringer.

func (*Location) ToEdge

func (l *Location) ToEdge(order *LocationOrder) *LocationEdge

ToEdge converts Location into LocationEdge.

func (*Location) Unwrap

func (l *Location) Unwrap() *Location

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

func (l *Location) Update() *LocationUpdateOne

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

type LocationClient

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

LocationClient is a client for the Location schema.

func NewLocationClient

func NewLocationClient(c config) *LocationClient

NewLocationClient returns a client for the Location from the given config.

func (*LocationClient) Create

func (c *LocationClient) Create() *LocationCreate

Create returns a builder for creating a Location entity.

func (*LocationClient) CreateBulk

func (c *LocationClient) CreateBulk(builders ...*LocationCreate) *LocationCreateBulk

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

func (*LocationClient) Delete

func (c *LocationClient) Delete() *LocationDelete

Delete returns a delete builder for Location.

func (*LocationClient) DeleteOne

func (c *LocationClient) DeleteOne(l *Location) *LocationDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*LocationClient) DeleteOneID

func (c *LocationClient) DeleteOneID(id uuid.UUID) *LocationDeleteOne

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

func (*LocationClient) Get

func (c *LocationClient) Get(ctx context.Context, id uuid.UUID) (*Location, error)

Get returns a Location entity by its id.

func (*LocationClient) GetX

func (c *LocationClient) GetX(ctx context.Context, id uuid.UUID) *Location

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

func (*LocationClient) Hooks

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

Hooks returns the client hooks.

func (*LocationClient) Intercept

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

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

func (*LocationClient) Interceptors

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

Interceptors returns the client interceptors.

func (*LocationClient) Query

func (c *LocationClient) Query() *LocationQuery

Query returns a query builder for Location.

func (*LocationClient) QueryCompany

func (c *LocationClient) QueryCompany(l *Location) *CompanyQuery

QueryCompany queries the company edge of a Location.

func (*LocationClient) QueryCountry

func (c *LocationClient) QueryCountry(l *Location) *CountryQuery

QueryCountry queries the country edge of a Location.

func (*LocationClient) Update

func (c *LocationClient) Update() *LocationUpdate

Update returns an update builder for Location.

func (*LocationClient) UpdateOne

func (c *LocationClient) UpdateOne(l *Location) *LocationUpdateOne

UpdateOne returns an update builder for the given entity.

func (*LocationClient) UpdateOneID

func (c *LocationClient) UpdateOneID(id uuid.UUID) *LocationUpdateOne

UpdateOneID returns an update builder for the given id.

func (*LocationClient) Use

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

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

type LocationConnection

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

LocationConnection is the connection containing edges to Location.

type LocationCreate

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

LocationCreate is the builder for creating a Location entity.

func (*LocationCreate) Exec

func (lc *LocationCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*LocationCreate) ExecX

func (lc *LocationCreate) ExecX(ctx context.Context)

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

func (*LocationCreate) Mutation

func (lc *LocationCreate) Mutation() *LocationMutation

Mutation returns the LocationMutation object of the builder.

func (*LocationCreate) Save

func (lc *LocationCreate) Save(ctx context.Context) (*Location, error)

Save creates the Location in the database.

func (*LocationCreate) SaveX

func (lc *LocationCreate) SaveX(ctx context.Context) *Location

SaveX calls Save and panics if Save returns an error.

func (*LocationCreate) SetAddress

func (lc *LocationCreate) SetAddress(s string) *LocationCreate

SetAddress sets the "address" field.

func (*LocationCreate) SetCompany

func (lc *LocationCreate) SetCompany(c *Company) *LocationCreate

SetCompany sets the "company" edge to the Company entity.

func (*LocationCreate) SetCompanyID

func (lc *LocationCreate) SetCompanyID(id uuid.UUID) *LocationCreate

SetCompanyID sets the "company" edge to the Company entity by ID.

func (*LocationCreate) SetCountry

func (lc *LocationCreate) SetCountry(c *Country) *LocationCreate

SetCountry sets the "country" edge to the Country entity.

func (*LocationCreate) SetCountryID

func (lc *LocationCreate) SetCountryID(id uuid.UUID) *LocationCreate

SetCountryID sets the "country" edge to the Country entity by ID.

func (*LocationCreate) SetDescription

func (lc *LocationCreate) SetDescription(s string) *LocationCreate

SetDescription sets the "description" field.

func (*LocationCreate) SetID

func (lc *LocationCreate) SetID(u uuid.UUID) *LocationCreate

SetID sets the "id" field.

func (*LocationCreate) SetInput

SetInput applies the change-set in the CreateLocationInput on the LocationCreate builder.

func (*LocationCreate) SetLatitude

func (lc *LocationCreate) SetLatitude(f float64) *LocationCreate

SetLatitude sets the "latitude" field.

func (*LocationCreate) SetLongitude

func (lc *LocationCreate) SetLongitude(f float64) *LocationCreate

SetLongitude sets the "longitude" field.

func (*LocationCreate) SetNillableCompanyID

func (lc *LocationCreate) SetNillableCompanyID(id *uuid.UUID) *LocationCreate

SetNillableCompanyID sets the "company" edge to the Company entity by ID if the given value is not nil.

func (*LocationCreate) SetNillableCountryID

func (lc *LocationCreate) SetNillableCountryID(id *uuid.UUID) *LocationCreate

SetNillableCountryID sets the "country" edge to the Country entity by ID if the given value is not nil.

func (*LocationCreate) SetNillableID

func (lc *LocationCreate) SetNillableID(u *uuid.UUID) *LocationCreate

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

func (*LocationCreate) SetPostcode

func (lc *LocationCreate) SetPostcode(s string) *LocationCreate

SetPostcode sets the "postcode" field.

func (*LocationCreate) SetState

func (lc *LocationCreate) SetState(s string) *LocationCreate

SetState sets the "state" field.

func (*LocationCreate) SetStreetName

func (lc *LocationCreate) SetStreetName(s string) *LocationCreate

SetStreetName sets the "street_name" field.

func (*LocationCreate) SetStreetType

func (lc *LocationCreate) SetStreetType(s string) *LocationCreate

SetStreetType sets the "street_type" field.

func (*LocationCreate) SetSuburb

func (lc *LocationCreate) SetSuburb(s string) *LocationCreate

SetSuburb sets the "suburb" field.

func (*LocationCreate) SetTitle

func (lc *LocationCreate) SetTitle(s string) *LocationCreate

SetTitle sets the "title" field.

func (*LocationCreate) SetType

func (lc *LocationCreate) SetType(s string) *LocationCreate

SetType sets the "type" field.

type LocationCreateBulk

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

LocationCreateBulk is the builder for creating many Location entities in bulk.

func (*LocationCreateBulk) Exec

func (lcb *LocationCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*LocationCreateBulk) ExecX

func (lcb *LocationCreateBulk) ExecX(ctx context.Context)

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

func (*LocationCreateBulk) Save

func (lcb *LocationCreateBulk) Save(ctx context.Context) ([]*Location, error)

Save creates the Location entities in the database.

func (*LocationCreateBulk) SaveX

func (lcb *LocationCreateBulk) SaveX(ctx context.Context) []*Location

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

type LocationDelete

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

LocationDelete is the builder for deleting a Location entity.

func (*LocationDelete) Exec

func (ld *LocationDelete) Exec(ctx context.Context) (int, error)

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

func (*LocationDelete) ExecX

func (ld *LocationDelete) ExecX(ctx context.Context) int

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

func (*LocationDelete) Where

func (ld *LocationDelete) Where(ps ...predicate.Location) *LocationDelete

Where appends a list predicates to the LocationDelete builder.

type LocationDeleteOne

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

LocationDeleteOne is the builder for deleting a single Location entity.

func (*LocationDeleteOne) Exec

func (ldo *LocationDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*LocationDeleteOne) ExecX

func (ldo *LocationDeleteOne) ExecX(ctx context.Context)

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

type LocationEdge

type LocationEdge struct {
	Node   *Location `json:"node"`
	Cursor Cursor    `json:"cursor"`
}

LocationEdge is the edge representation of Location.

type LocationEdges

type LocationEdges struct {
	// Company holds the value of the company edge.
	Company *Company `json:"company,omitempty"`
	// Country holds the value of the country edge.
	Country *Country `json:"country,omitempty"`
	// contains filtered or unexported fields
}

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

func (LocationEdges) CompanyOrErr

func (e LocationEdges) CompanyOrErr() (*Company, error)

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

func (LocationEdges) CountryOrErr

func (e LocationEdges) CountryOrErr() (*Country, error)

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

type LocationGroupBy

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

LocationGroupBy is the group-by builder for Location entities.

func (*LocationGroupBy) Aggregate

func (lgb *LocationGroupBy) Aggregate(fns ...AggregateFunc) *LocationGroupBy

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

func (*LocationGroupBy) Bool

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

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

func (*LocationGroupBy) BoolX

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

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

func (*LocationGroupBy) Bools

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

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

func (*LocationGroupBy) BoolsX

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

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

func (*LocationGroupBy) Float64

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

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

func (*LocationGroupBy) Float64X

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

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

func (*LocationGroupBy) Float64s

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

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

func (*LocationGroupBy) Float64sX

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

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

func (*LocationGroupBy) Int

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

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

func (*LocationGroupBy) IntX

func (s *LocationGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*LocationGroupBy) Ints

func (s *LocationGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*LocationGroupBy) IntsX

func (s *LocationGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*LocationGroupBy) Scan

func (lgb *LocationGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*LocationGroupBy) ScanX

func (s *LocationGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*LocationGroupBy) String

func (s *LocationGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*LocationGroupBy) StringX

func (s *LocationGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*LocationGroupBy) Strings

func (s *LocationGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*LocationGroupBy) StringsX

func (s *LocationGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type LocationMutation

type LocationMutation struct {
	// contains filtered or unexported fields
}

LocationMutation represents an operation that mutates the Location nodes in the graph.

func (*LocationMutation) AddField

func (m *LocationMutation) 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 (*LocationMutation) AddLatitude

func (m *LocationMutation) AddLatitude(f float64)

AddLatitude adds f to the "latitude" field.

func (*LocationMutation) AddLongitude

func (m *LocationMutation) AddLongitude(f float64)

AddLongitude adds f to the "longitude" field.

func (*LocationMutation) AddedEdges

func (m *LocationMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*LocationMutation) AddedField

func (m *LocationMutation) 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 (*LocationMutation) AddedFields

func (m *LocationMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*LocationMutation) AddedIDs

func (m *LocationMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*LocationMutation) AddedLatitude

func (m *LocationMutation) AddedLatitude() (r float64, exists bool)

AddedLatitude returns the value that was added to the "latitude" field in this mutation.

func (*LocationMutation) AddedLongitude

func (m *LocationMutation) AddedLongitude() (r float64, exists bool)

AddedLongitude returns the value that was added to the "longitude" field in this mutation.

func (*LocationMutation) Address

func (m *LocationMutation) Address() (r string, exists bool)

Address returns the value of the "address" field in the mutation.

func (*LocationMutation) ClearCompany

func (m *LocationMutation) ClearCompany()

ClearCompany clears the "company" edge to the Company entity.

func (*LocationMutation) ClearCountry

func (m *LocationMutation) ClearCountry()

ClearCountry clears the "country" edge to the Country entity.

func (*LocationMutation) ClearEdge

func (m *LocationMutation) 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 (*LocationMutation) ClearField

func (m *LocationMutation) 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 (*LocationMutation) ClearedEdges

func (m *LocationMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*LocationMutation) ClearedFields

func (m *LocationMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (LocationMutation) Client

func (m LocationMutation) 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 (*LocationMutation) CompanyCleared

func (m *LocationMutation) CompanyCleared() bool

CompanyCleared reports if the "company" edge to the Company entity was cleared.

func (*LocationMutation) CompanyID

func (m *LocationMutation) CompanyID() (id uuid.UUID, exists bool)

CompanyID returns the "company" edge ID in the mutation.

func (*LocationMutation) CompanyIDs

func (m *LocationMutation) CompanyIDs() (ids []uuid.UUID)

CompanyIDs returns the "company" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use CompanyID instead. It exists only for internal usage by the builders.

func (*LocationMutation) CountryCleared

func (m *LocationMutation) CountryCleared() bool

CountryCleared reports if the "country" edge to the Country entity was cleared.

func (*LocationMutation) CountryID

func (m *LocationMutation) CountryID() (id uuid.UUID, exists bool)

CountryID returns the "country" edge ID in the mutation.

func (*LocationMutation) CountryIDs

func (m *LocationMutation) CountryIDs() (ids []uuid.UUID)

CountryIDs returns the "country" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use CountryID instead. It exists only for internal usage by the builders.

func (*LocationMutation) Description

func (m *LocationMutation) Description() (r string, exists bool)

Description returns the value of the "description" field in the mutation.

func (*LocationMutation) EdgeCleared

func (m *LocationMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*LocationMutation) Field

func (m *LocationMutation) 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 (*LocationMutation) FieldCleared

func (m *LocationMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*LocationMutation) Fields

func (m *LocationMutation) 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 (*LocationMutation) GetType

func (m *LocationMutation) GetType() (r string, exists bool)

GetType returns the value of the "type" field in the mutation.

func (*LocationMutation) ID

func (m *LocationMutation) ID() (id uuid.UUID, 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 (*LocationMutation) IDs

func (m *LocationMutation) IDs(ctx context.Context) ([]uuid.UUID, 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 (*LocationMutation) Latitude

func (m *LocationMutation) Latitude() (r float64, exists bool)

Latitude returns the value of the "latitude" field in the mutation.

func (*LocationMutation) Longitude

func (m *LocationMutation) Longitude() (r float64, exists bool)

Longitude returns the value of the "longitude" field in the mutation.

func (*LocationMutation) OldAddress

func (m *LocationMutation) OldAddress(ctx context.Context) (v string, err error)

OldAddress returns the old "address" field's value of the Location entity. If the Location 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 (*LocationMutation) OldDescription

func (m *LocationMutation) OldDescription(ctx context.Context) (v string, err error)

OldDescription returns the old "description" field's value of the Location entity. If the Location 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 (*LocationMutation) OldField

func (m *LocationMutation) 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 (*LocationMutation) OldLatitude

func (m *LocationMutation) OldLatitude(ctx context.Context) (v float64, err error)

OldLatitude returns the old "latitude" field's value of the Location entity. If the Location 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 (*LocationMutation) OldLongitude

func (m *LocationMutation) OldLongitude(ctx context.Context) (v float64, err error)

OldLongitude returns the old "longitude" field's value of the Location entity. If the Location 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 (*LocationMutation) OldPostcode

func (m *LocationMutation) OldPostcode(ctx context.Context) (v string, err error)

OldPostcode returns the old "postcode" field's value of the Location entity. If the Location 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 (*LocationMutation) OldState

func (m *LocationMutation) OldState(ctx context.Context) (v string, err error)

OldState returns the old "state" field's value of the Location entity. If the Location 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 (*LocationMutation) OldStreetName

func (m *LocationMutation) OldStreetName(ctx context.Context) (v string, err error)

OldStreetName returns the old "street_name" field's value of the Location entity. If the Location 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 (*LocationMutation) OldStreetType

func (m *LocationMutation) OldStreetType(ctx context.Context) (v string, err error)

OldStreetType returns the old "street_type" field's value of the Location entity. If the Location 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 (*LocationMutation) OldSuburb

func (m *LocationMutation) OldSuburb(ctx context.Context) (v string, err error)

OldSuburb returns the old "suburb" field's value of the Location entity. If the Location 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 (*LocationMutation) OldTitle

func (m *LocationMutation) OldTitle(ctx context.Context) (v string, err error)

OldTitle returns the old "title" field's value of the Location entity. If the Location 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 (*LocationMutation) OldType

func (m *LocationMutation) OldType(ctx context.Context) (v string, err error)

OldType returns the old "type" field's value of the Location entity. If the Location 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 (*LocationMutation) Op

func (m *LocationMutation) Op() Op

Op returns the operation name.

func (*LocationMutation) Postcode

func (m *LocationMutation) Postcode() (r string, exists bool)

Postcode returns the value of the "postcode" field in the mutation.

func (*LocationMutation) RemovedEdges

func (m *LocationMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*LocationMutation) RemovedIDs

func (m *LocationMutation) 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 (*LocationMutation) ResetAddress

func (m *LocationMutation) ResetAddress()

ResetAddress resets all changes to the "address" field.

func (*LocationMutation) ResetCompany

func (m *LocationMutation) ResetCompany()

ResetCompany resets all changes to the "company" edge.

func (*LocationMutation) ResetCountry

func (m *LocationMutation) ResetCountry()

ResetCountry resets all changes to the "country" edge.

func (*LocationMutation) ResetDescription

func (m *LocationMutation) ResetDescription()

ResetDescription resets all changes to the "description" field.

func (*LocationMutation) ResetEdge

func (m *LocationMutation) 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 (*LocationMutation) ResetField

func (m *LocationMutation) 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 (*LocationMutation) ResetLatitude

func (m *LocationMutation) ResetLatitude()

ResetLatitude resets all changes to the "latitude" field.

func (*LocationMutation) ResetLongitude

func (m *LocationMutation) ResetLongitude()

ResetLongitude resets all changes to the "longitude" field.

func (*LocationMutation) ResetPostcode

func (m *LocationMutation) ResetPostcode()

ResetPostcode resets all changes to the "postcode" field.

func (*LocationMutation) ResetState

func (m *LocationMutation) ResetState()

ResetState resets all changes to the "state" field.

func (*LocationMutation) ResetStreetName

func (m *LocationMutation) ResetStreetName()

ResetStreetName resets all changes to the "street_name" field.

func (*LocationMutation) ResetStreetType

func (m *LocationMutation) ResetStreetType()

ResetStreetType resets all changes to the "street_type" field.

func (*LocationMutation) ResetSuburb

func (m *LocationMutation) ResetSuburb()

ResetSuburb resets all changes to the "suburb" field.

func (*LocationMutation) ResetTitle

func (m *LocationMutation) ResetTitle()

ResetTitle resets all changes to the "title" field.

func (*LocationMutation) ResetType

func (m *LocationMutation) ResetType()

ResetType resets all changes to the "type" field.

func (*LocationMutation) SetAddress

func (m *LocationMutation) SetAddress(s string)

SetAddress sets the "address" field.

func (*LocationMutation) SetCompanyID

func (m *LocationMutation) SetCompanyID(id uuid.UUID)

SetCompanyID sets the "company" edge to the Company entity by id.

func (*LocationMutation) SetCountryID

func (m *LocationMutation) SetCountryID(id uuid.UUID)

SetCountryID sets the "country" edge to the Country entity by id.

func (*LocationMutation) SetDescription

func (m *LocationMutation) SetDescription(s string)

SetDescription sets the "description" field.

func (*LocationMutation) SetField

func (m *LocationMutation) 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 (*LocationMutation) SetID

func (m *LocationMutation) SetID(id uuid.UUID)

SetID sets the value of the id field. Note that this operation is only accepted on creation of Location entities.

func (*LocationMutation) SetLatitude

func (m *LocationMutation) SetLatitude(f float64)

SetLatitude sets the "latitude" field.

func (*LocationMutation) SetLongitude

func (m *LocationMutation) SetLongitude(f float64)

SetLongitude sets the "longitude" field.

func (*LocationMutation) SetOp

func (m *LocationMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*LocationMutation) SetPostcode

func (m *LocationMutation) SetPostcode(s string)

SetPostcode sets the "postcode" field.

func (*LocationMutation) SetState

func (m *LocationMutation) SetState(s string)

SetState sets the "state" field.

func (*LocationMutation) SetStreetName

func (m *LocationMutation) SetStreetName(s string)

SetStreetName sets the "street_name" field.

func (*LocationMutation) SetStreetType

func (m *LocationMutation) SetStreetType(s string)

SetStreetType sets the "street_type" field.

func (*LocationMutation) SetSuburb

func (m *LocationMutation) SetSuburb(s string)

SetSuburb sets the "suburb" field.

func (*LocationMutation) SetTitle

func (m *LocationMutation) SetTitle(s string)

SetTitle sets the "title" field.

func (*LocationMutation) SetType

func (m *LocationMutation) SetType(s string)

SetType sets the "type" field.

func (*LocationMutation) State

func (m *LocationMutation) State() (r string, exists bool)

State returns the value of the "state" field in the mutation.

func (*LocationMutation) StreetName

func (m *LocationMutation) StreetName() (r string, exists bool)

StreetName returns the value of the "street_name" field in the mutation.

func (*LocationMutation) StreetType

func (m *LocationMutation) StreetType() (r string, exists bool)

StreetType returns the value of the "street_type" field in the mutation.

func (*LocationMutation) Suburb

func (m *LocationMutation) Suburb() (r string, exists bool)

Suburb returns the value of the "suburb" field in the mutation.

func (*LocationMutation) Title

func (m *LocationMutation) Title() (r string, exists bool)

Title returns the value of the "title" field in the mutation.

func (LocationMutation) Tx

func (m LocationMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*LocationMutation) Type

func (m *LocationMutation) Type() string

Type returns the node type of this mutation (Location).

func (*LocationMutation) Where

func (m *LocationMutation) Where(ps ...predicate.Location)

Where appends a list predicates to the LocationMutation builder.

func (*LocationMutation) WhereP

func (m *LocationMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the LocationMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type LocationOrder

type LocationOrder struct {
	Direction OrderDirection      `json:"direction"`
	Field     *LocationOrderField `json:"field"`
}

LocationOrder defines the ordering of Location.

type LocationOrderField

type LocationOrderField struct {
	// contains filtered or unexported fields
}

LocationOrderField defines the ordering field of Location.

func (LocationOrderField) MarshalGQL

func (f LocationOrderField) MarshalGQL(w io.Writer)

MarshalGQL implements graphql.Marshaler interface.

func (LocationOrderField) String

func (f LocationOrderField) String() string

String implement fmt.Stringer interface.

func (*LocationOrderField) UnmarshalGQL

func (f *LocationOrderField) UnmarshalGQL(v interface{}) error

UnmarshalGQL implements graphql.Unmarshaler interface.

type LocationPaginateOption

type LocationPaginateOption func(*locationPager) error

LocationPaginateOption enables pagination customization.

func WithLocationFilter

func WithLocationFilter(filter func(*LocationQuery) (*LocationQuery, error)) LocationPaginateOption

WithLocationFilter configures pagination filter.

func WithLocationOrder

func WithLocationOrder(order *LocationOrder) LocationPaginateOption

WithLocationOrder configures pagination ordering.

type LocationQuery

type LocationQuery struct {
	// contains filtered or unexported fields
}

LocationQuery is the builder for querying Location entities.

func (*LocationQuery) Aggregate

func (lq *LocationQuery) Aggregate(fns ...AggregateFunc) *LocationSelect

Aggregate returns a LocationSelect configured with the given aggregations.

func (*LocationQuery) All

func (lq *LocationQuery) All(ctx context.Context) ([]*Location, error)

All executes the query and returns a list of Locations.

func (*LocationQuery) AllX

func (lq *LocationQuery) AllX(ctx context.Context) []*Location

AllX is like All, but panics if an error occurs.

func (*LocationQuery) Clone

func (lq *LocationQuery) Clone() *LocationQuery

Clone returns a duplicate of the LocationQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*LocationQuery) CollectFields

func (l *LocationQuery) CollectFields(ctx context.Context, satisfies ...string) (*LocationQuery, error)

CollectFields tells the query-builder to eagerly load connected nodes by resolver context.

func (*LocationQuery) Count

func (lq *LocationQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*LocationQuery) CountX

func (lq *LocationQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*LocationQuery) Exist

func (lq *LocationQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*LocationQuery) ExistX

func (lq *LocationQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*LocationQuery) First

func (lq *LocationQuery) First(ctx context.Context) (*Location, error)

First returns the first Location entity from the query. Returns a *NotFoundError when no Location was found.

func (*LocationQuery) FirstID

func (lq *LocationQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

FirstID returns the first Location ID from the query. Returns a *NotFoundError when no Location ID was found.

func (*LocationQuery) FirstIDX

func (lq *LocationQuery) FirstIDX(ctx context.Context) uuid.UUID

FirstIDX is like FirstID, but panics if an error occurs.

func (*LocationQuery) FirstX

func (lq *LocationQuery) FirstX(ctx context.Context) *Location

FirstX is like First, but panics if an error occurs.

func (*LocationQuery) GroupBy

func (lq *LocationQuery) GroupBy(field string, fields ...string) *LocationGroupBy

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 {
	Title string `json:"title,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Location.Query().
	GroupBy(location.FieldTitle).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*LocationQuery) IDs

func (lq *LocationQuery) IDs(ctx context.Context) ([]uuid.UUID, error)

IDs executes the query and returns a list of Location IDs.

func (*LocationQuery) IDsX

func (lq *LocationQuery) IDsX(ctx context.Context) []uuid.UUID

IDsX is like IDs, but panics if an error occurs.

func (*LocationQuery) Limit

func (lq *LocationQuery) Limit(limit int) *LocationQuery

Limit the number of records to be returned by this query.

func (*LocationQuery) Offset

func (lq *LocationQuery) Offset(offset int) *LocationQuery

Offset to start from.

func (*LocationQuery) Only

func (lq *LocationQuery) Only(ctx context.Context) (*Location, error)

Only returns a single Location entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Location entity is found. Returns a *NotFoundError when no Location entities are found.

func (*LocationQuery) OnlyID

func (lq *LocationQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

OnlyID is like Only, but returns the only Location ID in the query. Returns a *NotSingularError when more than one Location ID is found. Returns a *NotFoundError when no entities are found.

func (*LocationQuery) OnlyIDX

func (lq *LocationQuery) OnlyIDX(ctx context.Context) uuid.UUID

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*LocationQuery) OnlyX

func (lq *LocationQuery) OnlyX(ctx context.Context) *Location

OnlyX is like Only, but panics if an error occurs.

func (*LocationQuery) Order

func (lq *LocationQuery) Order(o ...OrderFunc) *LocationQuery

Order specifies how the records should be ordered.

func (*LocationQuery) Paginate

func (l *LocationQuery) Paginate(
	ctx context.Context, after *Cursor, first *int,
	before *Cursor, last *int, opts ...LocationPaginateOption,
) (*LocationConnection, error)

Paginate executes the query and returns a relay based cursor connection to Location.

func (*LocationQuery) QueryCompany

func (lq *LocationQuery) QueryCompany() *CompanyQuery

QueryCompany chains the current query on the "company" edge.

func (*LocationQuery) QueryCountry

func (lq *LocationQuery) QueryCountry() *CountryQuery

QueryCountry chains the current query on the "country" edge.

func (*LocationQuery) Select

func (lq *LocationQuery) Select(fields ...string) *LocationSelect

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 {
	Title string `json:"title,omitempty"`
}

client.Location.Query().
	Select(location.FieldTitle).
	Scan(ctx, &v)

func (*LocationQuery) Unique

func (lq *LocationQuery) Unique(unique bool) *LocationQuery

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 (*LocationQuery) Where

func (lq *LocationQuery) Where(ps ...predicate.Location) *LocationQuery

Where adds a new predicate for the LocationQuery builder.

func (*LocationQuery) WithCompany

func (lq *LocationQuery) WithCompany(opts ...func(*CompanyQuery)) *LocationQuery

WithCompany tells the query-builder to eager-load the nodes that are connected to the "company" edge. The optional arguments are used to configure the query builder of the edge.

func (*LocationQuery) WithCountry

func (lq *LocationQuery) WithCountry(opts ...func(*CountryQuery)) *LocationQuery

WithCountry tells the query-builder to eager-load the nodes that are connected to the "country" edge. The optional arguments are used to configure the query builder of the edge.

type LocationSelect

type LocationSelect struct {
	*LocationQuery
	// contains filtered or unexported fields
}

LocationSelect is the builder for selecting fields of Location entities.

func (*LocationSelect) Aggregate

func (ls *LocationSelect) Aggregate(fns ...AggregateFunc) *LocationSelect

Aggregate adds the given aggregation functions to the selector query.

func (*LocationSelect) Bool

func (s *LocationSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*LocationSelect) BoolX

func (s *LocationSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*LocationSelect) Bools

func (s *LocationSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*LocationSelect) BoolsX

func (s *LocationSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*LocationSelect) Float64

func (s *LocationSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*LocationSelect) Float64X

func (s *LocationSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*LocationSelect) Float64s

func (s *LocationSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*LocationSelect) Float64sX

func (s *LocationSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*LocationSelect) Int

func (s *LocationSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*LocationSelect) IntX

func (s *LocationSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*LocationSelect) Ints

func (s *LocationSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*LocationSelect) IntsX

func (s *LocationSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*LocationSelect) Scan

func (ls *LocationSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*LocationSelect) ScanX

func (s *LocationSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*LocationSelect) String

func (s *LocationSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*LocationSelect) StringX

func (s *LocationSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*LocationSelect) Strings

func (s *LocationSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*LocationSelect) StringsX

func (s *LocationSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type LocationUpdate

type LocationUpdate struct {
	// contains filtered or unexported fields
}

LocationUpdate is the builder for updating Location entities.

func (*LocationUpdate) AddLatitude

func (lu *LocationUpdate) AddLatitude(f float64) *LocationUpdate

AddLatitude adds f to the "latitude" field.

func (*LocationUpdate) AddLongitude

func (lu *LocationUpdate) AddLongitude(f float64) *LocationUpdate

AddLongitude adds f to the "longitude" field.

func (*LocationUpdate) ClearCompany

func (lu *LocationUpdate) ClearCompany() *LocationUpdate

ClearCompany clears the "company" edge to the Company entity.

func (*LocationUpdate) ClearCountry

func (lu *LocationUpdate) ClearCountry() *LocationUpdate

ClearCountry clears the "country" edge to the Country entity.

func (*LocationUpdate) Exec

func (lu *LocationUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*LocationUpdate) ExecX

func (lu *LocationUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*LocationUpdate) Mutation

func (lu *LocationUpdate) Mutation() *LocationMutation

Mutation returns the LocationMutation object of the builder.

func (*LocationUpdate) Save

func (lu *LocationUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*LocationUpdate) SaveX

func (lu *LocationUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*LocationUpdate) SetAddress

func (lu *LocationUpdate) SetAddress(s string) *LocationUpdate

SetAddress sets the "address" field.

func (*LocationUpdate) SetCompany

func (lu *LocationUpdate) SetCompany(c *Company) *LocationUpdate

SetCompany sets the "company" edge to the Company entity.

func (*LocationUpdate) SetCompanyID

func (lu *LocationUpdate) SetCompanyID(id uuid.UUID) *LocationUpdate

SetCompanyID sets the "company" edge to the Company entity by ID.

func (*LocationUpdate) SetCountry

func (lu *LocationUpdate) SetCountry(c *Country) *LocationUpdate

SetCountry sets the "country" edge to the Country entity.

func (*LocationUpdate) SetCountryID

func (lu *LocationUpdate) SetCountryID(id uuid.UUID) *LocationUpdate

SetCountryID sets the "country" edge to the Country entity by ID.

func (*LocationUpdate) SetDescription

func (lu *LocationUpdate) SetDescription(s string) *LocationUpdate

SetDescription sets the "description" field.

func (*LocationUpdate) SetInput

SetInput applies the change-set in the UpdateLocationInput on the LocationUpdate builder.

func (*LocationUpdate) SetLatitude

func (lu *LocationUpdate) SetLatitude(f float64) *LocationUpdate

SetLatitude sets the "latitude" field.

func (*LocationUpdate) SetLongitude

func (lu *LocationUpdate) SetLongitude(f float64) *LocationUpdate

SetLongitude sets the "longitude" field.

func (*LocationUpdate) SetNillableCompanyID

func (lu *LocationUpdate) SetNillableCompanyID(id *uuid.UUID) *LocationUpdate

SetNillableCompanyID sets the "company" edge to the Company entity by ID if the given value is not nil.

func (*LocationUpdate) SetNillableCountryID

func (lu *LocationUpdate) SetNillableCountryID(id *uuid.UUID) *LocationUpdate

SetNillableCountryID sets the "country" edge to the Country entity by ID if the given value is not nil.

func (*LocationUpdate) SetPostcode

func (lu *LocationUpdate) SetPostcode(s string) *LocationUpdate

SetPostcode sets the "postcode" field.

func (*LocationUpdate) SetState

func (lu *LocationUpdate) SetState(s string) *LocationUpdate

SetState sets the "state" field.

func (*LocationUpdate) SetStreetName

func (lu *LocationUpdate) SetStreetName(s string) *LocationUpdate

SetStreetName sets the "street_name" field.

func (*LocationUpdate) SetStreetType

func (lu *LocationUpdate) SetStreetType(s string) *LocationUpdate

SetStreetType sets the "street_type" field.

func (*LocationUpdate) SetSuburb

func (lu *LocationUpdate) SetSuburb(s string) *LocationUpdate

SetSuburb sets the "suburb" field.

func (*LocationUpdate) SetTitle

func (lu *LocationUpdate) SetTitle(s string) *LocationUpdate

SetTitle sets the "title" field.

func (*LocationUpdate) SetType

func (lu *LocationUpdate) SetType(s string) *LocationUpdate

SetType sets the "type" field.

func (*LocationUpdate) Where

func (lu *LocationUpdate) Where(ps ...predicate.Location) *LocationUpdate

Where appends a list predicates to the LocationUpdate builder.

type LocationUpdateOne

type LocationUpdateOne struct {
	// contains filtered or unexported fields
}

LocationUpdateOne is the builder for updating a single Location entity.

func (*LocationUpdateOne) AddLatitude

func (luo *LocationUpdateOne) AddLatitude(f float64) *LocationUpdateOne

AddLatitude adds f to the "latitude" field.

func (*LocationUpdateOne) AddLongitude

func (luo *LocationUpdateOne) AddLongitude(f float64) *LocationUpdateOne

AddLongitude adds f to the "longitude" field.

func (*LocationUpdateOne) ClearCompany

func (luo *LocationUpdateOne) ClearCompany() *LocationUpdateOne

ClearCompany clears the "company" edge to the Company entity.

func (*LocationUpdateOne) ClearCountry

func (luo *LocationUpdateOne) ClearCountry() *LocationUpdateOne

ClearCountry clears the "country" edge to the Country entity.

func (*LocationUpdateOne) Exec

func (luo *LocationUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*LocationUpdateOne) ExecX

func (luo *LocationUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*LocationUpdateOne) Mutation

func (luo *LocationUpdateOne) Mutation() *LocationMutation

Mutation returns the LocationMutation object of the builder.

func (*LocationUpdateOne) Save

func (luo *LocationUpdateOne) Save(ctx context.Context) (*Location, error)

Save executes the query and returns the updated Location entity.

func (*LocationUpdateOne) SaveX

func (luo *LocationUpdateOne) SaveX(ctx context.Context) *Location

SaveX is like Save, but panics if an error occurs.

func (*LocationUpdateOne) Select

func (luo *LocationUpdateOne) Select(field string, fields ...string) *LocationUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*LocationUpdateOne) SetAddress

func (luo *LocationUpdateOne) SetAddress(s string) *LocationUpdateOne

SetAddress sets the "address" field.

func (*LocationUpdateOne) SetCompany

func (luo *LocationUpdateOne) SetCompany(c *Company) *LocationUpdateOne

SetCompany sets the "company" edge to the Company entity.

func (*LocationUpdateOne) SetCompanyID

func (luo *LocationUpdateOne) SetCompanyID(id uuid.UUID) *LocationUpdateOne

SetCompanyID sets the "company" edge to the Company entity by ID.

func (*LocationUpdateOne) SetCountry

func (luo *LocationUpdateOne) SetCountry(c *Country) *LocationUpdateOne

SetCountry sets the "country" edge to the Country entity.

func (*LocationUpdateOne) SetCountryID

func (luo *LocationUpdateOne) SetCountryID(id uuid.UUID) *LocationUpdateOne

SetCountryID sets the "country" edge to the Country entity by ID.

func (*LocationUpdateOne) SetDescription

func (luo *LocationUpdateOne) SetDescription(s string) *LocationUpdateOne

SetDescription sets the "description" field.

func (*LocationUpdateOne) SetInput

SetInput applies the change-set in the UpdateLocationInput on the LocationUpdateOne builder.

func (*LocationUpdateOne) SetLatitude

func (luo *LocationUpdateOne) SetLatitude(f float64) *LocationUpdateOne

SetLatitude sets the "latitude" field.

func (*LocationUpdateOne) SetLongitude

func (luo *LocationUpdateOne) SetLongitude(f float64) *LocationUpdateOne

SetLongitude sets the "longitude" field.

func (*LocationUpdateOne) SetNillableCompanyID

func (luo *LocationUpdateOne) SetNillableCompanyID(id *uuid.UUID) *LocationUpdateOne

SetNillableCompanyID sets the "company" edge to the Company entity by ID if the given value is not nil.

func (*LocationUpdateOne) SetNillableCountryID

func (luo *LocationUpdateOne) SetNillableCountryID(id *uuid.UUID) *LocationUpdateOne

SetNillableCountryID sets the "country" edge to the Country entity by ID if the given value is not nil.

func (*LocationUpdateOne) SetPostcode

func (luo *LocationUpdateOne) SetPostcode(s string) *LocationUpdateOne

SetPostcode sets the "postcode" field.

func (*LocationUpdateOne) SetState

func (luo *LocationUpdateOne) SetState(s string) *LocationUpdateOne

SetState sets the "state" field.

func (*LocationUpdateOne) SetStreetName

func (luo *LocationUpdateOne) SetStreetName(s string) *LocationUpdateOne

SetStreetName sets the "street_name" field.

func (*LocationUpdateOne) SetStreetType

func (luo *LocationUpdateOne) SetStreetType(s string) *LocationUpdateOne

SetStreetType sets the "street_type" field.

func (*LocationUpdateOne) SetSuburb

func (luo *LocationUpdateOne) SetSuburb(s string) *LocationUpdateOne

SetSuburb sets the "suburb" field.

func (*LocationUpdateOne) SetTitle

func (luo *LocationUpdateOne) SetTitle(s string) *LocationUpdateOne

SetTitle sets the "title" field.

func (*LocationUpdateOne) SetType

func (luo *LocationUpdateOne) SetType(s string) *LocationUpdateOne

SetType sets the "type" field.

type LocationWhereInput

type LocationWhereInput struct {
	Predicates []predicate.Location  `json:"-"`
	Not        *LocationWhereInput   `json:"not,omitempty"`
	Or         []*LocationWhereInput `json:"or,omitempty"`
	And        []*LocationWhereInput `json:"and,omitempty"`

	// "id" field predicates.
	ID      *uuid.UUID  `json:"id,omitempty"`
	IDNEQ   *uuid.UUID  `json:"idNEQ,omitempty"`
	IDIn    []uuid.UUID `json:"idIn,omitempty"`
	IDNotIn []uuid.UUID `json:"idNotIn,omitempty"`
	IDGT    *uuid.UUID  `json:"idGT,omitempty"`
	IDGTE   *uuid.UUID  `json:"idGTE,omitempty"`
	IDLT    *uuid.UUID  `json:"idLT,omitempty"`
	IDLTE   *uuid.UUID  `json:"idLTE,omitempty"`

	// "title" field predicates.
	Title             *string  `json:"title,omitempty"`
	TitleNEQ          *string  `json:"titleNEQ,omitempty"`
	TitleIn           []string `json:"titleIn,omitempty"`
	TitleNotIn        []string `json:"titleNotIn,omitempty"`
	TitleGT           *string  `json:"titleGT,omitempty"`
	TitleGTE          *string  `json:"titleGTE,omitempty"`
	TitleLT           *string  `json:"titleLT,omitempty"`
	TitleLTE          *string  `json:"titleLTE,omitempty"`
	TitleContains     *string  `json:"titleContains,omitempty"`
	TitleHasPrefix    *string  `json:"titleHasPrefix,omitempty"`
	TitleHasSuffix    *string  `json:"titleHasSuffix,omitempty"`
	TitleEqualFold    *string  `json:"titleEqualFold,omitempty"`
	TitleContainsFold *string  `json:"titleContainsFold,omitempty"`

	// "description" field predicates.
	Description             *string  `json:"description,omitempty"`
	DescriptionNEQ          *string  `json:"descriptionNEQ,omitempty"`
	DescriptionIn           []string `json:"descriptionIn,omitempty"`
	DescriptionNotIn        []string `json:"descriptionNotIn,omitempty"`
	DescriptionGT           *string  `json:"descriptionGT,omitempty"`
	DescriptionGTE          *string  `json:"descriptionGTE,omitempty"`
	DescriptionLT           *string  `json:"descriptionLT,omitempty"`
	DescriptionLTE          *string  `json:"descriptionLTE,omitempty"`
	DescriptionContains     *string  `json:"descriptionContains,omitempty"`
	DescriptionHasPrefix    *string  `json:"descriptionHasPrefix,omitempty"`
	DescriptionHasSuffix    *string  `json:"descriptionHasSuffix,omitempty"`
	DescriptionEqualFold    *string  `json:"descriptionEqualFold,omitempty"`
	DescriptionContainsFold *string  `json:"descriptionContainsFold,omitempty"`

	// "latitude" field predicates.
	Latitude      *float64  `json:"latitude,omitempty"`
	LatitudeNEQ   *float64  `json:"latitudeNEQ,omitempty"`
	LatitudeIn    []float64 `json:"latitudeIn,omitempty"`
	LatitudeNotIn []float64 `json:"latitudeNotIn,omitempty"`
	LatitudeGT    *float64  `json:"latitudeGT,omitempty"`
	LatitudeGTE   *float64  `json:"latitudeGTE,omitempty"`
	LatitudeLT    *float64  `json:"latitudeLT,omitempty"`
	LatitudeLTE   *float64  `json:"latitudeLTE,omitempty"`

	// "longitude" field predicates.
	Longitude      *float64  `json:"longitude,omitempty"`
	LongitudeNEQ   *float64  `json:"longitudeNEQ,omitempty"`
	LongitudeIn    []float64 `json:"longitudeIn,omitempty"`
	LongitudeNotIn []float64 `json:"longitudeNotIn,omitempty"`
	LongitudeGT    *float64  `json:"longitudeGT,omitempty"`
	LongitudeGTE   *float64  `json:"longitudeGTE,omitempty"`
	LongitudeLT    *float64  `json:"longitudeLT,omitempty"`
	LongitudeLTE   *float64  `json:"longitudeLTE,omitempty"`

	// "address" field predicates.
	Address             *string  `json:"address,omitempty"`
	AddressNEQ          *string  `json:"addressNEQ,omitempty"`
	AddressIn           []string `json:"addressIn,omitempty"`
	AddressNotIn        []string `json:"addressNotIn,omitempty"`
	AddressGT           *string  `json:"addressGT,omitempty"`
	AddressGTE          *string  `json:"addressGTE,omitempty"`
	AddressLT           *string  `json:"addressLT,omitempty"`
	AddressLTE          *string  `json:"addressLTE,omitempty"`
	AddressContains     *string  `json:"addressContains,omitempty"`
	AddressHasPrefix    *string  `json:"addressHasPrefix,omitempty"`
	AddressHasSuffix    *string  `json:"addressHasSuffix,omitempty"`
	AddressEqualFold    *string  `json:"addressEqualFold,omitempty"`
	AddressContainsFold *string  `json:"addressContainsFold,omitempty"`

	// "postcode" field predicates.
	Postcode             *string  `json:"postcode,omitempty"`
	PostcodeNEQ          *string  `json:"postcodeNEQ,omitempty"`
	PostcodeIn           []string `json:"postcodeIn,omitempty"`
	PostcodeNotIn        []string `json:"postcodeNotIn,omitempty"`
	PostcodeGT           *string  `json:"postcodeGT,omitempty"`
	PostcodeGTE          *string  `json:"postcodeGTE,omitempty"`
	PostcodeLT           *string  `json:"postcodeLT,omitempty"`
	PostcodeLTE          *string  `json:"postcodeLTE,omitempty"`
	PostcodeContains     *string  `json:"postcodeContains,omitempty"`
	PostcodeHasPrefix    *string  `json:"postcodeHasPrefix,omitempty"`
	PostcodeHasSuffix    *string  `json:"postcodeHasSuffix,omitempty"`
	PostcodeEqualFold    *string  `json:"postcodeEqualFold,omitempty"`
	PostcodeContainsFold *string  `json:"postcodeContainsFold,omitempty"`

	// "type" field predicates.
	Type             *string  `json:"type,omitempty"`
	TypeNEQ          *string  `json:"typeNEQ,omitempty"`
	TypeIn           []string `json:"typeIn,omitempty"`
	TypeNotIn        []string `json:"typeNotIn,omitempty"`
	TypeGT           *string  `json:"typeGT,omitempty"`
	TypeGTE          *string  `json:"typeGTE,omitempty"`
	TypeLT           *string  `json:"typeLT,omitempty"`
	TypeLTE          *string  `json:"typeLTE,omitempty"`
	TypeContains     *string  `json:"typeContains,omitempty"`
	TypeHasPrefix    *string  `json:"typeHasPrefix,omitempty"`
	TypeHasSuffix    *string  `json:"typeHasSuffix,omitempty"`
	TypeEqualFold    *string  `json:"typeEqualFold,omitempty"`
	TypeContainsFold *string  `json:"typeContainsFold,omitempty"`

	// "state" field predicates.
	State             *string  `json:"state,omitempty"`
	StateNEQ          *string  `json:"stateNEQ,omitempty"`
	StateIn           []string `json:"stateIn,omitempty"`
	StateNotIn        []string `json:"stateNotIn,omitempty"`
	StateGT           *string  `json:"stateGT,omitempty"`
	StateGTE          *string  `json:"stateGTE,omitempty"`
	StateLT           *string  `json:"stateLT,omitempty"`
	StateLTE          *string  `json:"stateLTE,omitempty"`
	StateContains     *string  `json:"stateContains,omitempty"`
	StateHasPrefix    *string  `json:"stateHasPrefix,omitempty"`
	StateHasSuffix    *string  `json:"stateHasSuffix,omitempty"`
	StateEqualFold    *string  `json:"stateEqualFold,omitempty"`
	StateContainsFold *string  `json:"stateContainsFold,omitempty"`

	// "suburb" field predicates.
	Suburb             *string  `json:"suburb,omitempty"`
	SuburbNEQ          *string  `json:"suburbNEQ,omitempty"`
	SuburbIn           []string `json:"suburbIn,omitempty"`
	SuburbNotIn        []string `json:"suburbNotIn,omitempty"`
	SuburbGT           *string  `json:"suburbGT,omitempty"`
	SuburbGTE          *string  `json:"suburbGTE,omitempty"`
	SuburbLT           *string  `json:"suburbLT,omitempty"`
	SuburbLTE          *string  `json:"suburbLTE,omitempty"`
	SuburbContains     *string  `json:"suburbContains,omitempty"`
	SuburbHasPrefix    *string  `json:"suburbHasPrefix,omitempty"`
	SuburbHasSuffix    *string  `json:"suburbHasSuffix,omitempty"`
	SuburbEqualFold    *string  `json:"suburbEqualFold,omitempty"`
	SuburbContainsFold *string  `json:"suburbContainsFold,omitempty"`

	// "street_type" field predicates.
	StreetType             *string  `json:"streetType,omitempty"`
	StreetTypeNEQ          *string  `json:"streetTypeNEQ,omitempty"`
	StreetTypeIn           []string `json:"streetTypeIn,omitempty"`
	StreetTypeNotIn        []string `json:"streetTypeNotIn,omitempty"`
	StreetTypeGT           *string  `json:"streetTypeGT,omitempty"`
	StreetTypeGTE          *string  `json:"streetTypeGTE,omitempty"`
	StreetTypeLT           *string  `json:"streetTypeLT,omitempty"`
	StreetTypeLTE          *string  `json:"streetTypeLTE,omitempty"`
	StreetTypeContains     *string  `json:"streetTypeContains,omitempty"`
	StreetTypeHasPrefix    *string  `json:"streetTypeHasPrefix,omitempty"`
	StreetTypeHasSuffix    *string  `json:"streetTypeHasSuffix,omitempty"`
	StreetTypeEqualFold    *string  `json:"streetTypeEqualFold,omitempty"`
	StreetTypeContainsFold *string  `json:"streetTypeContainsFold,omitempty"`

	// "street_name" field predicates.
	StreetName             *string  `json:"streetName,omitempty"`
	StreetNameNEQ          *string  `json:"streetNameNEQ,omitempty"`
	StreetNameIn           []string `json:"streetNameIn,omitempty"`
	StreetNameNotIn        []string `json:"streetNameNotIn,omitempty"`
	StreetNameGT           *string  `json:"streetNameGT,omitempty"`
	StreetNameGTE          *string  `json:"streetNameGTE,omitempty"`
	StreetNameLT           *string  `json:"streetNameLT,omitempty"`
	StreetNameLTE          *string  `json:"streetNameLTE,omitempty"`
	StreetNameContains     *string  `json:"streetNameContains,omitempty"`
	StreetNameHasPrefix    *string  `json:"streetNameHasPrefix,omitempty"`
	StreetNameHasSuffix    *string  `json:"streetNameHasSuffix,omitempty"`
	StreetNameEqualFold    *string  `json:"streetNameEqualFold,omitempty"`
	StreetNameContainsFold *string  `json:"streetNameContainsFold,omitempty"`

	// "company" edge predicates.
	HasCompany     *bool                `json:"hasCompany,omitempty"`
	HasCompanyWith []*CompanyWhereInput `json:"hasCompanyWith,omitempty"`

	// "country" edge predicates.
	HasCountry     *bool                `json:"hasCountry,omitempty"`
	HasCountryWith []*CountryWhereInput `json:"hasCountryWith,omitempty"`
}

LocationWhereInput represents a where input for filtering Location queries.

func (*LocationWhereInput) AddPredicates

func (i *LocationWhereInput) AddPredicates(predicates ...predicate.Location)

AddPredicates adds custom predicates to the where input to be used during the filtering phase.

func (*LocationWhereInput) ApplySearchQuery

func (lwi *LocationWhereInput) ApplySearchQuery(q *string) *LocationWhereInput

func (*LocationWhereInput) Filter

Filter applies the LocationWhereInput filter on the LocationQuery builder.

func (*LocationWhereInput) P

P returns a predicate for filtering locations. An error is returned if the input is empty or invalid.

type Locations

type Locations []*Location

Locations is a parsable slice of Location.

type MutateFunc

type MutateFunc = ent.MutateFunc

ent aliases to avoid import conflicts in user's code.

type Mutation

type Mutation = ent.Mutation

ent aliases to avoid import conflicts in user's code.

type Mutator

type Mutator = ent.Mutator

ent aliases to avoid import conflicts in user's code.

type NodeOption

type NodeOption func(*nodeOptions)

NodeOption allows configuring the Noder execution using functional options.

func WithFixedNodeType

func WithFixedNodeType(t string) NodeOption

WithFixedNodeType sets the Type of the node to a fixed value.

func WithNodeType

func WithNodeType(f func(context.Context, uuid.UUID) (string, error)) NodeOption

WithNodeType sets the node Type resolver function (i.e. the table to query). If was not provided, the table will be derived from the universal-id configuration as described in: https://entgo.io/docs/migrate/#universal-ids.

type Noder

type Noder interface {
	IsNode()
}

Noder wraps the basic Node method.

type NotFoundError

type NotFoundError struct {
	// contains filtered or unexported fields
}

NotFoundError returns when trying to fetch a specific entity and it was not found in the database.

func (*NotFoundError) Error

func (e *NotFoundError) Error() string

Error implements the error interface.

type NotLoadedError

type NotLoadedError struct {
	// contains filtered or unexported fields
}

NotLoadedError returns when trying to get a node that was not loaded by the query.

func (*NotLoadedError) Error

func (e *NotLoadedError) Error() string

Error implements the error interface.

type NotSingularError

type NotSingularError struct {
	// contains filtered or unexported fields
}

NotSingularError returns when trying to fetch a singular entity and more then one was found in the database.

func (*NotSingularError) Error

func (e *NotSingularError) Error() string

Error implements the error interface.

type Op

type Op = ent.Op

ent aliases to avoid import conflicts in user's code.

type Option

type Option func(*config)

Option function to configure the client.

func 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 OrderDirection

type OrderDirection string

OrderDirection defines the directions in which to order a list of items.

const (
	// OrderDirectionAsc specifies an ascending order.
	OrderDirectionAsc OrderDirection = "ASC"
	// OrderDirectionDesc specifies a descending order.
	OrderDirectionDesc OrderDirection = "DESC"
)

func (OrderDirection) MarshalGQL

func (o OrderDirection) MarshalGQL(w io.Writer)

MarshalGQL implements graphql.Marshaler interface.

func (OrderDirection) String

func (o OrderDirection) String() string

String implements fmt.Stringer interface.

func (*OrderDirection) UnmarshalGQL

func (o *OrderDirection) UnmarshalGQL(val interface{}) error

UnmarshalGQL implements graphql.Unmarshaler interface.

func (OrderDirection) Validate

func (o OrderDirection) Validate() error

Validate the order direction value.

type OrderFunc

type OrderFunc func(*sql.Selector)

OrderFunc applies an ordering on the sql selector.

func Asc

func Asc(fields ...string) OrderFunc

Asc applies the given fields in ASC order.

func Desc

func Desc(fields ...string) OrderFunc

Desc applies the given fields in DESC order.

type PageInfo

type PageInfo struct {
	HasNextPage     bool    `json:"hasNextPage"`
	HasPreviousPage bool    `json:"hasPreviousPage"`
	StartCursor     *Cursor `json:"startCursor"`
	EndCursor       *Cursor `json:"endCursor"`
}

PageInfo of a connection type.

type Phone

type Phone struct {

	// ID of the ent.
	ID uuid.UUID `json:"id,omitempty"`
	// Title holds the value of the "title" field.
	Title string `json:"title,omitempty"`
	// Description holds the value of the "description" field.
	Description string `json:"description,omitempty"`
	// Number holds the value of the "number" field.
	Number string `json:"number,omitempty"`
	// Type holds the value of the "type" field.
	Type string `json:"type,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the PhoneQuery when eager-loading is set.
	Edges PhoneEdges `json:"edges"`
	// contains filtered or unexported fields
}

Phone is the model entity for the Phone schema.

func (*Phone) Company

func (ph *Phone) Company(ctx context.Context) (*Company, error)

func (*Phone) Country

func (ph *Phone) Country(ctx context.Context) (*Country, error)

func (*Phone) IsNode

func (n *Phone) IsNode()

IsNode implements the Node interface check for GQLGen.

func (*Phone) QueryCompany

func (ph *Phone) QueryCompany() *CompanyQuery

QueryCompany queries the "company" edge of the Phone entity.

func (*Phone) QueryCountry

func (ph *Phone) QueryCountry() *CountryQuery

QueryCountry queries the "country" edge of the Phone entity.

func (*Phone) String

func (ph *Phone) String() string

String implements the fmt.Stringer.

func (*Phone) ToEdge

func (ph *Phone) ToEdge(order *PhoneOrder) *PhoneEdge

ToEdge converts Phone into PhoneEdge.

func (*Phone) Unwrap

func (ph *Phone) Unwrap() *Phone

Unwrap unwraps the Phone 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 (*Phone) Update

func (ph *Phone) Update() *PhoneUpdateOne

Update returns a builder for updating this Phone. Note that you need to call Phone.Unwrap() before calling this method if this Phone was returned from a transaction, and the transaction was committed or rolled back.

type PhoneClient

type PhoneClient struct {
	// contains filtered or unexported fields
}

PhoneClient is a client for the Phone schema.

func NewPhoneClient

func NewPhoneClient(c config) *PhoneClient

NewPhoneClient returns a client for the Phone from the given config.

func (*PhoneClient) Create

func (c *PhoneClient) Create() *PhoneCreate

Create returns a builder for creating a Phone entity.

func (*PhoneClient) CreateBulk

func (c *PhoneClient) CreateBulk(builders ...*PhoneCreate) *PhoneCreateBulk

CreateBulk returns a builder for creating a bulk of Phone entities.

func (*PhoneClient) Delete

func (c *PhoneClient) Delete() *PhoneDelete

Delete returns a delete builder for Phone.

func (*PhoneClient) DeleteOne

func (c *PhoneClient) DeleteOne(ph *Phone) *PhoneDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*PhoneClient) DeleteOneID

func (c *PhoneClient) DeleteOneID(id uuid.UUID) *PhoneDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*PhoneClient) Get

func (c *PhoneClient) Get(ctx context.Context, id uuid.UUID) (*Phone, error)

Get returns a Phone entity by its id.

func (*PhoneClient) GetX

func (c *PhoneClient) GetX(ctx context.Context, id uuid.UUID) *Phone

GetX is like Get, but panics if an error occurs.

func (*PhoneClient) Hooks

func (c *PhoneClient) Hooks() []Hook

Hooks returns the client hooks.

func (*PhoneClient) Intercept

func (c *PhoneClient) Intercept(interceptors ...Interceptor)

Use adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `phone.Intercept(f(g(h())))`.

func (*PhoneClient) Interceptors

func (c *PhoneClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*PhoneClient) Query

func (c *PhoneClient) Query() *PhoneQuery

Query returns a query builder for Phone.

func (*PhoneClient) QueryCompany

func (c *PhoneClient) QueryCompany(ph *Phone) *CompanyQuery

QueryCompany queries the company edge of a Phone.

func (*PhoneClient) QueryCountry

func (c *PhoneClient) QueryCountry(ph *Phone) *CountryQuery

QueryCountry queries the country edge of a Phone.

func (*PhoneClient) Update

func (c *PhoneClient) Update() *PhoneUpdate

Update returns an update builder for Phone.

func (*PhoneClient) UpdateOne

func (c *PhoneClient) UpdateOne(ph *Phone) *PhoneUpdateOne

UpdateOne returns an update builder for the given entity.

func (*PhoneClient) UpdateOneID

func (c *PhoneClient) UpdateOneID(id uuid.UUID) *PhoneUpdateOne

UpdateOneID returns an update builder for the given id.

func (*PhoneClient) Use

func (c *PhoneClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `phone.Hooks(f(g(h())))`.

type PhoneConnection

type PhoneConnection struct {
	Edges      []*PhoneEdge `json:"edges"`
	PageInfo   PageInfo     `json:"pageInfo"`
	TotalCount int          `json:"totalCount"`
}

PhoneConnection is the connection containing edges to Phone.

type PhoneCreate

type PhoneCreate struct {
	// contains filtered or unexported fields
}

PhoneCreate is the builder for creating a Phone entity.

func (*PhoneCreate) Exec

func (pc *PhoneCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*PhoneCreate) ExecX

func (pc *PhoneCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*PhoneCreate) Mutation

func (pc *PhoneCreate) Mutation() *PhoneMutation

Mutation returns the PhoneMutation object of the builder.

func (*PhoneCreate) Save

func (pc *PhoneCreate) Save(ctx context.Context) (*Phone, error)

Save creates the Phone in the database.

func (*PhoneCreate) SaveX

func (pc *PhoneCreate) SaveX(ctx context.Context) *Phone

SaveX calls Save and panics if Save returns an error.

func (*PhoneCreate) SetCompany

func (pc *PhoneCreate) SetCompany(c *Company) *PhoneCreate

SetCompany sets the "company" edge to the Company entity.

func (*PhoneCreate) SetCompanyID

func (pc *PhoneCreate) SetCompanyID(id uuid.UUID) *PhoneCreate

SetCompanyID sets the "company" edge to the Company entity by ID.

func (*PhoneCreate) SetCountry

func (pc *PhoneCreate) SetCountry(c *Country) *PhoneCreate

SetCountry sets the "country" edge to the Country entity.

func (*PhoneCreate) SetCountryID

func (pc *PhoneCreate) SetCountryID(id uuid.UUID) *PhoneCreate

SetCountryID sets the "country" edge to the Country entity by ID.

func (*PhoneCreate) SetDescription

func (pc *PhoneCreate) SetDescription(s string) *PhoneCreate

SetDescription sets the "description" field.

func (*PhoneCreate) SetID

func (pc *PhoneCreate) SetID(u uuid.UUID) *PhoneCreate

SetID sets the "id" field.

func (*PhoneCreate) SetInput

func (c *PhoneCreate) SetInput(i CreatePhoneInput) *PhoneCreate

SetInput applies the change-set in the CreatePhoneInput on the PhoneCreate builder.

func (*PhoneCreate) SetNillableCompanyID

func (pc *PhoneCreate) SetNillableCompanyID(id *uuid.UUID) *PhoneCreate

SetNillableCompanyID sets the "company" edge to the Company entity by ID if the given value is not nil.

func (*PhoneCreate) SetNillableCountryID

func (pc *PhoneCreate) SetNillableCountryID(id *uuid.UUID) *PhoneCreate

SetNillableCountryID sets the "country" edge to the Country entity by ID if the given value is not nil.

func (*PhoneCreate) SetNillableID

func (pc *PhoneCreate) SetNillableID(u *uuid.UUID) *PhoneCreate

SetNillableID sets the "id" field if the given value is not nil.

func (*PhoneCreate) SetNumber

func (pc *PhoneCreate) SetNumber(s string) *PhoneCreate

SetNumber sets the "number" field.

func (*PhoneCreate) SetTitle

func (pc *PhoneCreate) SetTitle(s string) *PhoneCreate

SetTitle sets the "title" field.

func (*PhoneCreate) SetType

func (pc *PhoneCreate) SetType(s string) *PhoneCreate

SetType sets the "type" field.

type PhoneCreateBulk

type PhoneCreateBulk struct {
	// contains filtered or unexported fields
}

PhoneCreateBulk is the builder for creating many Phone entities in bulk.

func (*PhoneCreateBulk) Exec

func (pcb *PhoneCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*PhoneCreateBulk) ExecX

func (pcb *PhoneCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*PhoneCreateBulk) Save

func (pcb *PhoneCreateBulk) Save(ctx context.Context) ([]*Phone, error)

Save creates the Phone entities in the database.

func (*PhoneCreateBulk) SaveX

func (pcb *PhoneCreateBulk) SaveX(ctx context.Context) []*Phone

SaveX is like Save, but panics if an error occurs.

type PhoneDelete

type PhoneDelete struct {
	// contains filtered or unexported fields
}

PhoneDelete is the builder for deleting a Phone entity.

func (*PhoneDelete) Exec

func (pd *PhoneDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*PhoneDelete) ExecX

func (pd *PhoneDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*PhoneDelete) Where

func (pd *PhoneDelete) Where(ps ...predicate.Phone) *PhoneDelete

Where appends a list predicates to the PhoneDelete builder.

type PhoneDeleteOne

type PhoneDeleteOne struct {
	// contains filtered or unexported fields
}

PhoneDeleteOne is the builder for deleting a single Phone entity.

func (*PhoneDeleteOne) Exec

func (pdo *PhoneDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*PhoneDeleteOne) ExecX

func (pdo *PhoneDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

type PhoneEdge

type PhoneEdge struct {
	Node   *Phone `json:"node"`
	Cursor Cursor `json:"cursor"`
}

PhoneEdge is the edge representation of Phone.

type PhoneEdges

type PhoneEdges struct {
	// Company holds the value of the company edge.
	Company *Company `json:"company,omitempty"`
	// Country holds the value of the country edge.
	Country *Country `json:"country,omitempty"`
	// contains filtered or unexported fields
}

PhoneEdges holds the relations/edges for other nodes in the graph.

func (PhoneEdges) CompanyOrErr

func (e PhoneEdges) CompanyOrErr() (*Company, error)

CompanyOrErr returns the Company value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

func (PhoneEdges) CountryOrErr

func (e PhoneEdges) CountryOrErr() (*Country, error)

CountryOrErr returns the Country value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

type PhoneGroupBy

type PhoneGroupBy struct {
	// contains filtered or unexported fields
}

PhoneGroupBy is the group-by builder for Phone entities.

func (*PhoneGroupBy) Aggregate

func (pgb *PhoneGroupBy) Aggregate(fns ...AggregateFunc) *PhoneGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*PhoneGroupBy) Bool

func (s *PhoneGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*PhoneGroupBy) BoolX

func (s *PhoneGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*PhoneGroupBy) Bools

func (s *PhoneGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*PhoneGroupBy) BoolsX

func (s *PhoneGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*PhoneGroupBy) Float64

func (s *PhoneGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*PhoneGroupBy) Float64X

func (s *PhoneGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*PhoneGroupBy) Float64s

func (s *PhoneGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*PhoneGroupBy) Float64sX

func (s *PhoneGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*PhoneGroupBy) Int

func (s *PhoneGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*PhoneGroupBy) IntX

func (s *PhoneGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*PhoneGroupBy) Ints

func (s *PhoneGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*PhoneGroupBy) IntsX

func (s *PhoneGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*PhoneGroupBy) Scan

func (pgb *PhoneGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*PhoneGroupBy) ScanX

func (s *PhoneGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*PhoneGroupBy) String

func (s *PhoneGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*PhoneGroupBy) StringX

func (s *PhoneGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*PhoneGroupBy) Strings

func (s *PhoneGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*PhoneGroupBy) StringsX

func (s *PhoneGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type PhoneMutation

type PhoneMutation struct {
	// contains filtered or unexported fields
}

PhoneMutation represents an operation that mutates the Phone nodes in the graph.

func (*PhoneMutation) AddField

func (m *PhoneMutation) 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 (*PhoneMutation) AddedEdges

func (m *PhoneMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*PhoneMutation) AddedField

func (m *PhoneMutation) 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 (*PhoneMutation) AddedFields

func (m *PhoneMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*PhoneMutation) AddedIDs

func (m *PhoneMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*PhoneMutation) ClearCompany

func (m *PhoneMutation) ClearCompany()

ClearCompany clears the "company" edge to the Company entity.

func (*PhoneMutation) ClearCountry

func (m *PhoneMutation) ClearCountry()

ClearCountry clears the "country" edge to the Country entity.

func (*PhoneMutation) ClearEdge

func (m *PhoneMutation) 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 (*PhoneMutation) ClearField

func (m *PhoneMutation) 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 (*PhoneMutation) ClearedEdges

func (m *PhoneMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*PhoneMutation) ClearedFields

func (m *PhoneMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (PhoneMutation) Client

func (m PhoneMutation) 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 (*PhoneMutation) CompanyCleared

func (m *PhoneMutation) CompanyCleared() bool

CompanyCleared reports if the "company" edge to the Company entity was cleared.

func (*PhoneMutation) CompanyID

func (m *PhoneMutation) CompanyID() (id uuid.UUID, exists bool)

CompanyID returns the "company" edge ID in the mutation.

func (*PhoneMutation) CompanyIDs

func (m *PhoneMutation) CompanyIDs() (ids []uuid.UUID)

CompanyIDs returns the "company" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use CompanyID instead. It exists only for internal usage by the builders.

func (*PhoneMutation) CountryCleared

func (m *PhoneMutation) CountryCleared() bool

CountryCleared reports if the "country" edge to the Country entity was cleared.

func (*PhoneMutation) CountryID

func (m *PhoneMutation) CountryID() (id uuid.UUID, exists bool)

CountryID returns the "country" edge ID in the mutation.

func (*PhoneMutation) CountryIDs

func (m *PhoneMutation) CountryIDs() (ids []uuid.UUID)

CountryIDs returns the "country" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use CountryID instead. It exists only for internal usage by the builders.

func (*PhoneMutation) Description

func (m *PhoneMutation) Description() (r string, exists bool)

Description returns the value of the "description" field in the mutation.

func (*PhoneMutation) EdgeCleared

func (m *PhoneMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*PhoneMutation) Field

func (m *PhoneMutation) 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 (*PhoneMutation) FieldCleared

func (m *PhoneMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*PhoneMutation) Fields

func (m *PhoneMutation) 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 (*PhoneMutation) GetType

func (m *PhoneMutation) GetType() (r string, exists bool)

GetType returns the value of the "type" field in the mutation.

func (*PhoneMutation) ID

func (m *PhoneMutation) ID() (id uuid.UUID, 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 (*PhoneMutation) IDs

func (m *PhoneMutation) IDs(ctx context.Context) ([]uuid.UUID, 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 (*PhoneMutation) Number

func (m *PhoneMutation) Number() (r string, exists bool)

Number returns the value of the "number" field in the mutation.

func (*PhoneMutation) OldDescription

func (m *PhoneMutation) OldDescription(ctx context.Context) (v string, err error)

OldDescription returns the old "description" field's value of the Phone entity. If the Phone 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 (*PhoneMutation) OldField

func (m *PhoneMutation) 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 (*PhoneMutation) OldNumber

func (m *PhoneMutation) OldNumber(ctx context.Context) (v string, err error)

OldNumber returns the old "number" field's value of the Phone entity. If the Phone 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 (*PhoneMutation) OldTitle

func (m *PhoneMutation) OldTitle(ctx context.Context) (v string, err error)

OldTitle returns the old "title" field's value of the Phone entity. If the Phone 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 (*PhoneMutation) OldType

func (m *PhoneMutation) OldType(ctx context.Context) (v string, err error)

OldType returns the old "type" field's value of the Phone entity. If the Phone 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 (*PhoneMutation) Op

func (m *PhoneMutation) Op() Op

Op returns the operation name.

func (*PhoneMutation) RemovedEdges

func (m *PhoneMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*PhoneMutation) RemovedIDs

func (m *PhoneMutation) 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 (*PhoneMutation) ResetCompany

func (m *PhoneMutation) ResetCompany()

ResetCompany resets all changes to the "company" edge.

func (*PhoneMutation) ResetCountry

func (m *PhoneMutation) ResetCountry()

ResetCountry resets all changes to the "country" edge.

func (*PhoneMutation) ResetDescription

func (m *PhoneMutation) ResetDescription()

ResetDescription resets all changes to the "description" field.

func (*PhoneMutation) ResetEdge

func (m *PhoneMutation) 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 (*PhoneMutation) ResetField

func (m *PhoneMutation) 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 (*PhoneMutation) ResetNumber

func (m *PhoneMutation) ResetNumber()

ResetNumber resets all changes to the "number" field.

func (*PhoneMutation) ResetTitle

func (m *PhoneMutation) ResetTitle()

ResetTitle resets all changes to the "title" field.

func (*PhoneMutation) ResetType

func (m *PhoneMutation) ResetType()

ResetType resets all changes to the "type" field.

func (*PhoneMutation) SetCompanyID

func (m *PhoneMutation) SetCompanyID(id uuid.UUID)

SetCompanyID sets the "company" edge to the Company entity by id.

func (*PhoneMutation) SetCountryID

func (m *PhoneMutation) SetCountryID(id uuid.UUID)

SetCountryID sets the "country" edge to the Country entity by id.

func (*PhoneMutation) SetDescription

func (m *PhoneMutation) SetDescription(s string)

SetDescription sets the "description" field.

func (*PhoneMutation) SetField

func (m *PhoneMutation) 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 (*PhoneMutation) SetID

func (m *PhoneMutation) SetID(id uuid.UUID)

SetID sets the value of the id field. Note that this operation is only accepted on creation of Phone entities.

func (*PhoneMutation) SetNumber

func (m *PhoneMutation) SetNumber(s string)

SetNumber sets the "number" field.

func (*PhoneMutation) SetOp

func (m *PhoneMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*PhoneMutation) SetTitle

func (m *PhoneMutation) SetTitle(s string)

SetTitle sets the "title" field.

func (*PhoneMutation) SetType

func (m *PhoneMutation) SetType(s string)

SetType sets the "type" field.

func (*PhoneMutation) Title

func (m *PhoneMutation) Title() (r string, exists bool)

Title returns the value of the "title" field in the mutation.

func (PhoneMutation) Tx

func (m PhoneMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*PhoneMutation) Type

func (m *PhoneMutation) Type() string

Type returns the node type of this mutation (Phone).

func (*PhoneMutation) Where

func (m *PhoneMutation) Where(ps ...predicate.Phone)

Where appends a list predicates to the PhoneMutation builder.

func (*PhoneMutation) WhereP

func (m *PhoneMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the PhoneMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type PhoneOrder

type PhoneOrder struct {
	Direction OrderDirection   `json:"direction"`
	Field     *PhoneOrderField `json:"field"`
}

PhoneOrder defines the ordering of Phone.

type PhoneOrderField

type PhoneOrderField struct {
	// contains filtered or unexported fields
}

PhoneOrderField defines the ordering field of Phone.

func (PhoneOrderField) MarshalGQL

func (f PhoneOrderField) MarshalGQL(w io.Writer)

MarshalGQL implements graphql.Marshaler interface.

func (PhoneOrderField) String

func (f PhoneOrderField) String() string

String implement fmt.Stringer interface.

func (*PhoneOrderField) UnmarshalGQL

func (f *PhoneOrderField) UnmarshalGQL(v interface{}) error

UnmarshalGQL implements graphql.Unmarshaler interface.

type PhonePaginateOption

type PhonePaginateOption func(*phonePager) error

PhonePaginateOption enables pagination customization.

func WithPhoneFilter

func WithPhoneFilter(filter func(*PhoneQuery) (*PhoneQuery, error)) PhonePaginateOption

WithPhoneFilter configures pagination filter.

func WithPhoneOrder

func WithPhoneOrder(order *PhoneOrder) PhonePaginateOption

WithPhoneOrder configures pagination ordering.

type PhoneQuery

type PhoneQuery struct {
	// contains filtered or unexported fields
}

PhoneQuery is the builder for querying Phone entities.

func (*PhoneQuery) Aggregate

func (pq *PhoneQuery) Aggregate(fns ...AggregateFunc) *PhoneSelect

Aggregate returns a PhoneSelect configured with the given aggregations.

func (*PhoneQuery) All

func (pq *PhoneQuery) All(ctx context.Context) ([]*Phone, error)

All executes the query and returns a list of Phones.

func (*PhoneQuery) AllX

func (pq *PhoneQuery) AllX(ctx context.Context) []*Phone

AllX is like All, but panics if an error occurs.

func (*PhoneQuery) Clone

func (pq *PhoneQuery) Clone() *PhoneQuery

Clone returns a duplicate of the PhoneQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*PhoneQuery) CollectFields

func (ph *PhoneQuery) CollectFields(ctx context.Context, satisfies ...string) (*PhoneQuery, error)

CollectFields tells the query-builder to eagerly load connected nodes by resolver context.

func (*PhoneQuery) Count

func (pq *PhoneQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*PhoneQuery) CountX

func (pq *PhoneQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*PhoneQuery) Exist

func (pq *PhoneQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*PhoneQuery) ExistX

func (pq *PhoneQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*PhoneQuery) First

func (pq *PhoneQuery) First(ctx context.Context) (*Phone, error)

First returns the first Phone entity from the query. Returns a *NotFoundError when no Phone was found.

func (*PhoneQuery) FirstID

func (pq *PhoneQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

FirstID returns the first Phone ID from the query. Returns a *NotFoundError when no Phone ID was found.

func (*PhoneQuery) FirstIDX

func (pq *PhoneQuery) FirstIDX(ctx context.Context) uuid.UUID

FirstIDX is like FirstID, but panics if an error occurs.

func (*PhoneQuery) FirstX

func (pq *PhoneQuery) FirstX(ctx context.Context) *Phone

FirstX is like First, but panics if an error occurs.

func (*PhoneQuery) GroupBy

func (pq *PhoneQuery) GroupBy(field string, fields ...string) *PhoneGroupBy

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 {
	Title string `json:"title,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Phone.Query().
	GroupBy(phone.FieldTitle).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*PhoneQuery) IDs

func (pq *PhoneQuery) IDs(ctx context.Context) ([]uuid.UUID, error)

IDs executes the query and returns a list of Phone IDs.

func (*PhoneQuery) IDsX

func (pq *PhoneQuery) IDsX(ctx context.Context) []uuid.UUID

IDsX is like IDs, but panics if an error occurs.

func (*PhoneQuery) Limit

func (pq *PhoneQuery) Limit(limit int) *PhoneQuery

Limit the number of records to be returned by this query.

func (*PhoneQuery) Offset

func (pq *PhoneQuery) Offset(offset int) *PhoneQuery

Offset to start from.

func (*PhoneQuery) Only

func (pq *PhoneQuery) Only(ctx context.Context) (*Phone, error)

Only returns a single Phone entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Phone entity is found. Returns a *NotFoundError when no Phone entities are found.

func (*PhoneQuery) OnlyID

func (pq *PhoneQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

OnlyID is like Only, but returns the only Phone ID in the query. Returns a *NotSingularError when more than one Phone ID is found. Returns a *NotFoundError when no entities are found.

func (*PhoneQuery) OnlyIDX

func (pq *PhoneQuery) OnlyIDX(ctx context.Context) uuid.UUID

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*PhoneQuery) OnlyX

func (pq *PhoneQuery) OnlyX(ctx context.Context) *Phone

OnlyX is like Only, but panics if an error occurs.

func (*PhoneQuery) Order

func (pq *PhoneQuery) Order(o ...OrderFunc) *PhoneQuery

Order specifies how the records should be ordered.

func (*PhoneQuery) Paginate

func (ph *PhoneQuery) Paginate(
	ctx context.Context, after *Cursor, first *int,
	before *Cursor, last *int, opts ...PhonePaginateOption,
) (*PhoneConnection, error)

Paginate executes the query and returns a relay based cursor connection to Phone.

func (*PhoneQuery) QueryCompany

func (pq *PhoneQuery) QueryCompany() *CompanyQuery

QueryCompany chains the current query on the "company" edge.

func (*PhoneQuery) QueryCountry

func (pq *PhoneQuery) QueryCountry() *CountryQuery

QueryCountry chains the current query on the "country" edge.

func (*PhoneQuery) Select

func (pq *PhoneQuery) Select(fields ...string) *PhoneSelect

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 {
	Title string `json:"title,omitempty"`
}

client.Phone.Query().
	Select(phone.FieldTitle).
	Scan(ctx, &v)

func (*PhoneQuery) Unique

func (pq *PhoneQuery) Unique(unique bool) *PhoneQuery

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 (*PhoneQuery) Where

func (pq *PhoneQuery) Where(ps ...predicate.Phone) *PhoneQuery

Where adds a new predicate for the PhoneQuery builder.

func (*PhoneQuery) WithCompany

func (pq *PhoneQuery) WithCompany(opts ...func(*CompanyQuery)) *PhoneQuery

WithCompany tells the query-builder to eager-load the nodes that are connected to the "company" edge. The optional arguments are used to configure the query builder of the edge.

func (*PhoneQuery) WithCountry

func (pq *PhoneQuery) WithCountry(opts ...func(*CountryQuery)) *PhoneQuery

WithCountry tells the query-builder to eager-load the nodes that are connected to the "country" edge. The optional arguments are used to configure the query builder of the edge.

type PhoneSelect

type PhoneSelect struct {
	*PhoneQuery
	// contains filtered or unexported fields
}

PhoneSelect is the builder for selecting fields of Phone entities.

func (*PhoneSelect) Aggregate

func (ps *PhoneSelect) Aggregate(fns ...AggregateFunc) *PhoneSelect

Aggregate adds the given aggregation functions to the selector query.

func (*PhoneSelect) Bool

func (s *PhoneSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*PhoneSelect) BoolX

func (s *PhoneSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*PhoneSelect) Bools

func (s *PhoneSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*PhoneSelect) BoolsX

func (s *PhoneSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*PhoneSelect) Float64

func (s *PhoneSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*PhoneSelect) Float64X

func (s *PhoneSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*PhoneSelect) Float64s

func (s *PhoneSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*PhoneSelect) Float64sX

func (s *PhoneSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*PhoneSelect) Int

func (s *PhoneSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*PhoneSelect) IntX

func (s *PhoneSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*PhoneSelect) Ints

func (s *PhoneSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*PhoneSelect) IntsX

func (s *PhoneSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*PhoneSelect) Scan

func (ps *PhoneSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*PhoneSelect) ScanX

func (s *PhoneSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*PhoneSelect) String

func (s *PhoneSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*PhoneSelect) StringX

func (s *PhoneSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*PhoneSelect) Strings

func (s *PhoneSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*PhoneSelect) StringsX

func (s *PhoneSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type PhoneUpdate

type PhoneUpdate struct {
	// contains filtered or unexported fields
}

PhoneUpdate is the builder for updating Phone entities.

func (*PhoneUpdate) ClearCompany

func (pu *PhoneUpdate) ClearCompany() *PhoneUpdate

ClearCompany clears the "company" edge to the Company entity.

func (*PhoneUpdate) ClearCountry

func (pu *PhoneUpdate) ClearCountry() *PhoneUpdate

ClearCountry clears the "country" edge to the Country entity.

func (*PhoneUpdate) Exec

func (pu *PhoneUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*PhoneUpdate) ExecX

func (pu *PhoneUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*PhoneUpdate) Mutation

func (pu *PhoneUpdate) Mutation() *PhoneMutation

Mutation returns the PhoneMutation object of the builder.

func (*PhoneUpdate) Save

func (pu *PhoneUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*PhoneUpdate) SaveX

func (pu *PhoneUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*PhoneUpdate) SetCompany

func (pu *PhoneUpdate) SetCompany(c *Company) *PhoneUpdate

SetCompany sets the "company" edge to the Company entity.

func (*PhoneUpdate) SetCompanyID

func (pu *PhoneUpdate) SetCompanyID(id uuid.UUID) *PhoneUpdate

SetCompanyID sets the "company" edge to the Company entity by ID.

func (*PhoneUpdate) SetCountry

func (pu *PhoneUpdate) SetCountry(c *Country) *PhoneUpdate

SetCountry sets the "country" edge to the Country entity.

func (*PhoneUpdate) SetCountryID

func (pu *PhoneUpdate) SetCountryID(id uuid.UUID) *PhoneUpdate

SetCountryID sets the "country" edge to the Country entity by ID.

func (*PhoneUpdate) SetDescription

func (pu *PhoneUpdate) SetDescription(s string) *PhoneUpdate

SetDescription sets the "description" field.

func (*PhoneUpdate) SetInput

func (c *PhoneUpdate) SetInput(i UpdatePhoneInput) *PhoneUpdate

SetInput applies the change-set in the UpdatePhoneInput on the PhoneUpdate builder.

func (*PhoneUpdate) SetNillableCompanyID

func (pu *PhoneUpdate) SetNillableCompanyID(id *uuid.UUID) *PhoneUpdate

SetNillableCompanyID sets the "company" edge to the Company entity by ID if the given value is not nil.

func (*PhoneUpdate) SetNillableCountryID

func (pu *PhoneUpdate) SetNillableCountryID(id *uuid.UUID) *PhoneUpdate

SetNillableCountryID sets the "country" edge to the Country entity by ID if the given value is not nil.

func (*PhoneUpdate) SetNumber

func (pu *PhoneUpdate) SetNumber(s string) *PhoneUpdate

SetNumber sets the "number" field.

func (*PhoneUpdate) SetTitle

func (pu *PhoneUpdate) SetTitle(s string) *PhoneUpdate

SetTitle sets the "title" field.

func (*PhoneUpdate) SetType

func (pu *PhoneUpdate) SetType(s string) *PhoneUpdate

SetType sets the "type" field.

func (*PhoneUpdate) Where

func (pu *PhoneUpdate) Where(ps ...predicate.Phone) *PhoneUpdate

Where appends a list predicates to the PhoneUpdate builder.

type PhoneUpdateOne

type PhoneUpdateOne struct {
	// contains filtered or unexported fields
}

PhoneUpdateOne is the builder for updating a single Phone entity.

func (*PhoneUpdateOne) ClearCompany

func (puo *PhoneUpdateOne) ClearCompany() *PhoneUpdateOne

ClearCompany clears the "company" edge to the Company entity.

func (*PhoneUpdateOne) ClearCountry

func (puo *PhoneUpdateOne) ClearCountry() *PhoneUpdateOne

ClearCountry clears the "country" edge to the Country entity.

func (*PhoneUpdateOne) Exec

func (puo *PhoneUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*PhoneUpdateOne) ExecX

func (puo *PhoneUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*PhoneUpdateOne) Mutation

func (puo *PhoneUpdateOne) Mutation() *PhoneMutation

Mutation returns the PhoneMutation object of the builder.

func (*PhoneUpdateOne) Save

func (puo *PhoneUpdateOne) Save(ctx context.Context) (*Phone, error)

Save executes the query and returns the updated Phone entity.

func (*PhoneUpdateOne) SaveX

func (puo *PhoneUpdateOne) SaveX(ctx context.Context) *Phone

SaveX is like Save, but panics if an error occurs.

func (*PhoneUpdateOne) Select

func (puo *PhoneUpdateOne) Select(field string, fields ...string) *PhoneUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*PhoneUpdateOne) SetCompany

func (puo *PhoneUpdateOne) SetCompany(c *Company) *PhoneUpdateOne

SetCompany sets the "company" edge to the Company entity.

func (*PhoneUpdateOne) SetCompanyID

func (puo *PhoneUpdateOne) SetCompanyID(id uuid.UUID) *PhoneUpdateOne

SetCompanyID sets the "company" edge to the Company entity by ID.

func (*PhoneUpdateOne) SetCountry

func (puo *PhoneUpdateOne) SetCountry(c *Country) *PhoneUpdateOne

SetCountry sets the "country" edge to the Country entity.

func (*PhoneUpdateOne) SetCountryID

func (puo *PhoneUpdateOne) SetCountryID(id uuid.UUID) *PhoneUpdateOne

SetCountryID sets the "country" edge to the Country entity by ID.

func (*PhoneUpdateOne) SetDescription

func (puo *PhoneUpdateOne) SetDescription(s string) *PhoneUpdateOne

SetDescription sets the "description" field.

func (*PhoneUpdateOne) SetInput

SetInput applies the change-set in the UpdatePhoneInput on the PhoneUpdateOne builder.

func (*PhoneUpdateOne) SetNillableCompanyID

func (puo *PhoneUpdateOne) SetNillableCompanyID(id *uuid.UUID) *PhoneUpdateOne

SetNillableCompanyID sets the "company" edge to the Company entity by ID if the given value is not nil.

func (*PhoneUpdateOne) SetNillableCountryID

func (puo *PhoneUpdateOne) SetNillableCountryID(id *uuid.UUID) *PhoneUpdateOne

SetNillableCountryID sets the "country" edge to the Country entity by ID if the given value is not nil.

func (*PhoneUpdateOne) SetNumber

func (puo *PhoneUpdateOne) SetNumber(s string) *PhoneUpdateOne

SetNumber sets the "number" field.

func (*PhoneUpdateOne) SetTitle

func (puo *PhoneUpdateOne) SetTitle(s string) *PhoneUpdateOne

SetTitle sets the "title" field.

func (*PhoneUpdateOne) SetType

func (puo *PhoneUpdateOne) SetType(s string) *PhoneUpdateOne

SetType sets the "type" field.

type PhoneWhereInput

type PhoneWhereInput struct {
	Predicates []predicate.Phone  `json:"-"`
	Not        *PhoneWhereInput   `json:"not,omitempty"`
	Or         []*PhoneWhereInput `json:"or,omitempty"`
	And        []*PhoneWhereInput `json:"and,omitempty"`

	// "id" field predicates.
	ID      *uuid.UUID  `json:"id,omitempty"`
	IDNEQ   *uuid.UUID  `json:"idNEQ,omitempty"`
	IDIn    []uuid.UUID `json:"idIn,omitempty"`
	IDNotIn []uuid.UUID `json:"idNotIn,omitempty"`
	IDGT    *uuid.UUID  `json:"idGT,omitempty"`
	IDGTE   *uuid.UUID  `json:"idGTE,omitempty"`
	IDLT    *uuid.UUID  `json:"idLT,omitempty"`
	IDLTE   *uuid.UUID  `json:"idLTE,omitempty"`

	// "title" field predicates.
	Title             *string  `json:"title,omitempty"`
	TitleNEQ          *string  `json:"titleNEQ,omitempty"`
	TitleIn           []string `json:"titleIn,omitempty"`
	TitleNotIn        []string `json:"titleNotIn,omitempty"`
	TitleGT           *string  `json:"titleGT,omitempty"`
	TitleGTE          *string  `json:"titleGTE,omitempty"`
	TitleLT           *string  `json:"titleLT,omitempty"`
	TitleLTE          *string  `json:"titleLTE,omitempty"`
	TitleContains     *string  `json:"titleContains,omitempty"`
	TitleHasPrefix    *string  `json:"titleHasPrefix,omitempty"`
	TitleHasSuffix    *string  `json:"titleHasSuffix,omitempty"`
	TitleEqualFold    *string  `json:"titleEqualFold,omitempty"`
	TitleContainsFold *string  `json:"titleContainsFold,omitempty"`

	// "description" field predicates.
	Description             *string  `json:"description,omitempty"`
	DescriptionNEQ          *string  `json:"descriptionNEQ,omitempty"`
	DescriptionIn           []string `json:"descriptionIn,omitempty"`
	DescriptionNotIn        []string `json:"descriptionNotIn,omitempty"`
	DescriptionGT           *string  `json:"descriptionGT,omitempty"`
	DescriptionGTE          *string  `json:"descriptionGTE,omitempty"`
	DescriptionLT           *string  `json:"descriptionLT,omitempty"`
	DescriptionLTE          *string  `json:"descriptionLTE,omitempty"`
	DescriptionContains     *string  `json:"descriptionContains,omitempty"`
	DescriptionHasPrefix    *string  `json:"descriptionHasPrefix,omitempty"`
	DescriptionHasSuffix    *string  `json:"descriptionHasSuffix,omitempty"`
	DescriptionEqualFold    *string  `json:"descriptionEqualFold,omitempty"`
	DescriptionContainsFold *string  `json:"descriptionContainsFold,omitempty"`

	// "number" field predicates.
	Number             *string  `json:"number,omitempty"`
	NumberNEQ          *string  `json:"numberNEQ,omitempty"`
	NumberIn           []string `json:"numberIn,omitempty"`
	NumberNotIn        []string `json:"numberNotIn,omitempty"`
	NumberGT           *string  `json:"numberGT,omitempty"`
	NumberGTE          *string  `json:"numberGTE,omitempty"`
	NumberLT           *string  `json:"numberLT,omitempty"`
	NumberLTE          *string  `json:"numberLTE,omitempty"`
	NumberContains     *string  `json:"numberContains,omitempty"`
	NumberHasPrefix    *string  `json:"numberHasPrefix,omitempty"`
	NumberHasSuffix    *string  `json:"numberHasSuffix,omitempty"`
	NumberEqualFold    *string  `json:"numberEqualFold,omitempty"`
	NumberContainsFold *string  `json:"numberContainsFold,omitempty"`

	// "type" field predicates.
	Type             *string  `json:"type,omitempty"`
	TypeNEQ          *string  `json:"typeNEQ,omitempty"`
	TypeIn           []string `json:"typeIn,omitempty"`
	TypeNotIn        []string `json:"typeNotIn,omitempty"`
	TypeGT           *string  `json:"typeGT,omitempty"`
	TypeGTE          *string  `json:"typeGTE,omitempty"`
	TypeLT           *string  `json:"typeLT,omitempty"`
	TypeLTE          *string  `json:"typeLTE,omitempty"`
	TypeContains     *string  `json:"typeContains,omitempty"`
	TypeHasPrefix    *string  `json:"typeHasPrefix,omitempty"`
	TypeHasSuffix    *string  `json:"typeHasSuffix,omitempty"`
	TypeEqualFold    *string  `json:"typeEqualFold,omitempty"`
	TypeContainsFold *string  `json:"typeContainsFold,omitempty"`

	// "company" edge predicates.
	HasCompany     *bool                `json:"hasCompany,omitempty"`
	HasCompanyWith []*CompanyWhereInput `json:"hasCompanyWith,omitempty"`

	// "country" edge predicates.
	HasCountry     *bool                `json:"hasCountry,omitempty"`
	HasCountryWith []*CountryWhereInput `json:"hasCountryWith,omitempty"`
}

PhoneWhereInput represents a where input for filtering Phone queries.

func (*PhoneWhereInput) AddPredicates

func (i *PhoneWhereInput) AddPredicates(predicates ...predicate.Phone)

AddPredicates adds custom predicates to the where input to be used during the filtering phase.

func (*PhoneWhereInput) ApplySearchQuery

func (pwi *PhoneWhereInput) ApplySearchQuery(q *string) *PhoneWhereInput

func (*PhoneWhereInput) Filter

func (i *PhoneWhereInput) Filter(q *PhoneQuery) (*PhoneQuery, error)

Filter applies the PhoneWhereInput filter on the PhoneQuery builder.

func (*PhoneWhereInput) P

P returns a predicate for filtering phones. An error is returned if the input is empty or invalid.

type Phones

type Phones []*Phone

Phones is a parsable slice of Phone.

type Policy

type Policy = ent.Policy

ent aliases to avoid import conflicts in user's code.

type Product

type Product struct {

	// ID of the ent.
	ID uuid.UUID `json:"id,omitempty"`
	// Name holds the value of the "name" field.
	Name string `json:"name,omitempty"`
	// Description holds the value of the "description" field.
	Description string `json:"description,omitempty"`
	// Image holds the value of the "image" field.
	Image string `json:"image,omitempty"`
	// URL holds the value of the "url" field.
	URL string `json:"url,omitempty"`
	// LastSell holds the value of the "last_sell" field.
	LastSell *time.Time `json:"last_sell,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt *time.Time `json:"created_at,omitempty"`
	// Status holds the value of the "status" field.
	Status enums.ProcessStatus `json:"status,omitempty"`
	// BuildStatus holds the value of the "build_status" field.
	BuildStatus enums.ProcessStatus `json:"build_status,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the ProductQuery when eager-loading is set.
	Edges ProductEdges `json:"edges"`
	// contains filtered or unexported fields
}

Product is the model entity for the Product schema.

func (*Product) IsNode

func (n *Product) IsNode()

IsNode implements the Node interface check for GQLGen.

func (*Product) QueryVendor

func (pr *Product) QueryVendor() *VendorQuery

QueryVendor queries the "vendor" edge of the Product entity.

func (*Product) QueryWarehouse

func (pr *Product) QueryWarehouse() *WarehouseQuery

QueryWarehouse queries the "warehouse" edge of the Product entity.

func (*Product) String

func (pr *Product) String() string

String implements the fmt.Stringer.

func (*Product) ToEdge

func (pr *Product) ToEdge(order *ProductOrder) *ProductEdge

ToEdge converts Product into ProductEdge.

func (*Product) Unwrap

func (pr *Product) Unwrap() *Product

Unwrap unwraps the Product 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 (*Product) Update

func (pr *Product) Update() *ProductUpdateOne

Update returns a builder for updating this Product. Note that you need to call Product.Unwrap() before calling this method if this Product was returned from a transaction, and the transaction was committed or rolled back.

func (*Product) Vendor

func (pr *Product) Vendor(ctx context.Context) (*Vendor, error)

func (*Product) Warehouse

func (pr *Product) Warehouse(ctx context.Context) (*Warehouse, error)

type ProductClient

type ProductClient struct {
	// contains filtered or unexported fields
}

ProductClient is a client for the Product schema.

func NewProductClient

func NewProductClient(c config) *ProductClient

NewProductClient returns a client for the Product from the given config.

func (*ProductClient) Create

func (c *ProductClient) Create() *ProductCreate

Create returns a builder for creating a Product entity.

func (*ProductClient) CreateBulk

func (c *ProductClient) CreateBulk(builders ...*ProductCreate) *ProductCreateBulk

CreateBulk returns a builder for creating a bulk of Product entities.

func (*ProductClient) Delete

func (c *ProductClient) Delete() *ProductDelete

Delete returns a delete builder for Product.

func (*ProductClient) DeleteOne

func (c *ProductClient) DeleteOne(pr *Product) *ProductDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*ProductClient) DeleteOneID

func (c *ProductClient) DeleteOneID(id uuid.UUID) *ProductDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*ProductClient) Get

func (c *ProductClient) Get(ctx context.Context, id uuid.UUID) (*Product, error)

Get returns a Product entity by its id.

func (*ProductClient) GetX

func (c *ProductClient) GetX(ctx context.Context, id uuid.UUID) *Product

GetX is like Get, but panics if an error occurs.

func (*ProductClient) Hooks

func (c *ProductClient) Hooks() []Hook

Hooks returns the client hooks.

func (*ProductClient) Intercept

func (c *ProductClient) Intercept(interceptors ...Interceptor)

Use adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `product.Intercept(f(g(h())))`.

func (*ProductClient) Interceptors

func (c *ProductClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*ProductClient) Query

func (c *ProductClient) Query() *ProductQuery

Query returns a query builder for Product.

func (*ProductClient) QueryVendor

func (c *ProductClient) QueryVendor(pr *Product) *VendorQuery

QueryVendor queries the vendor edge of a Product.

func (*ProductClient) QueryWarehouse

func (c *ProductClient) QueryWarehouse(pr *Product) *WarehouseQuery

QueryWarehouse queries the warehouse edge of a Product.

func (*ProductClient) Update

func (c *ProductClient) Update() *ProductUpdate

Update returns an update builder for Product.

func (*ProductClient) UpdateOne

func (c *ProductClient) UpdateOne(pr *Product) *ProductUpdateOne

UpdateOne returns an update builder for the given entity.

func (*ProductClient) UpdateOneID

func (c *ProductClient) UpdateOneID(id uuid.UUID) *ProductUpdateOne

UpdateOneID returns an update builder for the given id.

func (*ProductClient) Use

func (c *ProductClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `product.Hooks(f(g(h())))`.

type ProductConnection

type ProductConnection struct {
	Edges      []*ProductEdge `json:"edges"`
	PageInfo   PageInfo       `json:"pageInfo"`
	TotalCount int            `json:"totalCount"`
}

ProductConnection is the connection containing edges to Product.

type ProductCreate

type ProductCreate struct {
	// contains filtered or unexported fields
}

ProductCreate is the builder for creating a Product entity.

func (*ProductCreate) Exec

func (pc *ProductCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*ProductCreate) ExecX

func (pc *ProductCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ProductCreate) Mutation

func (pc *ProductCreate) Mutation() *ProductMutation

Mutation returns the ProductMutation object of the builder.

func (*ProductCreate) Save

func (pc *ProductCreate) Save(ctx context.Context) (*Product, error)

Save creates the Product in the database.

func (*ProductCreate) SaveX

func (pc *ProductCreate) SaveX(ctx context.Context) *Product

SaveX calls Save and panics if Save returns an error.

func (*ProductCreate) SetBuildStatus

func (pc *ProductCreate) SetBuildStatus(es enums.ProcessStatus) *ProductCreate

SetBuildStatus sets the "build_status" field.

func (*ProductCreate) SetCreatedAt

func (pc *ProductCreate) SetCreatedAt(t time.Time) *ProductCreate

SetCreatedAt sets the "created_at" field.

func (*ProductCreate) SetDescription

func (pc *ProductCreate) SetDescription(s string) *ProductCreate

SetDescription sets the "description" field.

func (*ProductCreate) SetID

func (pc *ProductCreate) SetID(u uuid.UUID) *ProductCreate

SetID sets the "id" field.

func (*ProductCreate) SetImage

func (pc *ProductCreate) SetImage(s string) *ProductCreate

SetImage sets the "image" field.

func (*ProductCreate) SetInput

SetInput applies the change-set in the CreateProductInput on the ProductCreate builder.

func (*ProductCreate) SetLastSell

func (pc *ProductCreate) SetLastSell(t time.Time) *ProductCreate

SetLastSell sets the "last_sell" field.

func (*ProductCreate) SetName

func (pc *ProductCreate) SetName(s string) *ProductCreate

SetName sets the "name" field.

func (*ProductCreate) SetNillableBuildStatus

func (pc *ProductCreate) SetNillableBuildStatus(es *enums.ProcessStatus) *ProductCreate

SetNillableBuildStatus sets the "build_status" field if the given value is not nil.

func (*ProductCreate) SetNillableCreatedAt

func (pc *ProductCreate) SetNillableCreatedAt(t *time.Time) *ProductCreate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*ProductCreate) SetNillableID

func (pc *ProductCreate) SetNillableID(u *uuid.UUID) *ProductCreate

SetNillableID sets the "id" field if the given value is not nil.

func (*ProductCreate) SetNillableLastSell

func (pc *ProductCreate) SetNillableLastSell(t *time.Time) *ProductCreate

SetNillableLastSell sets the "last_sell" field if the given value is not nil.

func (*ProductCreate) SetNillableStatus

func (pc *ProductCreate) SetNillableStatus(es *enums.ProcessStatus) *ProductCreate

SetNillableStatus sets the "status" field if the given value is not nil.

func (*ProductCreate) SetNillableVendorID

func (pc *ProductCreate) SetNillableVendorID(id *uuid.UUID) *ProductCreate

SetNillableVendorID sets the "vendor" edge to the Vendor entity by ID if the given value is not nil.

func (*ProductCreate) SetNillableWarehouseID

func (pc *ProductCreate) SetNillableWarehouseID(id *uuid.UUID) *ProductCreate

SetNillableWarehouseID sets the "warehouse" edge to the Warehouse entity by ID if the given value is not nil.

func (*ProductCreate) SetStatus

func (pc *ProductCreate) SetStatus(es enums.ProcessStatus) *ProductCreate

SetStatus sets the "status" field.

func (*ProductCreate) SetURL

func (pc *ProductCreate) SetURL(s string) *ProductCreate

SetURL sets the "url" field.

func (*ProductCreate) SetVendor

func (pc *ProductCreate) SetVendor(v *Vendor) *ProductCreate

SetVendor sets the "vendor" edge to the Vendor entity.

func (*ProductCreate) SetVendorID

func (pc *ProductCreate) SetVendorID(id uuid.UUID) *ProductCreate

SetVendorID sets the "vendor" edge to the Vendor entity by ID.

func (*ProductCreate) SetWarehouse

func (pc *ProductCreate) SetWarehouse(w *Warehouse) *ProductCreate

SetWarehouse sets the "warehouse" edge to the Warehouse entity.

func (*ProductCreate) SetWarehouseID

func (pc *ProductCreate) SetWarehouseID(id uuid.UUID) *ProductCreate

SetWarehouseID sets the "warehouse" edge to the Warehouse entity by ID.

type ProductCreateBulk

type ProductCreateBulk struct {
	// contains filtered or unexported fields
}

ProductCreateBulk is the builder for creating many Product entities in bulk.

func (*ProductCreateBulk) Exec

func (pcb *ProductCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*ProductCreateBulk) ExecX

func (pcb *ProductCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ProductCreateBulk) Save

func (pcb *ProductCreateBulk) Save(ctx context.Context) ([]*Product, error)

Save creates the Product entities in the database.

func (*ProductCreateBulk) SaveX

func (pcb *ProductCreateBulk) SaveX(ctx context.Context) []*Product

SaveX is like Save, but panics if an error occurs.

type ProductDelete

type ProductDelete struct {
	// contains filtered or unexported fields
}

ProductDelete is the builder for deleting a Product entity.

func (*ProductDelete) Exec

func (pd *ProductDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*ProductDelete) ExecX

func (pd *ProductDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*ProductDelete) Where

func (pd *ProductDelete) Where(ps ...predicate.Product) *ProductDelete

Where appends a list predicates to the ProductDelete builder.

type ProductDeleteOne

type ProductDeleteOne struct {
	// contains filtered or unexported fields
}

ProductDeleteOne is the builder for deleting a single Product entity.

func (*ProductDeleteOne) Exec

func (pdo *ProductDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*ProductDeleteOne) ExecX

func (pdo *ProductDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

type ProductEdge

type ProductEdge struct {
	Node   *Product `json:"node"`
	Cursor Cursor   `json:"cursor"`
}

ProductEdge is the edge representation of Product.

type ProductEdges

type ProductEdges struct {
	// Warehouse holds the value of the warehouse edge.
	Warehouse *Warehouse `json:"warehouse,omitempty"`
	// Vendor holds the value of the vendor edge.
	Vendor *Vendor `json:"vendor,omitempty"`
	// contains filtered or unexported fields
}

ProductEdges holds the relations/edges for other nodes in the graph.

func (ProductEdges) VendorOrErr

func (e ProductEdges) VendorOrErr() (*Vendor, error)

VendorOrErr returns the Vendor value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

func (ProductEdges) WarehouseOrErr

func (e ProductEdges) WarehouseOrErr() (*Warehouse, error)

WarehouseOrErr returns the Warehouse value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

type ProductGroupBy

type ProductGroupBy struct {
	// contains filtered or unexported fields
}

ProductGroupBy is the group-by builder for Product entities.

func (*ProductGroupBy) Aggregate

func (pgb *ProductGroupBy) Aggregate(fns ...AggregateFunc) *ProductGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*ProductGroupBy) Bool

func (s *ProductGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*ProductGroupBy) BoolX

func (s *ProductGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*ProductGroupBy) Bools

func (s *ProductGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*ProductGroupBy) BoolsX

func (s *ProductGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*ProductGroupBy) Float64

func (s *ProductGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*ProductGroupBy) Float64X

func (s *ProductGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*ProductGroupBy) Float64s

func (s *ProductGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*ProductGroupBy) Float64sX

func (s *ProductGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*ProductGroupBy) Int

func (s *ProductGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*ProductGroupBy) IntX

func (s *ProductGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*ProductGroupBy) Ints

func (s *ProductGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*ProductGroupBy) IntsX

func (s *ProductGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*ProductGroupBy) Scan

func (pgb *ProductGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*ProductGroupBy) ScanX

func (s *ProductGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*ProductGroupBy) String

func (s *ProductGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*ProductGroupBy) StringX

func (s *ProductGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*ProductGroupBy) Strings

func (s *ProductGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*ProductGroupBy) StringsX

func (s *ProductGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type ProductMutation

type ProductMutation struct {
	// contains filtered or unexported fields
}

ProductMutation represents an operation that mutates the Product nodes in the graph.

func (*ProductMutation) AddField

func (m *ProductMutation) 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 (*ProductMutation) AddedEdges

func (m *ProductMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*ProductMutation) AddedField

func (m *ProductMutation) 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 (*ProductMutation) AddedFields

func (m *ProductMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*ProductMutation) AddedIDs

func (m *ProductMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*ProductMutation) BuildStatus

func (m *ProductMutation) BuildStatus() (r enums.ProcessStatus, exists bool)

BuildStatus returns the value of the "build_status" field in the mutation.

func (*ProductMutation) ClearCreatedAt

func (m *ProductMutation) ClearCreatedAt()

ClearCreatedAt clears the value of the "created_at" field.

func (*ProductMutation) ClearEdge

func (m *ProductMutation) 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 (*ProductMutation) ClearField

func (m *ProductMutation) 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 (*ProductMutation) ClearLastSell

func (m *ProductMutation) ClearLastSell()

ClearLastSell clears the value of the "last_sell" field.

func (*ProductMutation) ClearVendor

func (m *ProductMutation) ClearVendor()

ClearVendor clears the "vendor" edge to the Vendor entity.

func (*ProductMutation) ClearWarehouse

func (m *ProductMutation) ClearWarehouse()

ClearWarehouse clears the "warehouse" edge to the Warehouse entity.

func (*ProductMutation) ClearedEdges

func (m *ProductMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*ProductMutation) ClearedFields

func (m *ProductMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (ProductMutation) Client

func (m ProductMutation) 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 (*ProductMutation) CreatedAt

func (m *ProductMutation) CreatedAt() (r time.Time, exists bool)

CreatedAt returns the value of the "created_at" field in the mutation.

func (*ProductMutation) CreatedAtCleared

func (m *ProductMutation) CreatedAtCleared() bool

CreatedAtCleared returns if the "created_at" field was cleared in this mutation.

func (*ProductMutation) Description

func (m *ProductMutation) Description() (r string, exists bool)

Description returns the value of the "description" field in the mutation.

func (*ProductMutation) EdgeCleared

func (m *ProductMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*ProductMutation) Field

func (m *ProductMutation) 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 (*ProductMutation) FieldCleared

func (m *ProductMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*ProductMutation) Fields

func (m *ProductMutation) 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 (*ProductMutation) ID

func (m *ProductMutation) ID() (id uuid.UUID, 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 (*ProductMutation) IDs

func (m *ProductMutation) IDs(ctx context.Context) ([]uuid.UUID, 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 (*ProductMutation) Image

func (m *ProductMutation) Image() (r string, exists bool)

Image returns the value of the "image" field in the mutation.

func (*ProductMutation) LastSell

func (m *ProductMutation) LastSell() (r time.Time, exists bool)

LastSell returns the value of the "last_sell" field in the mutation.

func (*ProductMutation) LastSellCleared

func (m *ProductMutation) LastSellCleared() bool

LastSellCleared returns if the "last_sell" field was cleared in this mutation.

func (*ProductMutation) Name

func (m *ProductMutation) Name() (r string, exists bool)

Name returns the value of the "name" field in the mutation.

func (*ProductMutation) OldBuildStatus

func (m *ProductMutation) OldBuildStatus(ctx context.Context) (v enums.ProcessStatus, err error)

OldBuildStatus returns the old "build_status" field's value of the Product entity. If the Product 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 (*ProductMutation) OldCreatedAt

func (m *ProductMutation) OldCreatedAt(ctx context.Context) (v *time.Time, err error)

OldCreatedAt returns the old "created_at" field's value of the Product entity. If the Product 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 (*ProductMutation) OldDescription

func (m *ProductMutation) OldDescription(ctx context.Context) (v string, err error)

OldDescription returns the old "description" field's value of the Product entity. If the Product 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 (*ProductMutation) OldField

func (m *ProductMutation) 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 (*ProductMutation) OldImage

func (m *ProductMutation) OldImage(ctx context.Context) (v string, err error)

OldImage returns the old "image" field's value of the Product entity. If the Product 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 (*ProductMutation) OldLastSell

func (m *ProductMutation) OldLastSell(ctx context.Context) (v *time.Time, err error)

OldLastSell returns the old "last_sell" field's value of the Product entity. If the Product 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 (*ProductMutation) OldName

func (m *ProductMutation) OldName(ctx context.Context) (v string, err error)

OldName returns the old "name" field's value of the Product entity. If the Product 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 (*ProductMutation) OldStatus

func (m *ProductMutation) OldStatus(ctx context.Context) (v enums.ProcessStatus, err error)

OldStatus returns the old "status" field's value of the Product entity. If the Product 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 (*ProductMutation) OldURL

func (m *ProductMutation) OldURL(ctx context.Context) (v string, err error)

OldURL returns the old "url" field's value of the Product entity. If the Product 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 (*ProductMutation) Op

func (m *ProductMutation) Op() Op

Op returns the operation name.

func (*ProductMutation) RemovedEdges

func (m *ProductMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*ProductMutation) RemovedIDs

func (m *ProductMutation) 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 (*ProductMutation) ResetBuildStatus

func (m *ProductMutation) ResetBuildStatus()

ResetBuildStatus resets all changes to the "build_status" field.

func (*ProductMutation) ResetCreatedAt

func (m *ProductMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*ProductMutation) ResetDescription

func (m *ProductMutation) ResetDescription()

ResetDescription resets all changes to the "description" field.

func (*ProductMutation) ResetEdge

func (m *ProductMutation) 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 (*ProductMutation) ResetField

func (m *ProductMutation) 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 (*ProductMutation) ResetImage

func (m *ProductMutation) ResetImage()

ResetImage resets all changes to the "image" field.

func (*ProductMutation) ResetLastSell

func (m *ProductMutation) ResetLastSell()

ResetLastSell resets all changes to the "last_sell" field.

func (*ProductMutation) ResetName

func (m *ProductMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*ProductMutation) ResetStatus

func (m *ProductMutation) ResetStatus()

ResetStatus resets all changes to the "status" field.

func (*ProductMutation) ResetURL

func (m *ProductMutation) ResetURL()

ResetURL resets all changes to the "url" field.

func (*ProductMutation) ResetVendor

func (m *ProductMutation) ResetVendor()

ResetVendor resets all changes to the "vendor" edge.

func (*ProductMutation) ResetWarehouse

func (m *ProductMutation) ResetWarehouse()

ResetWarehouse resets all changes to the "warehouse" edge.

func (*ProductMutation) SetBuildStatus

func (m *ProductMutation) SetBuildStatus(es enums.ProcessStatus)

SetBuildStatus sets the "build_status" field.

func (*ProductMutation) SetCreatedAt

func (m *ProductMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" field.

func (*ProductMutation) SetDescription

func (m *ProductMutation) SetDescription(s string)

SetDescription sets the "description" field.

func (*ProductMutation) SetField

func (m *ProductMutation) 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 (*ProductMutation) SetID

func (m *ProductMutation) SetID(id uuid.UUID)

SetID sets the value of the id field. Note that this operation is only accepted on creation of Product entities.

func (*ProductMutation) SetImage

func (m *ProductMutation) SetImage(s string)

SetImage sets the "image" field.

func (*ProductMutation) SetLastSell

func (m *ProductMutation) SetLastSell(t time.Time)

SetLastSell sets the "last_sell" field.

func (*ProductMutation) SetName

func (m *ProductMutation) SetName(s string)

SetName sets the "name" field.

func (*ProductMutation) SetOp

func (m *ProductMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*ProductMutation) SetStatus

func (m *ProductMutation) SetStatus(es enums.ProcessStatus)

SetStatus sets the "status" field.

func (*ProductMutation) SetURL

func (m *ProductMutation) SetURL(s string)

SetURL sets the "url" field.

func (*ProductMutation) SetVendorID

func (m *ProductMutation) SetVendorID(id uuid.UUID)

SetVendorID sets the "vendor" edge to the Vendor entity by id.

func (*ProductMutation) SetWarehouseID

func (m *ProductMutation) SetWarehouseID(id uuid.UUID)

SetWarehouseID sets the "warehouse" edge to the Warehouse entity by id.

func (*ProductMutation) Status

func (m *ProductMutation) Status() (r enums.ProcessStatus, exists bool)

Status returns the value of the "status" field in the mutation.

func (ProductMutation) Tx

func (m ProductMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*ProductMutation) Type

func (m *ProductMutation) Type() string

Type returns the node type of this mutation (Product).

func (*ProductMutation) URL

func (m *ProductMutation) URL() (r string, exists bool)

URL returns the value of the "url" field in the mutation.

func (*ProductMutation) VendorCleared

func (m *ProductMutation) VendorCleared() bool

VendorCleared reports if the "vendor" edge to the Vendor entity was cleared.

func (*ProductMutation) VendorID

func (m *ProductMutation) VendorID() (id uuid.UUID, exists bool)

VendorID returns the "vendor" edge ID in the mutation.

func (*ProductMutation) VendorIDs

func (m *ProductMutation) VendorIDs() (ids []uuid.UUID)

VendorIDs returns the "vendor" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use VendorID instead. It exists only for internal usage by the builders.

func (*ProductMutation) WarehouseCleared

func (m *ProductMutation) WarehouseCleared() bool

WarehouseCleared reports if the "warehouse" edge to the Warehouse entity was cleared.

func (*ProductMutation) WarehouseID

func (m *ProductMutation) WarehouseID() (id uuid.UUID, exists bool)

WarehouseID returns the "warehouse" edge ID in the mutation.

func (*ProductMutation) WarehouseIDs

func (m *ProductMutation) WarehouseIDs() (ids []uuid.UUID)

WarehouseIDs returns the "warehouse" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use WarehouseID instead. It exists only for internal usage by the builders.

func (*ProductMutation) Where

func (m *ProductMutation) Where(ps ...predicate.Product)

Where appends a list predicates to the ProductMutation builder.

func (*ProductMutation) WhereP

func (m *ProductMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the ProductMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type ProductOrder

type ProductOrder struct {
	Direction OrderDirection     `json:"direction"`
	Field     *ProductOrderField `json:"field"`
}

ProductOrder defines the ordering of Product.

type ProductOrderField

type ProductOrderField struct {
	// contains filtered or unexported fields
}

ProductOrderField defines the ordering field of Product.

func (ProductOrderField) MarshalGQL

func (f ProductOrderField) MarshalGQL(w io.Writer)

MarshalGQL implements graphql.Marshaler interface.

func (ProductOrderField) String

func (f ProductOrderField) String() string

String implement fmt.Stringer interface.

func (*ProductOrderField) UnmarshalGQL

func (f *ProductOrderField) UnmarshalGQL(v interface{}) error

UnmarshalGQL implements graphql.Unmarshaler interface.

type ProductPaginateOption

type ProductPaginateOption func(*productPager) error

ProductPaginateOption enables pagination customization.

func WithProductFilter

func WithProductFilter(filter func(*ProductQuery) (*ProductQuery, error)) ProductPaginateOption

WithProductFilter configures pagination filter.

func WithProductOrder

func WithProductOrder(order *ProductOrder) ProductPaginateOption

WithProductOrder configures pagination ordering.

type ProductQuery

type ProductQuery struct {
	// contains filtered or unexported fields
}

ProductQuery is the builder for querying Product entities.

func (*ProductQuery) Aggregate

func (pq *ProductQuery) Aggregate(fns ...AggregateFunc) *ProductSelect

Aggregate returns a ProductSelect configured with the given aggregations.

func (*ProductQuery) All

func (pq *ProductQuery) All(ctx context.Context) ([]*Product, error)

All executes the query and returns a list of Products.

func (*ProductQuery) AllX

func (pq *ProductQuery) AllX(ctx context.Context) []*Product

AllX is like All, but panics if an error occurs.

func (*ProductQuery) Clone

func (pq *ProductQuery) Clone() *ProductQuery

Clone returns a duplicate of the ProductQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*ProductQuery) CollectFields

func (pr *ProductQuery) CollectFields(ctx context.Context, satisfies ...string) (*ProductQuery, error)

CollectFields tells the query-builder to eagerly load connected nodes by resolver context.

func (*ProductQuery) Count

func (pq *ProductQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*ProductQuery) CountX

func (pq *ProductQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*ProductQuery) Exist

func (pq *ProductQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*ProductQuery) ExistX

func (pq *ProductQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*ProductQuery) First

func (pq *ProductQuery) First(ctx context.Context) (*Product, error)

First returns the first Product entity from the query. Returns a *NotFoundError when no Product was found.

func (*ProductQuery) FirstID

func (pq *ProductQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

FirstID returns the first Product ID from the query. Returns a *NotFoundError when no Product ID was found.

func (*ProductQuery) FirstIDX

func (pq *ProductQuery) FirstIDX(ctx context.Context) uuid.UUID

FirstIDX is like FirstID, but panics if an error occurs.

func (*ProductQuery) FirstX

func (pq *ProductQuery) FirstX(ctx context.Context) *Product

FirstX is like First, but panics if an error occurs.

func (*ProductQuery) GroupBy

func (pq *ProductQuery) GroupBy(field string, fields ...string) *ProductGroupBy

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.Product.Query().
	GroupBy(product.FieldName).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*ProductQuery) IDs

func (pq *ProductQuery) IDs(ctx context.Context) ([]uuid.UUID, error)

IDs executes the query and returns a list of Product IDs.

func (*ProductQuery) IDsX

func (pq *ProductQuery) IDsX(ctx context.Context) []uuid.UUID

IDsX is like IDs, but panics if an error occurs.

func (*ProductQuery) Limit

func (pq *ProductQuery) Limit(limit int) *ProductQuery

Limit the number of records to be returned by this query.

func (*ProductQuery) Offset

func (pq *ProductQuery) Offset(offset int) *ProductQuery

Offset to start from.

func (*ProductQuery) Only

func (pq *ProductQuery) Only(ctx context.Context) (*Product, error)

Only returns a single Product entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Product entity is found. Returns a *NotFoundError when no Product entities are found.

func (*ProductQuery) OnlyID

func (pq *ProductQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

OnlyID is like Only, but returns the only Product ID in the query. Returns a *NotSingularError when more than one Product ID is found. Returns a *NotFoundError when no entities are found.

func (*ProductQuery) OnlyIDX

func (pq *ProductQuery) OnlyIDX(ctx context.Context) uuid.UUID

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*ProductQuery) OnlyX

func (pq *ProductQuery) OnlyX(ctx context.Context) *Product

OnlyX is like Only, but panics if an error occurs.

func (*ProductQuery) Order

func (pq *ProductQuery) Order(o ...OrderFunc) *ProductQuery

Order specifies how the records should be ordered.

func (*ProductQuery) Paginate

func (pr *ProductQuery) Paginate(
	ctx context.Context, after *Cursor, first *int,
	before *Cursor, last *int, opts ...ProductPaginateOption,
) (*ProductConnection, error)

Paginate executes the query and returns a relay based cursor connection to Product.

func (*ProductQuery) QueryVendor

func (pq *ProductQuery) QueryVendor() *VendorQuery

QueryVendor chains the current query on the "vendor" edge.

func (*ProductQuery) QueryWarehouse

func (pq *ProductQuery) QueryWarehouse() *WarehouseQuery

QueryWarehouse chains the current query on the "warehouse" edge.

func (*ProductQuery) Select

func (pq *ProductQuery) Select(fields ...string) *ProductSelect

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.Product.Query().
	Select(product.FieldName).
	Scan(ctx, &v)

func (*ProductQuery) Unique

func (pq *ProductQuery) Unique(unique bool) *ProductQuery

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 (*ProductQuery) Where

func (pq *ProductQuery) Where(ps ...predicate.Product) *ProductQuery

Where adds a new predicate for the ProductQuery builder.

func (*ProductQuery) WithVendor

func (pq *ProductQuery) WithVendor(opts ...func(*VendorQuery)) *ProductQuery

WithVendor tells the query-builder to eager-load the nodes that are connected to the "vendor" edge. The optional arguments are used to configure the query builder of the edge.

func (*ProductQuery) WithWarehouse

func (pq *ProductQuery) WithWarehouse(opts ...func(*WarehouseQuery)) *ProductQuery

WithWarehouse tells the query-builder to eager-load the nodes that are connected to the "warehouse" edge. The optional arguments are used to configure the query builder of the edge.

type ProductSelect

type ProductSelect struct {
	*ProductQuery
	// contains filtered or unexported fields
}

ProductSelect is the builder for selecting fields of Product entities.

func (*ProductSelect) Aggregate

func (ps *ProductSelect) Aggregate(fns ...AggregateFunc) *ProductSelect

Aggregate adds the given aggregation functions to the selector query.

func (*ProductSelect) Bool

func (s *ProductSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*ProductSelect) BoolX

func (s *ProductSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*ProductSelect) Bools

func (s *ProductSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*ProductSelect) BoolsX

func (s *ProductSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*ProductSelect) Float64

func (s *ProductSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*ProductSelect) Float64X

func (s *ProductSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*ProductSelect) Float64s

func (s *ProductSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*ProductSelect) Float64sX

func (s *ProductSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*ProductSelect) Int

func (s *ProductSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*ProductSelect) IntX

func (s *ProductSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*ProductSelect) Ints

func (s *ProductSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*ProductSelect) IntsX

func (s *ProductSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*ProductSelect) Scan

func (ps *ProductSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*ProductSelect) ScanX

func (s *ProductSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*ProductSelect) String

func (s *ProductSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*ProductSelect) StringX

func (s *ProductSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*ProductSelect) Strings

func (s *ProductSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*ProductSelect) StringsX

func (s *ProductSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type ProductUpdate

type ProductUpdate struct {
	// contains filtered or unexported fields
}

ProductUpdate is the builder for updating Product entities.

func (*ProductUpdate) ClearCreatedAt

func (pu *ProductUpdate) ClearCreatedAt() *ProductUpdate

ClearCreatedAt clears the value of the "created_at" field.

func (*ProductUpdate) ClearLastSell

func (pu *ProductUpdate) ClearLastSell() *ProductUpdate

ClearLastSell clears the value of the "last_sell" field.

func (*ProductUpdate) ClearVendor

func (pu *ProductUpdate) ClearVendor() *ProductUpdate

ClearVendor clears the "vendor" edge to the Vendor entity.

func (*ProductUpdate) ClearWarehouse

func (pu *ProductUpdate) ClearWarehouse() *ProductUpdate

ClearWarehouse clears the "warehouse" edge to the Warehouse entity.

func (*ProductUpdate) Exec

func (pu *ProductUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*ProductUpdate) ExecX

func (pu *ProductUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ProductUpdate) Mutation

func (pu *ProductUpdate) Mutation() *ProductMutation

Mutation returns the ProductMutation object of the builder.

func (*ProductUpdate) Save

func (pu *ProductUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*ProductUpdate) SaveX

func (pu *ProductUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*ProductUpdate) SetBuildStatus

func (pu *ProductUpdate) SetBuildStatus(es enums.ProcessStatus) *ProductUpdate

SetBuildStatus sets the "build_status" field.

func (*ProductUpdate) SetCreatedAt

func (pu *ProductUpdate) SetCreatedAt(t time.Time) *ProductUpdate

SetCreatedAt sets the "created_at" field.

func (*ProductUpdate) SetDescription

func (pu *ProductUpdate) SetDescription(s string) *ProductUpdate

SetDescription sets the "description" field.

func (*ProductUpdate) SetImage

func (pu *ProductUpdate) SetImage(s string) *ProductUpdate

SetImage sets the "image" field.

func (*ProductUpdate) SetInput

SetInput applies the change-set in the UpdateProductInput on the ProductUpdate builder.

func (*ProductUpdate) SetLastSell

func (pu *ProductUpdate) SetLastSell(t time.Time) *ProductUpdate

SetLastSell sets the "last_sell" field.

func (*ProductUpdate) SetName

func (pu *ProductUpdate) SetName(s string) *ProductUpdate

SetName sets the "name" field.

func (*ProductUpdate) SetNillableBuildStatus

func (pu *ProductUpdate) SetNillableBuildStatus(es *enums.ProcessStatus) *ProductUpdate

SetNillableBuildStatus sets the "build_status" field if the given value is not nil.

func (*ProductUpdate) SetNillableCreatedAt

func (pu *ProductUpdate) SetNillableCreatedAt(t *time.Time) *ProductUpdate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*ProductUpdate) SetNillableLastSell

func (pu *ProductUpdate) SetNillableLastSell(t *time.Time) *ProductUpdate

SetNillableLastSell sets the "last_sell" field if the given value is not nil.

func (*ProductUpdate) SetNillableStatus

func (pu *ProductUpdate) SetNillableStatus(es *enums.ProcessStatus) *ProductUpdate

SetNillableStatus sets the "status" field if the given value is not nil.

func (*ProductUpdate) SetNillableVendorID

func (pu *ProductUpdate) SetNillableVendorID(id *uuid.UUID) *ProductUpdate

SetNillableVendorID sets the "vendor" edge to the Vendor entity by ID if the given value is not nil.

func (*ProductUpdate) SetNillableWarehouseID

func (pu *ProductUpdate) SetNillableWarehouseID(id *uuid.UUID) *ProductUpdate

SetNillableWarehouseID sets the "warehouse" edge to the Warehouse entity by ID if the given value is not nil.

func (*ProductUpdate) SetStatus

func (pu *ProductUpdate) SetStatus(es enums.ProcessStatus) *ProductUpdate

SetStatus sets the "status" field.

func (*ProductUpdate) SetURL

func (pu *ProductUpdate) SetURL(s string) *ProductUpdate

SetURL sets the "url" field.

func (*ProductUpdate) SetVendor

func (pu *ProductUpdate) SetVendor(v *Vendor) *ProductUpdate

SetVendor sets the "vendor" edge to the Vendor entity.

func (*ProductUpdate) SetVendorID

func (pu *ProductUpdate) SetVendorID(id uuid.UUID) *ProductUpdate

SetVendorID sets the "vendor" edge to the Vendor entity by ID.

func (*ProductUpdate) SetWarehouse

func (pu *ProductUpdate) SetWarehouse(w *Warehouse) *ProductUpdate

SetWarehouse sets the "warehouse" edge to the Warehouse entity.

func (*ProductUpdate) SetWarehouseID

func (pu *ProductUpdate) SetWarehouseID(id uuid.UUID) *ProductUpdate

SetWarehouseID sets the "warehouse" edge to the Warehouse entity by ID.

func (*ProductUpdate) Where

func (pu *ProductUpdate) Where(ps ...predicate.Product) *ProductUpdate

Where appends a list predicates to the ProductUpdate builder.

type ProductUpdateOne

type ProductUpdateOne struct {
	// contains filtered or unexported fields
}

ProductUpdateOne is the builder for updating a single Product entity.

func (*ProductUpdateOne) ClearCreatedAt

func (puo *ProductUpdateOne) ClearCreatedAt() *ProductUpdateOne

ClearCreatedAt clears the value of the "created_at" field.

func (*ProductUpdateOne) ClearLastSell

func (puo *ProductUpdateOne) ClearLastSell() *ProductUpdateOne

ClearLastSell clears the value of the "last_sell" field.

func (*ProductUpdateOne) ClearVendor

func (puo *ProductUpdateOne) ClearVendor() *ProductUpdateOne

ClearVendor clears the "vendor" edge to the Vendor entity.

func (*ProductUpdateOne) ClearWarehouse

func (puo *ProductUpdateOne) ClearWarehouse() *ProductUpdateOne

ClearWarehouse clears the "warehouse" edge to the Warehouse entity.

func (*ProductUpdateOne) Exec

func (puo *ProductUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*ProductUpdateOne) ExecX

func (puo *ProductUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ProductUpdateOne) Mutation

func (puo *ProductUpdateOne) Mutation() *ProductMutation

Mutation returns the ProductMutation object of the builder.

func (*ProductUpdateOne) Save

func (puo *ProductUpdateOne) Save(ctx context.Context) (*Product, error)

Save executes the query and returns the updated Product entity.

func (*ProductUpdateOne) SaveX

func (puo *ProductUpdateOne) SaveX(ctx context.Context) *Product

SaveX is like Save, but panics if an error occurs.

func (*ProductUpdateOne) Select

func (puo *ProductUpdateOne) Select(field string, fields ...string) *ProductUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*ProductUpdateOne) SetBuildStatus

func (puo *ProductUpdateOne) SetBuildStatus(es enums.ProcessStatus) *ProductUpdateOne

SetBuildStatus sets the "build_status" field.

func (*ProductUpdateOne) SetCreatedAt

func (puo *ProductUpdateOne) SetCreatedAt(t time.Time) *ProductUpdateOne

SetCreatedAt sets the "created_at" field.

func (*ProductUpdateOne) SetDescription

func (puo *ProductUpdateOne) SetDescription(s string) *ProductUpdateOne

SetDescription sets the "description" field.

func (*ProductUpdateOne) SetImage

func (puo *ProductUpdateOne) SetImage(s string) *ProductUpdateOne

SetImage sets the "image" field.

func (*ProductUpdateOne) SetInput

SetInput applies the change-set in the UpdateProductInput on the ProductUpdateOne builder.

func (*ProductUpdateOne) SetLastSell

func (puo *ProductUpdateOne) SetLastSell(t time.Time) *ProductUpdateOne

SetLastSell sets the "last_sell" field.

func (*ProductUpdateOne) SetName

func (puo *ProductUpdateOne) SetName(s string) *ProductUpdateOne

SetName sets the "name" field.

func (*ProductUpdateOne) SetNillableBuildStatus

func (puo *ProductUpdateOne) SetNillableBuildStatus(es *enums.ProcessStatus) *ProductUpdateOne

SetNillableBuildStatus sets the "build_status" field if the given value is not nil.

func (*ProductUpdateOne) SetNillableCreatedAt

func (puo *ProductUpdateOne) SetNillableCreatedAt(t *time.Time) *ProductUpdateOne

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*ProductUpdateOne) SetNillableLastSell

func (puo *ProductUpdateOne) SetNillableLastSell(t *time.Time) *ProductUpdateOne

SetNillableLastSell sets the "last_sell" field if the given value is not nil.

func (*ProductUpdateOne) SetNillableStatus

func (puo *ProductUpdateOne) SetNillableStatus(es *enums.ProcessStatus) *ProductUpdateOne

SetNillableStatus sets the "status" field if the given value is not nil.

func (*ProductUpdateOne) SetNillableVendorID

func (puo *ProductUpdateOne) SetNillableVendorID(id *uuid.UUID) *ProductUpdateOne

SetNillableVendorID sets the "vendor" edge to the Vendor entity by ID if the given value is not nil.

func (*ProductUpdateOne) SetNillableWarehouseID

func (puo *ProductUpdateOne) SetNillableWarehouseID(id *uuid.UUID) *ProductUpdateOne

SetNillableWarehouseID sets the "warehouse" edge to the Warehouse entity by ID if the given value is not nil.

func (*ProductUpdateOne) SetStatus

SetStatus sets the "status" field.

func (*ProductUpdateOne) SetURL

func (puo *ProductUpdateOne) SetURL(s string) *ProductUpdateOne

SetURL sets the "url" field.

func (*ProductUpdateOne) SetVendor

func (puo *ProductUpdateOne) SetVendor(v *Vendor) *ProductUpdateOne

SetVendor sets the "vendor" edge to the Vendor entity.

func (*ProductUpdateOne) SetVendorID

func (puo *ProductUpdateOne) SetVendorID(id uuid.UUID) *ProductUpdateOne

SetVendorID sets the "vendor" edge to the Vendor entity by ID.

func (*ProductUpdateOne) SetWarehouse

func (puo *ProductUpdateOne) SetWarehouse(w *Warehouse) *ProductUpdateOne

SetWarehouse sets the "warehouse" edge to the Warehouse entity.

func (*ProductUpdateOne) SetWarehouseID

func (puo *ProductUpdateOne) SetWarehouseID(id uuid.UUID) *ProductUpdateOne

SetWarehouseID sets the "warehouse" edge to the Warehouse entity by ID.

type ProductWhereInput

type ProductWhereInput struct {
	Predicates []predicate.Product  `json:"-"`
	Not        *ProductWhereInput   `json:"not,omitempty"`
	Or         []*ProductWhereInput `json:"or,omitempty"`
	And        []*ProductWhereInput `json:"and,omitempty"`

	// "id" field predicates.
	ID      *uuid.UUID  `json:"id,omitempty"`
	IDNEQ   *uuid.UUID  `json:"idNEQ,omitempty"`
	IDIn    []uuid.UUID `json:"idIn,omitempty"`
	IDNotIn []uuid.UUID `json:"idNotIn,omitempty"`
	IDGT    *uuid.UUID  `json:"idGT,omitempty"`
	IDGTE   *uuid.UUID  `json:"idGTE,omitempty"`
	IDLT    *uuid.UUID  `json:"idLT,omitempty"`
	IDLTE   *uuid.UUID  `json:"idLTE,omitempty"`

	// "name" field predicates.
	Name             *string  `json:"name,omitempty"`
	NameNEQ          *string  `json:"nameNEQ,omitempty"`
	NameIn           []string `json:"nameIn,omitempty"`
	NameNotIn        []string `json:"nameNotIn,omitempty"`
	NameGT           *string  `json:"nameGT,omitempty"`
	NameGTE          *string  `json:"nameGTE,omitempty"`
	NameLT           *string  `json:"nameLT,omitempty"`
	NameLTE          *string  `json:"nameLTE,omitempty"`
	NameContains     *string  `json:"nameContains,omitempty"`
	NameHasPrefix    *string  `json:"nameHasPrefix,omitempty"`
	NameHasSuffix    *string  `json:"nameHasSuffix,omitempty"`
	NameEqualFold    *string  `json:"nameEqualFold,omitempty"`
	NameContainsFold *string  `json:"nameContainsFold,omitempty"`

	// "description" field predicates.
	Description             *string  `json:"description,omitempty"`
	DescriptionNEQ          *string  `json:"descriptionNEQ,omitempty"`
	DescriptionIn           []string `json:"descriptionIn,omitempty"`
	DescriptionNotIn        []string `json:"descriptionNotIn,omitempty"`
	DescriptionGT           *string  `json:"descriptionGT,omitempty"`
	DescriptionGTE          *string  `json:"descriptionGTE,omitempty"`
	DescriptionLT           *string  `json:"descriptionLT,omitempty"`
	DescriptionLTE          *string  `json:"descriptionLTE,omitempty"`
	DescriptionContains     *string  `json:"descriptionContains,omitempty"`
	DescriptionHasPrefix    *string  `json:"descriptionHasPrefix,omitempty"`
	DescriptionHasSuffix    *string  `json:"descriptionHasSuffix,omitempty"`
	DescriptionEqualFold    *string  `json:"descriptionEqualFold,omitempty"`
	DescriptionContainsFold *string  `json:"descriptionContainsFold,omitempty"`

	// "image" field predicates.
	Image             *string  `json:"image,omitempty"`
	ImageNEQ          *string  `json:"imageNEQ,omitempty"`
	ImageIn           []string `json:"imageIn,omitempty"`
	ImageNotIn        []string `json:"imageNotIn,omitempty"`
	ImageGT           *string  `json:"imageGT,omitempty"`
	ImageGTE          *string  `json:"imageGTE,omitempty"`
	ImageLT           *string  `json:"imageLT,omitempty"`
	ImageLTE          *string  `json:"imageLTE,omitempty"`
	ImageContains     *string  `json:"imageContains,omitempty"`
	ImageHasPrefix    *string  `json:"imageHasPrefix,omitempty"`
	ImageHasSuffix    *string  `json:"imageHasSuffix,omitempty"`
	ImageEqualFold    *string  `json:"imageEqualFold,omitempty"`
	ImageContainsFold *string  `json:"imageContainsFold,omitempty"`

	// "url" field predicates.
	URL             *string  `json:"url,omitempty"`
	URLNEQ          *string  `json:"urlNEQ,omitempty"`
	URLIn           []string `json:"urlIn,omitempty"`
	URLNotIn        []string `json:"urlNotIn,omitempty"`
	URLGT           *string  `json:"urlGT,omitempty"`
	URLGTE          *string  `json:"urlGTE,omitempty"`
	URLLT           *string  `json:"urlLT,omitempty"`
	URLLTE          *string  `json:"urlLTE,omitempty"`
	URLContains     *string  `json:"urlContains,omitempty"`
	URLHasPrefix    *string  `json:"urlHasPrefix,omitempty"`
	URLHasSuffix    *string  `json:"urlHasSuffix,omitempty"`
	URLEqualFold    *string  `json:"urlEqualFold,omitempty"`
	URLContainsFold *string  `json:"urlContainsFold,omitempty"`

	// "last_sell" field predicates.
	LastSell       *time.Time  `json:"lastSell,omitempty"`
	LastSellNEQ    *time.Time  `json:"lastSellNEQ,omitempty"`
	LastSellIn     []time.Time `json:"lastSellIn,omitempty"`
	LastSellNotIn  []time.Time `json:"lastSellNotIn,omitempty"`
	LastSellGT     *time.Time  `json:"lastSellGT,omitempty"`
	LastSellGTE    *time.Time  `json:"lastSellGTE,omitempty"`
	LastSellLT     *time.Time  `json:"lastSellLT,omitempty"`
	LastSellLTE    *time.Time  `json:"lastSellLTE,omitempty"`
	LastSellIsNil  bool        `json:"lastSellIsNil,omitempty"`
	LastSellNotNil bool        `json:"lastSellNotNil,omitempty"`

	// "created_at" field predicates.
	CreatedAt       *time.Time  `json:"createdAt,omitempty"`
	CreatedAtNEQ    *time.Time  `json:"createdAtNEQ,omitempty"`
	CreatedAtIn     []time.Time `json:"createdAtIn,omitempty"`
	CreatedAtNotIn  []time.Time `json:"createdAtNotIn,omitempty"`
	CreatedAtGT     *time.Time  `json:"createdAtGT,omitempty"`
	CreatedAtGTE    *time.Time  `json:"createdAtGTE,omitempty"`
	CreatedAtLT     *time.Time  `json:"createdAtLT,omitempty"`
	CreatedAtLTE    *time.Time  `json:"createdAtLTE,omitempty"`
	CreatedAtIsNil  bool        `json:"createdAtIsNil,omitempty"`
	CreatedAtNotNil bool        `json:"createdAtNotNil,omitempty"`

	// "status" field predicates.
	Status      *enums.ProcessStatus  `json:"status,omitempty"`
	StatusNEQ   *enums.ProcessStatus  `json:"statusNEQ,omitempty"`
	StatusIn    []enums.ProcessStatus `json:"statusIn,omitempty"`
	StatusNotIn []enums.ProcessStatus `json:"statusNotIn,omitempty"`

	// "build_status" field predicates.
	BuildStatus      *enums.ProcessStatus  `json:"buildStatus,omitempty"`
	BuildStatusNEQ   *enums.ProcessStatus  `json:"buildStatusNEQ,omitempty"`
	BuildStatusIn    []enums.ProcessStatus `json:"buildStatusIn,omitempty"`
	BuildStatusNotIn []enums.ProcessStatus `json:"buildStatusNotIn,omitempty"`

	// "warehouse" edge predicates.
	HasWarehouse     *bool                  `json:"hasWarehouse,omitempty"`
	HasWarehouseWith []*WarehouseWhereInput `json:"hasWarehouseWith,omitempty"`

	// "vendor" edge predicates.
	HasVendor     *bool               `json:"hasVendor,omitempty"`
	HasVendorWith []*VendorWhereInput `json:"hasVendorWith,omitempty"`
}

ProductWhereInput represents a where input for filtering Product queries.

func (*ProductWhereInput) AddPredicates

func (i *ProductWhereInput) AddPredicates(predicates ...predicate.Product)

AddPredicates adds custom predicates to the where input to be used during the filtering phase.

func (*ProductWhereInput) ApplySearchQuery

func (pwi *ProductWhereInput) ApplySearchQuery(q *string) *ProductWhereInput

func (*ProductWhereInput) Filter

Filter applies the ProductWhereInput filter on the ProductQuery builder.

func (*ProductWhereInput) P

P returns a predicate for filtering products. An error is returned if the input is empty or invalid.

type Products

type Products []*Product

Products is a parsable slice of Product.

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 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 {

	// Company is the client for interacting with the Company builders.
	Company *CompanyClient
	// Country is the client for interacting with the Country builders.
	Country *CountryClient
	// Email is the client for interacting with the Email builders.
	Email *EmailClient
	// Image is the client for interacting with the Image builders.
	Image *ImageClient
	// Location is the client for interacting with the Location builders.
	Location *LocationClient
	// Phone is the client for interacting with the Phone builders.
	Phone *PhoneClient
	// Product is the client for interacting with the Product builders.
	Product *ProductClient
	// Vendor is the client for interacting with the Vendor builders.
	Vendor *VendorClient
	// Warehouse is the client for interacting with the Warehouse builders.
	Warehouse *WarehouseClient
	// Website is the client for interacting with the Website builders.
	Website *WebsiteClient
	// 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 UpdateCompanyInput

type UpdateCompanyInput struct {
	Name                  *string
	Description           *string
	ClearCountries        bool
	AddCountryIDs         []uuid.UUID
	RemoveCountryIDs      []uuid.UUID
	ClearPhones           bool
	AddPhoneIDs           []uuid.UUID
	RemovePhoneIDs        []uuid.UUID
	ClearEmails           bool
	AddEmailIDs           []uuid.UUID
	RemoveEmailIDs        []uuid.UUID
	ClearWebsites         bool
	AddWebsiteIDs         []uuid.UUID
	RemoveWebsiteIDs      []uuid.UUID
	ClearLocations        bool
	AddLocationIDs        []uuid.UUID
	RemoveLocationIDs     []uuid.UUID
	ClearLogoImage        bool
	LogoImageID           *uuid.UUID
	ClearCoverImage       bool
	CoverImageID          *uuid.UUID
	ClearGalleryImages    bool
	AddGalleryImageIDs    []uuid.UUID
	RemoveGalleryImageIDs []uuid.UUID
}

UpdateCompanyInput represents a mutation input for updating companies.

func (*UpdateCompanyInput) Mutate

func (i *UpdateCompanyInput) Mutate(m *CompanyMutation)

Mutate applies the UpdateCompanyInput on the CompanyMutation builder.

type UpdateCountryInput

type UpdateCountryInput struct {
	Name              *string
	Code              *string
	ClearCompanies    bool
	AddCompanyIDs     []uuid.UUID
	RemoveCompanyIDs  []uuid.UUID
	ClearPhones       bool
	AddPhoneIDs       []uuid.UUID
	RemovePhoneIDs    []uuid.UUID
	ClearEmails       bool
	AddEmailIDs       []uuid.UUID
	RemoveEmailIDs    []uuid.UUID
	ClearWebsites     bool
	AddWebsiteIDs     []uuid.UUID
	RemoveWebsiteIDs  []uuid.UUID
	ClearLocations    bool
	AddLocationIDs    []uuid.UUID
	RemoveLocationIDs []uuid.UUID
}

UpdateCountryInput represents a mutation input for updating countries.

func (*UpdateCountryInput) Mutate

func (i *UpdateCountryInput) Mutate(m *CountryMutation)

Mutate applies the UpdateCountryInput on the CountryMutation builder.

type UpdateEmailInput

type UpdateEmailInput struct {
	Title        *string
	Description  *string
	Address      *string
	ClearCompany bool
	CompanyID    *uuid.UUID
	ClearCountry bool
	CountryID    *uuid.UUID
}

UpdateEmailInput represents a mutation input for updating emails.

func (*UpdateEmailInput) Mutate

func (i *UpdateEmailInput) Mutate(m *EmailMutation)

Mutate applies the UpdateEmailInput on the EmailMutation builder.

type UpdateImageInput

type UpdateImageInput struct {
	Title               *string
	OriginalURL         *string
	ClearGalleryCompany bool
	GalleryCompanyID    *uuid.UUID
	ClearLogoCompany    bool
	LogoCompanyID       *uuid.UUID
	ClearCoverCompany   bool
	CoverCompanyID      *uuid.UUID
}

UpdateImageInput represents a mutation input for updating images.

func (*UpdateImageInput) Mutate

func (i *UpdateImageInput) Mutate(m *ImageMutation)

Mutate applies the UpdateImageInput on the ImageMutation builder.

type UpdateLocationInput

type UpdateLocationInput struct {
	Title        *string
	Description  *string
	Latitude     *float64
	Longitude    *float64
	Address      *string
	Postcode     *string
	Type         *string
	State        *string
	Suburb       *string
	StreetType   *string
	StreetName   *string
	ClearCompany bool
	CompanyID    *uuid.UUID
	ClearCountry bool
	CountryID    *uuid.UUID
}

UpdateLocationInput represents a mutation input for updating locations.

func (*UpdateLocationInput) Mutate

func (i *UpdateLocationInput) Mutate(m *LocationMutation)

Mutate applies the UpdateLocationInput on the LocationMutation builder.

type UpdatePhoneInput

type UpdatePhoneInput struct {
	Title        *string
	Description  *string
	Number       *string
	Type         *string
	ClearCompany bool
	CompanyID    *uuid.UUID
	ClearCountry bool
	CountryID    *uuid.UUID
}

UpdatePhoneInput represents a mutation input for updating phones.

func (*UpdatePhoneInput) Mutate

func (i *UpdatePhoneInput) Mutate(m *PhoneMutation)

Mutate applies the UpdatePhoneInput on the PhoneMutation builder.

type UpdateProductInput

type UpdateProductInput struct {
	Name           *string
	Description    *string
	Image          *string
	URL            *string
	ClearLastSell  bool
	LastSell       *time.Time
	ClearCreatedAt bool
	CreatedAt      *time.Time
	Status         *enums.ProcessStatus
	BuildStatus    *enums.ProcessStatus
	ClearWarehouse bool
	WarehouseID    *uuid.UUID
	ClearVendor    bool
	VendorID       *uuid.UUID
}

UpdateProductInput represents a mutation input for updating products.

func (*UpdateProductInput) Mutate

func (i *UpdateProductInput) Mutate(m *ProductMutation)

Mutate applies the UpdateProductInput on the ProductMutation builder.

type UpdateVendorInput

type UpdateVendorInput struct {
	Name               *string
	Schema             *string
	ClearWarehouses    bool
	AddWarehouseIDs    []uuid.UUID
	RemoveWarehouseIDs []uuid.UUID
	ClearProducts      bool
	AddProductIDs      []uuid.UUID
	RemoveProductIDs   []uuid.UUID
}

UpdateVendorInput represents a mutation input for updating vendors.

func (*UpdateVendorInput) Mutate

func (i *UpdateVendorInput) Mutate(m *VendorMutation)

Mutate applies the UpdateVendorInput on the VendorMutation builder.

type UpdateWarehouseInput

type UpdateWarehouseInput struct {
	Name              *string
	ClearLastUpdate   bool
	LastUpdate        *time.Time
	ClearOriginalData bool
	OriginalData      *string
	Enabled           *bool
	ClearFilters      bool
	Filters           []string
	AppendFilters     []string
	ClearProducts     bool
	AddProductIDs     []uuid.UUID
	RemoveProductIDs  []uuid.UUID
	ClearVendor       bool
	VendorID          *uuid.UUID
}

UpdateWarehouseInput represents a mutation input for updating warehouses.

func (*UpdateWarehouseInput) Mutate

Mutate applies the UpdateWarehouseInput on the WarehouseMutation builder.

type UpdateWebsiteInput

type UpdateWebsiteInput struct {
	Title        *string
	Description  *string
	URL          *string
	ClearCompany bool
	CompanyID    *uuid.UUID
	ClearCountry bool
	CountryID    *uuid.UUID
}

UpdateWebsiteInput represents a mutation input for updating websites.

func (*UpdateWebsiteInput) Mutate

func (i *UpdateWebsiteInput) Mutate(m *WebsiteMutation)

Mutate applies the UpdateWebsiteInput on the WebsiteMutation builder.

type ValidationError

type ValidationError struct {
	Name string // Field or edge name.
	// contains filtered or unexported fields
}

ValidationError returns when validating a field or edge fails.

func (*ValidationError) Error

func (e *ValidationError) Error() string

Error implements the error interface.

func (*ValidationError) Unwrap

func (e *ValidationError) Unwrap() error

Unwrap implements the errors.Wrapper interface.

type Value

type Value = ent.Value

ent aliases to avoid import conflicts in user's code.

type Vendor

type Vendor struct {

	// ID of the ent.
	ID uuid.UUID `json:"id,omitempty"`
	// Name holds the value of the "name" field.
	Name string `json:"name,omitempty"`
	// Schema holds the value of the "schema" field.
	Schema string `json:"schema,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the VendorQuery when eager-loading is set.
	Edges VendorEdges `json:"edges"`
	// contains filtered or unexported fields
}

Vendor is the model entity for the Vendor schema.

func (*Vendor) IsNode

func (n *Vendor) IsNode()

IsNode implements the Node interface check for GQLGen.

func (*Vendor) NamedProducts

func (v *Vendor) NamedProducts(name string) ([]*Product, error)

NamedProducts returns the Products named value or an error if the edge was not loaded in eager-loading with this name.

func (*Vendor) NamedWarehouses

func (v *Vendor) NamedWarehouses(name string) ([]*Warehouse, error)

NamedWarehouses returns the Warehouses named value or an error if the edge was not loaded in eager-loading with this name.

func (*Vendor) Products

func (v *Vendor) Products(
	ctx context.Context, after *Cursor, first *int, before *Cursor, last *int, orderBy *ProductOrder, where *ProductWhereInput,
) (*ProductConnection, error)

func (*Vendor) QueryProducts

func (v *Vendor) QueryProducts() *ProductQuery

QueryProducts queries the "products" edge of the Vendor entity.

func (*Vendor) QueryWarehouses

func (v *Vendor) QueryWarehouses() *WarehouseQuery

QueryWarehouses queries the "warehouses" edge of the Vendor entity.

func (*Vendor) String

func (v *Vendor) String() string

String implements the fmt.Stringer.

func (*Vendor) ToEdge

func (v *Vendor) ToEdge(order *VendorOrder) *VendorEdge

ToEdge converts Vendor into VendorEdge.

func (*Vendor) Unwrap

func (v *Vendor) Unwrap() *Vendor

Unwrap unwraps the Vendor 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 (*Vendor) Update

func (v *Vendor) Update() *VendorUpdateOne

Update returns a builder for updating this Vendor. Note that you need to call Vendor.Unwrap() before calling this method if this Vendor was returned from a transaction, and the transaction was committed or rolled back.

func (*Vendor) Warehouses

func (v *Vendor) Warehouses(
	ctx context.Context, after *Cursor, first *int, before *Cursor, last *int, orderBy *WarehouseOrder, where *WarehouseWhereInput,
) (*WarehouseConnection, error)

type VendorClient

type VendorClient struct {
	// contains filtered or unexported fields
}

VendorClient is a client for the Vendor schema.

func NewVendorClient

func NewVendorClient(c config) *VendorClient

NewVendorClient returns a client for the Vendor from the given config.

func (*VendorClient) Create

func (c *VendorClient) Create() *VendorCreate

Create returns a builder for creating a Vendor entity.

func (*VendorClient) CreateBulk

func (c *VendorClient) CreateBulk(builders ...*VendorCreate) *VendorCreateBulk

CreateBulk returns a builder for creating a bulk of Vendor entities.

func (*VendorClient) Delete

func (c *VendorClient) Delete() *VendorDelete

Delete returns a delete builder for Vendor.

func (*VendorClient) DeleteOne

func (c *VendorClient) DeleteOne(v *Vendor) *VendorDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*VendorClient) DeleteOneID

func (c *VendorClient) DeleteOneID(id uuid.UUID) *VendorDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*VendorClient) Get

func (c *VendorClient) Get(ctx context.Context, id uuid.UUID) (*Vendor, error)

Get returns a Vendor entity by its id.

func (*VendorClient) GetX

func (c *VendorClient) GetX(ctx context.Context, id uuid.UUID) *Vendor

GetX is like Get, but panics if an error occurs.

func (*VendorClient) Hooks

func (c *VendorClient) Hooks() []Hook

Hooks returns the client hooks.

func (*VendorClient) Intercept

func (c *VendorClient) Intercept(interceptors ...Interceptor)

Use adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `vendor.Intercept(f(g(h())))`.

func (*VendorClient) Interceptors

func (c *VendorClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*VendorClient) Query

func (c *VendorClient) Query() *VendorQuery

Query returns a query builder for Vendor.

func (*VendorClient) QueryProducts

func (c *VendorClient) QueryProducts(v *Vendor) *ProductQuery

QueryProducts queries the products edge of a Vendor.

func (*VendorClient) QueryWarehouses

func (c *VendorClient) QueryWarehouses(v *Vendor) *WarehouseQuery

QueryWarehouses queries the warehouses edge of a Vendor.

func (*VendorClient) Update

func (c *VendorClient) Update() *VendorUpdate

Update returns an update builder for Vendor.

func (*VendorClient) UpdateOne

func (c *VendorClient) UpdateOne(v *Vendor) *VendorUpdateOne

UpdateOne returns an update builder for the given entity.

func (*VendorClient) UpdateOneID

func (c *VendorClient) UpdateOneID(id uuid.UUID) *VendorUpdateOne

UpdateOneID returns an update builder for the given id.

func (*VendorClient) Use

func (c *VendorClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `vendor.Hooks(f(g(h())))`.

type VendorConnection

type VendorConnection struct {
	Edges      []*VendorEdge `json:"edges"`
	PageInfo   PageInfo      `json:"pageInfo"`
	TotalCount int           `json:"totalCount"`
}

VendorConnection is the connection containing edges to Vendor.

type VendorCreate

type VendorCreate struct {
	// contains filtered or unexported fields
}

VendorCreate is the builder for creating a Vendor entity.

func (*VendorCreate) AddProductIDs

func (vc *VendorCreate) AddProductIDs(ids ...uuid.UUID) *VendorCreate

AddProductIDs adds the "products" edge to the Product entity by IDs.

func (*VendorCreate) AddProducts

func (vc *VendorCreate) AddProducts(p ...*Product) *VendorCreate

AddProducts adds the "products" edges to the Product entity.

func (*VendorCreate) AddWarehouseIDs

func (vc *VendorCreate) AddWarehouseIDs(ids ...uuid.UUID) *VendorCreate

AddWarehouseIDs adds the "warehouses" edge to the Warehouse entity by IDs.

func (*VendorCreate) AddWarehouses

func (vc *VendorCreate) AddWarehouses(w ...*Warehouse) *VendorCreate

AddWarehouses adds the "warehouses" edges to the Warehouse entity.

func (*VendorCreate) Exec

func (vc *VendorCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*VendorCreate) ExecX

func (vc *VendorCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*VendorCreate) Mutation

func (vc *VendorCreate) Mutation() *VendorMutation

Mutation returns the VendorMutation object of the builder.

func (*VendorCreate) Save

func (vc *VendorCreate) Save(ctx context.Context) (*Vendor, error)

Save creates the Vendor in the database.

func (*VendorCreate) SaveX

func (vc *VendorCreate) SaveX(ctx context.Context) *Vendor

SaveX calls Save and panics if Save returns an error.

func (*VendorCreate) SetID

func (vc *VendorCreate) SetID(u uuid.UUID) *VendorCreate

SetID sets the "id" field.

func (*VendorCreate) SetInput

SetInput applies the change-set in the CreateVendorInput on the VendorCreate builder.

func (*VendorCreate) SetName

func (vc *VendorCreate) SetName(s string) *VendorCreate

SetName sets the "name" field.

func (*VendorCreate) SetNillableID

func (vc *VendorCreate) SetNillableID(u *uuid.UUID) *VendorCreate

SetNillableID sets the "id" field if the given value is not nil.

func (*VendorCreate) SetSchema

func (vc *VendorCreate) SetSchema(s string) *VendorCreate

SetSchema sets the "schema" field.

type VendorCreateBulk

type VendorCreateBulk struct {
	// contains filtered or unexported fields
}

VendorCreateBulk is the builder for creating many Vendor entities in bulk.

func (*VendorCreateBulk) Exec

func (vcb *VendorCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*VendorCreateBulk) ExecX

func (vcb *VendorCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*VendorCreateBulk) Save

func (vcb *VendorCreateBulk) Save(ctx context.Context) ([]*Vendor, error)

Save creates the Vendor entities in the database.

func (*VendorCreateBulk) SaveX

func (vcb *VendorCreateBulk) SaveX(ctx context.Context) []*Vendor

SaveX is like Save, but panics if an error occurs.

type VendorDelete

type VendorDelete struct {
	// contains filtered or unexported fields
}

VendorDelete is the builder for deleting a Vendor entity.

func (*VendorDelete) Exec

func (vd *VendorDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*VendorDelete) ExecX

func (vd *VendorDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*VendorDelete) Where

func (vd *VendorDelete) Where(ps ...predicate.Vendor) *VendorDelete

Where appends a list predicates to the VendorDelete builder.

type VendorDeleteOne

type VendorDeleteOne struct {
	// contains filtered or unexported fields
}

VendorDeleteOne is the builder for deleting a single Vendor entity.

func (*VendorDeleteOne) Exec

func (vdo *VendorDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*VendorDeleteOne) ExecX

func (vdo *VendorDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

type VendorEdge

type VendorEdge struct {
	Node   *Vendor `json:"node"`
	Cursor Cursor  `json:"cursor"`
}

VendorEdge is the edge representation of Vendor.

type VendorEdges

type VendorEdges struct {
	// Warehouses holds the value of the warehouses edge.
	Warehouses []*Warehouse `json:"warehouses,omitempty"`
	// Products holds the value of the products edge.
	Products []*Product `json:"products,omitempty"`
	// contains filtered or unexported fields
}

VendorEdges holds the relations/edges for other nodes in the graph.

func (VendorEdges) ProductsOrErr

func (e VendorEdges) ProductsOrErr() ([]*Product, error)

ProductsOrErr returns the Products value or an error if the edge was not loaded in eager-loading.

func (VendorEdges) WarehousesOrErr

func (e VendorEdges) WarehousesOrErr() ([]*Warehouse, error)

WarehousesOrErr returns the Warehouses value or an error if the edge was not loaded in eager-loading.

type VendorGroupBy

type VendorGroupBy struct {
	// contains filtered or unexported fields
}

VendorGroupBy is the group-by builder for Vendor entities.

func (*VendorGroupBy) Aggregate

func (vgb *VendorGroupBy) Aggregate(fns ...AggregateFunc) *VendorGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*VendorGroupBy) Bool

func (s *VendorGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*VendorGroupBy) BoolX

func (s *VendorGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*VendorGroupBy) Bools

func (s *VendorGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*VendorGroupBy) BoolsX

func (s *VendorGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*VendorGroupBy) Float64

func (s *VendorGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*VendorGroupBy) Float64X

func (s *VendorGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*VendorGroupBy) Float64s

func (s *VendorGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*VendorGroupBy) Float64sX

func (s *VendorGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*VendorGroupBy) Int

func (s *VendorGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*VendorGroupBy) IntX

func (s *VendorGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*VendorGroupBy) Ints

func (s *VendorGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*VendorGroupBy) IntsX

func (s *VendorGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*VendorGroupBy) Scan

func (vgb *VendorGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*VendorGroupBy) ScanX

func (s *VendorGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*VendorGroupBy) String

func (s *VendorGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*VendorGroupBy) StringX

func (s *VendorGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*VendorGroupBy) Strings

func (s *VendorGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*VendorGroupBy) StringsX

func (s *VendorGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type VendorMutation

type VendorMutation struct {
	// contains filtered or unexported fields
}

VendorMutation represents an operation that mutates the Vendor nodes in the graph.

func (*VendorMutation) AddField

func (m *VendorMutation) 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 (*VendorMutation) AddProductIDs

func (m *VendorMutation) AddProductIDs(ids ...uuid.UUID)

AddProductIDs adds the "products" edge to the Product entity by ids.

func (*VendorMutation) AddWarehouseIDs

func (m *VendorMutation) AddWarehouseIDs(ids ...uuid.UUID)

AddWarehouseIDs adds the "warehouses" edge to the Warehouse entity by ids.

func (*VendorMutation) AddedEdges

func (m *VendorMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*VendorMutation) AddedField

func (m *VendorMutation) 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 (*VendorMutation) AddedFields

func (m *VendorMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*VendorMutation) AddedIDs

func (m *VendorMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*VendorMutation) ClearEdge

func (m *VendorMutation) 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 (*VendorMutation) ClearField

func (m *VendorMutation) 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 (*VendorMutation) ClearProducts

func (m *VendorMutation) ClearProducts()

ClearProducts clears the "products" edge to the Product entity.

func (*VendorMutation) ClearWarehouses

func (m *VendorMutation) ClearWarehouses()

ClearWarehouses clears the "warehouses" edge to the Warehouse entity.

func (*VendorMutation) ClearedEdges

func (m *VendorMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*VendorMutation) ClearedFields

func (m *VendorMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (VendorMutation) Client

func (m VendorMutation) 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 (*VendorMutation) EdgeCleared

func (m *VendorMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*VendorMutation) Field

func (m *VendorMutation) 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 (*VendorMutation) FieldCleared

func (m *VendorMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*VendorMutation) Fields

func (m *VendorMutation) 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 (*VendorMutation) ID

func (m *VendorMutation) ID() (id uuid.UUID, 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 (*VendorMutation) IDs

func (m *VendorMutation) IDs(ctx context.Context) ([]uuid.UUID, 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 (*VendorMutation) Name

func (m *VendorMutation) Name() (r string, exists bool)

Name returns the value of the "name" field in the mutation.

func (*VendorMutation) OldField

func (m *VendorMutation) 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 (*VendorMutation) OldName

func (m *VendorMutation) OldName(ctx context.Context) (v string, err error)

OldName returns the old "name" field's value of the Vendor entity. If the Vendor 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 (*VendorMutation) OldSchema

func (m *VendorMutation) OldSchema(ctx context.Context) (v string, err error)

OldSchema returns the old "schema" field's value of the Vendor entity. If the Vendor 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 (*VendorMutation) Op

func (m *VendorMutation) Op() Op

Op returns the operation name.

func (*VendorMutation) ProductsCleared

func (m *VendorMutation) ProductsCleared() bool

ProductsCleared reports if the "products" edge to the Product entity was cleared.

func (*VendorMutation) ProductsIDs

func (m *VendorMutation) ProductsIDs() (ids []uuid.UUID)

ProductsIDs returns the "products" edge IDs in the mutation.

func (*VendorMutation) RemoveProductIDs

func (m *VendorMutation) RemoveProductIDs(ids ...uuid.UUID)

RemoveProductIDs removes the "products" edge to the Product entity by IDs.

func (*VendorMutation) RemoveWarehouseIDs

func (m *VendorMutation) RemoveWarehouseIDs(ids ...uuid.UUID)

RemoveWarehouseIDs removes the "warehouses" edge to the Warehouse entity by IDs.

func (*VendorMutation) RemovedEdges

func (m *VendorMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*VendorMutation) RemovedIDs

func (m *VendorMutation) 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 (*VendorMutation) RemovedProductsIDs

func (m *VendorMutation) RemovedProductsIDs() (ids []uuid.UUID)

RemovedProducts returns the removed IDs of the "products" edge to the Product entity.

func (*VendorMutation) RemovedWarehousesIDs

func (m *VendorMutation) RemovedWarehousesIDs() (ids []uuid.UUID)

RemovedWarehouses returns the removed IDs of the "warehouses" edge to the Warehouse entity.

func (*VendorMutation) ResetEdge

func (m *VendorMutation) 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 (*VendorMutation) ResetField

func (m *VendorMutation) 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 (*VendorMutation) ResetName

func (m *VendorMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*VendorMutation) ResetProducts

func (m *VendorMutation) ResetProducts()

ResetProducts resets all changes to the "products" edge.

func (*VendorMutation) ResetSchema

func (m *VendorMutation) ResetSchema()

ResetSchema resets all changes to the "schema" field.

func (*VendorMutation) ResetWarehouses

func (m *VendorMutation) ResetWarehouses()

ResetWarehouses resets all changes to the "warehouses" edge.

func (*VendorMutation) Schema

func (m *VendorMutation) Schema() (r string, exists bool)

Schema returns the value of the "schema" field in the mutation.

func (*VendorMutation) SetField

func (m *VendorMutation) 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 (*VendorMutation) SetID

func (m *VendorMutation) SetID(id uuid.UUID)

SetID sets the value of the id field. Note that this operation is only accepted on creation of Vendor entities.

func (*VendorMutation) SetName

func (m *VendorMutation) SetName(s string)

SetName sets the "name" field.

func (*VendorMutation) SetOp

func (m *VendorMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*VendorMutation) SetSchema

func (m *VendorMutation) SetSchema(s string)

SetSchema sets the "schema" field.

func (VendorMutation) Tx

func (m VendorMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*VendorMutation) Type

func (m *VendorMutation) Type() string

Type returns the node type of this mutation (Vendor).

func (*VendorMutation) WarehousesCleared

func (m *VendorMutation) WarehousesCleared() bool

WarehousesCleared reports if the "warehouses" edge to the Warehouse entity was cleared.

func (*VendorMutation) WarehousesIDs

func (m *VendorMutation) WarehousesIDs() (ids []uuid.UUID)

WarehousesIDs returns the "warehouses" edge IDs in the mutation.

func (*VendorMutation) Where

func (m *VendorMutation) Where(ps ...predicate.Vendor)

Where appends a list predicates to the VendorMutation builder.

func (*VendorMutation) WhereP

func (m *VendorMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the VendorMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type VendorOrder

type VendorOrder struct {
	Direction OrderDirection    `json:"direction"`
	Field     *VendorOrderField `json:"field"`
}

VendorOrder defines the ordering of Vendor.

type VendorOrderField

type VendorOrderField struct {
	// contains filtered or unexported fields
}

VendorOrderField defines the ordering field of Vendor.

func (VendorOrderField) MarshalGQL

func (f VendorOrderField) MarshalGQL(w io.Writer)

MarshalGQL implements graphql.Marshaler interface.

func (VendorOrderField) String

func (f VendorOrderField) String() string

String implement fmt.Stringer interface.

func (*VendorOrderField) UnmarshalGQL

func (f *VendorOrderField) UnmarshalGQL(v interface{}) error

UnmarshalGQL implements graphql.Unmarshaler interface.

type VendorPaginateOption

type VendorPaginateOption func(*vendorPager) error

VendorPaginateOption enables pagination customization.

func WithVendorFilter

func WithVendorFilter(filter func(*VendorQuery) (*VendorQuery, error)) VendorPaginateOption

WithVendorFilter configures pagination filter.

func WithVendorOrder

func WithVendorOrder(order *VendorOrder) VendorPaginateOption

WithVendorOrder configures pagination ordering.

type VendorQuery

type VendorQuery struct {
	// contains filtered or unexported fields
}

VendorQuery is the builder for querying Vendor entities.

func (*VendorQuery) Aggregate

func (vq *VendorQuery) Aggregate(fns ...AggregateFunc) *VendorSelect

Aggregate returns a VendorSelect configured with the given aggregations.

func (*VendorQuery) All

func (vq *VendorQuery) All(ctx context.Context) ([]*Vendor, error)

All executes the query and returns a list of Vendors.

func (*VendorQuery) AllX

func (vq *VendorQuery) AllX(ctx context.Context) []*Vendor

AllX is like All, but panics if an error occurs.

func (*VendorQuery) Clone

func (vq *VendorQuery) Clone() *VendorQuery

Clone returns a duplicate of the VendorQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*VendorQuery) CollectFields

func (v *VendorQuery) CollectFields(ctx context.Context, satisfies ...string) (*VendorQuery, error)

CollectFields tells the query-builder to eagerly load connected nodes by resolver context.

func (*VendorQuery) Count

func (vq *VendorQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*VendorQuery) CountX

func (vq *VendorQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*VendorQuery) Exist

func (vq *VendorQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*VendorQuery) ExistX

func (vq *VendorQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*VendorQuery) First

func (vq *VendorQuery) First(ctx context.Context) (*Vendor, error)

First returns the first Vendor entity from the query. Returns a *NotFoundError when no Vendor was found.

func (*VendorQuery) FirstID

func (vq *VendorQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

FirstID returns the first Vendor ID from the query. Returns a *NotFoundError when no Vendor ID was found.

func (*VendorQuery) FirstIDX

func (vq *VendorQuery) FirstIDX(ctx context.Context) uuid.UUID

FirstIDX is like FirstID, but panics if an error occurs.

func (*VendorQuery) FirstX

func (vq *VendorQuery) FirstX(ctx context.Context) *Vendor

FirstX is like First, but panics if an error occurs.

func (*VendorQuery) GroupBy

func (vq *VendorQuery) GroupBy(field string, fields ...string) *VendorGroupBy

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.Vendor.Query().
	GroupBy(vendor.FieldName).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*VendorQuery) IDs

func (vq *VendorQuery) IDs(ctx context.Context) ([]uuid.UUID, error)

IDs executes the query and returns a list of Vendor IDs.

func (*VendorQuery) IDsX

func (vq *VendorQuery) IDsX(ctx context.Context) []uuid.UUID

IDsX is like IDs, but panics if an error occurs.

func (*VendorQuery) Limit

func (vq *VendorQuery) Limit(limit int) *VendorQuery

Limit the number of records to be returned by this query.

func (*VendorQuery) Offset

func (vq *VendorQuery) Offset(offset int) *VendorQuery

Offset to start from.

func (*VendorQuery) Only

func (vq *VendorQuery) Only(ctx context.Context) (*Vendor, error)

Only returns a single Vendor entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Vendor entity is found. Returns a *NotFoundError when no Vendor entities are found.

func (*VendorQuery) OnlyID

func (vq *VendorQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

OnlyID is like Only, but returns the only Vendor ID in the query. Returns a *NotSingularError when more than one Vendor ID is found. Returns a *NotFoundError when no entities are found.

func (*VendorQuery) OnlyIDX

func (vq *VendorQuery) OnlyIDX(ctx context.Context) uuid.UUID

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*VendorQuery) OnlyX

func (vq *VendorQuery) OnlyX(ctx context.Context) *Vendor

OnlyX is like Only, but panics if an error occurs.

func (*VendorQuery) Order

func (vq *VendorQuery) Order(o ...OrderFunc) *VendorQuery

Order specifies how the records should be ordered.

func (*VendorQuery) Paginate

func (v *VendorQuery) Paginate(
	ctx context.Context, after *Cursor, first *int,
	before *Cursor, last *int, opts ...VendorPaginateOption,
) (*VendorConnection, error)

Paginate executes the query and returns a relay based cursor connection to Vendor.

func (*VendorQuery) QueryProducts

func (vq *VendorQuery) QueryProducts() *ProductQuery

QueryProducts chains the current query on the "products" edge.

func (*VendorQuery) QueryWarehouses

func (vq *VendorQuery) QueryWarehouses() *WarehouseQuery

QueryWarehouses chains the current query on the "warehouses" edge.

func (*VendorQuery) Select

func (vq *VendorQuery) Select(fields ...string) *VendorSelect

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.Vendor.Query().
	Select(vendor.FieldName).
	Scan(ctx, &v)

func (*VendorQuery) Unique

func (vq *VendorQuery) Unique(unique bool) *VendorQuery

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 (*VendorQuery) Where

func (vq *VendorQuery) Where(ps ...predicate.Vendor) *VendorQuery

Where adds a new predicate for the VendorQuery builder.

func (*VendorQuery) WithNamedProducts

func (vq *VendorQuery) WithNamedProducts(name string, opts ...func(*ProductQuery)) *VendorQuery

WithNamedProducts tells the query-builder to eager-load the nodes that are connected to the "products" edge with the given name. The optional arguments are used to configure the query builder of the edge.

func (*VendorQuery) WithNamedWarehouses

func (vq *VendorQuery) WithNamedWarehouses(name string, opts ...func(*WarehouseQuery)) *VendorQuery

WithNamedWarehouses tells the query-builder to eager-load the nodes that are connected to the "warehouses" edge with the given name. The optional arguments are used to configure the query builder of the edge.

func (*VendorQuery) WithProducts

func (vq *VendorQuery) WithProducts(opts ...func(*ProductQuery)) *VendorQuery

WithProducts tells the query-builder to eager-load the nodes that are connected to the "products" edge. The optional arguments are used to configure the query builder of the edge.

func (*VendorQuery) WithWarehouses

func (vq *VendorQuery) WithWarehouses(opts ...func(*WarehouseQuery)) *VendorQuery

WithWarehouses tells the query-builder to eager-load the nodes that are connected to the "warehouses" edge. The optional arguments are used to configure the query builder of the edge.

type VendorSelect

type VendorSelect struct {
	*VendorQuery
	// contains filtered or unexported fields
}

VendorSelect is the builder for selecting fields of Vendor entities.

func (*VendorSelect) Aggregate

func (vs *VendorSelect) Aggregate(fns ...AggregateFunc) *VendorSelect

Aggregate adds the given aggregation functions to the selector query.

func (*VendorSelect) Bool

func (s *VendorSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*VendorSelect) BoolX

func (s *VendorSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*VendorSelect) Bools

func (s *VendorSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*VendorSelect) BoolsX

func (s *VendorSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*VendorSelect) Float64

func (s *VendorSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*VendorSelect) Float64X

func (s *VendorSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*VendorSelect) Float64s

func (s *VendorSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*VendorSelect) Float64sX

func (s *VendorSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*VendorSelect) Int

func (s *VendorSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*VendorSelect) IntX

func (s *VendorSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*VendorSelect) Ints

func (s *VendorSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*VendorSelect) IntsX

func (s *VendorSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*VendorSelect) Scan

func (vs *VendorSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*VendorSelect) ScanX

func (s *VendorSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*VendorSelect) String

func (s *VendorSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*VendorSelect) StringX

func (s *VendorSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*VendorSelect) Strings

func (s *VendorSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*VendorSelect) StringsX

func (s *VendorSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type VendorUpdate

type VendorUpdate struct {
	// contains filtered or unexported fields
}

VendorUpdate is the builder for updating Vendor entities.

func (*VendorUpdate) AddProductIDs

func (vu *VendorUpdate) AddProductIDs(ids ...uuid.UUID) *VendorUpdate

AddProductIDs adds the "products" edge to the Product entity by IDs.

func (*VendorUpdate) AddProducts

func (vu *VendorUpdate) AddProducts(p ...*Product) *VendorUpdate

AddProducts adds the "products" edges to the Product entity.

func (*VendorUpdate) AddWarehouseIDs

func (vu *VendorUpdate) AddWarehouseIDs(ids ...uuid.UUID) *VendorUpdate

AddWarehouseIDs adds the "warehouses" edge to the Warehouse entity by IDs.

func (*VendorUpdate) AddWarehouses

func (vu *VendorUpdate) AddWarehouses(w ...*Warehouse) *VendorUpdate

AddWarehouses adds the "warehouses" edges to the Warehouse entity.

func (*VendorUpdate) ClearProducts

func (vu *VendorUpdate) ClearProducts() *VendorUpdate

ClearProducts clears all "products" edges to the Product entity.

func (*VendorUpdate) ClearWarehouses

func (vu *VendorUpdate) ClearWarehouses() *VendorUpdate

ClearWarehouses clears all "warehouses" edges to the Warehouse entity.

func (*VendorUpdate) Exec

func (vu *VendorUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*VendorUpdate) ExecX

func (vu *VendorUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*VendorUpdate) Mutation

func (vu *VendorUpdate) Mutation() *VendorMutation

Mutation returns the VendorMutation object of the builder.

func (*VendorUpdate) RemoveProductIDs

func (vu *VendorUpdate) RemoveProductIDs(ids ...uuid.UUID) *VendorUpdate

RemoveProductIDs removes the "products" edge to Product entities by IDs.

func (*VendorUpdate) RemoveProducts

func (vu *VendorUpdate) RemoveProducts(p ...*Product) *VendorUpdate

RemoveProducts removes "products" edges to Product entities.

func (*VendorUpdate) RemoveWarehouseIDs

func (vu *VendorUpdate) RemoveWarehouseIDs(ids ...uuid.UUID) *VendorUpdate

RemoveWarehouseIDs removes the "warehouses" edge to Warehouse entities by IDs.

func (*VendorUpdate) RemoveWarehouses

func (vu *VendorUpdate) RemoveWarehouses(w ...*Warehouse) *VendorUpdate

RemoveWarehouses removes "warehouses" edges to Warehouse entities.

func (*VendorUpdate) Save

func (vu *VendorUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*VendorUpdate) SaveX

func (vu *VendorUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*VendorUpdate) SetInput

SetInput applies the change-set in the UpdateVendorInput on the VendorUpdate builder.

func (*VendorUpdate) SetName

func (vu *VendorUpdate) SetName(s string) *VendorUpdate

SetName sets the "name" field.

func (*VendorUpdate) SetSchema

func (vu *VendorUpdate) SetSchema(s string) *VendorUpdate

SetSchema sets the "schema" field.

func (*VendorUpdate) Where

func (vu *VendorUpdate) Where(ps ...predicate.Vendor) *VendorUpdate

Where appends a list predicates to the VendorUpdate builder.

type VendorUpdateOne

type VendorUpdateOne struct {
	// contains filtered or unexported fields
}

VendorUpdateOne is the builder for updating a single Vendor entity.

func (*VendorUpdateOne) AddProductIDs

func (vuo *VendorUpdateOne) AddProductIDs(ids ...uuid.UUID) *VendorUpdateOne

AddProductIDs adds the "products" edge to the Product entity by IDs.

func (*VendorUpdateOne) AddProducts

func (vuo *VendorUpdateOne) AddProducts(p ...*Product) *VendorUpdateOne

AddProducts adds the "products" edges to the Product entity.

func (*VendorUpdateOne) AddWarehouseIDs

func (vuo *VendorUpdateOne) AddWarehouseIDs(ids ...uuid.UUID) *VendorUpdateOne

AddWarehouseIDs adds the "warehouses" edge to the Warehouse entity by IDs.

func (*VendorUpdateOne) AddWarehouses

func (vuo *VendorUpdateOne) AddWarehouses(w ...*Warehouse) *VendorUpdateOne

AddWarehouses adds the "warehouses" edges to the Warehouse entity.

func (*VendorUpdateOne) ClearProducts

func (vuo *VendorUpdateOne) ClearProducts() *VendorUpdateOne

ClearProducts clears all "products" edges to the Product entity.

func (*VendorUpdateOne) ClearWarehouses

func (vuo *VendorUpdateOne) ClearWarehouses() *VendorUpdateOne

ClearWarehouses clears all "warehouses" edges to the Warehouse entity.

func (*VendorUpdateOne) Exec

func (vuo *VendorUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*VendorUpdateOne) ExecX

func (vuo *VendorUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*VendorUpdateOne) Mutation

func (vuo *VendorUpdateOne) Mutation() *VendorMutation

Mutation returns the VendorMutation object of the builder.

func (*VendorUpdateOne) RemoveProductIDs

func (vuo *VendorUpdateOne) RemoveProductIDs(ids ...uuid.UUID) *VendorUpdateOne

RemoveProductIDs removes the "products" edge to Product entities by IDs.

func (*VendorUpdateOne) RemoveProducts

func (vuo *VendorUpdateOne) RemoveProducts(p ...*Product) *VendorUpdateOne

RemoveProducts removes "products" edges to Product entities.

func (*VendorUpdateOne) RemoveWarehouseIDs

func (vuo *VendorUpdateOne) RemoveWarehouseIDs(ids ...uuid.UUID) *VendorUpdateOne

RemoveWarehouseIDs removes the "warehouses" edge to Warehouse entities by IDs.

func (*VendorUpdateOne) RemoveWarehouses

func (vuo *VendorUpdateOne) RemoveWarehouses(w ...*Warehouse) *VendorUpdateOne

RemoveWarehouses removes "warehouses" edges to Warehouse entities.

func (*VendorUpdateOne) Save

func (vuo *VendorUpdateOne) Save(ctx context.Context) (*Vendor, error)

Save executes the query and returns the updated Vendor entity.

func (*VendorUpdateOne) SaveX

func (vuo *VendorUpdateOne) SaveX(ctx context.Context) *Vendor

SaveX is like Save, but panics if an error occurs.

func (*VendorUpdateOne) Select

func (vuo *VendorUpdateOne) Select(field string, fields ...string) *VendorUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*VendorUpdateOne) SetInput

SetInput applies the change-set in the UpdateVendorInput on the VendorUpdateOne builder.

func (*VendorUpdateOne) SetName

func (vuo *VendorUpdateOne) SetName(s string) *VendorUpdateOne

SetName sets the "name" field.

func (*VendorUpdateOne) SetSchema

func (vuo *VendorUpdateOne) SetSchema(s string) *VendorUpdateOne

SetSchema sets the "schema" field.

type VendorWhereInput

type VendorWhereInput struct {
	Predicates []predicate.Vendor  `json:"-"`
	Not        *VendorWhereInput   `json:"not,omitempty"`
	Or         []*VendorWhereInput `json:"or,omitempty"`
	And        []*VendorWhereInput `json:"and,omitempty"`

	// "id" field predicates.
	ID      *uuid.UUID  `json:"id,omitempty"`
	IDNEQ   *uuid.UUID  `json:"idNEQ,omitempty"`
	IDIn    []uuid.UUID `json:"idIn,omitempty"`
	IDNotIn []uuid.UUID `json:"idNotIn,omitempty"`
	IDGT    *uuid.UUID  `json:"idGT,omitempty"`
	IDGTE   *uuid.UUID  `json:"idGTE,omitempty"`
	IDLT    *uuid.UUID  `json:"idLT,omitempty"`
	IDLTE   *uuid.UUID  `json:"idLTE,omitempty"`

	// "name" field predicates.
	Name             *string  `json:"name,omitempty"`
	NameNEQ          *string  `json:"nameNEQ,omitempty"`
	NameIn           []string `json:"nameIn,omitempty"`
	NameNotIn        []string `json:"nameNotIn,omitempty"`
	NameGT           *string  `json:"nameGT,omitempty"`
	NameGTE          *string  `json:"nameGTE,omitempty"`
	NameLT           *string  `json:"nameLT,omitempty"`
	NameLTE          *string  `json:"nameLTE,omitempty"`
	NameContains     *string  `json:"nameContains,omitempty"`
	NameHasPrefix    *string  `json:"nameHasPrefix,omitempty"`
	NameHasSuffix    *string  `json:"nameHasSuffix,omitempty"`
	NameEqualFold    *string  `json:"nameEqualFold,omitempty"`
	NameContainsFold *string  `json:"nameContainsFold,omitempty"`

	// "schema" field predicates.
	Schema             *string  `json:"schema,omitempty"`
	SchemaNEQ          *string  `json:"schemaNEQ,omitempty"`
	SchemaIn           []string `json:"schemaIn,omitempty"`
	SchemaNotIn        []string `json:"schemaNotIn,omitempty"`
	SchemaGT           *string  `json:"schemaGT,omitempty"`
	SchemaGTE          *string  `json:"schemaGTE,omitempty"`
	SchemaLT           *string  `json:"schemaLT,omitempty"`
	SchemaLTE          *string  `json:"schemaLTE,omitempty"`
	SchemaContains     *string  `json:"schemaContains,omitempty"`
	SchemaHasPrefix    *string  `json:"schemaHasPrefix,omitempty"`
	SchemaHasSuffix    *string  `json:"schemaHasSuffix,omitempty"`
	SchemaEqualFold    *string  `json:"schemaEqualFold,omitempty"`
	SchemaContainsFold *string  `json:"schemaContainsFold,omitempty"`

	// "warehouses" edge predicates.
	HasWarehouses     *bool                  `json:"hasWarehouses,omitempty"`
	HasWarehousesWith []*WarehouseWhereInput `json:"hasWarehousesWith,omitempty"`

	// "products" edge predicates.
	HasProducts     *bool                `json:"hasProducts,omitempty"`
	HasProductsWith []*ProductWhereInput `json:"hasProductsWith,omitempty"`
}

VendorWhereInput represents a where input for filtering Vendor queries.

func (*VendorWhereInput) AddPredicates

func (i *VendorWhereInput) AddPredicates(predicates ...predicate.Vendor)

AddPredicates adds custom predicates to the where input to be used during the filtering phase.

func (*VendorWhereInput) ApplySearchQuery

func (vwi *VendorWhereInput) ApplySearchQuery(q *string) *VendorWhereInput

func (*VendorWhereInput) Filter

func (i *VendorWhereInput) Filter(q *VendorQuery) (*VendorQuery, error)

Filter applies the VendorWhereInput filter on the VendorQuery builder.

func (*VendorWhereInput) P

P returns a predicate for filtering vendors. An error is returned if the input is empty or invalid.

type Vendors

type Vendors []*Vendor

Vendors is a parsable slice of Vendor.

type Warehouse

type Warehouse struct {

	// ID of the ent.
	ID uuid.UUID `json:"id,omitempty"`
	// Name holds the value of the "name" field.
	Name string `json:"name,omitempty"`
	// LastUpdate holds the value of the "last_update" field.
	LastUpdate *time.Time `json:"last_update,omitempty"`
	// OriginalData holds the value of the "original_data" field.
	OriginalData *string `json:"original_data,omitempty"`
	// Enabled holds the value of the "enabled" field.
	Enabled bool `json:"enabled,omitempty"`
	// Filters holds the value of the "filters" field.
	Filters []string `json:"filters,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the WarehouseQuery when eager-loading is set.
	Edges WarehouseEdges `json:"edges"`
	// contains filtered or unexported fields
}

Warehouse is the model entity for the Warehouse schema.

func (*Warehouse) IsNode

func (n *Warehouse) IsNode()

IsNode implements the Node interface check for GQLGen.

func (*Warehouse) NamedProducts

func (w *Warehouse) NamedProducts(name string) ([]*Product, error)

NamedProducts returns the Products named value or an error if the edge was not loaded in eager-loading with this name.

func (*Warehouse) Products

func (w *Warehouse) Products(
	ctx context.Context, after *Cursor, first *int, before *Cursor, last *int, orderBy *ProductOrder, where *ProductWhereInput,
) (*ProductConnection, error)

func (*Warehouse) QueryProducts

func (w *Warehouse) QueryProducts() *ProductQuery

QueryProducts queries the "products" edge of the Warehouse entity.

func (*Warehouse) QueryVendor

func (w *Warehouse) QueryVendor() *VendorQuery

QueryVendor queries the "vendor" edge of the Warehouse entity.

func (*Warehouse) String

func (w *Warehouse) String() string

String implements the fmt.Stringer.

func (*Warehouse) ToEdge

func (w *Warehouse) ToEdge(order *WarehouseOrder) *WarehouseEdge

ToEdge converts Warehouse into WarehouseEdge.

func (*Warehouse) Unwrap

func (w *Warehouse) Unwrap() *Warehouse

Unwrap unwraps the Warehouse 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 (*Warehouse) Update

func (w *Warehouse) Update() *WarehouseUpdateOne

Update returns a builder for updating this Warehouse. Note that you need to call Warehouse.Unwrap() before calling this method if this Warehouse was returned from a transaction, and the transaction was committed or rolled back.

func (*Warehouse) Vendor

func (w *Warehouse) Vendor(ctx context.Context) (*Vendor, error)

type WarehouseClient

type WarehouseClient struct {
	// contains filtered or unexported fields
}

WarehouseClient is a client for the Warehouse schema.

func NewWarehouseClient

func NewWarehouseClient(c config) *WarehouseClient

NewWarehouseClient returns a client for the Warehouse from the given config.

func (*WarehouseClient) Create

func (c *WarehouseClient) Create() *WarehouseCreate

Create returns a builder for creating a Warehouse entity.

func (*WarehouseClient) CreateBulk

func (c *WarehouseClient) CreateBulk(builders ...*WarehouseCreate) *WarehouseCreateBulk

CreateBulk returns a builder for creating a bulk of Warehouse entities.

func (*WarehouseClient) Delete

func (c *WarehouseClient) Delete() *WarehouseDelete

Delete returns a delete builder for Warehouse.

func (*WarehouseClient) DeleteOne

func (c *WarehouseClient) DeleteOne(w *Warehouse) *WarehouseDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*WarehouseClient) DeleteOneID

func (c *WarehouseClient) DeleteOneID(id uuid.UUID) *WarehouseDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*WarehouseClient) Get

func (c *WarehouseClient) Get(ctx context.Context, id uuid.UUID) (*Warehouse, error)

Get returns a Warehouse entity by its id.

func (*WarehouseClient) GetX

func (c *WarehouseClient) GetX(ctx context.Context, id uuid.UUID) *Warehouse

GetX is like Get, but panics if an error occurs.

func (*WarehouseClient) Hooks

func (c *WarehouseClient) Hooks() []Hook

Hooks returns the client hooks.

func (*WarehouseClient) Intercept

func (c *WarehouseClient) Intercept(interceptors ...Interceptor)

Use adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `warehouse.Intercept(f(g(h())))`.

func (*WarehouseClient) Interceptors

func (c *WarehouseClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*WarehouseClient) Query

func (c *WarehouseClient) Query() *WarehouseQuery

Query returns a query builder for Warehouse.

func (*WarehouseClient) QueryProducts

func (c *WarehouseClient) QueryProducts(w *Warehouse) *ProductQuery

QueryProducts queries the products edge of a Warehouse.

func (*WarehouseClient) QueryVendor

func (c *WarehouseClient) QueryVendor(w *Warehouse) *VendorQuery

QueryVendor queries the vendor edge of a Warehouse.

func (*WarehouseClient) Update

func (c *WarehouseClient) Update() *WarehouseUpdate

Update returns an update builder for Warehouse.

func (*WarehouseClient) UpdateOne

func (c *WarehouseClient) UpdateOne(w *Warehouse) *WarehouseUpdateOne

UpdateOne returns an update builder for the given entity.

func (*WarehouseClient) UpdateOneID

func (c *WarehouseClient) UpdateOneID(id uuid.UUID) *WarehouseUpdateOne

UpdateOneID returns an update builder for the given id.

func (*WarehouseClient) Use

func (c *WarehouseClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `warehouse.Hooks(f(g(h())))`.

type WarehouseConnection

type WarehouseConnection struct {
	Edges      []*WarehouseEdge `json:"edges"`
	PageInfo   PageInfo         `json:"pageInfo"`
	TotalCount int              `json:"totalCount"`
}

WarehouseConnection is the connection containing edges to Warehouse.

type WarehouseCreate

type WarehouseCreate struct {
	// contains filtered or unexported fields
}

WarehouseCreate is the builder for creating a Warehouse entity.

func (*WarehouseCreate) AddProductIDs

func (wc *WarehouseCreate) AddProductIDs(ids ...uuid.UUID) *WarehouseCreate

AddProductIDs adds the "products" edge to the Product entity by IDs.

func (*WarehouseCreate) AddProducts

func (wc *WarehouseCreate) AddProducts(p ...*Product) *WarehouseCreate

AddProducts adds the "products" edges to the Product entity.

func (*WarehouseCreate) Exec

func (wc *WarehouseCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*WarehouseCreate) ExecX

func (wc *WarehouseCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*WarehouseCreate) Mutation

func (wc *WarehouseCreate) Mutation() *WarehouseMutation

Mutation returns the WarehouseMutation object of the builder.

func (*WarehouseCreate) Save

func (wc *WarehouseCreate) Save(ctx context.Context) (*Warehouse, error)

Save creates the Warehouse in the database.

func (*WarehouseCreate) SaveX

func (wc *WarehouseCreate) SaveX(ctx context.Context) *Warehouse

SaveX calls Save and panics if Save returns an error.

func (*WarehouseCreate) SetEnabled

func (wc *WarehouseCreate) SetEnabled(b bool) *WarehouseCreate

SetEnabled sets the "enabled" field.

func (*WarehouseCreate) SetFilters

func (wc *WarehouseCreate) SetFilters(s []string) *WarehouseCreate

SetFilters sets the "filters" field.

func (*WarehouseCreate) SetID

func (wc *WarehouseCreate) SetID(u uuid.UUID) *WarehouseCreate

SetID sets the "id" field.

func (*WarehouseCreate) SetInput

SetInput applies the change-set in the CreateWarehouseInput on the WarehouseCreate builder.

func (*WarehouseCreate) SetLastUpdate

func (wc *WarehouseCreate) SetLastUpdate(t time.Time) *WarehouseCreate

SetLastUpdate sets the "last_update" field.

func (*WarehouseCreate) SetName

func (wc *WarehouseCreate) SetName(s string) *WarehouseCreate

SetName sets the "name" field.

func (*WarehouseCreate) SetNillableEnabled

func (wc *WarehouseCreate) SetNillableEnabled(b *bool) *WarehouseCreate

SetNillableEnabled sets the "enabled" field if the given value is not nil.

func (*WarehouseCreate) SetNillableID

func (wc *WarehouseCreate) SetNillableID(u *uuid.UUID) *WarehouseCreate

SetNillableID sets the "id" field if the given value is not nil.

func (*WarehouseCreate) SetNillableLastUpdate

func (wc *WarehouseCreate) SetNillableLastUpdate(t *time.Time) *WarehouseCreate

SetNillableLastUpdate sets the "last_update" field if the given value is not nil.

func (*WarehouseCreate) SetNillableOriginalData

func (wc *WarehouseCreate) SetNillableOriginalData(s *string) *WarehouseCreate

SetNillableOriginalData sets the "original_data" field if the given value is not nil.

func (*WarehouseCreate) SetNillableVendorID

func (wc *WarehouseCreate) SetNillableVendorID(id *uuid.UUID) *WarehouseCreate

SetNillableVendorID sets the "vendor" edge to the Vendor entity by ID if the given value is not nil.

func (*WarehouseCreate) SetOriginalData

func (wc *WarehouseCreate) SetOriginalData(s string) *WarehouseCreate

SetOriginalData sets the "original_data" field.

func (*WarehouseCreate) SetVendor

func (wc *WarehouseCreate) SetVendor(v *Vendor) *WarehouseCreate

SetVendor sets the "vendor" edge to the Vendor entity.

func (*WarehouseCreate) SetVendorID

func (wc *WarehouseCreate) SetVendorID(id uuid.UUID) *WarehouseCreate

SetVendorID sets the "vendor" edge to the Vendor entity by ID.

type WarehouseCreateBulk

type WarehouseCreateBulk struct {
	// contains filtered or unexported fields
}

WarehouseCreateBulk is the builder for creating many Warehouse entities in bulk.

func (*WarehouseCreateBulk) Exec

func (wcb *WarehouseCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*WarehouseCreateBulk) ExecX

func (wcb *WarehouseCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*WarehouseCreateBulk) Save

func (wcb *WarehouseCreateBulk) Save(ctx context.Context) ([]*Warehouse, error)

Save creates the Warehouse entities in the database.

func (*WarehouseCreateBulk) SaveX

func (wcb *WarehouseCreateBulk) SaveX(ctx context.Context) []*Warehouse

SaveX is like Save, but panics if an error occurs.

type WarehouseDelete

type WarehouseDelete struct {
	// contains filtered or unexported fields
}

WarehouseDelete is the builder for deleting a Warehouse entity.

func (*WarehouseDelete) Exec

func (wd *WarehouseDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*WarehouseDelete) ExecX

func (wd *WarehouseDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*WarehouseDelete) Where

Where appends a list predicates to the WarehouseDelete builder.

type WarehouseDeleteOne

type WarehouseDeleteOne struct {
	// contains filtered or unexported fields
}

WarehouseDeleteOne is the builder for deleting a single Warehouse entity.

func (*WarehouseDeleteOne) Exec

func (wdo *WarehouseDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*WarehouseDeleteOne) ExecX

func (wdo *WarehouseDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

type WarehouseEdge

type WarehouseEdge struct {
	Node   *Warehouse `json:"node"`
	Cursor Cursor     `json:"cursor"`
}

WarehouseEdge is the edge representation of Warehouse.

type WarehouseEdges

type WarehouseEdges struct {
	// Products holds the value of the products edge.
	Products []*Product `json:"products,omitempty"`
	// Vendor holds the value of the vendor edge.
	Vendor *Vendor `json:"vendor,omitempty"`
	// contains filtered or unexported fields
}

WarehouseEdges holds the relations/edges for other nodes in the graph.

func (WarehouseEdges) ProductsOrErr

func (e WarehouseEdges) ProductsOrErr() ([]*Product, error)

ProductsOrErr returns the Products value or an error if the edge was not loaded in eager-loading.

func (WarehouseEdges) VendorOrErr

func (e WarehouseEdges) VendorOrErr() (*Vendor, error)

VendorOrErr returns the Vendor value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

type WarehouseGroupBy

type WarehouseGroupBy struct {
	// contains filtered or unexported fields
}

WarehouseGroupBy is the group-by builder for Warehouse entities.

func (*WarehouseGroupBy) Aggregate

func (wgb *WarehouseGroupBy) Aggregate(fns ...AggregateFunc) *WarehouseGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*WarehouseGroupBy) Bool

func (s *WarehouseGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*WarehouseGroupBy) BoolX

func (s *WarehouseGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*WarehouseGroupBy) Bools

func (s *WarehouseGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*WarehouseGroupBy) BoolsX

func (s *WarehouseGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*WarehouseGroupBy) Float64

func (s *WarehouseGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*WarehouseGroupBy) Float64X

func (s *WarehouseGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*WarehouseGroupBy) Float64s

func (s *WarehouseGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*WarehouseGroupBy) Float64sX

func (s *WarehouseGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*WarehouseGroupBy) Int

func (s *WarehouseGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*WarehouseGroupBy) IntX

func (s *WarehouseGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*WarehouseGroupBy) Ints

func (s *WarehouseGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*WarehouseGroupBy) IntsX

func (s *WarehouseGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*WarehouseGroupBy) Scan

func (wgb *WarehouseGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*WarehouseGroupBy) ScanX

func (s *WarehouseGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*WarehouseGroupBy) String

func (s *WarehouseGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*WarehouseGroupBy) StringX

func (s *WarehouseGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*WarehouseGroupBy) Strings

func (s *WarehouseGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*WarehouseGroupBy) StringsX

func (s *WarehouseGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type WarehouseMutation

type WarehouseMutation struct {
	// contains filtered or unexported fields
}

WarehouseMutation represents an operation that mutates the Warehouse nodes in the graph.

func (*WarehouseMutation) AddField

func (m *WarehouseMutation) 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 (*WarehouseMutation) AddProductIDs

func (m *WarehouseMutation) AddProductIDs(ids ...uuid.UUID)

AddProductIDs adds the "products" edge to the Product entity by ids.

func (*WarehouseMutation) AddedEdges

func (m *WarehouseMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*WarehouseMutation) AddedField

func (m *WarehouseMutation) 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 (*WarehouseMutation) AddedFields

func (m *WarehouseMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*WarehouseMutation) AddedIDs

func (m *WarehouseMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*WarehouseMutation) AppendFilters

func (m *WarehouseMutation) AppendFilters(s []string)

AppendFilters adds s to the "filters" field.

func (*WarehouseMutation) AppendedFilters

func (m *WarehouseMutation) AppendedFilters() ([]string, bool)

AppendedFilters returns the list of values that were appended to the "filters" field in this mutation.

func (*WarehouseMutation) ClearEdge

func (m *WarehouseMutation) 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 (*WarehouseMutation) ClearField

func (m *WarehouseMutation) 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 (*WarehouseMutation) ClearFilters

func (m *WarehouseMutation) ClearFilters()

ClearFilters clears the value of the "filters" field.

func (*WarehouseMutation) ClearLastUpdate

func (m *WarehouseMutation) ClearLastUpdate()

ClearLastUpdate clears the value of the "last_update" field.

func (*WarehouseMutation) ClearOriginalData

func (m *WarehouseMutation) ClearOriginalData()

ClearOriginalData clears the value of the "original_data" field.

func (*WarehouseMutation) ClearProducts

func (m *WarehouseMutation) ClearProducts()

ClearProducts clears the "products" edge to the Product entity.

func (*WarehouseMutation) ClearVendor

func (m *WarehouseMutation) ClearVendor()

ClearVendor clears the "vendor" edge to the Vendor entity.

func (*WarehouseMutation) ClearedEdges

func (m *WarehouseMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*WarehouseMutation) ClearedFields

func (m *WarehouseMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (WarehouseMutation) Client

func (m WarehouseMutation) 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 (*WarehouseMutation) EdgeCleared

func (m *WarehouseMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*WarehouseMutation) Enabled

func (m *WarehouseMutation) Enabled() (r bool, exists bool)

Enabled returns the value of the "enabled" field in the mutation.

func (*WarehouseMutation) Field

func (m *WarehouseMutation) 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 (*WarehouseMutation) FieldCleared

func (m *WarehouseMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*WarehouseMutation) Fields

func (m *WarehouseMutation) 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 (*WarehouseMutation) Filters

func (m *WarehouseMutation) Filters() (r []string, exists bool)

Filters returns the value of the "filters" field in the mutation.

func (*WarehouseMutation) FiltersCleared

func (m *WarehouseMutation) FiltersCleared() bool

FiltersCleared returns if the "filters" field was cleared in this mutation.

func (*WarehouseMutation) ID

func (m *WarehouseMutation) ID() (id uuid.UUID, 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 (*WarehouseMutation) IDs

func (m *WarehouseMutation) IDs(ctx context.Context) ([]uuid.UUID, 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 (*WarehouseMutation) LastUpdate

func (m *WarehouseMutation) LastUpdate() (r time.Time, exists bool)

LastUpdate returns the value of the "last_update" field in the mutation.

func (*WarehouseMutation) LastUpdateCleared

func (m *WarehouseMutation) LastUpdateCleared() bool

LastUpdateCleared returns if the "last_update" field was cleared in this mutation.

func (*WarehouseMutation) Name

func (m *WarehouseMutation) Name() (r string, exists bool)

Name returns the value of the "name" field in the mutation.

func (*WarehouseMutation) OldEnabled

func (m *WarehouseMutation) OldEnabled(ctx context.Context) (v bool, err error)

OldEnabled returns the old "enabled" field's value of the Warehouse entity. If the Warehouse 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 (*WarehouseMutation) OldField

func (m *WarehouseMutation) 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 (*WarehouseMutation) OldFilters

func (m *WarehouseMutation) OldFilters(ctx context.Context) (v []string, err error)

OldFilters returns the old "filters" field's value of the Warehouse entity. If the Warehouse 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 (*WarehouseMutation) OldLastUpdate

func (m *WarehouseMutation) OldLastUpdate(ctx context.Context) (v *time.Time, err error)

OldLastUpdate returns the old "last_update" field's value of the Warehouse entity. If the Warehouse 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 (*WarehouseMutation) OldName

func (m *WarehouseMutation) OldName(ctx context.Context) (v string, err error)

OldName returns the old "name" field's value of the Warehouse entity. If the Warehouse 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 (*WarehouseMutation) OldOriginalData

func (m *WarehouseMutation) OldOriginalData(ctx context.Context) (v *string, err error)

OldOriginalData returns the old "original_data" field's value of the Warehouse entity. If the Warehouse 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 (*WarehouseMutation) Op

func (m *WarehouseMutation) Op() Op

Op returns the operation name.

func (*WarehouseMutation) OriginalData

func (m *WarehouseMutation) OriginalData() (r string, exists bool)

OriginalData returns the value of the "original_data" field in the mutation.

func (*WarehouseMutation) OriginalDataCleared

func (m *WarehouseMutation) OriginalDataCleared() bool

OriginalDataCleared returns if the "original_data" field was cleared in this mutation.

func (*WarehouseMutation) ProductsCleared

func (m *WarehouseMutation) ProductsCleared() bool

ProductsCleared reports if the "products" edge to the Product entity was cleared.

func (*WarehouseMutation) ProductsIDs

func (m *WarehouseMutation) ProductsIDs() (ids []uuid.UUID)

ProductsIDs returns the "products" edge IDs in the mutation.

func (*WarehouseMutation) RemoveProductIDs

func (m *WarehouseMutation) RemoveProductIDs(ids ...uuid.UUID)

RemoveProductIDs removes the "products" edge to the Product entity by IDs.

func (*WarehouseMutation) RemovedEdges

func (m *WarehouseMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*WarehouseMutation) RemovedIDs

func (m *WarehouseMutation) 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 (*WarehouseMutation) RemovedProductsIDs

func (m *WarehouseMutation) RemovedProductsIDs() (ids []uuid.UUID)

RemovedProducts returns the removed IDs of the "products" edge to the Product entity.

func (*WarehouseMutation) ResetEdge

func (m *WarehouseMutation) 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 (*WarehouseMutation) ResetEnabled

func (m *WarehouseMutation) ResetEnabled()

ResetEnabled resets all changes to the "enabled" field.

func (*WarehouseMutation) ResetField

func (m *WarehouseMutation) 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 (*WarehouseMutation) ResetFilters

func (m *WarehouseMutation) ResetFilters()

ResetFilters resets all changes to the "filters" field.

func (*WarehouseMutation) ResetLastUpdate

func (m *WarehouseMutation) ResetLastUpdate()

ResetLastUpdate resets all changes to the "last_update" field.

func (*WarehouseMutation) ResetName

func (m *WarehouseMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*WarehouseMutation) ResetOriginalData

func (m *WarehouseMutation) ResetOriginalData()

ResetOriginalData resets all changes to the "original_data" field.

func (*WarehouseMutation) ResetProducts

func (m *WarehouseMutation) ResetProducts()

ResetProducts resets all changes to the "products" edge.

func (*WarehouseMutation) ResetVendor

func (m *WarehouseMutation) ResetVendor()

ResetVendor resets all changes to the "vendor" edge.

func (*WarehouseMutation) SetEnabled

func (m *WarehouseMutation) SetEnabled(b bool)

SetEnabled sets the "enabled" field.

func (*WarehouseMutation) SetField

func (m *WarehouseMutation) 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 (*WarehouseMutation) SetFilters

func (m *WarehouseMutation) SetFilters(s []string)

SetFilters sets the "filters" field.

func (*WarehouseMutation) SetID

func (m *WarehouseMutation) SetID(id uuid.UUID)

SetID sets the value of the id field. Note that this operation is only accepted on creation of Warehouse entities.

func (*WarehouseMutation) SetLastUpdate

func (m *WarehouseMutation) SetLastUpdate(t time.Time)

SetLastUpdate sets the "last_update" field.

func (*WarehouseMutation) SetName

func (m *WarehouseMutation) SetName(s string)

SetName sets the "name" field.

func (*WarehouseMutation) SetOp

func (m *WarehouseMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*WarehouseMutation) SetOriginalData

func (m *WarehouseMutation) SetOriginalData(s string)

SetOriginalData sets the "original_data" field.

func (*WarehouseMutation) SetVendorID

func (m *WarehouseMutation) SetVendorID(id uuid.UUID)

SetVendorID sets the "vendor" edge to the Vendor entity by id.

func (WarehouseMutation) Tx

func (m WarehouseMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*WarehouseMutation) Type

func (m *WarehouseMutation) Type() string

Type returns the node type of this mutation (Warehouse).

func (*WarehouseMutation) VendorCleared

func (m *WarehouseMutation) VendorCleared() bool

VendorCleared reports if the "vendor" edge to the Vendor entity was cleared.

func (*WarehouseMutation) VendorID

func (m *WarehouseMutation) VendorID() (id uuid.UUID, exists bool)

VendorID returns the "vendor" edge ID in the mutation.

func (*WarehouseMutation) VendorIDs

func (m *WarehouseMutation) VendorIDs() (ids []uuid.UUID)

VendorIDs returns the "vendor" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use VendorID instead. It exists only for internal usage by the builders.

func (*WarehouseMutation) Where

func (m *WarehouseMutation) Where(ps ...predicate.Warehouse)

Where appends a list predicates to the WarehouseMutation builder.

func (*WarehouseMutation) WhereP

func (m *WarehouseMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the WarehouseMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type WarehouseOrder

type WarehouseOrder struct {
	Direction OrderDirection       `json:"direction"`
	Field     *WarehouseOrderField `json:"field"`
}

WarehouseOrder defines the ordering of Warehouse.

type WarehouseOrderField

type WarehouseOrderField struct {
	// contains filtered or unexported fields
}

WarehouseOrderField defines the ordering field of Warehouse.

func (WarehouseOrderField) MarshalGQL

func (f WarehouseOrderField) MarshalGQL(w io.Writer)

MarshalGQL implements graphql.Marshaler interface.

func (WarehouseOrderField) String

func (f WarehouseOrderField) String() string

String implement fmt.Stringer interface.

func (*WarehouseOrderField) UnmarshalGQL

func (f *WarehouseOrderField) UnmarshalGQL(v interface{}) error

UnmarshalGQL implements graphql.Unmarshaler interface.

type WarehousePaginateOption

type WarehousePaginateOption func(*warehousePager) error

WarehousePaginateOption enables pagination customization.

func WithWarehouseFilter

func WithWarehouseFilter(filter func(*WarehouseQuery) (*WarehouseQuery, error)) WarehousePaginateOption

WithWarehouseFilter configures pagination filter.

func WithWarehouseOrder

func WithWarehouseOrder(order *WarehouseOrder) WarehousePaginateOption

WithWarehouseOrder configures pagination ordering.

type WarehouseQuery

type WarehouseQuery struct {
	// contains filtered or unexported fields
}

WarehouseQuery is the builder for querying Warehouse entities.

func (*WarehouseQuery) Aggregate

func (wq *WarehouseQuery) Aggregate(fns ...AggregateFunc) *WarehouseSelect

Aggregate returns a WarehouseSelect configured with the given aggregations.

func (*WarehouseQuery) All

func (wq *WarehouseQuery) All(ctx context.Context) ([]*Warehouse, error)

All executes the query and returns a list of Warehouses.

func (*WarehouseQuery) AllX

func (wq *WarehouseQuery) AllX(ctx context.Context) []*Warehouse

AllX is like All, but panics if an error occurs.

func (*WarehouseQuery) Clone

func (wq *WarehouseQuery) Clone() *WarehouseQuery

Clone returns a duplicate of the WarehouseQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*WarehouseQuery) CollectFields

func (w *WarehouseQuery) CollectFields(ctx context.Context, satisfies ...string) (*WarehouseQuery, error)

CollectFields tells the query-builder to eagerly load connected nodes by resolver context.

func (*WarehouseQuery) Count

func (wq *WarehouseQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*WarehouseQuery) CountX

func (wq *WarehouseQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*WarehouseQuery) Exist

func (wq *WarehouseQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*WarehouseQuery) ExistX

func (wq *WarehouseQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*WarehouseQuery) First

func (wq *WarehouseQuery) First(ctx context.Context) (*Warehouse, error)

First returns the first Warehouse entity from the query. Returns a *NotFoundError when no Warehouse was found.

func (*WarehouseQuery) FirstID

func (wq *WarehouseQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

FirstID returns the first Warehouse ID from the query. Returns a *NotFoundError when no Warehouse ID was found.

func (*WarehouseQuery) FirstIDX

func (wq *WarehouseQuery) FirstIDX(ctx context.Context) uuid.UUID

FirstIDX is like FirstID, but panics if an error occurs.

func (*WarehouseQuery) FirstX

func (wq *WarehouseQuery) FirstX(ctx context.Context) *Warehouse

FirstX is like First, but panics if an error occurs.

func (*WarehouseQuery) GroupBy

func (wq *WarehouseQuery) GroupBy(field string, fields ...string) *WarehouseGroupBy

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.Warehouse.Query().
	GroupBy(warehouse.FieldName).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*WarehouseQuery) IDs

func (wq *WarehouseQuery) IDs(ctx context.Context) ([]uuid.UUID, error)

IDs executes the query and returns a list of Warehouse IDs.

func (*WarehouseQuery) IDsX

func (wq *WarehouseQuery) IDsX(ctx context.Context) []uuid.UUID

IDsX is like IDs, but panics if an error occurs.

func (*WarehouseQuery) Limit

func (wq *WarehouseQuery) Limit(limit int) *WarehouseQuery

Limit the number of records to be returned by this query.

func (*WarehouseQuery) Offset

func (wq *WarehouseQuery) Offset(offset int) *WarehouseQuery

Offset to start from.

func (*WarehouseQuery) Only

func (wq *WarehouseQuery) Only(ctx context.Context) (*Warehouse, error)

Only returns a single Warehouse entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Warehouse entity is found. Returns a *NotFoundError when no Warehouse entities are found.

func (*WarehouseQuery) OnlyID

func (wq *WarehouseQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

OnlyID is like Only, but returns the only Warehouse ID in the query. Returns a *NotSingularError when more than one Warehouse ID is found. Returns a *NotFoundError when no entities are found.

func (*WarehouseQuery) OnlyIDX

func (wq *WarehouseQuery) OnlyIDX(ctx context.Context) uuid.UUID

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*WarehouseQuery) OnlyX

func (wq *WarehouseQuery) OnlyX(ctx context.Context) *Warehouse

OnlyX is like Only, but panics if an error occurs.

func (*WarehouseQuery) Order

func (wq *WarehouseQuery) Order(o ...OrderFunc) *WarehouseQuery

Order specifies how the records should be ordered.

func (*WarehouseQuery) Paginate

func (w *WarehouseQuery) Paginate(
	ctx context.Context, after *Cursor, first *int,
	before *Cursor, last *int, opts ...WarehousePaginateOption,
) (*WarehouseConnection, error)

Paginate executes the query and returns a relay based cursor connection to Warehouse.

func (*WarehouseQuery) QueryProducts

func (wq *WarehouseQuery) QueryProducts() *ProductQuery

QueryProducts chains the current query on the "products" edge.

func (*WarehouseQuery) QueryVendor

func (wq *WarehouseQuery) QueryVendor() *VendorQuery

QueryVendor chains the current query on the "vendor" edge.

func (*WarehouseQuery) Select

func (wq *WarehouseQuery) Select(fields ...string) *WarehouseSelect

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.Warehouse.Query().
	Select(warehouse.FieldName).
	Scan(ctx, &v)

func (*WarehouseQuery) Unique

func (wq *WarehouseQuery) Unique(unique bool) *WarehouseQuery

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 (*WarehouseQuery) Where

Where adds a new predicate for the WarehouseQuery builder.

func (*WarehouseQuery) WithNamedProducts

func (wq *WarehouseQuery) WithNamedProducts(name string, opts ...func(*ProductQuery)) *WarehouseQuery

WithNamedProducts tells the query-builder to eager-load the nodes that are connected to the "products" edge with the given name. The optional arguments are used to configure the query builder of the edge.

func (*WarehouseQuery) WithProducts

func (wq *WarehouseQuery) WithProducts(opts ...func(*ProductQuery)) *WarehouseQuery

WithProducts tells the query-builder to eager-load the nodes that are connected to the "products" edge. The optional arguments are used to configure the query builder of the edge.

func (*WarehouseQuery) WithVendor

func (wq *WarehouseQuery) WithVendor(opts ...func(*VendorQuery)) *WarehouseQuery

WithVendor tells the query-builder to eager-load the nodes that are connected to the "vendor" edge. The optional arguments are used to configure the query builder of the edge.

type WarehouseSelect

type WarehouseSelect struct {
	*WarehouseQuery
	// contains filtered or unexported fields
}

WarehouseSelect is the builder for selecting fields of Warehouse entities.

func (*WarehouseSelect) Aggregate

func (ws *WarehouseSelect) Aggregate(fns ...AggregateFunc) *WarehouseSelect

Aggregate adds the given aggregation functions to the selector query.

func (*WarehouseSelect) Bool

func (s *WarehouseSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*WarehouseSelect) BoolX

func (s *WarehouseSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*WarehouseSelect) Bools

func (s *WarehouseSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*WarehouseSelect) BoolsX

func (s *WarehouseSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*WarehouseSelect) Float64

func (s *WarehouseSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*WarehouseSelect) Float64X

func (s *WarehouseSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*WarehouseSelect) Float64s

func (s *WarehouseSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*WarehouseSelect) Float64sX

func (s *WarehouseSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*WarehouseSelect) Int

func (s *WarehouseSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*WarehouseSelect) IntX

func (s *WarehouseSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*WarehouseSelect) Ints

func (s *WarehouseSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*WarehouseSelect) IntsX

func (s *WarehouseSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*WarehouseSelect) Scan

func (ws *WarehouseSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*WarehouseSelect) ScanX

func (s *WarehouseSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*WarehouseSelect) String

func (s *WarehouseSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*WarehouseSelect) StringX

func (s *WarehouseSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*WarehouseSelect) Strings

func (s *WarehouseSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*WarehouseSelect) StringsX

func (s *WarehouseSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type WarehouseUpdate

type WarehouseUpdate struct {
	// contains filtered or unexported fields
}

WarehouseUpdate is the builder for updating Warehouse entities.

func (*WarehouseUpdate) AddProductIDs

func (wu *WarehouseUpdate) AddProductIDs(ids ...uuid.UUID) *WarehouseUpdate

AddProductIDs adds the "products" edge to the Product entity by IDs.

func (*WarehouseUpdate) AddProducts

func (wu *WarehouseUpdate) AddProducts(p ...*Product) *WarehouseUpdate

AddProducts adds the "products" edges to the Product entity.

func (*WarehouseUpdate) AppendFilters

func (wu *WarehouseUpdate) AppendFilters(s []string) *WarehouseUpdate

AppendFilters appends s to the "filters" field.

func (*WarehouseUpdate) ClearFilters

func (wu *WarehouseUpdate) ClearFilters() *WarehouseUpdate

ClearFilters clears the value of the "filters" field.

func (*WarehouseUpdate) ClearLastUpdate

func (wu *WarehouseUpdate) ClearLastUpdate() *WarehouseUpdate

ClearLastUpdate clears the value of the "last_update" field.

func (*WarehouseUpdate) ClearOriginalData

func (wu *WarehouseUpdate) ClearOriginalData() *WarehouseUpdate

ClearOriginalData clears the value of the "original_data" field.

func (*WarehouseUpdate) ClearProducts

func (wu *WarehouseUpdate) ClearProducts() *WarehouseUpdate

ClearProducts clears all "products" edges to the Product entity.

func (*WarehouseUpdate) ClearVendor

func (wu *WarehouseUpdate) ClearVendor() *WarehouseUpdate

ClearVendor clears the "vendor" edge to the Vendor entity.

func (*WarehouseUpdate) Exec

func (wu *WarehouseUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*WarehouseUpdate) ExecX

func (wu *WarehouseUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*WarehouseUpdate) Mutation

func (wu *WarehouseUpdate) Mutation() *WarehouseMutation

Mutation returns the WarehouseMutation object of the builder.

func (*WarehouseUpdate) RemoveProductIDs

func (wu *WarehouseUpdate) RemoveProductIDs(ids ...uuid.UUID) *WarehouseUpdate

RemoveProductIDs removes the "products" edge to Product entities by IDs.

func (*WarehouseUpdate) RemoveProducts

func (wu *WarehouseUpdate) RemoveProducts(p ...*Product) *WarehouseUpdate

RemoveProducts removes "products" edges to Product entities.

func (*WarehouseUpdate) Save

func (wu *WarehouseUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*WarehouseUpdate) SaveX

func (wu *WarehouseUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*WarehouseUpdate) SetEnabled

func (wu *WarehouseUpdate) SetEnabled(b bool) *WarehouseUpdate

SetEnabled sets the "enabled" field.

func (*WarehouseUpdate) SetFilters

func (wu *WarehouseUpdate) SetFilters(s []string) *WarehouseUpdate

SetFilters sets the "filters" field.

func (*WarehouseUpdate) SetInput

SetInput applies the change-set in the UpdateWarehouseInput on the WarehouseUpdate builder.

func (*WarehouseUpdate) SetLastUpdate

func (wu *WarehouseUpdate) SetLastUpdate(t time.Time) *WarehouseUpdate

SetLastUpdate sets the "last_update" field.

func (*WarehouseUpdate) SetName

func (wu *WarehouseUpdate) SetName(s string) *WarehouseUpdate

SetName sets the "name" field.

func (*WarehouseUpdate) SetNillableEnabled

func (wu *WarehouseUpdate) SetNillableEnabled(b *bool) *WarehouseUpdate

SetNillableEnabled sets the "enabled" field if the given value is not nil.

func (*WarehouseUpdate) SetNillableLastUpdate

func (wu *WarehouseUpdate) SetNillableLastUpdate(t *time.Time) *WarehouseUpdate

SetNillableLastUpdate sets the "last_update" field if the given value is not nil.

func (*WarehouseUpdate) SetNillableOriginalData

func (wu *WarehouseUpdate) SetNillableOriginalData(s *string) *WarehouseUpdate

SetNillableOriginalData sets the "original_data" field if the given value is not nil.

func (*WarehouseUpdate) SetNillableVendorID

func (wu *WarehouseUpdate) SetNillableVendorID(id *uuid.UUID) *WarehouseUpdate

SetNillableVendorID sets the "vendor" edge to the Vendor entity by ID if the given value is not nil.

func (*WarehouseUpdate) SetOriginalData

func (wu *WarehouseUpdate) SetOriginalData(s string) *WarehouseUpdate

SetOriginalData sets the "original_data" field.

func (*WarehouseUpdate) SetVendor

func (wu *WarehouseUpdate) SetVendor(v *Vendor) *WarehouseUpdate

SetVendor sets the "vendor" edge to the Vendor entity.

func (*WarehouseUpdate) SetVendorID

func (wu *WarehouseUpdate) SetVendorID(id uuid.UUID) *WarehouseUpdate

SetVendorID sets the "vendor" edge to the Vendor entity by ID.

func (*WarehouseUpdate) Where

Where appends a list predicates to the WarehouseUpdate builder.

type WarehouseUpdateOne

type WarehouseUpdateOne struct {
	// contains filtered or unexported fields
}

WarehouseUpdateOne is the builder for updating a single Warehouse entity.

func (*WarehouseUpdateOne) AddProductIDs

func (wuo *WarehouseUpdateOne) AddProductIDs(ids ...uuid.UUID) *WarehouseUpdateOne

AddProductIDs adds the "products" edge to the Product entity by IDs.

func (*WarehouseUpdateOne) AddProducts

func (wuo *WarehouseUpdateOne) AddProducts(p ...*Product) *WarehouseUpdateOne

AddProducts adds the "products" edges to the Product entity.

func (*WarehouseUpdateOne) AppendFilters

func (wuo *WarehouseUpdateOne) AppendFilters(s []string) *WarehouseUpdateOne

AppendFilters appends s to the "filters" field.

func (*WarehouseUpdateOne) ClearFilters

func (wuo *WarehouseUpdateOne) ClearFilters() *WarehouseUpdateOne

ClearFilters clears the value of the "filters" field.

func (*WarehouseUpdateOne) ClearLastUpdate

func (wuo *WarehouseUpdateOne) ClearLastUpdate() *WarehouseUpdateOne

ClearLastUpdate clears the value of the "last_update" field.

func (*WarehouseUpdateOne) ClearOriginalData

func (wuo *WarehouseUpdateOne) ClearOriginalData() *WarehouseUpdateOne

ClearOriginalData clears the value of the "original_data" field.

func (*WarehouseUpdateOne) ClearProducts

func (wuo *WarehouseUpdateOne) ClearProducts() *WarehouseUpdateOne

ClearProducts clears all "products" edges to the Product entity.

func (*WarehouseUpdateOne) ClearVendor

func (wuo *WarehouseUpdateOne) ClearVendor() *WarehouseUpdateOne

ClearVendor clears the "vendor" edge to the Vendor entity.

func (*WarehouseUpdateOne) Exec

func (wuo *WarehouseUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*WarehouseUpdateOne) ExecX

func (wuo *WarehouseUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*WarehouseUpdateOne) Mutation

func (wuo *WarehouseUpdateOne) Mutation() *WarehouseMutation

Mutation returns the WarehouseMutation object of the builder.

func (*WarehouseUpdateOne) RemoveProductIDs

func (wuo *WarehouseUpdateOne) RemoveProductIDs(ids ...uuid.UUID) *WarehouseUpdateOne

RemoveProductIDs removes the "products" edge to Product entities by IDs.

func (*WarehouseUpdateOne) RemoveProducts

func (wuo *WarehouseUpdateOne) RemoveProducts(p ...*Product) *WarehouseUpdateOne

RemoveProducts removes "products" edges to Product entities.

func (*WarehouseUpdateOne) Save

func (wuo *WarehouseUpdateOne) Save(ctx context.Context) (*Warehouse, error)

Save executes the query and returns the updated Warehouse entity.

func (*WarehouseUpdateOne) SaveX

func (wuo *WarehouseUpdateOne) SaveX(ctx context.Context) *Warehouse

SaveX is like Save, but panics if an error occurs.

func (*WarehouseUpdateOne) Select

func (wuo *WarehouseUpdateOne) Select(field string, fields ...string) *WarehouseUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*WarehouseUpdateOne) SetEnabled

func (wuo *WarehouseUpdateOne) SetEnabled(b bool) *WarehouseUpdateOne

SetEnabled sets the "enabled" field.

func (*WarehouseUpdateOne) SetFilters

func (wuo *WarehouseUpdateOne) SetFilters(s []string) *WarehouseUpdateOne

SetFilters sets the "filters" field.

func (*WarehouseUpdateOne) SetInput

SetInput applies the change-set in the UpdateWarehouseInput on the WarehouseUpdateOne builder.

func (*WarehouseUpdateOne) SetLastUpdate

func (wuo *WarehouseUpdateOne) SetLastUpdate(t time.Time) *WarehouseUpdateOne

SetLastUpdate sets the "last_update" field.

func (*WarehouseUpdateOne) SetName

func (wuo *WarehouseUpdateOne) SetName(s string) *WarehouseUpdateOne

SetName sets the "name" field.

func (*WarehouseUpdateOne) SetNillableEnabled

func (wuo *WarehouseUpdateOne) SetNillableEnabled(b *bool) *WarehouseUpdateOne

SetNillableEnabled sets the "enabled" field if the given value is not nil.

func (*WarehouseUpdateOne) SetNillableLastUpdate

func (wuo *WarehouseUpdateOne) SetNillableLastUpdate(t *time.Time) *WarehouseUpdateOne

SetNillableLastUpdate sets the "last_update" field if the given value is not nil.

func (*WarehouseUpdateOne) SetNillableOriginalData

func (wuo *WarehouseUpdateOne) SetNillableOriginalData(s *string) *WarehouseUpdateOne

SetNillableOriginalData sets the "original_data" field if the given value is not nil.

func (*WarehouseUpdateOne) SetNillableVendorID

func (wuo *WarehouseUpdateOne) SetNillableVendorID(id *uuid.UUID) *WarehouseUpdateOne

SetNillableVendorID sets the "vendor" edge to the Vendor entity by ID if the given value is not nil.

func (*WarehouseUpdateOne) SetOriginalData

func (wuo *WarehouseUpdateOne) SetOriginalData(s string) *WarehouseUpdateOne

SetOriginalData sets the "original_data" field.

func (*WarehouseUpdateOne) SetVendor

func (wuo *WarehouseUpdateOne) SetVendor(v *Vendor) *WarehouseUpdateOne

SetVendor sets the "vendor" edge to the Vendor entity.

func (*WarehouseUpdateOne) SetVendorID

func (wuo *WarehouseUpdateOne) SetVendorID(id uuid.UUID) *WarehouseUpdateOne

SetVendorID sets the "vendor" edge to the Vendor entity by ID.

type WarehouseWhereInput

type WarehouseWhereInput struct {
	Predicates []predicate.Warehouse  `json:"-"`
	Not        *WarehouseWhereInput   `json:"not,omitempty"`
	Or         []*WarehouseWhereInput `json:"or,omitempty"`
	And        []*WarehouseWhereInput `json:"and,omitempty"`

	// "id" field predicates.
	ID      *uuid.UUID  `json:"id,omitempty"`
	IDNEQ   *uuid.UUID  `json:"idNEQ,omitempty"`
	IDIn    []uuid.UUID `json:"idIn,omitempty"`
	IDNotIn []uuid.UUID `json:"idNotIn,omitempty"`
	IDGT    *uuid.UUID  `json:"idGT,omitempty"`
	IDGTE   *uuid.UUID  `json:"idGTE,omitempty"`
	IDLT    *uuid.UUID  `json:"idLT,omitempty"`
	IDLTE   *uuid.UUID  `json:"idLTE,omitempty"`

	// "name" field predicates.
	Name             *string  `json:"name,omitempty"`
	NameNEQ          *string  `json:"nameNEQ,omitempty"`
	NameIn           []string `json:"nameIn,omitempty"`
	NameNotIn        []string `json:"nameNotIn,omitempty"`
	NameGT           *string  `json:"nameGT,omitempty"`
	NameGTE          *string  `json:"nameGTE,omitempty"`
	NameLT           *string  `json:"nameLT,omitempty"`
	NameLTE          *string  `json:"nameLTE,omitempty"`
	NameContains     *string  `json:"nameContains,omitempty"`
	NameHasPrefix    *string  `json:"nameHasPrefix,omitempty"`
	NameHasSuffix    *string  `json:"nameHasSuffix,omitempty"`
	NameEqualFold    *string  `json:"nameEqualFold,omitempty"`
	NameContainsFold *string  `json:"nameContainsFold,omitempty"`

	// "last_update" field predicates.
	LastUpdate       *time.Time  `json:"lastUpdate,omitempty"`
	LastUpdateNEQ    *time.Time  `json:"lastUpdateNEQ,omitempty"`
	LastUpdateIn     []time.Time `json:"lastUpdateIn,omitempty"`
	LastUpdateNotIn  []time.Time `json:"lastUpdateNotIn,omitempty"`
	LastUpdateGT     *time.Time  `json:"lastUpdateGT,omitempty"`
	LastUpdateGTE    *time.Time  `json:"lastUpdateGTE,omitempty"`
	LastUpdateLT     *time.Time  `json:"lastUpdateLT,omitempty"`
	LastUpdateLTE    *time.Time  `json:"lastUpdateLTE,omitempty"`
	LastUpdateIsNil  bool        `json:"lastUpdateIsNil,omitempty"`
	LastUpdateNotNil bool        `json:"lastUpdateNotNil,omitempty"`

	// "original_data" field predicates.
	OriginalData             *string  `json:"originalData,omitempty"`
	OriginalDataNEQ          *string  `json:"originalDataNEQ,omitempty"`
	OriginalDataIn           []string `json:"originalDataIn,omitempty"`
	OriginalDataNotIn        []string `json:"originalDataNotIn,omitempty"`
	OriginalDataGT           *string  `json:"originalDataGT,omitempty"`
	OriginalDataGTE          *string  `json:"originalDataGTE,omitempty"`
	OriginalDataLT           *string  `json:"originalDataLT,omitempty"`
	OriginalDataLTE          *string  `json:"originalDataLTE,omitempty"`
	OriginalDataContains     *string  `json:"originalDataContains,omitempty"`
	OriginalDataHasPrefix    *string  `json:"originalDataHasPrefix,omitempty"`
	OriginalDataHasSuffix    *string  `json:"originalDataHasSuffix,omitempty"`
	OriginalDataIsNil        bool     `json:"originalDataIsNil,omitempty"`
	OriginalDataNotNil       bool     `json:"originalDataNotNil,omitempty"`
	OriginalDataEqualFold    *string  `json:"originalDataEqualFold,omitempty"`
	OriginalDataContainsFold *string  `json:"originalDataContainsFold,omitempty"`

	// "enabled" field predicates.
	Enabled    *bool `json:"enabled,omitempty"`
	EnabledNEQ *bool `json:"enabledNEQ,omitempty"`

	// "products" edge predicates.
	HasProducts     *bool                `json:"hasProducts,omitempty"`
	HasProductsWith []*ProductWhereInput `json:"hasProductsWith,omitempty"`

	// "vendor" edge predicates.
	HasVendor     *bool               `json:"hasVendor,omitempty"`
	HasVendorWith []*VendorWhereInput `json:"hasVendorWith,omitempty"`
}

WarehouseWhereInput represents a where input for filtering Warehouse queries.

func (*WarehouseWhereInput) AddPredicates

func (i *WarehouseWhereInput) AddPredicates(predicates ...predicate.Warehouse)

AddPredicates adds custom predicates to the where input to be used during the filtering phase.

func (*WarehouseWhereInput) ApplySearchQuery

func (wwi *WarehouseWhereInput) ApplySearchQuery(q *string) *WarehouseWhereInput

func (*WarehouseWhereInput) Filter

Filter applies the WarehouseWhereInput filter on the WarehouseQuery builder.

func (*WarehouseWhereInput) P

P returns a predicate for filtering warehouses. An error is returned if the input is empty or invalid.

type Warehouses

type Warehouses []*Warehouse

Warehouses is a parsable slice of Warehouse.

type Website

type Website struct {

	// ID of the ent.
	ID uuid.UUID `json:"id,omitempty"`
	// Title holds the value of the "title" field.
	Title string `json:"title,omitempty"`
	// Description holds the value of the "description" field.
	Description string `json:"description,omitempty"`
	// URL holds the value of the "url" field.
	URL string `json:"url,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the WebsiteQuery when eager-loading is set.
	Edges WebsiteEdges `json:"edges"`
	// contains filtered or unexported fields
}

Website is the model entity for the Website schema.

func (*Website) Company

func (w *Website) Company(ctx context.Context) (*Company, error)

func (*Website) Country

func (w *Website) Country(ctx context.Context) (*Country, error)

func (*Website) IsNode

func (n *Website) IsNode()

IsNode implements the Node interface check for GQLGen.

func (*Website) QueryCompany

func (w *Website) QueryCompany() *CompanyQuery

QueryCompany queries the "company" edge of the Website entity.

func (*Website) QueryCountry

func (w *Website) QueryCountry() *CountryQuery

QueryCountry queries the "country" edge of the Website entity.

func (*Website) String

func (w *Website) String() string

String implements the fmt.Stringer.

func (*Website) ToEdge

func (w *Website) ToEdge(order *WebsiteOrder) *WebsiteEdge

ToEdge converts Website into WebsiteEdge.

func (*Website) Unwrap

func (w *Website) Unwrap() *Website

Unwrap unwraps the Website 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 (*Website) Update

func (w *Website) Update() *WebsiteUpdateOne

Update returns a builder for updating this Website. Note that you need to call Website.Unwrap() before calling this method if this Website was returned from a transaction, and the transaction was committed or rolled back.

type WebsiteClient

type WebsiteClient struct {
	// contains filtered or unexported fields
}

WebsiteClient is a client for the Website schema.

func NewWebsiteClient

func NewWebsiteClient(c config) *WebsiteClient

NewWebsiteClient returns a client for the Website from the given config.

func (*WebsiteClient) Create

func (c *WebsiteClient) Create() *WebsiteCreate

Create returns a builder for creating a Website entity.

func (*WebsiteClient) CreateBulk

func (c *WebsiteClient) CreateBulk(builders ...*WebsiteCreate) *WebsiteCreateBulk

CreateBulk returns a builder for creating a bulk of Website entities.

func (*WebsiteClient) Delete

func (c *WebsiteClient) Delete() *WebsiteDelete

Delete returns a delete builder for Website.

func (*WebsiteClient) DeleteOne

func (c *WebsiteClient) DeleteOne(w *Website) *WebsiteDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*WebsiteClient) DeleteOneID

func (c *WebsiteClient) DeleteOneID(id uuid.UUID) *WebsiteDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*WebsiteClient) Get

func (c *WebsiteClient) Get(ctx context.Context, id uuid.UUID) (*Website, error)

Get returns a Website entity by its id.

func (*WebsiteClient) GetX

func (c *WebsiteClient) GetX(ctx context.Context, id uuid.UUID) *Website

GetX is like Get, but panics if an error occurs.

func (*WebsiteClient) Hooks

func (c *WebsiteClient) Hooks() []Hook

Hooks returns the client hooks.

func (*WebsiteClient) Intercept

func (c *WebsiteClient) Intercept(interceptors ...Interceptor)

Use adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `website.Intercept(f(g(h())))`.

func (*WebsiteClient) Interceptors

func (c *WebsiteClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*WebsiteClient) Query

func (c *WebsiteClient) Query() *WebsiteQuery

Query returns a query builder for Website.

func (*WebsiteClient) QueryCompany

func (c *WebsiteClient) QueryCompany(w *Website) *CompanyQuery

QueryCompany queries the company edge of a Website.

func (*WebsiteClient) QueryCountry

func (c *WebsiteClient) QueryCountry(w *Website) *CountryQuery

QueryCountry queries the country edge of a Website.

func (*WebsiteClient) Update

func (c *WebsiteClient) Update() *WebsiteUpdate

Update returns an update builder for Website.

func (*WebsiteClient) UpdateOne

func (c *WebsiteClient) UpdateOne(w *Website) *WebsiteUpdateOne

UpdateOne returns an update builder for the given entity.

func (*WebsiteClient) UpdateOneID

func (c *WebsiteClient) UpdateOneID(id uuid.UUID) *WebsiteUpdateOne

UpdateOneID returns an update builder for the given id.

func (*WebsiteClient) Use

func (c *WebsiteClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `website.Hooks(f(g(h())))`.

type WebsiteConnection

type WebsiteConnection struct {
	Edges      []*WebsiteEdge `json:"edges"`
	PageInfo   PageInfo       `json:"pageInfo"`
	TotalCount int            `json:"totalCount"`
}

WebsiteConnection is the connection containing edges to Website.

type WebsiteCreate

type WebsiteCreate struct {
	// contains filtered or unexported fields
}

WebsiteCreate is the builder for creating a Website entity.

func (*WebsiteCreate) Exec

func (wc *WebsiteCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*WebsiteCreate) ExecX

func (wc *WebsiteCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*WebsiteCreate) Mutation

func (wc *WebsiteCreate) Mutation() *WebsiteMutation

Mutation returns the WebsiteMutation object of the builder.

func (*WebsiteCreate) Save

func (wc *WebsiteCreate) Save(ctx context.Context) (*Website, error)

Save creates the Website in the database.

func (*WebsiteCreate) SaveX

func (wc *WebsiteCreate) SaveX(ctx context.Context) *Website

SaveX calls Save and panics if Save returns an error.

func (*WebsiteCreate) SetCompany

func (wc *WebsiteCreate) SetCompany(c *Company) *WebsiteCreate

SetCompany sets the "company" edge to the Company entity.

func (*WebsiteCreate) SetCompanyID

func (wc *WebsiteCreate) SetCompanyID(id uuid.UUID) *WebsiteCreate

SetCompanyID sets the "company" edge to the Company entity by ID.

func (*WebsiteCreate) SetCountry

func (wc *WebsiteCreate) SetCountry(c *Country) *WebsiteCreate

SetCountry sets the "country" edge to the Country entity.

func (*WebsiteCreate) SetCountryID

func (wc *WebsiteCreate) SetCountryID(id uuid.UUID) *WebsiteCreate

SetCountryID sets the "country" edge to the Country entity by ID.

func (*WebsiteCreate) SetDescription

func (wc *WebsiteCreate) SetDescription(s string) *WebsiteCreate

SetDescription sets the "description" field.

func (*WebsiteCreate) SetID

func (wc *WebsiteCreate) SetID(u uuid.UUID) *WebsiteCreate

SetID sets the "id" field.

func (*WebsiteCreate) SetInput

SetInput applies the change-set in the CreateWebsiteInput on the WebsiteCreate builder.

func (*WebsiteCreate) SetNillableCompanyID

func (wc *WebsiteCreate) SetNillableCompanyID(id *uuid.UUID) *WebsiteCreate

SetNillableCompanyID sets the "company" edge to the Company entity by ID if the given value is not nil.

func (*WebsiteCreate) SetNillableCountryID

func (wc *WebsiteCreate) SetNillableCountryID(id *uuid.UUID) *WebsiteCreate

SetNillableCountryID sets the "country" edge to the Country entity by ID if the given value is not nil.

func (*WebsiteCreate) SetNillableID

func (wc *WebsiteCreate) SetNillableID(u *uuid.UUID) *WebsiteCreate

SetNillableID sets the "id" field if the given value is not nil.

func (*WebsiteCreate) SetTitle

func (wc *WebsiteCreate) SetTitle(s string) *WebsiteCreate

SetTitle sets the "title" field.

func (*WebsiteCreate) SetURL

func (wc *WebsiteCreate) SetURL(s string) *WebsiteCreate

SetURL sets the "url" field.

type WebsiteCreateBulk

type WebsiteCreateBulk struct {
	// contains filtered or unexported fields
}

WebsiteCreateBulk is the builder for creating many Website entities in bulk.

func (*WebsiteCreateBulk) Exec

func (wcb *WebsiteCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*WebsiteCreateBulk) ExecX

func (wcb *WebsiteCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*WebsiteCreateBulk) Save

func (wcb *WebsiteCreateBulk) Save(ctx context.Context) ([]*Website, error)

Save creates the Website entities in the database.

func (*WebsiteCreateBulk) SaveX

func (wcb *WebsiteCreateBulk) SaveX(ctx context.Context) []*Website

SaveX is like Save, but panics if an error occurs.

type WebsiteDelete

type WebsiteDelete struct {
	// contains filtered or unexported fields
}

WebsiteDelete is the builder for deleting a Website entity.

func (*WebsiteDelete) Exec

func (wd *WebsiteDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*WebsiteDelete) ExecX

func (wd *WebsiteDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*WebsiteDelete) Where

func (wd *WebsiteDelete) Where(ps ...predicate.Website) *WebsiteDelete

Where appends a list predicates to the WebsiteDelete builder.

type WebsiteDeleteOne

type WebsiteDeleteOne struct {
	// contains filtered or unexported fields
}

WebsiteDeleteOne is the builder for deleting a single Website entity.

func (*WebsiteDeleteOne) Exec

func (wdo *WebsiteDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*WebsiteDeleteOne) ExecX

func (wdo *WebsiteDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

type WebsiteEdge

type WebsiteEdge struct {
	Node   *Website `json:"node"`
	Cursor Cursor   `json:"cursor"`
}

WebsiteEdge is the edge representation of Website.

type WebsiteEdges

type WebsiteEdges struct {
	// Company holds the value of the company edge.
	Company *Company `json:"company,omitempty"`
	// Country holds the value of the country edge.
	Country *Country `json:"country,omitempty"`
	// contains filtered or unexported fields
}

WebsiteEdges holds the relations/edges for other nodes in the graph.

func (WebsiteEdges) CompanyOrErr

func (e WebsiteEdges) CompanyOrErr() (*Company, error)

CompanyOrErr returns the Company value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

func (WebsiteEdges) CountryOrErr

func (e WebsiteEdges) CountryOrErr() (*Country, error)

CountryOrErr returns the Country value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

type WebsiteGroupBy

type WebsiteGroupBy struct {
	// contains filtered or unexported fields
}

WebsiteGroupBy is the group-by builder for Website entities.

func (*WebsiteGroupBy) Aggregate

func (wgb *WebsiteGroupBy) Aggregate(fns ...AggregateFunc) *WebsiteGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*WebsiteGroupBy) Bool

func (s *WebsiteGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*WebsiteGroupBy) BoolX

func (s *WebsiteGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*WebsiteGroupBy) Bools

func (s *WebsiteGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*WebsiteGroupBy) BoolsX

func (s *WebsiteGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*WebsiteGroupBy) Float64

func (s *WebsiteGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*WebsiteGroupBy) Float64X

func (s *WebsiteGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*WebsiteGroupBy) Float64s

func (s *WebsiteGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*WebsiteGroupBy) Float64sX

func (s *WebsiteGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*WebsiteGroupBy) Int

func (s *WebsiteGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*WebsiteGroupBy) IntX

func (s *WebsiteGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*WebsiteGroupBy) Ints

func (s *WebsiteGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*WebsiteGroupBy) IntsX

func (s *WebsiteGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*WebsiteGroupBy) Scan

func (wgb *WebsiteGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*WebsiteGroupBy) ScanX

func (s *WebsiteGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*WebsiteGroupBy) String

func (s *WebsiteGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*WebsiteGroupBy) StringX

func (s *WebsiteGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*WebsiteGroupBy) Strings

func (s *WebsiteGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*WebsiteGroupBy) StringsX

func (s *WebsiteGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type WebsiteMutation

type WebsiteMutation struct {
	// contains filtered or unexported fields
}

WebsiteMutation represents an operation that mutates the Website nodes in the graph.

func (*WebsiteMutation) AddField

func (m *WebsiteMutation) 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 (*WebsiteMutation) AddedEdges

func (m *WebsiteMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*WebsiteMutation) AddedField

func (m *WebsiteMutation) 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 (*WebsiteMutation) AddedFields

func (m *WebsiteMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*WebsiteMutation) AddedIDs

func (m *WebsiteMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*WebsiteMutation) ClearCompany

func (m *WebsiteMutation) ClearCompany()

ClearCompany clears the "company" edge to the Company entity.

func (*WebsiteMutation) ClearCountry

func (m *WebsiteMutation) ClearCountry()

ClearCountry clears the "country" edge to the Country entity.

func (*WebsiteMutation) ClearEdge

func (m *WebsiteMutation) 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 (*WebsiteMutation) ClearField

func (m *WebsiteMutation) 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 (*WebsiteMutation) ClearedEdges

func (m *WebsiteMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*WebsiteMutation) ClearedFields

func (m *WebsiteMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (WebsiteMutation) Client

func (m WebsiteMutation) 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 (*WebsiteMutation) CompanyCleared

func (m *WebsiteMutation) CompanyCleared() bool

CompanyCleared reports if the "company" edge to the Company entity was cleared.

func (*WebsiteMutation) CompanyID

func (m *WebsiteMutation) CompanyID() (id uuid.UUID, exists bool)

CompanyID returns the "company" edge ID in the mutation.

func (*WebsiteMutation) CompanyIDs

func (m *WebsiteMutation) CompanyIDs() (ids []uuid.UUID)

CompanyIDs returns the "company" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use CompanyID instead. It exists only for internal usage by the builders.

func (*WebsiteMutation) CountryCleared

func (m *WebsiteMutation) CountryCleared() bool

CountryCleared reports if the "country" edge to the Country entity was cleared.

func (*WebsiteMutation) CountryID

func (m *WebsiteMutation) CountryID() (id uuid.UUID, exists bool)

CountryID returns the "country" edge ID in the mutation.

func (*WebsiteMutation) CountryIDs

func (m *WebsiteMutation) CountryIDs() (ids []uuid.UUID)

CountryIDs returns the "country" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use CountryID instead. It exists only for internal usage by the builders.

func (*WebsiteMutation) Description

func (m *WebsiteMutation) Description() (r string, exists bool)

Description returns the value of the "description" field in the mutation.

func (*WebsiteMutation) EdgeCleared

func (m *WebsiteMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*WebsiteMutation) Field

func (m *WebsiteMutation) 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 (*WebsiteMutation) FieldCleared

func (m *WebsiteMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*WebsiteMutation) Fields

func (m *WebsiteMutation) 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 (*WebsiteMutation) ID

func (m *WebsiteMutation) ID() (id uuid.UUID, 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 (*WebsiteMutation) IDs

func (m *WebsiteMutation) IDs(ctx context.Context) ([]uuid.UUID, 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 (*WebsiteMutation) OldDescription

func (m *WebsiteMutation) OldDescription(ctx context.Context) (v string, err error)

OldDescription returns the old "description" field's value of the Website entity. If the Website 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 (*WebsiteMutation) OldField

func (m *WebsiteMutation) 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 (*WebsiteMutation) OldTitle

func (m *WebsiteMutation) OldTitle(ctx context.Context) (v string, err error)

OldTitle returns the old "title" field's value of the Website entity. If the Website 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 (*WebsiteMutation) OldURL

func (m *WebsiteMutation) OldURL(ctx context.Context) (v string, err error)

OldURL returns the old "url" field's value of the Website entity. If the Website 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 (*WebsiteMutation) Op

func (m *WebsiteMutation) Op() Op

Op returns the operation name.

func (*WebsiteMutation) RemovedEdges

func (m *WebsiteMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*WebsiteMutation) RemovedIDs

func (m *WebsiteMutation) 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 (*WebsiteMutation) ResetCompany

func (m *WebsiteMutation) ResetCompany()

ResetCompany resets all changes to the "company" edge.

func (*WebsiteMutation) ResetCountry

func (m *WebsiteMutation) ResetCountry()

ResetCountry resets all changes to the "country" edge.

func (*WebsiteMutation) ResetDescription

func (m *WebsiteMutation) ResetDescription()

ResetDescription resets all changes to the "description" field.

func (*WebsiteMutation) ResetEdge

func (m *WebsiteMutation) 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 (*WebsiteMutation) ResetField

func (m *WebsiteMutation) 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 (*WebsiteMutation) ResetTitle

func (m *WebsiteMutation) ResetTitle()

ResetTitle resets all changes to the "title" field.

func (*WebsiteMutation) ResetURL

func (m *WebsiteMutation) ResetURL()

ResetURL resets all changes to the "url" field.

func (*WebsiteMutation) SetCompanyID

func (m *WebsiteMutation) SetCompanyID(id uuid.UUID)

SetCompanyID sets the "company" edge to the Company entity by id.

func (*WebsiteMutation) SetCountryID

func (m *WebsiteMutation) SetCountryID(id uuid.UUID)

SetCountryID sets the "country" edge to the Country entity by id.

func (*WebsiteMutation) SetDescription

func (m *WebsiteMutation) SetDescription(s string)

SetDescription sets the "description" field.

func (*WebsiteMutation) SetField

func (m *WebsiteMutation) 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 (*WebsiteMutation) SetID

func (m *WebsiteMutation) SetID(id uuid.UUID)

SetID sets the value of the id field. Note that this operation is only accepted on creation of Website entities.

func (*WebsiteMutation) SetOp

func (m *WebsiteMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*WebsiteMutation) SetTitle

func (m *WebsiteMutation) SetTitle(s string)

SetTitle sets the "title" field.

func (*WebsiteMutation) SetURL

func (m *WebsiteMutation) SetURL(s string)

SetURL sets the "url" field.

func (*WebsiteMutation) Title

func (m *WebsiteMutation) Title() (r string, exists bool)

Title returns the value of the "title" field in the mutation.

func (WebsiteMutation) Tx

func (m WebsiteMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*WebsiteMutation) Type

func (m *WebsiteMutation) Type() string

Type returns the node type of this mutation (Website).

func (*WebsiteMutation) URL

func (m *WebsiteMutation) URL() (r string, exists bool)

URL returns the value of the "url" field in the mutation.

func (*WebsiteMutation) Where

func (m *WebsiteMutation) Where(ps ...predicate.Website)

Where appends a list predicates to the WebsiteMutation builder.

func (*WebsiteMutation) WhereP

func (m *WebsiteMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the WebsiteMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type WebsiteOrder

type WebsiteOrder struct {
	Direction OrderDirection     `json:"direction"`
	Field     *WebsiteOrderField `json:"field"`
}

WebsiteOrder defines the ordering of Website.

type WebsiteOrderField

type WebsiteOrderField struct {
	// contains filtered or unexported fields
}

WebsiteOrderField defines the ordering field of Website.

func (WebsiteOrderField) MarshalGQL

func (f WebsiteOrderField) MarshalGQL(w io.Writer)

MarshalGQL implements graphql.Marshaler interface.

func (WebsiteOrderField) String

func (f WebsiteOrderField) String() string

String implement fmt.Stringer interface.

func (*WebsiteOrderField) UnmarshalGQL

func (f *WebsiteOrderField) UnmarshalGQL(v interface{}) error

UnmarshalGQL implements graphql.Unmarshaler interface.

type WebsitePaginateOption

type WebsitePaginateOption func(*websitePager) error

WebsitePaginateOption enables pagination customization.

func WithWebsiteFilter

func WithWebsiteFilter(filter func(*WebsiteQuery) (*WebsiteQuery, error)) WebsitePaginateOption

WithWebsiteFilter configures pagination filter.

func WithWebsiteOrder

func WithWebsiteOrder(order *WebsiteOrder) WebsitePaginateOption

WithWebsiteOrder configures pagination ordering.

type WebsiteQuery

type WebsiteQuery struct {
	// contains filtered or unexported fields
}

WebsiteQuery is the builder for querying Website entities.

func (*WebsiteQuery) Aggregate

func (wq *WebsiteQuery) Aggregate(fns ...AggregateFunc) *WebsiteSelect

Aggregate returns a WebsiteSelect configured with the given aggregations.

func (*WebsiteQuery) All

func (wq *WebsiteQuery) All(ctx context.Context) ([]*Website, error)

All executes the query and returns a list of Websites.

func (*WebsiteQuery) AllX

func (wq *WebsiteQuery) AllX(ctx context.Context) []*Website

AllX is like All, but panics if an error occurs.

func (*WebsiteQuery) Clone

func (wq *WebsiteQuery) Clone() *WebsiteQuery

Clone returns a duplicate of the WebsiteQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*WebsiteQuery) CollectFields

func (w *WebsiteQuery) CollectFields(ctx context.Context, satisfies ...string) (*WebsiteQuery, error)

CollectFields tells the query-builder to eagerly load connected nodes by resolver context.

func (*WebsiteQuery) Count

func (wq *WebsiteQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*WebsiteQuery) CountX

func (wq *WebsiteQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*WebsiteQuery) Exist

func (wq *WebsiteQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*WebsiteQuery) ExistX

func (wq *WebsiteQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*WebsiteQuery) First

func (wq *WebsiteQuery) First(ctx context.Context) (*Website, error)

First returns the first Website entity from the query. Returns a *NotFoundError when no Website was found.

func (*WebsiteQuery) FirstID

func (wq *WebsiteQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

FirstID returns the first Website ID from the query. Returns a *NotFoundError when no Website ID was found.

func (*WebsiteQuery) FirstIDX

func (wq *WebsiteQuery) FirstIDX(ctx context.Context) uuid.UUID

FirstIDX is like FirstID, but panics if an error occurs.

func (*WebsiteQuery) FirstX

func (wq *WebsiteQuery) FirstX(ctx context.Context) *Website

FirstX is like First, but panics if an error occurs.

func (*WebsiteQuery) GroupBy

func (wq *WebsiteQuery) GroupBy(field string, fields ...string) *WebsiteGroupBy

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 {
	Title string `json:"title,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Website.Query().
	GroupBy(website.FieldTitle).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*WebsiteQuery) IDs

func (wq *WebsiteQuery) IDs(ctx context.Context) ([]uuid.UUID, error)

IDs executes the query and returns a list of Website IDs.

func (*WebsiteQuery) IDsX

func (wq *WebsiteQuery) IDsX(ctx context.Context) []uuid.UUID

IDsX is like IDs, but panics if an error occurs.

func (*WebsiteQuery) Limit

func (wq *WebsiteQuery) Limit(limit int) *WebsiteQuery

Limit the number of records to be returned by this query.

func (*WebsiteQuery) Offset

func (wq *WebsiteQuery) Offset(offset int) *WebsiteQuery

Offset to start from.

func (*WebsiteQuery) Only

func (wq *WebsiteQuery) Only(ctx context.Context) (*Website, error)

Only returns a single Website entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Website entity is found. Returns a *NotFoundError when no Website entities are found.

func (*WebsiteQuery) OnlyID

func (wq *WebsiteQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

OnlyID is like Only, but returns the only Website ID in the query. Returns a *NotSingularError when more than one Website ID is found. Returns a *NotFoundError when no entities are found.

func (*WebsiteQuery) OnlyIDX

func (wq *WebsiteQuery) OnlyIDX(ctx context.Context) uuid.UUID

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*WebsiteQuery) OnlyX

func (wq *WebsiteQuery) OnlyX(ctx context.Context) *Website

OnlyX is like Only, but panics if an error occurs.

func (*WebsiteQuery) Order

func (wq *WebsiteQuery) Order(o ...OrderFunc) *WebsiteQuery

Order specifies how the records should be ordered.

func (*WebsiteQuery) Paginate

func (w *WebsiteQuery) Paginate(
	ctx context.Context, after *Cursor, first *int,
	before *Cursor, last *int, opts ...WebsitePaginateOption,
) (*WebsiteConnection, error)

Paginate executes the query and returns a relay based cursor connection to Website.

func (*WebsiteQuery) QueryCompany

func (wq *WebsiteQuery) QueryCompany() *CompanyQuery

QueryCompany chains the current query on the "company" edge.

func (*WebsiteQuery) QueryCountry

func (wq *WebsiteQuery) QueryCountry() *CountryQuery

QueryCountry chains the current query on the "country" edge.

func (*WebsiteQuery) Select

func (wq *WebsiteQuery) Select(fields ...string) *WebsiteSelect

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 {
	Title string `json:"title,omitempty"`
}

client.Website.Query().
	Select(website.FieldTitle).
	Scan(ctx, &v)

func (*WebsiteQuery) Unique

func (wq *WebsiteQuery) Unique(unique bool) *WebsiteQuery

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 (*WebsiteQuery) Where

func (wq *WebsiteQuery) Where(ps ...predicate.Website) *WebsiteQuery

Where adds a new predicate for the WebsiteQuery builder.

func (*WebsiteQuery) WithCompany

func (wq *WebsiteQuery) WithCompany(opts ...func(*CompanyQuery)) *WebsiteQuery

WithCompany tells the query-builder to eager-load the nodes that are connected to the "company" edge. The optional arguments are used to configure the query builder of the edge.

func (*WebsiteQuery) WithCountry

func (wq *WebsiteQuery) WithCountry(opts ...func(*CountryQuery)) *WebsiteQuery

WithCountry tells the query-builder to eager-load the nodes that are connected to the "country" edge. The optional arguments are used to configure the query builder of the edge.

type WebsiteSelect

type WebsiteSelect struct {
	*WebsiteQuery
	// contains filtered or unexported fields
}

WebsiteSelect is the builder for selecting fields of Website entities.

func (*WebsiteSelect) Aggregate

func (ws *WebsiteSelect) Aggregate(fns ...AggregateFunc) *WebsiteSelect

Aggregate adds the given aggregation functions to the selector query.

func (*WebsiteSelect) Bool

func (s *WebsiteSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*WebsiteSelect) BoolX

func (s *WebsiteSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*WebsiteSelect) Bools

func (s *WebsiteSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*WebsiteSelect) BoolsX

func (s *WebsiteSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*WebsiteSelect) Float64

func (s *WebsiteSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*WebsiteSelect) Float64X

func (s *WebsiteSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*WebsiteSelect) Float64s

func (s *WebsiteSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*WebsiteSelect) Float64sX

func (s *WebsiteSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*WebsiteSelect) Int

func (s *WebsiteSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*WebsiteSelect) IntX

func (s *WebsiteSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*WebsiteSelect) Ints

func (s *WebsiteSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*WebsiteSelect) IntsX

func (s *WebsiteSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*WebsiteSelect) Scan

func (ws *WebsiteSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*WebsiteSelect) ScanX

func (s *WebsiteSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*WebsiteSelect) String

func (s *WebsiteSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*WebsiteSelect) StringX

func (s *WebsiteSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*WebsiteSelect) Strings

func (s *WebsiteSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*WebsiteSelect) StringsX

func (s *WebsiteSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type WebsiteUpdate

type WebsiteUpdate struct {
	// contains filtered or unexported fields
}

WebsiteUpdate is the builder for updating Website entities.

func (*WebsiteUpdate) ClearCompany

func (wu *WebsiteUpdate) ClearCompany() *WebsiteUpdate

ClearCompany clears the "company" edge to the Company entity.

func (*WebsiteUpdate) ClearCountry

func (wu *WebsiteUpdate) ClearCountry() *WebsiteUpdate

ClearCountry clears the "country" edge to the Country entity.

func (*WebsiteUpdate) Exec

func (wu *WebsiteUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*WebsiteUpdate) ExecX

func (wu *WebsiteUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*WebsiteUpdate) Mutation

func (wu *WebsiteUpdate) Mutation() *WebsiteMutation

Mutation returns the WebsiteMutation object of the builder.

func (*WebsiteUpdate) Save

func (wu *WebsiteUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*WebsiteUpdate) SaveX

func (wu *WebsiteUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*WebsiteUpdate) SetCompany

func (wu *WebsiteUpdate) SetCompany(c *Company) *WebsiteUpdate

SetCompany sets the "company" edge to the Company entity.

func (*WebsiteUpdate) SetCompanyID

func (wu *WebsiteUpdate) SetCompanyID(id uuid.UUID) *WebsiteUpdate

SetCompanyID sets the "company" edge to the Company entity by ID.

func (*WebsiteUpdate) SetCountry

func (wu *WebsiteUpdate) SetCountry(c *Country) *WebsiteUpdate

SetCountry sets the "country" edge to the Country entity.

func (*WebsiteUpdate) SetCountryID

func (wu *WebsiteUpdate) SetCountryID(id uuid.UUID) *WebsiteUpdate

SetCountryID sets the "country" edge to the Country entity by ID.

func (*WebsiteUpdate) SetDescription

func (wu *WebsiteUpdate) SetDescription(s string) *WebsiteUpdate

SetDescription sets the "description" field.

func (*WebsiteUpdate) SetInput

SetInput applies the change-set in the UpdateWebsiteInput on the WebsiteUpdate builder.

func (*WebsiteUpdate) SetNillableCompanyID

func (wu *WebsiteUpdate) SetNillableCompanyID(id *uuid.UUID) *WebsiteUpdate

SetNillableCompanyID sets the "company" edge to the Company entity by ID if the given value is not nil.

func (*WebsiteUpdate) SetNillableCountryID

func (wu *WebsiteUpdate) SetNillableCountryID(id *uuid.UUID) *WebsiteUpdate

SetNillableCountryID sets the "country" edge to the Country entity by ID if the given value is not nil.

func (*WebsiteUpdate) SetTitle

func (wu *WebsiteUpdate) SetTitle(s string) *WebsiteUpdate

SetTitle sets the "title" field.

func (*WebsiteUpdate) SetURL

func (wu *WebsiteUpdate) SetURL(s string) *WebsiteUpdate

SetURL sets the "url" field.

func (*WebsiteUpdate) Where

func (wu *WebsiteUpdate) Where(ps ...predicate.Website) *WebsiteUpdate

Where appends a list predicates to the WebsiteUpdate builder.

type WebsiteUpdateOne

type WebsiteUpdateOne struct {
	// contains filtered or unexported fields
}

WebsiteUpdateOne is the builder for updating a single Website entity.

func (*WebsiteUpdateOne) ClearCompany

func (wuo *WebsiteUpdateOne) ClearCompany() *WebsiteUpdateOne

ClearCompany clears the "company" edge to the Company entity.

func (*WebsiteUpdateOne) ClearCountry

func (wuo *WebsiteUpdateOne) ClearCountry() *WebsiteUpdateOne

ClearCountry clears the "country" edge to the Country entity.

func (*WebsiteUpdateOne) Exec

func (wuo *WebsiteUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*WebsiteUpdateOne) ExecX

func (wuo *WebsiteUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*WebsiteUpdateOne) Mutation

func (wuo *WebsiteUpdateOne) Mutation() *WebsiteMutation

Mutation returns the WebsiteMutation object of the builder.

func (*WebsiteUpdateOne) Save

func (wuo *WebsiteUpdateOne) Save(ctx context.Context) (*Website, error)

Save executes the query and returns the updated Website entity.

func (*WebsiteUpdateOne) SaveX

func (wuo *WebsiteUpdateOne) SaveX(ctx context.Context) *Website

SaveX is like Save, but panics if an error occurs.

func (*WebsiteUpdateOne) Select

func (wuo *WebsiteUpdateOne) Select(field string, fields ...string) *WebsiteUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*WebsiteUpdateOne) SetCompany

func (wuo *WebsiteUpdateOne) SetCompany(c *Company) *WebsiteUpdateOne

SetCompany sets the "company" edge to the Company entity.

func (*WebsiteUpdateOne) SetCompanyID

func (wuo *WebsiteUpdateOne) SetCompanyID(id uuid.UUID) *WebsiteUpdateOne

SetCompanyID sets the "company" edge to the Company entity by ID.

func (*WebsiteUpdateOne) SetCountry

func (wuo *WebsiteUpdateOne) SetCountry(c *Country) *WebsiteUpdateOne

SetCountry sets the "country" edge to the Country entity.

func (*WebsiteUpdateOne) SetCountryID

func (wuo *WebsiteUpdateOne) SetCountryID(id uuid.UUID) *WebsiteUpdateOne

SetCountryID sets the "country" edge to the Country entity by ID.

func (*WebsiteUpdateOne) SetDescription

func (wuo *WebsiteUpdateOne) SetDescription(s string) *WebsiteUpdateOne

SetDescription sets the "description" field.

func (*WebsiteUpdateOne) SetInput

SetInput applies the change-set in the UpdateWebsiteInput on the WebsiteUpdateOne builder.

func (*WebsiteUpdateOne) SetNillableCompanyID

func (wuo *WebsiteUpdateOne) SetNillableCompanyID(id *uuid.UUID) *WebsiteUpdateOne

SetNillableCompanyID sets the "company" edge to the Company entity by ID if the given value is not nil.

func (*WebsiteUpdateOne) SetNillableCountryID

func (wuo *WebsiteUpdateOne) SetNillableCountryID(id *uuid.UUID) *WebsiteUpdateOne

SetNillableCountryID sets the "country" edge to the Country entity by ID if the given value is not nil.

func (*WebsiteUpdateOne) SetTitle

func (wuo *WebsiteUpdateOne) SetTitle(s string) *WebsiteUpdateOne

SetTitle sets the "title" field.

func (*WebsiteUpdateOne) SetURL

func (wuo *WebsiteUpdateOne) SetURL(s string) *WebsiteUpdateOne

SetURL sets the "url" field.

type WebsiteWhereInput

type WebsiteWhereInput struct {
	Predicates []predicate.Website  `json:"-"`
	Not        *WebsiteWhereInput   `json:"not,omitempty"`
	Or         []*WebsiteWhereInput `json:"or,omitempty"`
	And        []*WebsiteWhereInput `json:"and,omitempty"`

	// "id" field predicates.
	ID      *uuid.UUID  `json:"id,omitempty"`
	IDNEQ   *uuid.UUID  `json:"idNEQ,omitempty"`
	IDIn    []uuid.UUID `json:"idIn,omitempty"`
	IDNotIn []uuid.UUID `json:"idNotIn,omitempty"`
	IDGT    *uuid.UUID  `json:"idGT,omitempty"`
	IDGTE   *uuid.UUID  `json:"idGTE,omitempty"`
	IDLT    *uuid.UUID  `json:"idLT,omitempty"`
	IDLTE   *uuid.UUID  `json:"idLTE,omitempty"`

	// "title" field predicates.
	Title             *string  `json:"title,omitempty"`
	TitleNEQ          *string  `json:"titleNEQ,omitempty"`
	TitleIn           []string `json:"titleIn,omitempty"`
	TitleNotIn        []string `json:"titleNotIn,omitempty"`
	TitleGT           *string  `json:"titleGT,omitempty"`
	TitleGTE          *string  `json:"titleGTE,omitempty"`
	TitleLT           *string  `json:"titleLT,omitempty"`
	TitleLTE          *string  `json:"titleLTE,omitempty"`
	TitleContains     *string  `json:"titleContains,omitempty"`
	TitleHasPrefix    *string  `json:"titleHasPrefix,omitempty"`
	TitleHasSuffix    *string  `json:"titleHasSuffix,omitempty"`
	TitleEqualFold    *string  `json:"titleEqualFold,omitempty"`
	TitleContainsFold *string  `json:"titleContainsFold,omitempty"`

	// "description" field predicates.
	Description             *string  `json:"description,omitempty"`
	DescriptionNEQ          *string  `json:"descriptionNEQ,omitempty"`
	DescriptionIn           []string `json:"descriptionIn,omitempty"`
	DescriptionNotIn        []string `json:"descriptionNotIn,omitempty"`
	DescriptionGT           *string  `json:"descriptionGT,omitempty"`
	DescriptionGTE          *string  `json:"descriptionGTE,omitempty"`
	DescriptionLT           *string  `json:"descriptionLT,omitempty"`
	DescriptionLTE          *string  `json:"descriptionLTE,omitempty"`
	DescriptionContains     *string  `json:"descriptionContains,omitempty"`
	DescriptionHasPrefix    *string  `json:"descriptionHasPrefix,omitempty"`
	DescriptionHasSuffix    *string  `json:"descriptionHasSuffix,omitempty"`
	DescriptionEqualFold    *string  `json:"descriptionEqualFold,omitempty"`
	DescriptionContainsFold *string  `json:"descriptionContainsFold,omitempty"`

	// "url" field predicates.
	URL             *string  `json:"url,omitempty"`
	URLNEQ          *string  `json:"urlNEQ,omitempty"`
	URLIn           []string `json:"urlIn,omitempty"`
	URLNotIn        []string `json:"urlNotIn,omitempty"`
	URLGT           *string  `json:"urlGT,omitempty"`
	URLGTE          *string  `json:"urlGTE,omitempty"`
	URLLT           *string  `json:"urlLT,omitempty"`
	URLLTE          *string  `json:"urlLTE,omitempty"`
	URLContains     *string  `json:"urlContains,omitempty"`
	URLHasPrefix    *string  `json:"urlHasPrefix,omitempty"`
	URLHasSuffix    *string  `json:"urlHasSuffix,omitempty"`
	URLEqualFold    *string  `json:"urlEqualFold,omitempty"`
	URLContainsFold *string  `json:"urlContainsFold,omitempty"`

	// "company" edge predicates.
	HasCompany     *bool                `json:"hasCompany,omitempty"`
	HasCompanyWith []*CompanyWhereInput `json:"hasCompanyWith,omitempty"`

	// "country" edge predicates.
	HasCountry     *bool                `json:"hasCountry,omitempty"`
	HasCountryWith []*CountryWhereInput `json:"hasCountryWith,omitempty"`
}

WebsiteWhereInput represents a where input for filtering Website queries.

func (*WebsiteWhereInput) AddPredicates

func (i *WebsiteWhereInput) AddPredicates(predicates ...predicate.Website)

AddPredicates adds custom predicates to the where input to be used during the filtering phase.

func (*WebsiteWhereInput) ApplySearchQuery

func (wwi *WebsiteWhereInput) ApplySearchQuery(q *string) *WebsiteWhereInput

func (*WebsiteWhereInput) Filter

Filter applies the WebsiteWhereInput filter on the WebsiteQuery builder.

func (*WebsiteWhereInput) P

P returns a predicate for filtering websites. An error is returned if the input is empty or invalid.

type Websites

type Websites []*Website

Websites is a parsable slice of Website.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL